Merge
diff --git a/.hgtags-top-repo b/.hgtags-top-repo
index d6e3100..931d3b8 100644
--- a/.hgtags-top-repo
+++ b/.hgtags-top-repo
@@ -260,3 +260,4 @@
 b114474fb25af4e73cb7219f7c04bd8994da03a5 jdk9-b15
 cf22a728521f91a4692b433d39d730a0a1b23155 jdk9-b16
 24152ee0ee1abef54a8bab04c099261dba7bcca5 jdk9-b17
+65abab59f783fcf02ff8e133431c252f9e5f07d5 jdk9-b18
diff --git a/corba/.hgtags b/corba/.hgtags
index 0a46f62..66b823f 100644
--- a/corba/.hgtags
+++ b/corba/.hgtags
@@ -260,3 +260,4 @@
 e54022d0dd92106fff7f7fe670010cd7e6517ee3 jdk9-b15
 422ef9d29d84f571453f015c4cb8713c3af70ee4 jdk9-b16
 4c75c2ca7cf3e0618315879acf17f42c8fcd0c09 jdk9-b17
+77565aaaa2bb814e94817e92d680168052a25395 jdk9-b18
diff --git a/hotspot/.hgtags b/hotspot/.hgtags
index e58c5c7..77d8c72 100644
--- a/hotspot/.hgtags
+++ b/hotspot/.hgtags
@@ -420,3 +420,4 @@
 170f6d733d7aec062f743a6b8c1cce940a7a984a jdk9-b15
 b14e7c0b7d3ec04127f565cda1d84122e205680c jdk9-b16
 14b656df31c2cb09c505921061e79977823de71a jdk9-b17
+871fd128548480095e0dc3fc34c422666baeec75 jdk9-b18
diff --git a/hotspot/make/bsd/makefiles/universal.gmk b/hotspot/make/bsd/makefiles/universal.gmk
index d1136a8..44d57d9 100644
--- a/hotspot/make/bsd/makefiles/universal.gmk
+++ b/hotspot/make/bsd/makefiles/universal.gmk
@@ -74,19 +74,21 @@
 
 
 # Replace arch specific binaries with universal binaries
+# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
+# That symbolic link belongs to the 'jdk' build.
 export_universal:
 	$(RM) -r $(EXPORT_PATH)/jre/lib/{i386,amd64}
 	$(RM) -r $(JDK_IMAGE_DIR)/jre/lib/{i386,amd64}
-	$(RM) $(JDK_IMAGE_DIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
 	($(CD) $(EXPORT_PATH) && \
 	  $(TAR) -cf - *) | \
 	  ($(CD) $(JDK_IMAGE_DIR) && $(TAR) -xpf -)
 
 
 # Overlay universal binaries
+# Do not touch jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
+# That symbolic link belongs to the 'jdk' build.
 copy_universal:
 	$(RM) -r $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{i386,amd64}
-	$(RM) $(JDK_IMAGE_DIR)$(COPY_SUBDIR)/jre/lib/{client,server}/libjsig.$(LIBRARY_SUFFIX)
 	($(CD) $(EXPORT_PATH)$(COPY_SUBDIR) && \
 	  $(TAR) -cf - *) | \
 	  ($(CD) $(JDK_IMAGE_DIR)$(COPY_SUBDIR) && $(TAR) -xpf -)
diff --git a/hotspot/src/share/vm/classfile/classFileParser.cpp b/hotspot/src/share/vm/classfile/classFileParser.cpp
index 61d9875..608b43a 100644
--- a/hotspot/src/share/vm/classfile/classFileParser.cpp
+++ b/hotspot/src/share/vm/classfile/classFileParser.cpp
@@ -4359,9 +4359,15 @@
   Method* m = k->lookup_method(vmSymbols::finalize_method_name(),
                                  vmSymbols::void_method_signature());
   if (m != NULL && !m->is_empty_method()) {
-    f = true;
+      f = true;
   }
-  assert(f == k->has_finalizer(), "inconsistent has_finalizer");
+
+  // Spec doesn't prevent agent from redefinition of empty finalizer.
+  // Despite the fact that it's generally bad idea and redefined finalizer
+  // will not work as expected we shouldn't abort vm in this case
+  if (!k->has_redefined_this_or_super()) {
+    assert(f == k->has_finalizer(), "inconsistent has_finalizer");
+  }
 #endif
 
   // Check if this klass supports the java.lang.Cloneable interface
diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp
index b4da42c..60c65fe 100644
--- a/hotspot/src/share/vm/classfile/javaClasses.hpp
+++ b/hotspot/src/share/vm/classfile/javaClasses.hpp
@@ -1181,7 +1181,7 @@
   static oop              target(         oop site)             { return site->obj_field(             _target_offset);         }
   static void         set_target(         oop site, oop target) {        site->obj_field_put(         _target_offset, target); }
 
-  static volatile oop     target_volatile(oop site)             { return site->obj_field_volatile(    _target_offset);         }
+  static volatile oop     target_volatile(oop site)             { return oop((oopDesc *)(site->obj_field_volatile(_target_offset))); }
   static void         set_target_volatile(oop site, oop target) {        site->obj_field_put_volatile(_target_offset, target); }
 
   // Testers
diff --git a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
index 43d6e92..dba6f8c 100644
--- a/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp
@@ -311,8 +311,7 @@
                              _cmsGen->refs_discovery_is_mt(),     // mt discovery
                              (int) MAX2(ConcGCThreads, ParallelGCThreads), // mt discovery degree
                              _cmsGen->refs_discovery_is_atomic(), // discovery is not atomic
-                             &_is_alive_closure,                  // closure for liveness info
-                             false);                              // next field updates do not need write barrier
+                             &_is_alive_closure);                 // closure for liveness info
     // Initialize the _ref_processor field of CMSGen
     _cmsGen->set_ref_processor(_ref_processor);
 
diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
index 060ffb0..83f819b 100644
--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp
@@ -2246,12 +2246,9 @@
                                 // degree of mt discovery
                            false,
                                 // Reference discovery is not atomic
-                           &_is_alive_closure_cm,
+                           &_is_alive_closure_cm);
                                 // is alive closure
                                 // (for efficiency/performance)
-                           true);
-                                // Setting next fields of discovered
-                                // lists requires a barrier.
 
   // STW ref processor
   _ref_processor_stw =
@@ -2266,12 +2263,9 @@
                                 // degree of mt discovery
                            true,
                                 // Reference discovery is atomic
-                           &_is_alive_closure_stw,
+                           &_is_alive_closure_stw);
                                 // is alive closure
                                 // (for efficiency/performance)
-                           false);
-                                // Setting next fields of discovered
-                                // lists does not require a barrier.
 }
 
 size_t G1CollectedHeap::capacity() const {
diff --git a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
index 2661e12..5e97996 100644
--- a/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parNew/parNewGeneration.cpp
@@ -1636,8 +1636,7 @@
                              refs_discovery_is_mt(),     // mt discovery
                              (int) ParallelGCThreads,    // mt discovery degree
                              refs_discovery_is_atomic(), // atomic_discovery
-                             NULL,                       // is_alive_non_header
-                             false);                     // write barrier for next field updates
+                             NULL);                      // is_alive_non_header
   }
 }
 
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
index de4c8bc..a9ffe54 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp
@@ -854,8 +854,7 @@
                            true,          // mt discovery
                            (int) ParallelGCThreads, // mt discovery degree
                            true,          // atomic_discovery
-                           &_is_alive_closure, // non-header is alive closure
-                           false);        // write barrier for next field updates
+                           &_is_alive_closure); // non-header is alive closure
   _counters = new CollectorCounters("PSParallelCompact", 1);
 
   // Initialize static fields in ParCompactionManager.
diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
index 81510c9..fd30304 100644
--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.cpp
@@ -864,8 +864,7 @@
                            true,                       // mt discovery
                            (int) ParallelGCThreads,    // mt discovery degree
                            true,                       // atomic_discovery
-                           NULL,                       // header provides liveness info
-                           false);                     // next field updates do not need write barrier
+                           NULL);                      // header provides liveness info
 
   // Cache the cardtable
   BarrierSet* bs = Universe::heap()->barrier_set();
diff --git a/hotspot/src/share/vm/memory/allocation.cpp b/hotspot/src/share/vm/memory/allocation.cpp
index 2a3f413..c0254d9 100644
--- a/hotspot/src/share/vm/memory/allocation.cpp
+++ b/hotspot/src/share/vm/memory/allocation.cpp
@@ -563,6 +563,7 @@
   _chunk = new (alloc_failmode, len) Chunk(len);
 
   if (_chunk == NULL) {
+    _chunk = k;                 // restore the previous value of _chunk
     return NULL;
   }
   if (k) k->set_next(_chunk);   // Append new chunk to end of linked list
diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp
index cd5fcef..d2d1ba7 100644
--- a/hotspot/src/share/vm/memory/metaspace.cpp
+++ b/hotspot/src/share/vm/memory/metaspace.cpp
@@ -1423,6 +1423,17 @@
   return (size_t)Atomic::add_ptr(-(intptr_t)v, &_capacity_until_GC);
 }
 
+void MetaspaceGC::initialize() {
+  // Set the high-water mark to MaxMetapaceSize during VM initializaton since
+  // we can't do a GC during initialization.
+  _capacity_until_GC = MaxMetaspaceSize;
+}
+
+void MetaspaceGC::post_initialize() {
+  // Reset the high-water mark once the VM initialization is done.
+  _capacity_until_GC = MAX2(MetaspaceAux::committed_bytes(), MetaspaceSize);
+}
+
 bool MetaspaceGC::can_expand(size_t word_size, bool is_class) {
   // Check if the compressed class space is full.
   if (is_class && Metaspace::using_class_space()) {
@@ -1443,21 +1454,13 @@
 
 size_t MetaspaceGC::allowed_expansion() {
   size_t committed_bytes = MetaspaceAux::committed_bytes();
-
-  size_t left_until_max  = MaxMetaspaceSize - committed_bytes;
-
-  // Always grant expansion if we are initiating the JVM,
-  // or if the GC_locker is preventing GCs.
-  if (!is_init_completed() || GC_locker::is_active_and_needs_gc()) {
-    return left_until_max / BytesPerWord;
-  }
-
   size_t capacity_until_gc = capacity_until_GC();
 
-  if (capacity_until_gc <= committed_bytes) {
-    return 0;
-  }
+  assert(capacity_until_gc >= committed_bytes,
+        err_msg("capacity_until_gc: " SIZE_FORMAT " < committed_bytes: " SIZE_FORMAT,
+                capacity_until_gc, committed_bytes));
 
+  size_t left_until_max  = MaxMetaspaceSize - committed_bytes;
   size_t left_until_GC = capacity_until_gc - committed_bytes;
   size_t left_to_commit = MIN2(left_until_GC, left_until_max);
 
@@ -1469,7 +1472,15 @@
   uint current_shrink_factor = _shrink_factor;
   _shrink_factor = 0;
 
-  const size_t used_after_gc = MetaspaceAux::capacity_bytes();
+  // Using committed_bytes() for used_after_gc is an overestimation, since the
+  // chunk free lists are included in committed_bytes() and the memory in an
+  // un-fragmented chunk free list is available for future allocations.
+  // However, if the chunk free lists becomes fragmented, then the memory may
+  // not be available for future allocations and the memory is therefore "in use".
+  // Including the chunk free lists in the definition of "in use" is therefore
+  // necessary. Not including the chunk free lists can cause capacity_until_GC to
+  // shrink below committed_bytes() and this has caused serious bugs in the past.
+  const size_t used_after_gc = MetaspaceAux::committed_bytes();
   const size_t capacity_until_GC = MetaspaceGC::capacity_until_GC();
 
   const double minimum_free_percentage = MinMetaspaceFreeRatio / 100.0;
@@ -3094,6 +3105,8 @@
 }
 
 void Metaspace::global_initialize() {
+  MetaspaceGC::initialize();
+
   // Initialize the alignment for shared spaces.
   int max_alignment = os::vm_allocation_granularity();
   size_t cds_total = 0;
@@ -3201,10 +3214,13 @@
     }
   }
 
-  MetaspaceGC::initialize();
   _tracer = new MetaspaceTracer();
 }
 
+void Metaspace::post_initialize() {
+  MetaspaceGC::post_initialize();
+}
+
 Metachunk* Metaspace::get_initialization_chunk(MetadataType mdtype,
                                                size_t chunk_word_size,
                                                size_t chunk_bunch) {
diff --git a/hotspot/src/share/vm/memory/metaspace.hpp b/hotspot/src/share/vm/memory/metaspace.hpp
index 22e21b8..baa25cd 100644
--- a/hotspot/src/share/vm/memory/metaspace.hpp
+++ b/hotspot/src/share/vm/memory/metaspace.hpp
@@ -208,6 +208,7 @@
 
   static void ergo_initialize();
   static void global_initialize();
+  static void post_initialize();
 
   static size_t first_chunk_word_size() { return _first_chunk_word_size; }
   static size_t first_class_chunk_word_size() { return _first_class_chunk_word_size; }
@@ -398,7 +399,8 @@
 
  public:
 
-  static void initialize() { _capacity_until_GC = MetaspaceSize; }
+  static void initialize();
+  static void post_initialize();
 
   static size_t capacity_until_GC();
   static size_t inc_capacity_until_GC(size_t v);
diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp
index 2a87b4b..2a074f2 100644
--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp
+++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp
@@ -96,12 +96,10 @@
                                        bool      mt_discovery,
                                        uint      mt_discovery_degree,
                                        bool      atomic_discovery,
-                                       BoolObjectClosure* is_alive_non_header,
-                                       bool      discovered_list_needs_post_barrier)  :
+                                       BoolObjectClosure* is_alive_non_header)  :
   _discovering_refs(false),
   _enqueuing_is_done(false),
   _is_alive_non_header(is_alive_non_header),
-  _discovered_list_needs_post_barrier(discovered_list_needs_post_barrier),
   _processing_is_mt(mt_processing),
   _next_id(0)
 {
@@ -340,10 +338,18 @@
   // (java.lang.ref.Reference.discovered), self-loop their "next" field
   // thus distinguishing them from active References, then
   // prepend them to the pending list.
+  //
+  // The Java threads will see the Reference objects linked together through
+  // the discovered field. Instead of trying to do the write barrier updates
+  // in all places in the reference processor where we manipulate the discovered
+  // field we make sure to do the barrier here where we anyway iterate through
+  // all linked Reference objects. Note that it is important to not dirty any
+  // cards during reference processing since this will cause card table
+  // verification to fail for G1.
+  //
   // BKWRD COMPATIBILITY NOTE: For older JDKs (prior to the fix for 4956777),
   // the "next" field is used to chain the pending list, not the discovered
   // field.
-
   if (TraceReferenceGC && PrintGCDetails) {
     gclog_or_tty->print_cr("ReferenceProcessor::enqueue_discovered_reflist list "
                            INTPTR_FORMAT, (address)refs_list.head());
@@ -365,15 +371,15 @@
       assert(java_lang_ref_Reference::next(obj) == NULL,
              "Reference not active; should not be discovered");
       // Self-loop next, so as to make Ref not active.
-      // Post-barrier not needed when looping to self.
       java_lang_ref_Reference::set_next_raw(obj, obj);
-      if (next_d == obj) {  // obj is last
+      if (next_d != obj) {
+        oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(obj), next_d);
+      } else {
+        // This is the last object.
         // Swap refs_list into pending_list_addr and
         // set obj's discovered to what we read from pending_list_addr.
         oop old = oopDesc::atomic_exchange_oop(refs_list.head(), pending_list_addr);
-        // Need post-barrier on pending_list_addr above;
-        // see special post-barrier code at the end of
-        // enqueue_discovered_reflists() further below.
+        // Need post-barrier on pending_list_addr. See enqueue_discovered_ref_helper() above.
         java_lang_ref_Reference::set_discovered_raw(obj, old); // old may be NULL
         oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(obj), old);
       }
@@ -496,20 +502,15 @@
   // pre-barrier here because we know the Reference has already been found/marked,
   // that's how it ended up in the discovered list in the first place.
   oop_store_raw(_prev_next, new_next);
-  if (_discovered_list_needs_post_barrier && _prev_next != _refs_list.adr_head()) {
-    // Needs post-barrier and this is not the list head (which is not on the heap)
-    oopDesc::bs()->write_ref_field(_prev_next, new_next);
-  }
   NOT_PRODUCT(_removed++);
   _refs_list.dec_length(1);
 }
 
 // Make the Reference object active again.
 void DiscoveredListIterator::make_active() {
-  // For G1 we don't want to use set_next - it
-  // will dirty the card for the next field of
-  // the reference object and will fail
-  // CT verification.
+  // The pre barrier for G1 is probably just needed for the old
+  // reference processing behavior. Should we guard this with
+  // ReferenceProcessor::pending_list_uses_discovered_field() ?
   if (UseG1GC) {
     HeapWord* next_addr = java_lang_ref_Reference::next_addr(_ref);
     if (UseCompressedOops) {
@@ -517,10 +518,8 @@
     } else {
       oopDesc::bs()->write_ref_field_pre((oop*)next_addr, NULL);
     }
-    java_lang_ref_Reference::set_next_raw(_ref, NULL);
-  } else {
-    java_lang_ref_Reference::set_next(_ref, NULL);
   }
+  java_lang_ref_Reference::set_next_raw(_ref, NULL);
 }
 
 void DiscoveredListIterator::clear_referent() {
@@ -546,7 +545,7 @@
                                    OopClosure*        keep_alive,
                                    VoidClosure*       complete_gc) {
   assert(policy != NULL, "Must have a non-NULL policy");
-  DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
   // Decide which softly reachable refs should be kept alive.
   while (iter.has_next()) {
     iter.load_ptrs(DEBUG_ONLY(!discovery_is_atomic() /* allow_null_referent */));
@@ -586,7 +585,7 @@
                              BoolObjectClosure* is_alive,
                              OopClosure*        keep_alive) {
   assert(discovery_is_atomic(), "Error");
-  DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
   while (iter.has_next()) {
     iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
     DEBUG_ONLY(oop next = java_lang_ref_Reference::next(iter.obj());)
@@ -623,7 +622,7 @@
                                                   OopClosure*        keep_alive,
                                                   VoidClosure*       complete_gc) {
   assert(!discovery_is_atomic(), "Error");
-  DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
   while (iter.has_next()) {
     iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
     HeapWord* next_addr = java_lang_ref_Reference::next_addr(iter.obj());
@@ -666,7 +665,7 @@
                                    OopClosure*        keep_alive,
                                    VoidClosure*       complete_gc) {
   ResourceMark rm;
-  DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
   while (iter.has_next()) {
     iter.update_discovered();
     iter.load_ptrs(DEBUG_ONLY(false /* allow_null_referent */));
@@ -782,13 +781,6 @@
   bool _clear_referent;
 };
 
-void ReferenceProcessor::set_discovered(oop ref, oop value) {
-  java_lang_ref_Reference::set_discovered_raw(ref, value);
-  if (_discovered_list_needs_post_barrier) {
-    oopDesc::bs()->write_ref_field(java_lang_ref_Reference::discovered_addr(ref), value);
-  }
-}
-
 // Balances reference queues.
 // Move entries from all queues[0, 1, ..., _max_num_q-1] to
 // queues[0, 1, ..., _num_q-1] because only the first _num_q
@@ -846,9 +838,9 @@
         // Add the chain to the to list.
         if (ref_lists[to_idx].head() == NULL) {
           // to list is empty. Make a loop at the end.
-          set_discovered(move_tail, move_tail);
+          java_lang_ref_Reference::set_discovered_raw(move_tail, move_tail);
         } else {
-          set_discovered(move_tail, ref_lists[to_idx].head());
+          java_lang_ref_Reference::set_discovered_raw(move_tail, ref_lists[to_idx].head());
         }
         ref_lists[to_idx].set_head(move_head);
         ref_lists[to_idx].inc_length(refs_to_move);
@@ -982,7 +974,7 @@
 
 void ReferenceProcessor::clean_up_discovered_reflist(DiscoveredList& refs_list) {
   assert(!discovery_is_atomic(), "Else why call this method?");
-  DiscoveredListIterator iter(refs_list, NULL, NULL, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, NULL, NULL);
   while (iter.has_next()) {
     iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
     oop next = java_lang_ref_Reference::next(iter.obj());
@@ -1071,16 +1063,6 @@
   // The last ref must have its discovered field pointing to itself.
   oop next_discovered = (current_head != NULL) ? current_head : obj;
 
-  // Note: In the case of G1, this specific pre-barrier is strictly
-  // not necessary because the only case we are interested in
-  // here is when *discovered_addr is NULL (see the CAS further below),
-  // so this will expand to nothing. As a result, we have manually
-  // elided this out for G1, but left in the test for some future
-  // collector that might have need for a pre-barrier here, e.g.:-
-  // oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered);
-  assert(!_discovered_list_needs_post_barrier || UseG1GC,
-         "Need to check non-G1 collector: "
-         "may need a pre-write-barrier for CAS from NULL below");
   oop retest = oopDesc::atomic_compare_exchange_oop(next_discovered, discovered_addr,
                                                     NULL);
   if (retest == NULL) {
@@ -1089,9 +1071,6 @@
     // is necessary.
     refs_list.set_head(obj);
     refs_list.inc_length(1);
-    if (_discovered_list_needs_post_barrier) {
-      oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered);
-    }
 
     if (TraceReferenceGC) {
       gclog_or_tty->print_cr("Discovered reference (mt) (" INTPTR_FORMAT ": %s)",
@@ -1242,24 +1221,14 @@
   if (_discovery_is_mt) {
     add_to_discovered_list_mt(*list, obj, discovered_addr);
   } else {
-    // If "_discovered_list_needs_post_barrier", we do write barriers when
-    // updating the discovered reference list.  Otherwise, we do a raw store
-    // here: the field will be visited later when processing the discovered
-    // references.
+    // We do a raw store here: the field will be visited later when processing
+    // the discovered references.
     oop current_head = list->head();
     // The last ref must have its discovered field pointing to itself.
     oop next_discovered = (current_head != NULL) ? current_head : obj;
 
-    // As in the case further above, since we are over-writing a NULL
-    // pre-value, we can safely elide the pre-barrier here for the case of G1.
-    // e.g.:- oopDesc::bs()->write_ref_field_pre((oop* or narrowOop*)discovered_addr, next_discovered);
     assert(discovered == NULL, "control point invariant");
-    assert(!_discovered_list_needs_post_barrier || UseG1GC,
-           "For non-G1 collector, may need a pre-write-barrier for CAS from NULL below");
     oop_store_raw(discovered_addr, next_discovered);
-    if (_discovered_list_needs_post_barrier) {
-      oopDesc::bs()->write_ref_field((void*)discovered_addr, next_discovered);
-    }
     list->set_head(obj);
     list->inc_length(1);
 
@@ -1353,7 +1322,7 @@
                                                 OopClosure*        keep_alive,
                                                 VoidClosure*       complete_gc,
                                                 YieldClosure*      yield) {
-  DiscoveredListIterator iter(refs_list, keep_alive, is_alive, _discovered_list_needs_post_barrier);
+  DiscoveredListIterator iter(refs_list, keep_alive, is_alive);
   while (iter.has_next()) {
     iter.load_ptrs(DEBUG_ONLY(true /* allow_null_referent */));
     oop obj = iter.obj();
diff --git a/hotspot/src/share/vm/memory/referenceProcessor.hpp b/hotspot/src/share/vm/memory/referenceProcessor.hpp
index f9f69f0..26ac9f1 100644
--- a/hotspot/src/share/vm/memory/referenceProcessor.hpp
+++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp
@@ -99,7 +99,6 @@
   oop                _referent;
   OopClosure*        _keep_alive;
   BoolObjectClosure* _is_alive;
-  bool               _discovered_list_needs_post_barrier;
 
   DEBUG_ONLY(
   oop                _first_seen; // cyclic linked list check
@@ -113,8 +112,7 @@
 public:
   inline DiscoveredListIterator(DiscoveredList&    refs_list,
                                 OopClosure*        keep_alive,
-                                BoolObjectClosure* is_alive,
-                                bool               discovered_list_needs_post_barrier = false):
+                                BoolObjectClosure* is_alive):
     _refs_list(refs_list),
     _prev_next(refs_list.adr_head()),
     _prev(NULL),
@@ -128,8 +126,7 @@
 #endif
     _next(NULL),
     _keep_alive(keep_alive),
-    _is_alive(is_alive),
-    _discovered_list_needs_post_barrier(discovered_list_needs_post_barrier)
+    _is_alive(is_alive)
 { }
 
   // End Of List.
@@ -230,14 +227,6 @@
                                         // other collectors in configuration
   bool        _discovery_is_mt;         // true if reference discovery is MT.
 
-  // If true, setting "next" field of a discovered refs list requires
-  // write post barrier.  (Must be true if used in a collector in which
-  // elements of a discovered list may be moved during discovery: for
-  // example, a collector like Garbage-First that moves objects during a
-  // long-term concurrent marking phase that does weak reference
-  // discovery.)
-  bool        _discovered_list_needs_post_barrier;
-
   bool        _enqueuing_is_done;       // true if all weak references enqueued
   bool        _processing_is_mt;        // true during phases when
                                         // reference processing is MT.
@@ -382,11 +371,6 @@
   void enqueue_discovered_reflists(HeapWord* pending_list_addr, AbstractRefProcTaskExecutor* task_executor);
 
  protected:
-  // Set the 'discovered' field of the given reference to
-  // the given value - emitting post barriers depending upon
-  // the value of _discovered_list_needs_post_barrier.
-  void set_discovered(oop ref, oop value);
-
   // "Preclean" the given discovered reference list
   // by removing references with strongly reachable referents.
   // Currently used in support of CMS only.
@@ -427,8 +411,7 @@
                      bool mt_processing = false, uint mt_processing_degree = 1,
                      bool mt_discovery  = false, uint mt_discovery_degree  = 1,
                      bool atomic_discovery = true,
-                     BoolObjectClosure* is_alive_non_header = NULL,
-                     bool discovered_list_needs_post_barrier = false);
+                     BoolObjectClosure* is_alive_non_header = NULL);
 
   // RefDiscoveryPolicy values
   enum DiscoveryPolicy {
diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp
index 34907dd..bcf9dc0 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp
@@ -1501,6 +1501,21 @@
   return NULL;
 }
 
+#ifdef ASSERT
+// search through class hierarchy and return true if this class or
+// one of the superclasses was redefined
+bool InstanceKlass::has_redefined_this_or_super() const {
+  const InstanceKlass* klass = this;
+  while (klass != NULL) {
+    if (klass->has_been_redefined()) {
+      return true;
+    }
+    klass = InstanceKlass::cast(klass->super());
+  }
+  return false;
+}
+#endif
+
 // lookup a method in the default methods list then in all transitive interfaces
 // Do NOT return private or static methods
 Method* InstanceKlass::lookup_method_in_ordered_interfaces(Symbol* name,
diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp
index 9010b91..57b0687 100644
--- a/hotspot/src/share/vm/oops/instanceKlass.hpp
+++ b/hotspot/src/share/vm/oops/instanceKlass.hpp
@@ -754,6 +754,11 @@
   bool implements_interface(Klass* k) const;
   bool is_same_or_direct_interface(Klass* k) const;
 
+#ifdef ASSERT
+  // check whether this class or one of its superclasses was redefined
+  bool has_redefined_this_or_super() const;
+#endif
+
   // Access to the implementor of an interface.
   Klass* implementor() const
   {
@@ -811,8 +816,8 @@
 
   // Casting from Klass*
   static InstanceKlass* cast(Klass* k) {
-    assert(k->is_klass(), "must be");
-    assert(k->oop_is_instance(), "cast to InstanceKlass");
+    assert(k == NULL || k->is_klass(), "must be");
+    assert(k == NULL || k->oop_is_instance(), "cast to InstanceKlass");
     return (InstanceKlass*) k;
   }
 
diff --git a/hotspot/src/share/vm/oops/oopsHierarchy.hpp b/hotspot/src/share/vm/oops/oopsHierarchy.hpp
index ef0d2ed..cd63547 100644
--- a/hotspot/src/share/vm/oops/oopsHierarchy.hpp
+++ b/hotspot/src/share/vm/oops/oopsHierarchy.hpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -112,9 +112,7 @@
 
   // Assignment
   oop& operator=(const oop& o)                            { _o = o.obj(); return *this; }
-#ifndef SOLARIS
   volatile oop& operator=(const oop& o) volatile          { _o = o.obj(); return *this; }
-#endif
   volatile oop& operator=(const volatile oop& o) volatile { _o = o.obj(); return *this; }
 
   // Explict user conversions
@@ -123,11 +121,10 @@
   operator void* () const volatile    { return (void *)obj(); }
 #endif
   operator HeapWord* () const         { return (HeapWord*)obj(); }
-  operator oopDesc* () const          { return obj(); }
+  operator oopDesc* () const volatile { return obj(); }
   operator intptr_t* () const         { return (intptr_t*)obj(); }
   operator PromotedObject* () const   { return (PromotedObject*)obj(); }
   operator markOop () const           { return markOop(obj()); }
-
   operator address   () const         { return (address)obj(); }
 
   // from javaCalls.cpp
@@ -161,11 +158,10 @@
             oop::operator=(o);                                             \
             return *this;                                                  \
        }                                                                   \
-       NOT_SOLARIS(                                                        \
        volatile type##Oop& operator=(const type##Oop& o) volatile {        \
             (void)const_cast<oop&>(oop::operator=(o));                     \
             return *this;                                                  \
-       })                                                                  \
+       }                                                                   \
        volatile type##Oop& operator=(const volatile type##Oop& o) volatile {\
             (void)const_cast<oop&>(oop::operator=(o));                     \
             return *this;                                                  \
diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp
index 136bc4d..439bb40 100644
--- a/hotspot/src/share/vm/runtime/mutexLocker.cpp
+++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp
@@ -280,10 +280,10 @@
 
 #ifdef INCLUDE_TRACE
   def(JfrMsg_lock                  , Monitor, leaf,        true);
-  def(JfrBuffer_lock               , Mutex,   nonleaf+1,   true);
-  def(JfrThreadGroups_lock         , Mutex,   nonleaf+1,   true);
-  def(JfrStream_lock               , Mutex,   nonleaf+2,   true);
-  def(JfrStacktrace_lock           , Mutex,   special,     true );
+  def(JfrBuffer_lock               , Mutex,   leaf,        true);
+  def(JfrThreadGroups_lock         , Mutex,   leaf,        true);
+  def(JfrStream_lock               , Mutex,   nonleaf,     true);
+  def(JfrStacktrace_lock           , Mutex,   special,     true);
 #endif
 
 }
diff --git a/hotspot/src/share/vm/runtime/objectMonitor.cpp b/hotspot/src/share/vm/runtime/objectMonitor.cpp
index 1f16ee4..6f2323c 100644
--- a/hotspot/src/share/vm/runtime/objectMonitor.cpp
+++ b/hotspot/src/share/vm/runtime/objectMonitor.cpp
@@ -385,6 +385,15 @@
       jt->java_suspend_self();
     }
     Self->set_current_pending_monitor(NULL);
+
+    // We cleared the pending monitor info since we've just gotten past
+    // the enter-check-for-suspend dance and we now own the monitor free
+    // and clear, i.e., it is no longer pending. The ThreadBlockInVM
+    // destructor can go to a safepoint at the end of this block. If we
+    // do a thread dump during that safepoint, then this thread will show
+    // as having "-locked" the monitor, but the OS and java.lang.Thread
+    // states will still report that the thread is blocked trying to
+    // acquire it.
   }
 
   Atomic::dec_ptr(&_count);
diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp
index e6d9eee..e9e9d22 100644
--- a/hotspot/src/share/vm/runtime/thread.cpp
+++ b/hotspot/src/share/vm/runtime/thread.cpp
@@ -1434,7 +1434,7 @@
   _in_deopt_handler = 0;
   _doing_unsafe_access = false;
   _stack_guard_state = stack_guard_unused;
-  (void)const_cast<oop&>(_exception_oop = NULL);
+  (void)const_cast<oop&>(_exception_oop = oop(NULL));
   _exception_pc  = 0;
   _exception_handler_pc = 0;
   _is_method_handle_return = 0;
@@ -3543,6 +3543,8 @@
   // debug stuff, that does not work until all basic classes have been initialized.
   set_init_completed();
 
+  Metaspace::post_initialize();
+
   HOTSPOT_VM_INIT_END();
 
   // record VM initialization completion time
diff --git a/hotspot/src/share/vm/runtime/vframe.cpp b/hotspot/src/share/vm/runtime/vframe.cpp
index 8b4d72f..a32d03a 100644
--- a/hotspot/src/share/vm/runtime/vframe.cpp
+++ b/hotspot/src/share/vm/runtime/vframe.cpp
@@ -199,6 +199,7 @@
         continue;
       }
       if (monitor->owner() != NULL) {
+        // the monitor is associated with an object, i.e., it is locked
 
         // First, assume we have the monitor locked. If we haven't found an
         // owned monitor before and this is the first frame, then we need to
@@ -209,7 +210,11 @@
         if (!found_first_monitor && frame_count == 0) {
           markOop mark = monitor->owner()->mark();
           if (mark->has_monitor() &&
-              mark->monitor() == thread()->current_pending_monitor()) {
+              ( // we have marked ourself as pending on this monitor
+                mark->monitor() == thread()->current_pending_monitor() ||
+                // we are not the owner of this monitor
+                !mark->monitor()->is_entered(thread())
+              )) {
             lock_state = "waiting to lock";
           }
         }
diff --git a/hotspot/src/share/vm/services/attachListener.cpp b/hotspot/src/share/vm/services/attachListener.cpp
index 9d68175..2321f08 100644
--- a/hotspot/src/share/vm/services/attachListener.cpp
+++ b/hotspot/src/share/vm/services/attachListener.cpp
@@ -162,10 +162,7 @@
     java_lang_Throwable::print(PENDING_EXCEPTION, out);
     out->cr();
     CLEAR_PENDING_EXCEPTION;
-    // The exception has been printed on the output stream
-    // If the JVM returns JNI_ERR, the attachAPI throws a generic I/O
-    // exception and the content of the output stream is not processed.
-    // By returning JNI_OK, the exception will be displayed on the client side
+    return JNI_ERR;
   }
   return JNI_OK;
 }
diff --git a/hotspot/src/share/vm/services/memoryManager.cpp b/hotspot/src/share/vm/services/memoryManager.cpp
index 646b5e1..0469c93 100644
--- a/hotspot/src/share/vm/services/memoryManager.cpp
+++ b/hotspot/src/share/vm/services/memoryManager.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -39,7 +39,7 @@
 
 MemoryManager::MemoryManager() {
   _num_pools = 0;
-  (void)const_cast<instanceOop&>(_memory_mgr_obj = NULL);
+  (void)const_cast<instanceOop&>(_memory_mgr_obj = instanceOop(NULL));
 }
 
 void MemoryManager::add_pool(MemoryPool* pool) {
diff --git a/hotspot/src/share/vm/services/memoryPool.cpp b/hotspot/src/share/vm/services/memoryPool.cpp
index 1510cd5..2d686cb 100644
--- a/hotspot/src/share/vm/services/memoryPool.cpp
+++ b/hotspot/src/share/vm/services/memoryPool.cpp
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
   _name = name;
   _initial_size = init_size;
   _max_size = max_size;
-  (void)const_cast<instanceOop&>(_memory_pool_obj = NULL);
+  (void)const_cast<instanceOop&>(_memory_pool_obj = instanceOop(NULL));
   _available_for_allocation = true;
   _num_managers = 0;
   _type = type;
diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp
index 604018f..ff3bc5d 100644
--- a/hotspot/src/share/vm/utilities/debug.cpp
+++ b/hotspot/src/share/vm/utilities/debug.cpp
@@ -263,13 +263,11 @@
 
 void report_out_of_shared_space(SharedSpaceType shared_space) {
   static const char* name[] = {
-    "native memory for metadata",
     "shared read only space",
     "shared read write space",
     "shared miscellaneous data space"
   };
   static const char* flag[] = {
-    "Metaspace",
     "SharedReadOnlySize",
     "SharedReadWriteSize",
     "SharedMiscDataSize"
diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups
index 8c2db99..962df9e 100644
--- a/hotspot/test/TEST.groups
+++ b/hotspot/test/TEST.groups
@@ -81,6 +81,7 @@
   runtime/NMT/ThreadedVirtualAllocTestType.java \
   runtime/NMT/VirtualAllocTestType.java \
   runtime/RedefineObject/TestRedefineObject.java \
+  runtime/Thread/TestThreadDumpMonitorContention.java \
   runtime/XCheckJniJsig/XCheckJSig.java \
   serviceability/attach/AttachWithStalePidFile.java \
   serviceability/jvmti/8036666/GetObjectLockCount.java \
diff --git a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
index 2de2826..947fd0f 100644
--- a/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
+++ b/hotspot/test/gc/arguments/TestParallelHeapSizeFlags.java
@@ -22,6 +22,7 @@
 */
 
 /*
+ * @ignore 8027915
  * @test TestParallelHeapSizeFlags
  * @key gc
  * @bug 8006088
diff --git a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
index 852076e..14ca6ed 100644
--- a/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
+++ b/hotspot/test/gc/arguments/TestUseCompressedOopsErgo.java
@@ -22,6 +22,7 @@
 */
 
 /*
+ * @ignore 8025645
  * @test TestUseCompressedOopsErgo
  * @key gc
  * @bug 8010722
diff --git a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
index c790c64..4cf6c41 100644
--- a/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
+++ b/hotspot/test/gc/g1/TestHumongousShrinkHeap.java
@@ -22,6 +22,7 @@
  */
 
 /**
+ * @ignore 8041506, 8041946, 8042051
  * @test TestHumongousShrinkHeap
  * @bug 8036025
  * @summary Verify that heap shrinks after GC in the presence of fragmentation due to humongous objects
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationTools.java b/hotspot/test/gc/g1/TestStringDeduplicationTools.java
index 5b27aa6..1f8347b 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationTools.java
+++ b/hotspot/test/gc/g1/TestStringDeduplicationTools.java
@@ -294,55 +294,6 @@
         }
     }
 
-    private static class MemoryUsageTest {
-        public static void main(String[] args) {
-            System.out.println("Begin: MemoryUsageTest");
-
-            final boolean useStringDeduplication = Boolean.parseBoolean(args[0]);
-            final int numberOfStrings = LargeNumberOfStrings;
-            final int numberOfUniqueStrings = 1;
-
-            ArrayList<String> list = createStrings(numberOfStrings, numberOfUniqueStrings);
-            forceDeduplication(DefaultAgeThreshold, FullGC);
-
-            if (useStringDeduplication) {
-                verifyStrings(list, numberOfUniqueStrings);
-            }
-
-            System.gc();
-
-            System.out.println("Heap Memory Usage: " + ManagementFactory.getMemoryMXBean().getHeapMemoryUsage().getUsed());
-            System.out.println("Array Header Size: " + unsafe.ARRAY_CHAR_BASE_OFFSET);
-
-            System.out.println("End: MemoryUsageTest");
-        }
-
-        public static OutputAnalyzer run(boolean useStringDeduplication) throws Exception {
-            String[] extraArgs = new String[0];
-
-            if (useStringDeduplication) {
-                extraArgs = new String[] {
-                    "-XX:+UseStringDeduplication",
-                    "-XX:+PrintStringDeduplicationStatistics",
-                    "-XX:StringDeduplicationAgeThreshold=" + DefaultAgeThreshold
-                };
-            }
-
-            String[] defaultArgs = new String[] {
-                "-XX:+PrintGC",
-                "-XX:+PrintGCDetails",
-                MemoryUsageTest.class.getName(),
-                "" + useStringDeduplication
-            };
-
-            ArrayList<String> args = new ArrayList<String>();
-            args.addAll(Arrays.asList(extraArgs));
-            args.addAll(Arrays.asList(defaultArgs));
-
-            return runTest(args.toArray(new String[args.size()]));
-        }
-    }
-
     /*
      * Tests
      */
@@ -480,44 +431,4 @@
         OutputAnalyzer output = InternedTest.run();
         output.shouldHaveExitValue(0);
     }
-
-    public static void testMemoryUsage() throws Exception {
-        // Test that memory usage is reduced after deduplication
-        OutputAnalyzer output;
-        final String heapMemoryUsagePattern = "Heap Memory Usage: (\\d+)";
-        final String arrayHeaderSizePattern = "Array Header Size: (\\d+)";
-
-        // Run without deduplication
-        output = MemoryUsageTest.run(false);
-        output.shouldHaveExitValue(0);
-        final long heapMemoryUsageWithoutDedup = Long.parseLong(output.firstMatch(heapMemoryUsagePattern, 1));
-        final long arrayHeaderSizeWithoutDedup = Long.parseLong(output.firstMatch(arrayHeaderSizePattern, 1));
-
-        // Run with deduplication
-        output = MemoryUsageTest.run(true);
-        output.shouldHaveExitValue(0);
-        final long heapMemoryUsageWithDedup = Long.parseLong(output.firstMatch(heapMemoryUsagePattern, 1));
-        final long arrayHeaderSizeWithDedup = Long.parseLong(output.firstMatch(arrayHeaderSizePattern, 1));
-
-        // Sanity check to make sure one instance isn't using compressed class pointers and the other not
-        if (arrayHeaderSizeWithoutDedup != arrayHeaderSizeWithDedup) {
-            throw new Exception("Unexpected difference between array header sizes");
-        }
-
-        // Calculate expected memory usage with deduplication enabled. This calculation does
-        // not take alignment and padding into account, so it's a conservative estimate.
-        final long sizeOfChar = unsafe.ARRAY_CHAR_INDEX_SCALE;
-        final long sizeOfCharArray = StringLength * sizeOfChar + arrayHeaderSizeWithoutDedup;
-        final long bytesSaved = (LargeNumberOfStrings - 1) * sizeOfCharArray;
-        final long heapMemoryUsageWithDedupExpected = heapMemoryUsageWithoutDedup - bytesSaved;
-
-        System.out.println("Memory usage summary:");
-        System.out.println("   heapMemoryUsageWithoutDedup:      " + heapMemoryUsageWithoutDedup);
-        System.out.println("   heapMemoryUsageWithDedup:         " + heapMemoryUsageWithDedup);
-        System.out.println("   heapMemoryUsageWithDedupExpected: " + heapMemoryUsageWithDedupExpected);
-
-        if (heapMemoryUsageWithDedup > heapMemoryUsageWithDedupExpected) {
-            throw new Exception("Unexpected memory usage, heapMemoryUsageWithDedup should be less or equal to heapMemoryUsageWithDedupExpected");
-        }
-    }
 }
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java
similarity index 60%
copy from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
copy to hotspot/test/gc/metaspace/TestMetaspaceInitialization.java
index ba34289..c7bbcec 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/hotspot/test/gc/metaspace/TestMetaspaceInitialization.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,16 +21,28 @@
  * questions.
  */
 
-/*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
- * @library /testlibrary
- */
+import java.util.ArrayList;
 
-public class TestStringDeduplicationMemoryUsage {
-    public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
+/* @test TestMetaspaceInitialization
+ * @bug 8042933
+ * @summary Tests to initialize metaspace with a very low MetaspaceSize
+ * @library /testlibrary
+ * @run main/othervm -XX:MetaspaceSize=2m TestMetaspaceInitialization
+ */
+public class TestMetaspaceInitialization {
+    private class Internal {
+        public int x;
+        public Internal(int x) {
+            this.x = x;
+        }
+    }
+
+    private void test() {
+        ArrayList<Internal> l = new ArrayList<>();
+        l.add(new Internal(17));
+    }
+
+    public static void main(String[] args) {
+        new TestMetaspaceInitialization().test();
     }
 }
diff --git a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java
index 6f9b02d..7a23509 100644
--- a/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java
+++ b/hotspot/test/gc/parallelScavenge/TestDynShrinkHeap.java
@@ -22,6 +22,7 @@
  */
 
 /**
+ * @ignore 8042051
  * @test TestDynShrinkHeap
  * @bug 8016479
  * @summary Verify that the heap shrinks after full GC according to the current values of the Min/MaxHeapFreeRatio flags
diff --git a/hotspot/test/runtime/CommandLine/TestHexArguments.java b/hotspot/test/runtime/CommandLine/TestHexArguments.java
index 1fd3346..f62435e 100644
--- a/hotspot/test/runtime/CommandLine/TestHexArguments.java
+++ b/hotspot/test/runtime/CommandLine/TestHexArguments.java
@@ -35,14 +35,14 @@
 public class TestHexArguments {
     public static void main(String args[]) throws Exception {
       String[] javaArgs = {"-XX:SharedBaseAddress=0x1D000000", "-version"};
-      ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, javaArgs);
+      ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(javaArgs);
 
       OutputAnalyzer output = new OutputAnalyzer(pb.start());
       output.shouldNotContain("Could not create the Java Virtual Machine");
       output.shouldHaveExitValue(0);
 
       String[] javaArgs1 = {"-XX:SharedBaseAddress=1D000000", "-version"};
-      pb = ProcessTools.createJavaProcessBuilder(true, javaArgs1);
+      pb = ProcessTools.createJavaProcessBuilder(javaArgs1);
       output = new OutputAnalyzer(pb.start());
       output.shouldContain("Could not create the Java Virtual Machine");
   }
diff --git a/hotspot/test/runtime/RedefineFinalizer/RedefineFinalizer.java b/hotspot/test/runtime/RedefineFinalizer/RedefineFinalizer.java
new file mode 100644
index 0000000..227b9e8
--- /dev/null
+++ b/hotspot/test/runtime/RedefineFinalizer/RedefineFinalizer.java
@@ -0,0 +1,64 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 6904403
+ * @summary Don't assert if we redefine finalize method
+ * @library /testlibrary
+ * @build RedefineClassHelper
+ * @run main RedefineClassHelper
+ * @run main/othervm -javaagent:redefineagent.jar RedefineFinalizer
+ */
+
+/*
+ * Regression test for hitting:
+ *
+ * assert(f == k->has_finalizer()) failed: inconsistent has_finalizer
+ *
+ * when redefining finalizer method
+ */
+public class RedefineFinalizer {
+
+    public static String newB =
+                "class RedefineFinalizer$B {" +
+                "   protected void finalize() { " +
+                "       System.out.println(\"Finalizer called\");" +
+                "   }" +
+                "}";
+
+    public static void main(String[] args) throws Exception {
+        RedefineClassHelper.redefineClass(B.class, newB);
+
+        A a = new A();
+    }
+
+    static class A extends B {
+    }
+
+    static class B {
+        protected void finalize() {
+            // should be empty
+        }
+    }
+}
diff --git a/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
new file mode 100644
index 0000000..dff6192
--- /dev/null
+++ b/hotspot/test/runtime/SharedArchiveFile/LimitSharedSizes.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @ignore JDK-8043896
+ * @test LimitSharedSizes
+ * @summary Test handling of limits on shared space size
+ * @library /testlibrary
+ * @run main LimitSharedSizes
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class LimitSharedSizes {
+    private static class SharedSizeTestData {
+        public String optionName;
+        public String optionValue;
+        public String expectedErrorMsg;
+
+        public SharedSizeTestData(String name, String value, String msg) {
+            optionName = name;
+            optionValue = value;
+            expectedErrorMsg = msg;
+        }
+    }
+
+    private static final SharedSizeTestData[] testTable = {
+        // values in this part of the test table should cause failure
+        // (shared space sizes are deliberately too small)
+        new SharedSizeTestData("-XX:SharedReadOnlySize", "4M",      "read only"),
+        new SharedSizeTestData("-XX:SharedReadWriteSize","4M",      "read write"),
+
+        // Known issue, JDK-8038422 (assert() on Windows)
+        // new SharedSizeTestData("-XX:SharedMiscDataSize", "500k",    "miscellaneous data"),
+
+        // This will cause a VM crash; commenting out for now; see bug JDK-8038268
+        // @ignore JDK-8038268
+        // new SharedSizeTestData("-XX:SharedMiscCodeSize", "20k",     "miscellaneous code"),
+
+        // these values are larger than default ones, but should
+        // be acceptable and not cause failure
+        new SharedSizeTestData("-XX:SharedReadOnlySize",    "20M", null),
+        new SharedSizeTestData("-XX:SharedReadWriteSize",   "20M", null),
+        new SharedSizeTestData("-XX:SharedMiscDataSize",    "20M", null),
+        new SharedSizeTestData("-XX:SharedMiscCodeSize",    "20M", null)
+    };
+
+    public static void main(String[] args) throws Exception {
+        String fileName = "test.jsa";
+
+        for (SharedSizeTestData td : testTable) {
+            String option = td.optionName + "=" + td.optionValue;
+            System.out.println("testing option <" + option + ">");
+
+            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+               "-XX:+UnlockDiagnosticVMOptions",
+               "-XX:SharedArchiveFile=./" + fileName,
+               option,
+               "-Xshare:dump");
+
+            OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+            if (td.expectedErrorMsg != null) {
+                output.shouldContain("The shared " + td.expectedErrorMsg
+                    + " space is not large enough");
+
+                output.shouldHaveExitValue(2);
+            } else {
+                output.shouldNotContain("space is not large enough");
+                output.shouldHaveExitValue(0);
+            }
+        }
+    }
+}
diff --git a/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java
new file mode 100644
index 0000000..388fe7d
--- /dev/null
+++ b/hotspot/test/runtime/SharedArchiveFile/SharedBaseAddress.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test SharedBaseAddress
+ * @summary Test variety of values for SharedBaseAddress, making sure
+ *          VM handles normal values as well as edge values w/o a crash.
+ * @library /testlibrary
+ * @run main SharedBaseAddress
+ */
+
+import com.oracle.java.testlibrary.*;
+
+public class SharedBaseAddress {
+
+    // shared base address test table
+    private static final String[] testTable = {
+        "1g", "8g", "64g","512g", "4t",
+        "32t", "128t", "0",
+        "1", "64k", "64M"
+    };
+
+    public static void main(String[] args) throws Exception {
+        // Known issue on Solaris-Sparc
+        // @ignore JDK-8044600
+        if (Platform.isSolaris() && Platform.isSparc())
+            return;
+
+        for (String testEntry : testTable) {
+            System.out.println("sharedBaseAddress = " + testEntry);
+
+            ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+               "-XX:+UnlockDiagnosticVMOptions",
+               "-XX:SharedArchiveFile=test.jsa",
+               "-XX:SharedBaseAddress=" + testEntry,
+               "-Xshare:dump");
+
+            OutputAnalyzer output = new OutputAnalyzer(pb.start());
+
+            output.shouldContain("Loading classes to share");
+
+            try {
+                pb = ProcessTools.createJavaProcessBuilder(
+                    "-XX:+UnlockDiagnosticVMOptions",
+                    "-XX:SharedArchiveFile=test.jsa",
+                    "-Xshare:on",
+                    "-version");
+                output = new OutputAnalyzer(pb.start());
+                output.shouldContain("sharing");
+                output.shouldHaveExitValue(0);
+            } catch (RuntimeException e) {
+                output.shouldContain("Unable to use shared archive");
+                output.shouldHaveExitValue(1);
+            }
+        }
+    }
+}
diff --git a/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java
new file mode 100644
index 0000000..a95979f
--- /dev/null
+++ b/hotspot/test/runtime/SharedArchiveFile/SpaceUtilizationCheck.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test SpaceUtilizationCheck
+ * @summary Check if the space utilization for shared spaces is adequate
+ * @library /testlibrary
+ * @run main SpaceUtilizationCheck
+ */
+
+import com.oracle.java.testlibrary.*;
+
+import java.util.regex.Pattern;
+import java.util.regex.Matcher;
+import java.util.ArrayList;
+import java.lang.Integer;
+
+public class SpaceUtilizationCheck {
+    // Minimum allowed utilization value (percent)
+    // The goal is to have this number to be 50% for RO and RW regions
+    // Once that feature is implemented, increase the MIN_UTILIZATION to 50
+    private static final int MIN_UTILIZATION = 30;
+
+    // Only RO and RW regions are considered for this check, since they
+    // currently account for the bulk of the shared space
+    private static final int NUMBER_OF_CHECKED_SHARED_REGIONS = 2;
+
+    public static void main(String[] args) throws Exception {
+        ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
+           "-XX:+UnlockDiagnosticVMOptions",
+           "-XX:SharedArchiveFile=./test.jsa",
+           "-Xshare:dump");
+
+        OutputAnalyzer output = new OutputAnalyzer(pb.start());
+        String stdout = output.getStdout();
+        ArrayList<String> utilization = findUtilization(stdout);
+
+        if (utilization.size() != NUMBER_OF_CHECKED_SHARED_REGIONS )
+            throw new RuntimeException("The output format of sharing summary has changed");
+
+        for(String str : utilization) {
+            int value = Integer.parseInt(str);
+            if (value < MIN_UTILIZATION) {
+                System.out.println(stdout);
+                throw new RuntimeException("Utilization for one of the regions" +
+                    "is below a threshold of " + MIN_UTILIZATION + "%");
+            }
+        }
+    }
+
+    public static ArrayList<String> findUtilization(String input) {
+        ArrayList<String> regions = filterRegionsOfInterest(input.split("\n"));
+        return filterByPattern(filterByPattern(regions, "bytes \\[.*% used\\]"), "\\d+");
+    }
+
+    private static ArrayList<String> filterByPattern(Iterable<String> input, String pattern) {
+        ArrayList<String> result = new ArrayList<String>();
+        for (String str : input) {
+            Matcher matcher = Pattern.compile(pattern).matcher(str);
+            if (matcher.find()) {
+                result.add(matcher.group());
+            }
+        }
+        return result;
+    }
+
+    private static ArrayList<String> filterRegionsOfInterest(String[] inputLines) {
+        ArrayList<String> result = new ArrayList<String>();
+        for (String str : inputLines) {
+            if (str.contains("ro space:") || str.contains("rw space:")) {
+                result.add(str);
+            }
+        }
+        return result;
+    }
+}
diff --git a/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
new file mode 100644
index 0000000..06b2274
--- /dev/null
+++ b/hotspot/test/runtime/Thread/TestThreadDumpMonitorContention.java
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug     8036823
+ * @summary Creates two threads contending for the same lock and checks
+ *      whether jstack reports "locked" by more than one thread.
+ *
+ * @library /testlibrary
+ * @run main/othervm TestThreadDumpMonitorContention
+ */
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.lang.management.ManagementFactory;
+import java.lang.management.RuntimeMXBean;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import com.oracle.java.testlibrary.*;
+
+public class TestThreadDumpMonitorContention {
+    // jstack tends to be closely bound to the VM that we are running
+    // so use getTestJDKTool() instead of getCompileJDKTool() or even
+    // getJDKTool() which can fall back to "compile.jdk".
+    final static String JSTACK = JDKToolFinder.getTestJDKTool("jstack");
+    final static String PID = getPid();
+
+    // looking for header lines with these patterns:
+    // "ContendingThread-1" #19 prio=5 os_prio=64 tid=0x000000000079c000 nid=0x23 runnable [0xffff80ffb8b87000]
+    // "ContendingThread-2" #21 prio=5 os_prio=64 tid=0x0000000000780000 nid=0x2f waiting for monitor entry [0xfffffd7fc1111000]
+    final static Pattern HEADER_PREFIX_PATTERN = Pattern.compile(
+        "^\"ContendingThread-.*");
+    final static Pattern HEADER_WAITING_PATTERN = Pattern.compile(
+        "^\"ContendingThread-.* waiting for monitor entry .*");
+    final static Pattern HEADER_RUNNABLE_PATTERN = Pattern.compile(
+        "^\"ContendingThread-.* runnable .*");
+
+    // looking for thread state lines with these patterns:
+    // java.lang.Thread.State: RUNNABLE
+    // java.lang.Thread.State: BLOCKED (on object monitor)
+    final static Pattern THREAD_STATE_PREFIX_PATTERN = Pattern.compile(
+        " *java\\.lang\\.Thread\\.State: .*");
+    final static Pattern THREAD_STATE_BLOCKED_PATTERN = Pattern.compile(
+        " *java\\.lang\\.Thread\\.State: BLOCKED \\(on object monitor\\)");
+    final static Pattern THREAD_STATE_RUNNABLE_PATTERN = Pattern.compile(
+        " *java\\.lang\\.Thread\\.State: RUNNABLE");
+
+    // looking for duplicates of this pattern:
+    // - locked <0x000000076ac59e20> (a TestThreadDumpMonitorContention$1)
+    final static Pattern LOCK_PATTERN = Pattern.compile(
+        ".* locked \\<.*\\(a TestThreadDumpMonitorContention.*");
+
+    // sanity checking header and thread state lines associated
+    // with this pattern:
+    // - waiting to lock <0x000000076ac59e20> (a TestThreadDumpMonitorContention$1)
+    final static Pattern WAITING_PATTERN = Pattern.compile(
+        ".* waiting to lock \\<.*\\(a TestThreadDumpMonitorContention.*");
+
+    volatile static boolean done = false;
+
+    static int error_cnt = 0;
+    static String header_line = null;
+    static boolean have_header_line = false;
+    static boolean have_thread_state_line = false;
+    static int match_cnt = 0;
+    static String[] match_list = new String[2];
+    static int n_samples = 15;
+    static String thread_state_line = null;
+    static boolean verbose = false;
+
+    public static void main(String[] args) throws Exception {
+        if (args.length != 0) {
+            int arg_i = 0;
+            if (args[arg_i].equals("-v")) {
+                verbose = true;
+                arg_i++;
+            }
+
+            try {
+                n_samples = Integer.parseInt(args[arg_i]);
+            } catch (NumberFormatException nfe) {
+                System.err.println(nfe);
+                usage();
+            }
+        }
+
+        Runnable runnable = new Runnable() {
+            public void run() {
+                while (!done) {
+                    synchronized (this) { }
+                }
+            }
+        };
+        Thread[] thread_list = new Thread[2];
+        thread_list[0] = new Thread(runnable, "ContendingThread-1");
+        thread_list[1] = new Thread(runnable, "ContendingThread-2");
+        thread_list[0].start();
+        thread_list[1].start();
+
+        doSamples();
+
+        done = true;
+
+        thread_list[0].join();
+        thread_list[1].join();
+
+        if (error_cnt == 0) {
+            System.out.println("Test PASSED.");
+        } else {
+            System.out.println("Test FAILED.");
+            throw new AssertionError("error_cnt=" + error_cnt);
+        }
+    }
+
+    // Reached a blank line which is the end of the
+    // stack trace without matching either LOCK_PATTERN
+    // or WAITING_PATTERN. Rare, but it's not an error.
+    //
+    // Example:
+    // "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f runnable [0xfffffd7fc1111000]
+    //    java.lang.Thread.State: RUNNABLE
+    //         at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
+    //         at java.lang.Thread.run(Thread.java:745)
+    //
+    static boolean checkBlankLine(String line) {
+        if (line.length() == 0) {
+            have_header_line = false;
+            have_thread_state_line = false;
+            return true;
+        }
+
+        return false;
+    }
+
+    // Process the locked line here if we found one.
+    //
+    // Example 1:
+    // "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f runnable [0xfffffd7fc1111000]
+    //    java.lang.Thread.State: RUNNABLE
+    //         at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
+    //         - locked <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
+    //         at java.lang.Thread.run(Thread.java:745)
+    //
+    // Example 2:
+    // "ContendingThread-1" #21 prio=5 os_prio=64 tid=0x00000000007b9000 nid=0x2f waiting for monitor entry [0xfffffd7fc1111000]
+    //    java.lang.Thread.State: BLOCKED (on object monitor)
+    //         at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
+    //         - locked <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
+    //         at java.lang.Thread.run(Thread.java:745)
+    //
+    static boolean checkLockedLine(String line) {
+        Matcher matcher = LOCK_PATTERN.matcher(line);
+        if (matcher.matches()) {
+            if (verbose) {
+                System.out.println("locked_line='" + line + "'");
+            }
+            match_list[match_cnt] = new String(line);
+            match_cnt++;
+
+            matcher = HEADER_RUNNABLE_PATTERN.matcher(header_line);
+            if (!matcher.matches()) {
+                // It's strange, but a locked line can also
+                // match the HEADER_WAITING_PATTERN.
+                matcher = HEADER_WAITING_PATTERN.matcher(header_line);
+                if (!matcher.matches()) {
+                    System.err.println();
+                    System.err.println("ERROR: header line does " +
+                        "not match runnable or waiting patterns.");
+                    System.err.println("ERROR: header_line='" +
+                        header_line + "'");
+                    System.err.println("ERROR: locked_line='" + line + "'");
+                    error_cnt++;
+                }
+            }
+
+            matcher = THREAD_STATE_RUNNABLE_PATTERN.matcher(thread_state_line);
+            if (!matcher.matches()) {
+                // It's strange, but a locked line can also
+                // match the THREAD_STATE_BLOCKED_PATTERN.
+                matcher = THREAD_STATE_BLOCKED_PATTERN.matcher(
+                              thread_state_line);
+                if (!matcher.matches()) {
+                    System.err.println();
+                    System.err.println("ERROR: thread state line does not " +
+                        "match runnable or waiting patterns.");
+                    System.err.println("ERROR: " + "thread_state_line='" +
+                        thread_state_line + "'");
+                    System.err.println("ERROR: locked_line='" + line + "'");
+                    error_cnt++;
+                }
+            }
+
+            // Have everything we need from this thread stack
+            // that matches the LOCK_PATTERN.
+            have_header_line = false;
+            have_thread_state_line = false;
+            return true;
+        }
+
+        return false;
+    }
+
+    // Process the waiting line here if we found one.
+    //
+    // Example:
+    // "ContendingThread-2" #22 prio=5 os_prio=64 tid=0x00000000007b9800 nid=0x30 waiting for monitor entry [0xfffffd7fc1010000]
+    //    java.lang.Thread.State: BLOCKED (on object monitor)
+    //         at TestThreadDumpMonitorContention$1.run(TestThreadDumpMonitorContention.java:67)
+    //         - waiting to lock <0xfffffd7e6a2912f8> (a TestThreadDumpMonitorContention$1)
+    //         at java.lang.Thread.run(Thread.java:745)
+    //
+    static boolean checkWaitingLine(String line) {
+        Matcher matcher = WAITING_PATTERN.matcher(line);
+        if (matcher.matches()) {
+            if (verbose) {
+                System.out.println("waiting_line='" + line + "'");
+            }
+
+            matcher = HEADER_WAITING_PATTERN.matcher(header_line);
+            if (!matcher.matches()) {
+                System.err.println();
+                System.err.println("ERROR: header line does " +
+                    "not match a waiting pattern.");
+                System.err.println("ERROR: header_line='" + header_line + "'");
+                System.err.println("ERROR: waiting_line='" + line + "'");
+                error_cnt++;
+            }
+
+            matcher = THREAD_STATE_BLOCKED_PATTERN.matcher(thread_state_line);
+            if (!matcher.matches()) {
+                System.err.println();
+                System.err.println("ERROR: thread state line " +
+                    "does not match a waiting pattern.");
+                System.err.println("ERROR: thread_state_line='" +
+                    thread_state_line + "'");
+                System.err.println("ERROR: waiting_line='" + line + "'");
+                error_cnt++;
+            }
+
+            // Have everything we need from this thread stack
+            // that matches the WAITING_PATTERN.
+            have_header_line = false;
+            have_thread_state_line = false;
+            return true;
+        }
+
+        return false;
+    }
+
+    static void doSamples() throws Exception {
+        for (int count = 0; count < n_samples; count++) {
+            match_cnt = 0;
+            // verbose mode or an error has a lot of output so add more space
+            if (verbose || error_cnt > 0) System.out.println();
+            System.out.println("Sample #" + count);
+
+            // We don't use the ProcessTools, OutputBuffer or
+            // OutputAnalyzer classes from the testlibrary because
+            // we have a complicated multi-line parse to perform
+            // on a narrow subset of the JSTACK output.
+            //
+            // - we only care about stack traces that match
+            //   HEADER_PREFIX_PATTERN; only two should match
+            // - we care about at most three lines from each stack trace
+            // - if both stack traces match LOCKED_PATTERN, then that's
+            //   a failure and we report it
+            // - for a stack trace that matches LOCKED_PATTERN, we verify:
+            //   - the header line matches HEADER_RUNNABLE_PATTERN
+            //     or HEADER_WAITING_PATTERN
+            //   - the thread state line matches THREAD_STATE_BLOCKED_PATTERN
+            //     or THREAD_STATE_RUNNABLE_PATTERN
+            //   - we report any mismatches as failures
+            // - for a stack trace that matches WAITING_PATTERN, we verify:
+            //   - the header line matches HEADER_WAITING_PATTERN
+            //   - the thread state line matches THREAD_STATE_BLOCKED_PATTERN
+            //   - we report any mismatches as failures
+            // - the stack traces that match HEADER_PREFIX_PATTERN may
+            //   not match either LOCKED_PATTERN or WAITING_PATTERN
+            //   because we might observe the thread outside of
+            //   monitor operations; this is not considered a failure
+            //
+            // When we do observe LOCKED_PATTERN or WAITING_PATTERN,
+            // then we are checking the header and thread state patterns
+            // that occurred earlier in the current stack trace that
+            // matched HEADER_PREFIX_PATTERN. We don't use data from
+            // stack traces that don't match HEADER_PREFIX_PATTERN and
+            // we don't mix data between the two stack traces that do
+            // match HEADER_PREFIX_PATTERN.
+            //
+            Process process = new ProcessBuilder(JSTACK, PID)
+                .redirectErrorStream(true).start();
+
+            BufferedReader reader = new BufferedReader(new InputStreamReader(
+                                        process.getInputStream()));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                Matcher matcher = null;
+
+                // process the header line here
+                if (!have_header_line) {
+                    matcher = HEADER_PREFIX_PATTERN.matcher(line);
+                    if (matcher.matches()) {
+                        if (verbose) {
+                            System.out.println();
+                            System.out.println("header='" + line + "'");
+                        }
+                        header_line = new String(line);
+                        have_header_line = true;
+                        continue;
+                    }
+                    continue;  // skip until have a header line
+                }
+
+                // process the thread state line here
+                if (!have_thread_state_line) {
+                    matcher = THREAD_STATE_PREFIX_PATTERN.matcher(line);
+                    if (matcher.matches()) {
+                        if (verbose) {
+                            System.out.println("thread_state='" + line + "'");
+                        }
+                        thread_state_line = new String(line);
+                        have_thread_state_line = true;
+                        continue;
+                    }
+                    continue;  // skip until we have a thread state line
+                }
+
+                // process the locked line here if we find one
+                if (checkLockedLine(line)) {
+                    continue;
+                }
+
+                // process the waiting line here if we find one
+                if (checkWaitingLine(line)) {
+                    continue;
+                }
+
+                // process the blank line here if we find one
+                if (checkBlankLine(line)) {
+                    continue;
+                }
+            }
+            process.waitFor();
+
+           if (match_cnt == 2) {
+               if (match_list[0].equals(match_list[1])) {
+                   System.err.println();
+                   System.err.println("ERROR: matching lock lines:");
+                   System.err.println("ERROR: line[0]'" + match_list[0] + "'");
+                   System.err.println("ERROR: line[1]'" + match_list[1] + "'");
+                   error_cnt++;
+               }
+           }
+
+            // slight delay between jstack launches
+            Thread.sleep(500);
+        }
+    }
+
+    // This helper relies on RuntimeMXBean.getName() returning a string
+    // that looks like this: 5436@mt-haku
+    //
+    // The testlibrary has tryFindJvmPid(), but that uses a separate
+    // process which is much more expensive for finding out your own PID.
+    //
+    static String getPid() {
+        RuntimeMXBean runtimebean = ManagementFactory.getRuntimeMXBean();
+        String vmname = runtimebean.getName();
+        int i = vmname.indexOf('@');
+        if (i != -1) {
+            vmname = vmname.substring(0, i);
+        }
+        return vmname;
+    }
+
+    static void usage() {
+        System.err.println("Usage: " +
+            "java TestThreadDumpMonitorContention [-v] [n_samples]");
+        System.exit(1);
+    }
+}
diff --git a/hotspot/test/serviceability/ParserTest.java b/hotspot/test/serviceability/ParserTest.java
index 63ee921..8db151f 100644
--- a/hotspot/test/serviceability/ParserTest.java
+++ b/hotspot/test/serviceability/ParserTest.java
@@ -22,10 +22,10 @@
  */
 
 /*
- * @test ParserTest
+ * @test
  * @summary Test that the diagnostic command arguemnt parser works
  * @library /testlibrary /testlibrary/whitebox
- * @build ParserTest
+ * @build ClassFileInstaller sun.hotspot.WhiteBox sun.hotspot.parser.*
  * @run main ClassFileInstaller sun.hotspot.WhiteBox
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI ParserTest
  */
diff --git a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
index fa74379..69dff6d 100644
--- a/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
+++ b/hotspot/test/serviceability/attach/AttachWithStalePidFile.java
@@ -27,7 +27,7 @@
  * @key regression
  * @summary Regression test for attach issue where stale pid files in /tmp lead to connection issues
  * @library /testlibrary
- * @compile AttachWithStalePidFileTarget.java
+ * @build com.oracle.java.testlibrary.* AttachWithStalePidFileTarget
  * @run main AttachWithStalePidFile
  */
 
diff --git a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java b/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
index a5c7183..069b06f 100644
--- a/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
+++ b/hotspot/test/serviceability/dcmd/DynLibDcmdTest.java
@@ -29,7 +29,7 @@
  * @test
  * @summary Test of VM.dynlib diagnostic command via MBean
  * @library /testlibrary
- * @compile DcmdUtil.java
+ * @build com.oracle.java.testlibrary.* DcmdUtil
  * @run main DynLibDcmdTest
  */
 
diff --git a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
index ec33d81..9acefe5 100644
--- a/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
+++ b/hotspot/test/serviceability/jvmti/GetObjectSizeOverflow.java
@@ -29,7 +29,7 @@
  * @test
  * @bug 8027230
  * @library /testlibrary
- * @build GetObjectSizeOverflowAgent
+ * @build ClassFileInstaller com.oracle.java.testlibrary.* GetObjectSizeOverflowAgent
  * @run main ClassFileInstaller GetObjectSizeOverflowAgent
  * @run main GetObjectSizeOverflow
  */
diff --git a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
index 4f929c4..14ffea9 100644
--- a/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
+++ b/hotspot/test/serviceability/jvmti/TestRedefineWithUnresolvedClass.java
@@ -26,7 +26,7 @@
  * @summary Redefine a class with an UnresolvedClass reference in the constant pool.
  * @bug 8035150
  * @library /testlibrary
- * @build UnresolvedClassAgent com.oracle.java.testlibrary.ProcessTools com.oracle.java.testlibrary.OutputAnalyzer
+ * @build com.oracle.java.testlibrary.* UnresolvedClassAgent
  * @run main TestRedefineWithUnresolvedClass
  */
 
diff --git a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
index bd743ab..6f4b2fd 100644
--- a/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
+++ b/hotspot/test/serviceability/sa/jmap-hashcode/Test8028623.java
@@ -26,6 +26,7 @@
  * @bug 8028623
  * @summary Test hashing of extended characters in Serviceability Agent.
  * @library /testlibrary
+ * @build com.oracle.java.testlibrary.*
  * @compile -encoding utf8 Test8028623.java
  * @run main Test8028623
  */
diff --git a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
index df6ecb2..eeeecba 100644
--- a/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
+++ b/hotspot/test/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java
@@ -44,7 +44,7 @@
  * @key regression
  * @summary Regression test for hprof export issue due to large heaps (>2G)
  * @library /testlibrary
- * @compile JMapHProfLargeHeapProc.java
+ * @build com.oracle.java.testlibrary.* JMapHProfLargeHeapProc
  * @run main JMapHProfLargeHeapTest
  */
 
diff --git a/hotspot/test/testlibrary/RedefineClassHelper.java b/hotspot/test/testlibrary/RedefineClassHelper.java
new file mode 100644
index 0000000..accc544
--- /dev/null
+++ b/hotspot/test/testlibrary/RedefineClassHelper.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.io.PrintWriter;
+import java.lang.instrument.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * Helper class to write tests that redefine classes.
+ * When main method is run, it will create a redefineagent.jar that can be used
+ * with the -javaagent option to support redefining classes in jtreg tests.
+ *
+ * See sample test in test/testlibrary_tests/RedefineClassTest.java
+ */
+public class RedefineClassHelper {
+
+    public static Instrumentation instrumentation;
+    public static void premain(String agentArgs, Instrumentation inst) {
+        instrumentation = inst;
+    }
+
+    /**
+     * Redefine a class
+     *
+     * @param clazz Class to redefine
+     * @param javacode String with the new java code for the class to be redefined
+     */
+    public static void redefineClass(Class clazz, String javacode) throws Exception {
+        byte[] bytecode = InMemoryJavaCompiler.compile(clazz.getName(), javacode);
+        redefineClass(clazz, bytecode);
+    }
+
+    /**
+     * Redefine a class
+     *
+     * @param clazz Class to redefine
+     * @param bytecode byte[] with the new class
+     */
+    public static void redefineClass(Class clazz, byte[] bytecode) throws Exception {
+        instrumentation.redefineClasses(new ClassDefinition(clazz, bytecode));
+    }
+
+    /**
+     * Main method to be invoked before test to create the redefineagent.jar
+     */
+    public static void main(String[] args) throws Exception {
+        ClassFileInstaller.main("RedefineClassHelper");
+
+        PrintWriter pw = new PrintWriter("MANIFEST.MF");
+        pw.println("Premain-Class: RedefineClassHelper");
+        pw.println("Can-Redefine-Classes: true");
+        pw.close();
+
+        sun.tools.jar.Main jarTool = new sun.tools.jar.Main(System.out, System.err, "jar");
+        if (!jarTool.run(new String[] { "-cmf", "MANIFEST.MF", "redefineagent.jar", "RedefineClassHelper.class" })) {
+            throw new Exception("jar operation failed");
+        }
+    }
+}
diff --git a/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java b/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java
index ae5eaf0..cc28d40 100644
--- a/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java
+++ b/hotspot/test/testlibrary/ctw/test/ClassesDirTest.java
@@ -22,10 +22,10 @@
  */
 
 /*
- * @test ClassesDirTest
+ * @test
  * @bug 8012447
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
- * @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox ClassesDirTest Foo Bar
+ * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  * @run main ClassesDirTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes
diff --git a/hotspot/test/testlibrary/ctw/test/ClassesListTest.java b/hotspot/test/testlibrary/ctw/test/ClassesListTest.java
index a98cd53..64c5203 100644
--- a/hotspot/test/testlibrary/ctw/test/ClassesListTest.java
+++ b/hotspot/test/testlibrary/ctw/test/ClassesListTest.java
@@ -22,10 +22,10 @@
  */
 
 /*
- * @test ClassesListTest
+ * @test
  * @bug 8012447
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
- * @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox ClassesListTest Foo Bar
+ * @build ClassFileInstaller sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  * @run main ClassesListTest prepare
  * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld classes.lst
diff --git a/hotspot/test/testlibrary/ctw/test/JarDirTest.java b/hotspot/test/testlibrary/ctw/test/JarDirTest.java
index 76f682f..abc5a08 100644
--- a/hotspot/test/testlibrary/ctw/test/JarDirTest.java
+++ b/hotspot/test/testlibrary/ctw/test/JarDirTest.java
@@ -22,10 +22,10 @@
  */
 
 /*
- * @test JarDirTest
+ * @test
  * @bug 8012447
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
- * @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox JarDirTest Foo Bar
+ * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  * @run main JarDirTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld jars/*
diff --git a/hotspot/test/testlibrary/ctw/test/JarsTest.java b/hotspot/test/testlibrary/ctw/test/JarsTest.java
index 0479272..c9bfb30 100644
--- a/hotspot/test/testlibrary/ctw/test/JarsTest.java
+++ b/hotspot/test/testlibrary/ctw/test/JarsTest.java
@@ -22,10 +22,10 @@
  */
 
 /*
- * @test JarsTest
+ * @test
  * @bug 8012447
  * @library /testlibrary /testlibrary/whitebox /testlibrary/ctw/src
- * @build sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox JarsTest Foo Bar
+ * @build ClassFileInstaller com.oracle.java.testlibrary.* sun.hotspot.tools.ctw.CompileTheWorld sun.hotspot.WhiteBox Foo Bar
  * @run main ClassFileInstaller sun.hotspot.WhiteBox Foo Bar
  * @run main JarsTest prepare
  * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Dsun.hotspot.tools.ctw.logfile=ctw.log sun.hotspot.tools.ctw.CompileTheWorld foo.jar bar.jar
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/hotspot/test/testlibrary_tests/RedefineClassTest.java
similarity index 60%
copy from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
copy to hotspot/test/testlibrary_tests/RedefineClassTest.java
index ba34289..e812e43 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/hotspot/test/testlibrary_tests/RedefineClassTest.java
@@ -22,15 +22,33 @@
  */
 
 /*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
+ * @test
  * @library /testlibrary
+ * @summary Proof of concept test for RedefineClassHelper
+ * @build RedefineClassHelper
+ * @run main RedefineClassHelper
+ * @run main/othervm -javaagent:redefineagent.jar RedefineClassTest
  */
 
-public class TestStringDeduplicationMemoryUsage {
+import static com.oracle.java.testlibrary.Asserts.*;
+import com.oracle.java.testlibrary.*;
+
+/*
+ * Proof of concept test for the test utility class RedefineClassHelper
+ */
+public class RedefineClassTest {
+
+    public static String newClass = "class RedefineClassTest$A { public int Method() { return 2; } }";
     public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
+        A a = new A();
+        assertTrue(a.Method() == 1);
+        RedefineClassHelper.redefineClass(A.class, newClass);
+        assertTrue(a.Method() == 2);
+    }
+
+    static class A {
+        public int Method() {
+            return 1;
+        }
     }
 }
diff --git a/jaxp/.hgtags b/jaxp/.hgtags
index 5f5830a..0bc9cac 100644
--- a/jaxp/.hgtags
+++ b/jaxp/.hgtags
@@ -260,3 +260,4 @@
 6bad71866c7598587860e0981b0b0e51ec8c0476 jdk9-b15
 a1461221b05d4620e4d7d1907e2a0282aaedf31c jdk9-b16
 6f923fcbe5129eceb9617a9a18dbdd743980e785 jdk9-b17
+5afa90c28742d175431be75f9098745510bd2b30 jdk9-b18
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
index 9eddf5c..fe82777 100644
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/runtime/AbstractTranslet.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -32,7 +34,6 @@
 import java.text.DecimalFormatSymbols;
 import java.util.ArrayList;
 import java.util.Enumeration;
-import java.util.Vector;
 import javax.xml.transform.Templates;
 import javax.xml.parsers.DocumentBuilderFactory;
 import org.w3c.dom.Document;
@@ -51,6 +52,7 @@
 import com.sun.org.apache.xalan.internal.xsltc.runtime.output.TransletOutputHandlerFactory;
 import com.sun.org.apache.xml.internal.dtm.DTMAxisIterator;
 import com.sun.org.apache.xml.internal.serializer.SerializationHandler;
+import com.sun.org.apache.xml.internal.serializer.ToStream;
 
 /**
  * @author Jacek Ambroziak
@@ -74,7 +76,7 @@
     public String  _doctypeSystem = null;
     public boolean _indent = false;
     public String  _mediaType = null;
-    public Vector _cdata = null;
+    public ArrayList<String> _cdata = null;
     public int _indentamount = -1;
 
     public static final int FIRST_TRANSLET_VERSION = 100;
@@ -642,7 +644,7 @@
      */
     public void addCdataElement(String name) {
         if (_cdata == null) {
-            _cdata = new Vector();
+            _cdata = new ArrayList<>();
         }
 
         int lastColon = name.lastIndexOf(':');
@@ -650,11 +652,11 @@
         if (lastColon > 0) {
             String uri = name.substring(0, lastColon);
             String localName = name.substring(lastColon+1);
-            _cdata.addElement(uri);
-            _cdata.addElement(localName);
+            _cdata.add(uri);
+            _cdata.add(localName);
         } else {
-            _cdata.addElement(null);
-            _cdata.addElement(name);
+            _cdata.add(null);
+            _cdata.add(name);
         }
     }
 
diff --git a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
index 6bf365f..6d5ca6e 100644
--- a/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerImpl.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -40,7 +42,7 @@
 import java.util.Enumeration;
 import java.util.Properties;
 import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
 import java.lang.reflect.Constructor;
 
 import javax.xml.parsers.DocumentBuilder;
@@ -1084,7 +1086,7 @@
             else if (name.equals(OutputKeys.CDATA_SECTION_ELEMENTS)) {
                 if (value != null) {
                     StringTokenizer e = new StringTokenizer(value);
-                    Vector uriAndLocalNames = null;
+                    ArrayList<String> uriAndLocalNames = null;
                     while (e.hasMoreTokens()) {
                         final String token = e.nextToken();
 
@@ -1104,11 +1106,11 @@
                         }
 
                         if (uriAndLocalNames == null) {
-                            uriAndLocalNames = new Vector();
+                            uriAndLocalNames = new ArrayList<>();
                         }
                         // add the uri/localName as a pair, in that order
-                        uriAndLocalNames.addElement(uri);
-                        uriAndLocalNames.addElement(localName);
+                        uriAndLocalNames.add(uri);
+                        uriAndLocalNames.add(localName);
                     }
                     handler.setCdataSectionElements(uriAndLocalNames);
                 }
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java
index 305dc33..bbc5287 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/dom/EntityReferenceImpl.java
@@ -347,7 +347,7 @@
      * @see DocumentTypeImpl
      * @see EntityImpl
      */
-    // The Xerces parser invokes callbacks for startEnityReference
+    // The Xerces parser invokes callbacks for startEntityReference
     // the parsed value of the entity EACH TIME, so it is actually
     // easier to create the nodes through the callbacks rather than
     // clone the Entity.
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
index f945b0a..d2ede94 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDTDScannerImpl.java
@@ -585,7 +585,7 @@
         boolean reportEntity = fReportEntity;
         if (name.startsWith("%")) {
             reportEntity = peekReportEntity();
-            // check well-formedness of the enity
+            // check well-formedness of the entity
             int startMarkUpDepth = popPEStack();
             // throw fatalError if this entity was incomplete and
             // was a freestanding decl
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
index c3e1910..0146828 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/XMLDocumentFragmentScannerImpl.java
@@ -2728,7 +2728,7 @@
                     //if the last section was character data
                     if(fLastSectionWasCharacterData){
 
-                        //if we dont encounter any CDATA or ENITY REFERENCE and current state is also not SCANNER_STATE_CHARACTER_DATA
+                        //if we dont encounter any CDATA or ENTITY REFERENCE and current state is also not SCANNER_STATE_CHARACTER_DATA
                         //return the last scanned charactrer data.
                         if((fScannerState != SCANNER_STATE_CDATA) && (fScannerState != SCANNER_STATE_REFERENCE)
                         && (fScannerState != SCANNER_STATE_CHARACTER_DATA)){
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
index 27e7cda..0530878 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/impl/dtd/XMLDTDValidator.java
@@ -1218,7 +1218,7 @@
                     // references appear in the document.
                     // REVISIT: this can be combined to a single check in
                     // startEntity if we add one more argument in
-                    // startEnity, inAttrValue
+                    // startEntity, inAttrValue
                     String nonNormalizedValue = attributes.getNonNormalizedValue(i);
                     if (nonNormalizedValue != null) {
                         String entityName = getExternalEntityRefInAttrValue(nonNormalizedValue);
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
index e33612e..5f44b08 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/ElementSchemePointer.java
@@ -559,11 +559,13 @@
          * @param token The token string
          */
         private void addToken(String tokenStr) {
-            if (!fTokenNames.containsValue(tokenStr)) {
-                Integer tokenInt = new Integer(fTokenNames.size());
+            String str = fTokenNames.get(tokenStr);
+            Integer tokenInt = str == null ? null : Integer.parseInt(str);
+            if (tokenInt == null) {
+                tokenInt = new Integer(fTokenNames.size());
                 fTokenNames.put(tokenInt, tokenStr);
-                addToken(tokenInt.intValue());
             }
+            addToken(tokenInt.intValue());
         }
 
         /**
diff --git a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
index 5d4c905..e577cfc 100644
--- a/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
+++ b/jaxp/src/com/sun/org/apache/xerces/internal/xpointer/XPointerHandler.java
@@ -524,11 +524,13 @@
          * @param token The token string
          */
         private void addToken(String tokenStr) {
-            if (!fTokenNames.containsValue(tokenStr)) {
-                Integer tokenInt = new Integer(fTokenNames.size());
+            String str = fTokenNames.get(tokenStr);
+            Integer tokenInt = str == null ? null : Integer.parseInt(str);
+            if (tokenInt == null) {
+                tokenInt = new Integer(fTokenNames.size());
                 fTokenNames.put(tokenInt, tokenStr);
-                addToken(tokenInt.intValue());
             }
+            addToken(tokenInt.intValue());
         }
 
         /**
@@ -1251,4 +1253,4 @@
         super.setProperty(propertyId, value);
     }
 
-}
+}
\ No newline at end of file
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
index c5de8bf..c58397d 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/dtm/DTMConfigurationException.java
@@ -32,7 +32,7 @@
 
     /**
      * Create a new <code>DTMConfigurationException</code> with no
-     * detail mesage.
+     * detail message.
      */
     public DTMConfigurationException() {
         super("Configuration Error");
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
index d14c2ea..09a13da 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/EmptySerializer.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -27,7 +29,7 @@
 import java.io.Writer;
 import java.util.Hashtable;
 import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
 
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.Transformer;
@@ -150,9 +152,9 @@
         couldThrowIOException();
     }
     /**
-     * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
+     * @see SerializationHandler#setCdataSectionElements(java.util.ArrayList<String>)
      */
-    public void setCdataSectionElements(Vector URI_and_localNames)
+    public void setCdataSectionElements(ArrayList<String> URI_and_localNames)
     {
         aMethodIsCalled();
     }
@@ -763,4 +765,25 @@
         aMethodIsCalled();
 
     }
+
+
+    public String getOutputProperty(String name) {
+        aMethodIsCalled();
+        return null;
+    }
+
+    public String getOutputPropertyDefault(String name) {
+        aMethodIsCalled();
+        return null;
+    }
+
+    public void setOutputProperty(String name, String val) {
+        aMethodIsCalled();
+
+    }
+
+    public void setOutputPropertyDefault(String name, String val) {
+        aMethodIsCalled();
+
+    }
 }
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
index a477890..fb80d77 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/SerializerBase.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -23,8 +25,11 @@
 package com.sun.org.apache.xml.internal.serializer;
 
 import java.io.IOException;
-import java.util.Vector;
+import java.util.HashMap;
+import java.util.Set;
+import java.util.ArrayList;
 
+import javax.xml.transform.OutputKeys;
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.Transformer;
 
@@ -108,12 +113,12 @@
     /**
      * The System ID for the doc type.
      */
-    private String m_doctypeSystem;
+    protected String m_doctypeSystem;
 
     /**
      * The public ID for the doc type.
      */
-    private String m_doctypePublic;
+    protected String m_doctypePublic;
 
     /**
      * Flag to tell that we need to add the doctype decl, which we can't do
@@ -122,15 +127,9 @@
     boolean m_needToOutputDocTypeDecl = true;
 
     /**
-     * The character encoding.  Must match the encoding used for the
-     * printWriter.
-     */
-    private String m_encoding = null;
-
-    /**
      * Tells if we should write the XML declaration.
      */
-    private boolean m_shouldNotWriteXMLHeader = false;
+    protected boolean m_shouldNotWriteXMLHeader = false;
 
     /**
      * The standalone value for the doctype.
@@ -159,12 +158,12 @@
     /**
      * Tells the XML version, for writing out to the XML decl.
      */
-    private String m_version = null;
+    protected String m_version = null;
 
     /**
      * The mediatype.  Not used right now.
      */
-    private String m_mediatype;
+    protected String m_mediatype;
 
     /**
      * The transformer that was around when this output handler was created (if
@@ -173,13 +172,6 @@
     private Transformer m_transformer;
 
     /**
-     * Pairs of local names and corresponding URIs of CDATA sections. This list
-     * comes from the cdata-section-elements attribute. Every second one is a
-     * local name, and every other second one is the URI for the local name.
-     */
-    protected Vector m_cdataSectionElements = null;
-
-    /**
      * Namespace support, that keeps track of currently defined
      * prefix/uri mappings. As processed elements come and go, so do
      * the associated mappings for that element.
@@ -538,16 +530,16 @@
      */
     public String getEncoding()
     {
-        return m_encoding;
+        return getOutputProperty(OutputKeys.ENCODING);
     }
 
    /**
      * Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
      * @param m_encoding the character encoding
      */
-    public void setEncoding(String m_encoding)
+    public void setEncoding(String encoding)
     {
-        this.m_encoding = m_encoding;
+        setOutputProperty(OutputKeys.ENCODING,encoding);
     }
 
     /**
@@ -557,7 +549,8 @@
      */
     public void setOmitXMLDeclaration(boolean b)
     {
-        this.m_shouldNotWriteXMLHeader = b;
+        String val = b ? "yes":"no";
+        setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,val);
     }
 
 
@@ -588,7 +581,7 @@
       */
     public void setDoctypePublic(String doctypePublic)
     {
-        this.m_doctypePublic = doctypePublic;
+        setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, doctypePublic);
     }
 
 
@@ -610,7 +603,7 @@
       */
     public void setDoctypeSystem(String doctypeSystem)
     {
-        this.m_doctypeSystem = doctypeSystem;
+        setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem);
     }
 
     /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
@@ -621,8 +614,8 @@
      */
     public void setDoctype(String doctypeSystem, String doctypePublic)
     {
-        this.m_doctypeSystem = doctypeSystem;
-        this.m_doctypePublic = doctypePublic;
+        setOutputProperty(OutputKeys.DOCTYPE_SYSTEM, doctypeSystem);
+        setOutputProperty(OutputKeys.DOCTYPE_PUBLIC, doctypePublic);
     }
 
     /**
@@ -634,12 +627,9 @@
      */
     public void setStandalone(String standalone)
     {
-        if (standalone != null)
-        {
-            m_standaloneWasSpecified = true;
-            setStandaloneInternal(standalone);
-        }
+        setOutputProperty(OutputKeys.STANDALONE, standalone);
     }
+
     /**
      * Sets the XSL standalone attribute, but does not remember if this is a
      * default or explicite setting.
@@ -700,7 +690,7 @@
      */
     public void setVersion(String version)
     {
-        m_version = version;
+        setOutputProperty(OutputKeys.VERSION, version);
     }
 
     /**
@@ -712,7 +702,7 @@
      */
     public void setMediaType(String mediaType)
     {
-        m_mediatype = mediaType;
+        setOutputProperty(OutputKeys.MEDIA_TYPE,mediaType);
     }
 
     /**
@@ -741,7 +731,8 @@
      */
     public void setIndent(boolean doIndent)
     {
-        m_doIndent = doIndent;
+        String val = doIndent ? "yes":"no";
+        setOutputProperty(OutputKeys.INDENT,val);
     }
 
     /**
@@ -787,59 +778,6 @@
     }
 
     /**
-     * Push a boolean state based on if the name of the current element
-     * is found in the list of qnames.  A state is only pushed if
-     * there were some cdata-section-names were specified.
-     * <p>
-     * Hidden parameters are the vector of qualified elements specified in
-     * cdata-section-names attribute, and the m_cdataSectionStates stack
-     * onto which whether the current element is in the list is pushed (true or
-     * false). Other hidden parameters are the current elements namespaceURI,
-     * localName and qName
-     */
-    protected boolean isCdataSection()
-    {
-
-        boolean b = false;
-
-        if (null != m_cdataSectionElements)
-        {
-            if (m_elemContext.m_elementLocalName == null)
-                m_elemContext.m_elementLocalName =
-                    getLocalName(m_elemContext.m_elementName);
-            if (m_elemContext.m_elementURI == null)
-            {
-                String prefix = getPrefixPart(m_elemContext.m_elementName);
-                if (prefix != null)
-                    m_elemContext.m_elementURI =
-                        m_prefixMap.lookupNamespace(prefix);
-
-            }
-
-            if ((null != m_elemContext.m_elementURI)
-                && m_elemContext.m_elementURI.length() == 0)
-                m_elemContext.m_elementURI = null;
-
-            int nElems = m_cdataSectionElements.size();
-
-            // loop through 2 at a time, as these are pairs of URI and localName
-            for (int i = 0; i < nElems; i += 2)
-            {
-                String uri = (String) m_cdataSectionElements.elementAt(i);
-                String loc = (String) m_cdataSectionElements.elementAt(i + 1);
-                if (loc.equals(m_elemContext.m_elementLocalName)
-                    && subPartMatch(m_elemContext.m_elementURI, uri))
-                {
-                    b = true;
-
-                    break;
-                }
-            }
-        }
-        return b;
-    }
-
-    /**
      * Tell if two strings are equal, without worry if the first string is null.
      *
      * @param p String reference, which may be null.
@@ -1312,12 +1250,11 @@
     private void resetSerializerBase()
     {
         this.m_attributes.clear();
-        this.m_cdataSectionElements = null;
+        this.m_StringOfCDATASections = null;
         this.m_elemContext = new ElemContext();
         this.m_doctypePublic = null;
         this.m_doctypeSystem = null;
         this.m_doIndent = false;
-        this.m_encoding = null;
         this.m_indentAmount = 0;
         this.m_inEntityRef = false;
         this.m_inExternalDTD = false;
@@ -1399,4 +1336,333 @@
         // A particular sub-class of SerializerBase provides the implementation (if desired)
     }
 
+
+    /**
+     * The CDATA section names stored in a whitespace separateed list with
+     * each element being a word of the form "{uri}localName" This list
+     * comes from the cdata-section-elements attribute.
+     *
+     * This field replaces m_cdataSectionElements Vector.
+     */
+    protected String m_StringOfCDATASections = null;
+
+    boolean m_docIsEmpty = true;
+    void initCdataElems(String s)
+    {
+        if (s != null)
+        {
+            int max = s.length();
+
+            // true if we are in the middle of a pair of curly braces that delimit a URI
+            boolean inCurly = false;
+
+            // true if we found a URI but haven't yet processed the local name
+            boolean foundURI = false;
+
+            StringBuilder buf = new StringBuilder();
+            String uri = null;
+            String localName = null;
+
+            // parse through string, breaking on whitespaces.  I do this instead
+            // of a tokenizer so I can track whitespace inside of curly brackets,
+            // which theoretically shouldn't happen if they contain legal URLs.
+            for (int i = 0; i < max; i++)
+            {
+                char c = s.charAt(i);
+
+                if (Character.isWhitespace(c))
+                {
+                    if (!inCurly)
+                    {
+                        if (buf.length() > 0)
+                        {
+                            localName = buf.toString();
+                            if (!foundURI)
+                                uri = "";
+                            addCDATAElement(uri,localName);
+                            buf.setLength(0);
+                            foundURI = false;
+                        }
+                        continue;
+                    }
+                    else
+                        buf.append(c); // add whitespace to the URI
+                }
+                else if ('{' == c) // starting a URI
+                    inCurly = true;
+                else if ('}' == c)
+                {
+                    // we just ended a URI
+                    foundURI = true;
+                    uri = buf.toString();
+                    buf.setLength(0);
+                    inCurly = false;
+                }
+                else
+                {
+                    // append non-whitespace, non-curly to current URI or localName being gathered.
+                    buf.append(c);
+                }
+
+            }
+
+            if (buf.length() > 0)
+            {
+                // We have one last localName to process.
+                localName = buf.toString();
+                if (!foundURI)
+                    uri = "";
+                addCDATAElement(uri,localName);
+            }
+        }
+    }
+
+    protected java.util.HashMap<String, HashMap<String, String>> m_CdataElems = null;
+    private void addCDATAElement(String uri, String localName)
+    {
+        if (m_CdataElems == null) {
+            m_CdataElems = new java.util.HashMap<>();
+        }
+
+        HashMap<String,String> h = m_CdataElems.get(localName);
+        if (h == null) {
+            h = new HashMap<>();
+            m_CdataElems.put(localName,h);
+        }
+        h.put(uri,uri);
+
+    }
+
+
+    /**
+     * Return true if nothing has been sent to this result tree yet.
+     * <p>
+     * This is not a public API.
+     *
+     * @xsl.usage internal
+     */
+    public boolean documentIsEmpty() {
+        // If we haven't called startDocument() yet, then this document is empty
+        return m_docIsEmpty && (m_elemContext.m_currentElemDepth == 0);
+    }
+
+    /**
+     * Return true if the current element in m_elemContext
+     * is a CDATA section.
+     * CDATA sections are specified in the <xsl:output> attribute
+     * cdata-section-names or in the JAXP equivalent property.
+     * In any case the format of the value of such a property is:
+     * <pre>
+     * "{uri1}localName1 {uri2}localName2 . . . "
+     * </pre>
+     *
+     * <p>
+     * This method is not a public API, but is only used internally by the serializer.
+     */
+    protected boolean isCdataSection() {
+        boolean b = false;
+
+        if (null != m_StringOfCDATASections) {
+            if (m_elemContext.m_elementLocalName == null) {
+                String localName =  getLocalName(m_elemContext.m_elementName);
+                m_elemContext.m_elementLocalName = localName;
+            }
+
+            if ( m_elemContext.m_elementURI == null) {
+
+                m_elemContext.m_elementURI = getElementURI();
+            }
+            else if ( m_elemContext.m_elementURI.length() == 0) {
+                if ( m_elemContext.m_elementName == null) {
+                    m_elemContext.m_elementName = m_elemContext.m_elementLocalName;
+                    // leave URI as "", meaning in no namespace
+                }
+                else if (m_elemContext.m_elementLocalName.length() < m_elemContext.m_elementName.length()){
+                    // We were told the URI was "", yet the name has a prefix since the name is longer than the localname.
+                    // So we will fix that incorrect information here.
+                    m_elemContext.m_elementURI = getElementURI();
+                }
+            }
+
+            HashMap<String, String> h = null;
+            if (m_CdataElems != null) {
+                h = m_CdataElems.get(m_elemContext.m_elementLocalName);
+            }
+            if (h != null) {
+                Object obj = h.get(m_elemContext.m_elementURI);
+                if (obj != null)
+                    b = true;
+            }
+
+        }
+        return b;
+    }
+
+    /**
+     * Before this call m_elementContext.m_elementURI is null,
+     * which means it is not yet known. After this call it
+     * is non-null, but possibly "" meaning that it is in the
+     * default namespace.
+     *
+     * @return The URI of the element, never null, but possibly "".
+     */
+    private String getElementURI() {
+        String uri = null;
+        // At this point in processing we have received all the
+        // namespace mappings
+        // As we still don't know the elements namespace,
+        // we now figure it out.
+
+        String prefix = getPrefixPart(m_elemContext.m_elementName);
+
+        if (prefix == null) {
+            // no prefix so lookup the URI of the default namespace
+            uri = m_prefixMap.lookupNamespace("");
+        } else {
+            uri = m_prefixMap.lookupNamespace(prefix);
+        }
+        if (uri == null) {
+            // We didn't find the namespace for the
+            // prefix ... ouch, that shouldn't happen.
+            // This is a hack, we really don't know
+            // the namespace
+            uri = EMPTYSTRING;
+        }
+
+        return uri;
+    }
+
+
+    /**
+     * Get the value of an output property,
+     * the explicit value, if any, otherwise the
+     * default value, if any, otherwise null.
+     */
+    public String getOutputProperty(String name) {
+        String val = getOutputPropertyNonDefault(name);
+        // If no explicit value, try to get the default value
+        if (val == null)
+            val = getOutputPropertyDefault(name);
+        return val;
+
+    }
+    /**
+     * Get the value of an output property,
+     * not the default value. If there is a default
+     * value, but no non-default value this method
+     * will return null.
+     * <p>
+     *
+     */
+    public String getOutputPropertyNonDefault(String name) {
+        return getProp(name,false);
+    }
+
+    /**
+     * Get the default value of an xsl:output property,
+     * which would be null only if no default value exists
+     * for the property.
+     */
+    public String getOutputPropertyDefault(String name) {
+        return getProp(name, true);
+    }
+
+    /**
+     * Set the value for the output property, typically from
+     * an xsl:output element, but this does not change what
+     * the default value is.
+     */
+    public void setOutputProperty(String name, String val) {
+        setProp(name,val,false);
+    }
+
+    /**
+     * Set the default value for an output property, but this does
+     * not impact any explicitly set value.
+     */
+    public void setOutputPropertyDefault(String name, String val) {
+        setProp(name,val,true);
+
+    }
+
+    /**
+     * A mapping of keys to explicitly set values, for example if
+     * and <xsl:output/> has an "encoding" attribute, this
+     * map will have what that attribute maps to.
+     */
+    private HashMap<String, String> m_OutputProps;
+    /**
+     * A mapping of keys to default values, for example if
+     * the default value of the encoding is "UTF-8" then this
+     * map will have that "encoding" maps to "UTF-8".
+     */
+    private HashMap<String, String> m_OutputPropsDefault;
+
+    Set<String> getOutputPropDefaultKeys() {
+        return m_OutputPropsDefault.keySet();
+    }
+    Set<String> getOutputPropKeys() {
+        return m_OutputProps.keySet();
+    }
+
+    private String getProp(String name, boolean defaultVal) {
+        if (m_OutputProps == null) {
+            m_OutputProps = new HashMap<>();
+            m_OutputPropsDefault = new HashMap<>();
+        }
+
+        String val;
+        if (defaultVal)
+            val = m_OutputPropsDefault.get(name);
+        else
+            val = m_OutputProps.get(name);
+
+        return val;
+    }
+    /**
+     *
+     * @param name The name of the property, e.g. "{http://myprop}indent-tabs" or "indent".
+     * @param val The value of the property, e.g. "4"
+     * @param defaultVal true if this is a default value being set for the property as
+     * opposed to a user define on, set say explicitly in the stylesheet or via JAXP
+     */
+    void setProp(String name, String val, boolean defaultVal) {
+        if (m_OutputProps == null) {
+            m_OutputProps = new HashMap<>();
+            m_OutputPropsDefault = new HashMap<>();
+        }
+
+        if (defaultVal)
+            m_OutputPropsDefault.put(name,val);
+        else {
+            if (OutputKeys.CDATA_SECTION_ELEMENTS.equals(name) && val != null) {
+                initCdataElems(val);
+                String oldVal = m_OutputProps.get(name);
+                String newVal;
+                if (oldVal == null)
+                    newVal = oldVal + ' ' + val;
+                else
+                    newVal = val;
+                m_OutputProps.put(name,newVal);
+            }
+            else {
+                m_OutputProps.put(name,val);
+            }
+        }
+    }
+
+    /**
+     * Get the first char of the local name
+     * @param name Either a local name, or a local name
+     * preceeded by a uri enclosed in curly braces.
+     */
+    static char getFirstCharLocName(String name) {
+        final char first;
+        int i = name.indexOf('}');
+        if (i < 0)
+            first = name.charAt(0);
+        else
+            first = name.charAt(i+1);
+        return first;
+    }
 }
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
index a68ec6d..f43faee 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToHTMLStream.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -349,84 +351,84 @@
 
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("A");
+        elemDesc = (ElemDesc) m_elementFlags.get("a");
         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
         elemDesc.setAttr("NAME", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("AREA");
+        elemDesc = (ElemDesc) m_elementFlags.get("area");
         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
         elemDesc.setAttr("NOHREF", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("BASE");
+        elemDesc = (ElemDesc) m_elementFlags.get("base");
         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("BUTTON");
+        elemDesc = (ElemDesc) m_elementFlags.get("button");
         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("BLOCKQUOTE");
+        elemDesc = (ElemDesc) m_elementFlags.get("blockquote");
         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("DEL");
+        elemDesc = (ElemDesc) m_elementFlags.get("del");
         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("DIR");
+        elemDesc = (ElemDesc) m_elementFlags.get("dir");
         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
 
-        elemDesc = (ElemDesc) m_elementFlags.get("DIV");
+        elemDesc = (ElemDesc) m_elementFlags.get("div");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL); // Netscape 4 extension
         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("DL");
+        elemDesc = (ElemDesc) m_elementFlags.get("dl");
         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("FORM");
+        elemDesc = (ElemDesc) m_elementFlags.get("form");
         elemDesc.setAttr("ACTION", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
         // Attribution to: "Voytenko, Dimitry" <DVoytenko@SECTORBASE.COM>
-        elemDesc = (ElemDesc) m_elementFlags.get("FRAME");
+        elemDesc = (ElemDesc) m_elementFlags.get("frame");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
         elemDesc.setAttr("NORESIZE",ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("HEAD");
+        elemDesc = (ElemDesc) m_elementFlags.get("head");
         elemDesc.setAttr("PROFILE", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("HR");
+        elemDesc = (ElemDesc) m_elementFlags.get("hr");
         elemDesc.setAttr("NOSHADE", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
         // HTML 4.0, section 16.5
-        elemDesc = (ElemDesc) m_elementFlags.get("IFRAME");
+        elemDesc = (ElemDesc) m_elementFlags.get("iframe");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
         // Netscape 4 extension
-        elemDesc = (ElemDesc) m_elementFlags.get("ILAYER");
+        elemDesc = (ElemDesc) m_elementFlags.get("ilayer");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("IMG");
+        elemDesc = (ElemDesc) m_elementFlags.get("img");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
         elemDesc.setAttr("LONGDESC", ElemDesc.ATTRURL);
         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
         elemDesc.setAttr("ISMAP", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("INPUT");
+        elemDesc = (ElemDesc) m_elementFlags.get("input");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
         elemDesc.setAttr("USEMAP", ElemDesc.ATTRURL);
         elemDesc.setAttr("CHECKED", ElemDesc.ATTREMPTY);
@@ -435,24 +437,24 @@
         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("INS");
+        elemDesc = (ElemDesc) m_elementFlags.get("ins");
         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
         // Netscape 4 extension
-        elemDesc = (ElemDesc) m_elementFlags.get("LAYER");
+        elemDesc = (ElemDesc) m_elementFlags.get("layer");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("LINK");
+        elemDesc = (ElemDesc) m_elementFlags.get("link");
         elemDesc.setAttr("HREF", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("MENU");
+        elemDesc = (ElemDesc) m_elementFlags.get("menu");
         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("OBJECT");
+        elemDesc = (ElemDesc) m_elementFlags.get("object");
         elemDesc.setAttr("CLASSID", ElemDesc.ATTRURL);
         elemDesc.setAttr("CODEBASE", ElemDesc.ATTRURL);
         elemDesc.setAttr("DATA", ElemDesc.ATTRURL);
@@ -461,58 +463,58 @@
         elemDesc.setAttr("DECLARE", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("OL");
+        elemDesc = (ElemDesc) m_elementFlags.get("ol");
         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("OPTGROUP");
+        elemDesc = (ElemDesc) m_elementFlags.get("optgroup");
         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("OPTION");
+        elemDesc = (ElemDesc) m_elementFlags.get("option");
         elemDesc.setAttr("SELECTED", ElemDesc.ATTREMPTY);
         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("Q");
+        elemDesc = (ElemDesc) m_elementFlags.get("q");
         elemDesc.setAttr("CITE", ElemDesc.ATTRURL);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("SCRIPT");
+        elemDesc = (ElemDesc) m_elementFlags.get("script");
         elemDesc.setAttr("SRC", ElemDesc.ATTRURL);
         elemDesc.setAttr("FOR", ElemDesc.ATTRURL);
         elemDesc.setAttr("DEFER", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("SELECT");
+        elemDesc = (ElemDesc) m_elementFlags.get("select");
         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
         elemDesc.setAttr("MULTIPLE", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("TABLE");
+        elemDesc = (ElemDesc) m_elementFlags.get("table");
         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY); // Internet-Explorer extension
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("TD");
+        elemDesc = (ElemDesc) m_elementFlags.get("td");
         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("TEXTAREA");
+        elemDesc = (ElemDesc) m_elementFlags.get("textarea");
         elemDesc.setAttr("DISABLED", ElemDesc.ATTREMPTY);
         elemDesc.setAttr("READONLY", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("TH");
+        elemDesc = (ElemDesc) m_elementFlags.get("th");
         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
         // The nowrap attribute of a tr element is both
         // a Netscape and Internet-Explorer extension
-        elemDesc = (ElemDesc) m_elementFlags.get("TR");
+        elemDesc = (ElemDesc) m_elementFlags.get("tr");
         elemDesc.setAttr("NOWRAP", ElemDesc.ATTREMPTY);
 
         // ----------------------------------------------
-        elemDesc = (ElemDesc) m_elementFlags.get("UL");
+        elemDesc = (ElemDesc) m_elementFlags.get("ul");
         elemDesc.setAttr("COMPACT", ElemDesc.ATTREMPTY);
     }
 
@@ -1762,7 +1764,7 @@
              * lets determine if the current element is specified in the cdata-
              * section-elements list.
              */
-            if (m_cdataSectionElements != null)
+            if (m_StringOfCDATASections != null)
                 m_elemContext.m_isCdataSection = isCdataSection();
             if (m_doIndent)
             {
@@ -1776,55 +1778,8 @@
                 throw new SAXException(e);
             }
     }
-    /**
-     * Initialize the serializer with the specified output stream and output
-     * format. Must be called before calling any of the serialize methods.
-     *
-     * @param output The output stream to use
-     * @param format The output format
-     * @throws UnsupportedEncodingException The encoding specified   in the
-     * output format is not supported
-     */
-    protected synchronized void init(OutputStream output, Properties format)
-        throws UnsupportedEncodingException
-    {
-        if (null == format)
-        {
-            format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
-         }
-        super.init(output,format, false);
-    }
 
         /**
-         * Specifies an output stream to which the document should be
-         * serialized. This method should not be called while the
-         * serializer is in the process of serializing a document.
-         * <p>
-         * The encoding specified in the output properties is used, or
-         * if no encoding was specified, the default for the selected
-         * output method.
-         *
-         * @param output The output stream
-         */
-        public void setOutputStream(OutputStream output)
-        {
-
-            try
-            {
-                Properties format;
-                if (null == m_format)
-                    format = OutputPropertiesFactory.getDefaultMethodProperties(Method.HTML);
-                else
-                    format = m_format;
-                init(output, format, true);
-            }
-            catch (UnsupportedEncodingException uee)
-            {
-
-                // Should have been warned in init, I guess...
-            }
-        }
-        /**
          * This method is used when a prefix/uri namespace mapping
          * is indicated after the element was started with a
          * startElement() and before and endElement().
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
index e6bc70a..d488aeb 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToSAXHandler.java
@@ -22,7 +22,7 @@
  */
 package com.sun.org.apache.xml.internal.serializer;
 
-import java.util.Vector;
+import java.util.ArrayList;
 
 import org.xml.sax.Attributes;
 import org.xml.sax.ContentHandler;
@@ -234,9 +234,9 @@
     /**
      * Does nothing. The setting of CDATA section elements has an impact on
      * stream serializers.
-     * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
+     * @see SerializationHandler#setCdataSectionElements(java.util.ArrayList<String>)
      */
-    public void setCdataSectionElements(Vector URI_and_localNames)
+    public void setCdataSectionElements(ArrayList<String> URI_and_localNames)
     {
         // do nothing
     }
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
index 2301763..2195e71 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToStream.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2001-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -25,11 +27,15 @@
 import com.sun.org.apache.xalan.internal.utils.SecuritySupport;
 import java.io.IOException;
 import java.io.OutputStream;
+import java.io.OutputStreamWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
+import java.util.Enumeration;
+import java.util.Iterator;
 import java.util.Properties;
+import java.util.Set;
 import java.util.StringTokenizer;
-import java.util.Vector;
+import java.util.ArrayList;
 
 import javax.xml.transform.ErrorListener;
 import javax.xml.transform.OutputKeys;
@@ -186,9 +192,6 @@
        */
     boolean m_isUTF8 = false;
 
-    /** The xsl:output properties. */
-    protected Properties m_format;
-
     /**
      * remembers if we are in between the startCDATA() and endCDATA() callbacks
      */
@@ -306,6 +309,7 @@
         }
     }
 
+    OutputStream m_outputStream;
     /**
      * Get the output stream where the events will be serialized to.
      *
@@ -314,13 +318,7 @@
      */
     public OutputStream getOutputStream()
     {
-
-        if (m_writer instanceof WriterToUTF8Buffered)
-            return ((WriterToUTF8Buffered) m_writer).getOutputStream();
-        if (m_writer instanceof WriterToASCI)
-            return ((WriterToASCI) m_writer).getOutputStream();
-        else
-            return null;
+        return m_outputStream;
     }
 
     // Implement DeclHandler
@@ -419,10 +417,174 @@
      */
     protected final void outputLineSep() throws IOException
     {
-
         m_writer.write(m_lineSep, 0, m_lineSepLen);
     }
 
+    void setProp(String name, String val, boolean defaultVal) {
+        if (val != null) {
+
+            char first = getFirstCharLocName(name);
+            switch (first) {
+            case 'c':
+                if (OutputKeys.CDATA_SECTION_ELEMENTS.equals(name)) {
+                    addCdataSectionElements(val); // val is cdataSectionNames
+                }
+                break;
+            case 'd':
+                if (OutputKeys.DOCTYPE_SYSTEM.equals(name)) {
+                    this.m_doctypeSystem = val;
+                } else if (OutputKeys.DOCTYPE_PUBLIC.equals(name)) {
+                    this.m_doctypePublic = val;
+                    if (val.startsWith("-//W3C//DTD XHTML"))
+                        m_spaceBeforeClose = true;
+                }
+                break;
+            case 'e':
+                String newEncoding = val;
+                if (OutputKeys.ENCODING.equals(name)) {
+                    String possible_encoding = Encodings.getMimeEncoding(val);
+                    if (possible_encoding != null) {
+                        // if the encoding is being set, try to get the
+                        // preferred
+                        // mime-name and set it too.
+                        super.setProp("mime-name", possible_encoding,
+                                defaultVal);
+                    }
+                    final String oldExplicitEncoding = getOutputPropertyNonDefault(OutputKeys.ENCODING);
+                    final String oldDefaultEncoding  = getOutputPropertyDefault(OutputKeys.ENCODING);
+                    if ( (defaultVal && ( oldDefaultEncoding == null || !oldDefaultEncoding.equalsIgnoreCase(newEncoding)))
+                            || ( !defaultVal && (oldExplicitEncoding == null || !oldExplicitEncoding.equalsIgnoreCase(newEncoding) ))) {
+                       // We are trying to change the default or the non-default setting of the encoding to a different value
+                       // from what it was
+
+                       EncodingInfo encodingInfo = Encodings.getEncodingInfo(newEncoding);
+                       if (newEncoding != null && encodingInfo.name == null) {
+                        // We tried to get an EncodingInfo for Object for the given
+                        // encoding, but it came back with an internall null name
+                        // so the encoding is not supported by the JDK, issue a message.
+                        final String msg = Utils.messages.createMessage(
+                                MsgKey.ER_ENCODING_NOT_SUPPORTED,new Object[]{ newEncoding });
+
+                        final String msg2 =
+                            "Warning: encoding \"" + newEncoding + "\" not supported, using "
+                                   + Encodings.DEFAULT_MIME_ENCODING;
+                        try {
+                                // Prepare to issue the warning message
+                                final Transformer tran = super.getTransformer();
+                                if (tran != null) {
+                                    final ErrorListener errHandler = tran
+                                            .getErrorListener();
+                                    // Issue the warning message
+                                    if (null != errHandler
+                                            && m_sourceLocator != null) {
+                                        errHandler
+                                                .warning(new TransformerException(
+                                                        msg, m_sourceLocator));
+                                        errHandler
+                                                .warning(new TransformerException(
+                                                        msg2, m_sourceLocator));
+                                    } else {
+                                        System.out.println(msg);
+                                        System.out.println(msg2);
+                                    }
+                                } else {
+                                    System.out.println(msg);
+                                    System.out.println(msg2);
+                                }
+                            } catch (Exception e) {
+                            }
+
+                            // We said we are using UTF-8, so use it
+                            newEncoding = Encodings.DEFAULT_MIME_ENCODING;
+                            val = Encodings.DEFAULT_MIME_ENCODING; // to store the modified value into the properties a little later
+                            encodingInfo = Encodings.getEncodingInfo(newEncoding);
+                        }
+                       // The encoding was good, or was forced to UTF-8 above
+
+
+                       // If there is already a non-default set encoding and we
+                       // are trying to set the default encoding, skip the this block
+                       // as the non-default value is already the one to use.
+                       if (defaultVal == false || oldExplicitEncoding == null) {
+                           m_encodingInfo = encodingInfo;
+                           if (newEncoding != null)
+                               m_isUTF8 = newEncoding.equals(Encodings.DEFAULT_MIME_ENCODING);
+
+                           // if there was a previously set OutputStream
+                           OutputStream os = getOutputStream();
+                           if (os != null) {
+                               Writer w = getWriter();
+
+                               // If the writer was previously set, but
+                               // set by the user, or if the new encoding is the same
+                               // as the old encoding, skip this block
+                               String oldEncoding = getOutputProperty(OutputKeys.ENCODING);
+                               if ((w == null || !m_writer_set_by_user)
+                                       && !newEncoding.equalsIgnoreCase(oldEncoding)) {
+                                   // Make the change of encoding in our internal
+                                   // table, then call setOutputStreamInternal
+                                   // which will stomp on the old Writer (if any)
+                                   // with a new Writer with the new encoding.
+                                   super.setProp(name, val, defaultVal);
+                                   setOutputStreamInternal(os,false);
+                               }
+                           }
+                       }
+                    }
+                }
+                break;
+            case 'i':
+                if (OutputPropertiesFactory.S_KEY_INDENT_AMOUNT.equals(name)) {
+                    setIndentAmount(Integer.parseInt(val));
+                } else if (OutputKeys.INDENT.equals(name)) {
+                    boolean b = "yes".equals(val) ? true : false;
+                    m_doIndent = b;
+                }
+
+                break;
+            case 'l':
+                if (OutputPropertiesFactory.S_KEY_LINE_SEPARATOR.equals(name)) {
+                    m_lineSep = val.toCharArray();
+                    m_lineSepLen = m_lineSep.length;
+                }
+
+                break;
+            case 'm':
+                if (OutputKeys.MEDIA_TYPE.equals(name)) {
+                    m_mediatype = val;
+                }
+                break;
+            case 'o':
+                if (OutputKeys.OMIT_XML_DECLARATION.equals(name)) {
+                    boolean b = "yes".equals(val) ? true : false;
+                    this.m_shouldNotWriteXMLHeader = b;
+                }
+                break;
+            case 's':
+                // if standalone was explicitly specified
+                if (OutputKeys.STANDALONE.equals(name)) {
+                    if (defaultVal) {
+                        setStandaloneInternal(val);
+                    } else {
+                        m_standaloneWasSpecified = true;
+                        setStandaloneInternal(val);
+                    }
+                }
+
+                break;
+            case 'v':
+                if (OutputKeys.VERSION.equals(name)) {
+                    m_version = val;
+                }
+                break;
+            default:
+                break;
+
+            }
+            super.setProp(name, val, defaultVal);
+        }
+    }
+
     /**
      * Specifies an output format for this serializer. It the
      * serializer has already been associated with an output format,
@@ -434,115 +596,34 @@
      */
     public void setOutputFormat(Properties format)
     {
-
         boolean shouldFlush = m_shouldFlush;
 
-        init(m_writer, format, false, false);
-
-        m_shouldFlush = shouldFlush;
-    }
-
-    /**
-     * Initialize the serializer with the specified writer and output format.
-     * Must be called before calling any of the serialize methods.
-     * This method can be called multiple times and the xsl:output properties
-     * passed in the 'format' parameter are accumulated across calls.
-     *
-     * @param writer The writer to use
-     * @param format The output format
-     * @param shouldFlush True if the writer should be flushed at EndDocument.
-     */
-    private synchronized void init(
-        Writer writer,
-        Properties format,
-        boolean defaultProperties,
-        boolean shouldFlush)
-    {
-
-        m_shouldFlush = shouldFlush;
-
-
-        // if we are tracing events we need to trace what
-        // characters are written to the output writer.
-        if (m_tracer != null
-         && !(writer instanceof SerializerTraceWriter)  )
-            m_writer = new SerializerTraceWriter(writer, m_tracer);
-        else
-            m_writer = writer;
-
-
-        m_format = format;
-        //        m_cdataSectionNames =
-        //            OutputProperties.getQNameProperties(
-        //                OutputKeys.CDATA_SECTION_ELEMENTS,
-        //                format);
-        setCdataSectionElements(OutputKeys.CDATA_SECTION_ELEMENTS, format);
-
-        setIndentAmount(
-            OutputPropertyUtils.getIntProperty(
-                OutputPropertiesFactory.S_KEY_INDENT_AMOUNT,
-                format));
-        setIndent(
-            OutputPropertyUtils.getBooleanProperty(OutputKeys.INDENT, format));
-
+        if (format != null)
         {
-            String sep =
-                    format.getProperty(OutputPropertiesFactory.S_KEY_LINE_SEPARATOR);
-            if (sep != null) {
-                m_lineSep = sep.toCharArray();
-                m_lineSepLen = sep.length();
+            // Set the default values first,
+            // and the non-default values after that,
+            // just in case there is some unexpected
+            // residual values left over from over-ridden default values
+            Enumeration propNames;
+            propNames = format.propertyNames();
+            while (propNames.hasMoreElements())
+            {
+                String key = (String) propNames.nextElement();
+                // Get the value, possibly a default value
+                String value = format.getProperty(key);
+                // Get the non-default value (if any).
+                String explicitValue = (String) format.get(key);
+                if (explicitValue == null && value != null) {
+                    // This is a default value
+                    this.setOutputPropertyDefault(key,value);
+                }
+                if (explicitValue != null) {
+                    // This is an explicit non-default value
+                    this.setOutputProperty(key,explicitValue);
+                }
             }
         }
 
-        boolean shouldNotWriteXMLHeader =
-            OutputPropertyUtils.getBooleanProperty(
-                OutputKeys.OMIT_XML_DECLARATION,
-                format);
-        setOmitXMLDeclaration(shouldNotWriteXMLHeader);
-        setDoctypeSystem(format.getProperty(OutputKeys.DOCTYPE_SYSTEM));
-        String doctypePublic = format.getProperty(OutputKeys.DOCTYPE_PUBLIC);
-        setDoctypePublic(doctypePublic);
-
-        // if standalone was explicitly specified
-        if (format.get(OutputKeys.STANDALONE) != null)
-        {
-            String val = format.getProperty(OutputKeys.STANDALONE);
-            if (defaultProperties)
-                setStandaloneInternal(val);
-            else
-                setStandalone(val);
-        }
-
-        setMediaType(format.getProperty(OutputKeys.MEDIA_TYPE));
-
-        if (null != doctypePublic)
-        {
-            if (doctypePublic.startsWith("-//W3C//DTD XHTML"))
-                m_spaceBeforeClose = true;
-        }
-
-        /*
-         * This code is added for XML 1.1 Version output.
-         */
-        String version = getVersion();
-        if (null == version)
-        {
-            version = format.getProperty(OutputKeys.VERSION);
-            setVersion(version);
-        }
-
-        // initCharsMap();
-        String encoding = getEncoding();
-        if (null == encoding)
-        {
-            encoding =
-                Encodings.getMimeEncoding(
-                    format.getProperty(OutputKeys.ENCODING));
-            setEncoding(encoding);
-        }
-
-        m_isUTF8 = encoding.equals(Encodings.DEFAULT_MIME_ENCODING);
-
         // Access this only from the Hashtable level... we don't want to
         // get default properties.
         String entitiesFileName =
@@ -557,107 +638,10 @@
             m_charInfo = CharInfo.getCharInfo(entitiesFileName, method);
         }
 
-    }
-
-    /**
-     * Initialize the serializer with the specified writer and output format.
-     * Must be called before calling any of the serialize methods.
-     *
-     * @param writer The writer to use
-     * @param format The output format
-     */
-    private synchronized void init(Writer writer, Properties format)
-    {
-        init(writer, format, false, false);
-    }
-    /**
-     * Initialize the serializer with the specified output stream and output
-     * format. Must be called before calling any of the serialize methods.
-     *
-     * @param output The output stream to use
-     * @param format The output format
-     * @param defaultProperties true if the properties are the default
-     * properties
-     *
-     * @throws UnsupportedEncodingException The encoding specified   in the
-     * output format is not supported
-     */
-    protected synchronized void init(
-        OutputStream output,
-        Properties format,
-        boolean defaultProperties)
-        throws UnsupportedEncodingException
-    {
-
-        String encoding = getEncoding();
-        if (encoding == null)
-        {
-            // if not already set then get it from the properties
-            encoding =
-                Encodings.getMimeEncoding(
-                    format.getProperty(OutputKeys.ENCODING));
-            setEncoding(encoding);
-        }
-
-        if (encoding.equalsIgnoreCase("UTF-8"))
-        {
-            m_isUTF8 = true;
-            //            if (output instanceof java.io.BufferedOutputStream)
-            //            {
-            //                init(new WriterToUTF8(output), format, defaultProperties, true);
-            //            }
-            //            else if (output instanceof java.io.FileOutputStream)
-            //            {
-            //                init(new WriterToUTF8Buffered(output), format, defaultProperties, true);
-            //            }
-            //            else
-            //            {
-            //                // Not sure what to do in this case.  I'm going to be conservative
-            //                // and not buffer.
-            //                init(new WriterToUTF8(output), format, defaultProperties, true);
-            //            }
 
 
-                init(
-                    new WriterToUTF8Buffered(output),
-                    format,
-                    defaultProperties,
-                    true);
 
-
-        }
-        else if (
-            encoding.equals("WINDOWS-1250")
-                || encoding.equals("US-ASCII")
-                || encoding.equals("ASCII"))
-        {
-            init(new WriterToASCI(output), format, defaultProperties, true);
-        }
-        else
-        {
-            Writer osw;
-
-            try
-            {
-                osw = Encodings.getWriter(output, encoding);
-            }
-            catch (UnsupportedEncodingException uee)
-            {
-                System.out.println(
-                    "Warning: encoding \""
-                        + encoding
-                        + "\" not supported"
-                        + ", using "
-                        + Encodings.DEFAULT_MIME_ENCODING);
-
-                encoding = Encodings.DEFAULT_MIME_ENCODING;
-                setEncoding(encoding);
-                osw = Encodings.getWriter(output, encoding);
-            }
-
-            init(osw, format, defaultProperties, true);
-        }
-
+        m_shouldFlush = shouldFlush;
     }
 
     /**
@@ -665,9 +649,26 @@
      *
      * @return The output format in use
      */
-    public Properties getOutputFormat()
-    {
-        return m_format;
+    public Properties getOutputFormat() {
+        Properties def = new Properties();
+        {
+            Set<String> s = getOutputPropDefaultKeys();
+            for (String key : s) {
+                String val = getOutputPropertyDefault(key);
+                def.put(key, val);
+            }
+        }
+
+        Properties props = new Properties(def);
+        {
+            Set<String> s = getOutputPropKeys();
+            for (String key : s) {
+                String val = getOutputPropertyNonDefault(key);
+                if (val != null)
+                    props.put(key, val);
+            }
+        }
+        return props;
     }
 
     /**
@@ -679,13 +680,28 @@
      */
     public void setWriter(Writer writer)
     {
+        setWriterInternal(writer, true);
+    }
+
+    private boolean m_writer_set_by_user;
+    private void setWriterInternal(Writer writer, boolean setByUser) {
+        m_writer_set_by_user = setByUser;
+        m_writer = writer;
         // if we are tracing events we need to trace what
         // characters are written to the output writer.
-        if (m_tracer != null
-         && !(writer instanceof SerializerTraceWriter)  )
-            m_writer = new SerializerTraceWriter(writer, m_tracer);
-        else
-            m_writer = writer;
+        if (m_tracer != null) {
+            boolean noTracerYet = true;
+            Writer w2 = m_writer;
+            while (w2 instanceof WriterChain) {
+                if (w2 instanceof SerializerTraceWriter) {
+                    noTracerYet = false;
+                    break;
+                }
+                w2 = ((WriterChain)w2).getWriter();
+            }
+            if (noTracerYet)
+                m_writer = new SerializerTraceWriter(m_writer, m_tracer);
+        }
     }
 
     /**
@@ -720,25 +736,68 @@
      */
     public void setOutputStream(OutputStream output)
     {
+        setOutputStreamInternal(output, true);
+    }
 
-        try
+    private void setOutputStreamInternal(OutputStream output, boolean setByUser)
+    {
+        m_outputStream = output;
+        String encoding = getOutputProperty(OutputKeys.ENCODING);
+        if (Encodings.DEFAULT_MIME_ENCODING.equalsIgnoreCase(encoding))
         {
-            Properties format;
-            if (null == m_format)
-                format =
-                    OutputPropertiesFactory.getDefaultMethodProperties(
-                        Method.XML);
-            else
-                format = m_format;
-            init(output, format, true);
+            // We wrap the OutputStream with a writer, but
+            // not one set by the user
+            try {
+                setWriterInternal(new WriterToUTF8Buffered(output), false);
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+        } else if (
+                "WINDOWS-1250".equals(encoding)
+                || "US-ASCII".equals(encoding)
+                || "ASCII".equals(encoding))
+        {
+            setWriterInternal(new WriterToASCI(output), false);
+        } else if (encoding != null) {
+            Writer osw = null;
+                try
+                {
+                    osw = Encodings.getWriter(output, encoding);
+                }
+                catch (UnsupportedEncodingException uee)
+                {
+                    osw = null;
+                }
+
+
+            if (osw == null) {
+                System.out.println(
+                    "Warning: encoding \""
+                        + encoding
+                        + "\" not supported"
+                        + ", using "
+                        + Encodings.DEFAULT_MIME_ENCODING);
+
+                encoding = Encodings.DEFAULT_MIME_ENCODING;
+                setEncoding(encoding);
+                try {
+                    osw = Encodings.getWriter(output, encoding);
+                } catch (UnsupportedEncodingException e) {
+                    // We can't really get here, UTF-8 is always supported
+                    // This try-catch exists to make the compiler happy
+                    e.printStackTrace();
+                }
+            }
+            setWriterInternal(osw,false);
         }
-        catch (UnsupportedEncodingException uee)
-        {
-
-            // Should have been warned in init, I guess...
+        else {
+            // don't have any encoding, but we have an OutputStream
+            Writer osw = new OutputStreamWriter(output);
+            setWriterInternal(osw,false);
         }
     }
 
+
     /**
      * @see SerializationHandler#setEscaping(boolean)
      */
@@ -2455,7 +2514,7 @@
              * lets determine if the current element is specified in the cdata-
              * section-elements list.
              */
-            if (m_cdataSectionElements != null)
+            if (m_StringOfCDATASections != null)
                 m_elemContext.m_isCdataSection = isCdataSection();
 
             if (m_doIndent)
@@ -2532,12 +2591,12 @@
      * @param   key   the property key.
      * @param props the list of properties to search in.
      *
-     * Sets the vector of local-name/URI pairs of the cdata section elements
+     * Sets the ArrayList of local-name/URI pairs of the cdata section elements
      * specified in the cdata-section-elements property.
      *
      * This method is essentially a copy of getQNameProperties() from
      * OutputProperties. Eventually this method should go away and a call
-     * to setCdataSectionElements(Vector v) should be made directly.
+     * to setCdataSectionElements(ArrayList<String> v) should be made directly.
      */
     private void setCdataSectionElements(String key, Properties props)
     {
@@ -2546,11 +2605,11 @@
 
         if (null != s)
         {
-            // Vector of URI/LocalName pairs
-            Vector v = new Vector();
+            // ArrayList<String> of URI/LocalName pairs
+            ArrayList<String> v = new ArrayList<>();
             int l = s.length();
             boolean inCurly = false;
-            StringBuffer buf = new StringBuffer();
+            StringBuilder buf = new StringBuilder();
 
             // parse through string, breaking on whitespaces.  I do this instead
             // of a tokenizer so I can track whitespace inside of curly brackets,
@@ -2597,7 +2656,7 @@
      *
      * @return a QName object
      */
-    private void addCdataSectionElement(String URI_and_localName, Vector v)
+    private void addCdataSectionElement(String URI_and_localName, ArrayList<String> v)
     {
 
         StringTokenizer tokenizer =
@@ -2608,14 +2667,14 @@
         if (null == s2)
         {
             // add null URI and the local name
-            v.addElement(null);
-            v.addElement(s1);
+            v.add(null);
+            v.add(s1);
         }
         else
         {
             // add URI, then local name
-            v.addElement(s1);
-            v.addElement(s2);
+            v.add(s1);
+            v.add(s2);
         }
     }
 
@@ -2624,11 +2683,38 @@
      * The "official way to set URI and localName pairs.
      * This method should be used by both Xalan and XSLTC.
      *
-     * @param URI_and_localNames a vector of pairs of Strings (URI/local)
+     * @param URI_and_localNames an ArrayList of pairs of Strings (URI/local)
      */
-    public void setCdataSectionElements(Vector URI_and_localNames)
+    public void setCdataSectionElements(ArrayList<String> URI_and_localNames)
     {
-        m_cdataSectionElements = URI_and_localNames;
+        // convert to the new way.
+        if (URI_and_localNames != null)
+        {
+            final int len = URI_and_localNames.size() - 1;
+            if (len > 0)
+            {
+                final StringBuilder sb = new StringBuilder();
+                for (int i = 0; i < len; i += 2)
+                {
+                    // whitspace separated "{uri1}local1 {uri2}local2 ..."
+                    if (i != 0)
+                        sb.append(' ');
+                    final String uri = (String) URI_and_localNames.get(i);
+                    final String localName =
+                        (String) URI_and_localNames.get(i + 1);
+                    if (uri != null)
+                    {
+                        // If there is no URI don't put this in, just the localName then.
+                        sb.append('{');
+                        sb.append(uri);
+                        sb.append('}');
+                    }
+                    sb.append(localName);
+                }
+                m_StringOfCDATASections = sb.toString();
+            }
+        }
+        initCdataElems(m_StringOfCDATASections);
     }
 
     /**
@@ -3084,37 +3170,7 @@
       */
      public void setEncoding(String encoding)
      {
-         String old = getEncoding();
-         super.setEncoding(encoding);
-         if (old == null || !old.equals(encoding)) {
-            // If we have changed the setting of the
-            m_encodingInfo = Encodings.getEncodingInfo(encoding);
-
-            if (encoding != null && m_encodingInfo.name == null) {
-                // We tried to get an EncodingInfo for Object for the given
-                // encoding, but it came back with an internall null name
-                // so the encoding is not supported by the JDK, issue a message.
-                String msg = Utils.messages.createMessage(
-                                MsgKey.ER_ENCODING_NOT_SUPPORTED,new Object[]{ encoding });
-                try
-                {
-                        // Prepare to issue the warning message
-                        Transformer tran = super.getTransformer();
-                        if (tran != null) {
-                                ErrorListener errHandler = tran.getErrorListener();
-                                // Issue the warning message
-                                if (null != errHandler && m_sourceLocator != null)
-                                        errHandler.warning(new TransformerException(msg, m_sourceLocator));
-                                else
-                                        System.out.println(msg);
-                    }
-                        else
-                                System.out.println(msg);
-                }
-                catch (Exception e){}
-            }
-         }
-         return;
+         setOutputProperty(OutputKeys.ENCODING,encoding);
      }
 
     /**
@@ -3386,4 +3442,24 @@
     public void setDTDEntityExpansion(boolean expand) {
         m_expandDTDEntities = expand;
     }
+
+    /**
+     * Remembers the cdata sections specified in the cdata-section-elements by appending the given
+     * cdata section elements to the list. This method can be called multiple times, but once an
+     * element is put in the list of cdata section elements it can not be removed.
+     * This method should be used by both Xalan and XSLTC.
+     *
+     * @param URI_and_localNames a whitespace separated list of element names, each element
+     * is a URI in curly braces (optional) and a local name. An example of such a parameter is:
+     * "{http://company.com}price {myURI2}book chapter"
+     */
+    public void addCdataSectionElements(String URI_and_localNames)
+    {
+        if (URI_and_localNames != null)
+            initCdataElems(URI_and_localNames);
+        if (m_StringOfCDATASections == null)
+            m_StringOfCDATASections = URI_and_localNames;
+        else
+            m_StringOfCDATASections += (" " + URI_and_localNames);
+    }
 }
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
index f82e9c0..a68382c 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/ToUnknownStream.java
@@ -26,7 +26,7 @@
 import java.io.OutputStream;
 import java.io.Writer;
 import java.util.Properties;
-import java.util.Vector;
+import java.util.ArrayList;
 
 import javax.xml.transform.SourceLocator;
 import javax.xml.transform.Transformer;
@@ -100,12 +100,12 @@
      * A collection of namespace URI's (only for first element).
      * _namespacePrefix has the matching prefix for these URI's
      */
-    private Vector m_namespaceURI = null;
+    private ArrayList<String> m_namespaceURI = null;
     /**
      * A collection of namespace Prefix (only for first element)
      * _namespaceURI has the matching URIs for these prefix'
      */
-    private Vector m_namespacePrefix = null;
+    private ArrayList<String> m_namespacePrefix = null;
 
     /**
      * true if startDocument() was called before the underlying handler
@@ -421,11 +421,11 @@
             {
                 if (m_namespacePrefix == null)
                 {
-                    m_namespacePrefix = new Vector();
-                    m_namespaceURI = new Vector();
+                    m_namespacePrefix = new ArrayList<>();
+                    m_namespaceURI = new ArrayList<>();
                 }
-                m_namespacePrefix.addElement(prefix);
-                m_namespaceURI.addElement(uri);
+                m_namespacePrefix.add(prefix);
+                m_namespaceURI.add(uri);
 
                 if (m_firstElementURI == null)
                 {
@@ -1092,8 +1092,8 @@
                 for (int i = 0; i < n; i++)
                 {
                     final String prefix =
-                        (String) m_namespacePrefix.elementAt(i);
-                    final String uri = (String) m_namespaceURI.elementAt(i);
+                        (String) m_namespacePrefix.get(i);
+                    final String uri = (String) m_namespaceURI.get(i);
                     m_handler.startPrefixMapping(prefix, uri, false);
                 }
                 m_namespacePrefix = null;
@@ -1165,8 +1165,8 @@
             final int max = m_namespacePrefix.size();
             for (int i = 0; i < max; i++)
             {
-                final String prefix = (String) m_namespacePrefix.elementAt(i);
-                final String uri = (String) m_namespaceURI.elementAt(i);
+                final String prefix = m_namespacePrefix.get(i);
+                final String uri = m_namespaceURI.get(i);
 
                 if (m_firstElementPrefix != null
                     && m_firstElementPrefix.equals(prefix)
@@ -1194,7 +1194,7 @@
      * specified in the cdata-section-elements attribute.
      * @see SerializationHandler#setCdataSectionElements(java.util.Vector)
      */
-    public void setCdataSectionElements(Vector URI_and_localNames)
+    public void setCdataSectionElements(ArrayList<String> URI_and_localNames)
     {
         m_handler.setCdataSectionElements(URI_and_localNames);
     }
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java
index b9291cc..8a0bcdd 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/WriterToUTF8Buffered.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 1999-2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
diff --git a/jaxp/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java b/jaxp/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
index 4fb9b4b..82df564 100644
--- a/jaxp/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
+++ b/jaxp/src/com/sun/org/apache/xml/internal/serializer/XSLOutputAttributes.java
@@ -3,9 +3,11 @@
  * DO NOT REMOVE OR ALTER!
  */
 /*
- * Copyright 2003-2004 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the  "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
@@ -22,7 +24,7 @@
  */
 package com.sun.org.apache.xml.internal.serializer;
 
-import java.util.Vector;
+import java.util.ArrayList;
 
 /**
  * This interface has methods associated with the XSLT xsl:output attribues
@@ -105,11 +107,6 @@
      */
     public String getVersion();
 
-
-
-
-
-
     /**
      * Sets the value coming from the xsl:output cdata-section-elements
      * stylesheet property.
@@ -124,7 +121,7 @@
      * relevant in specifying which elements have their text to be output as
      * CDATA sections.
      */
-    public void setCdataSectionElements(Vector URI_and_localNames);
+    public void setCdataSectionElements(ArrayList<String> URI_and_localNames);
 
     /** Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
      * @param system the system identifier to be used in the DOCTYPE declaration
@@ -181,4 +178,58 @@
      */
     public void setVersion(String version);
 
+    /**
+     * Get the value for a property that affects seraialization,
+     * if a property was set return that value, otherwise return
+     * the default value, otherwise return null.
+     * @param name The name of the property, which is just the local name
+     * if it is in no namespace, but is the URI in curly braces followed by
+     * the local name if it is in a namespace, for example:
+     * <ul>
+     * <li> "encoding"
+     * <li> "method"
+     * <li> "{http://xml.apache.org/xalan}indent-amount"
+     * <li> "{http://xml.apache.org/xalan}line-separator"
+     * </ul>
+     * @return The value of the parameter
+     */
+    public String getOutputProperty(String name);
+    /**
+     * Get the default value for a property that affects seraialization,
+     * or null if there is none. It is possible that a non-default value
+     * was set for the property, however the value returned by this method
+     * is unaffected by any non-default settings.
+     * @param name The name of the property.
+     * @return The default value of the parameter, or null if there is no default value.
+     */
+    public String getOutputPropertyDefault(String name);
+    /**
+     * Set the non-default value for a property that affects seraialization.
+     * @param name The name of the property, which is just the local name
+     * if it is in no namespace, but is the URI in curly braces followed by
+     * the local name if it is in a namespace, for example:
+     * <ul>
+     * <li> "encoding"
+     * <li> "method"
+     * <li> "{http://xml.apache.org/xalan}indent-amount"
+     * <li> "{http://xml.apache.org/xalan}line-separator"
+     * </ul>
+     * @val The non-default value of the parameter
+     */
+    public void   setOutputProperty(String name, String val);
+
+    /**
+     * Set the default value for a property that affects seraialization.
+     * @param name The name of the property, which is just the local name
+     * if it is in no namespace, but is the URI in curly braces followed by
+     * the local name if it is in a namespace, for example:
+     * <ul>
+     * <li> "encoding"
+     * <li> "method"
+     * <li> "{http://xml.apache.org/xalan}indent-amount"
+     * <li> "{http://xml.apache.org/xalan}line-separator"
+     * </ul>
+     * @val The default value of the parameter
+     */
+    public void   setOutputPropertyDefault(String name, String val);
 }
diff --git a/jaxp/src/com/sun/xml/internal/stream/Entity.java b/jaxp/src/com/sun/xml/internal/stream/Entity.java
index 9806cf7..b315124 100644
--- a/jaxp/src/com/sun/xml/internal/stream/Entity.java
+++ b/jaxp/src/com/sun/xml/internal/stream/Entity.java
@@ -352,7 +352,7 @@
         }
 
         /**each 'external' parsed entity may have xml/text declaration containing version information
-         * @return String version of the enity, for an internal entity version would be null
+         * @return String version of the entity, for an internal entity version would be null
          */
         public String getEntityVersion(){
             return version ;
diff --git a/jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java b/jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
index 65f852c..f56d865 100644
--- a/jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
+++ b/jaxp/src/com/sun/xml/internal/stream/StaxXMLInputSource.java
@@ -34,7 +34,7 @@
  * @author  Neeraj
  *
  * This class wraps XMLInputSource and is also capable of telling wether application
- * returned XMLStreamReader or not when XMLResolver.resolveEnity
+ * returned XMLStreamReader or not when XMLResolver.resolveEntity
  * was called.
  */
 public class StaxXMLInputSource {
diff --git a/jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java b/jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java
index 7f96ce9..a1496fb 100644
--- a/jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java
+++ b/jaxp/src/javax/xml/datatype/DatatypeConfigurationException.java
@@ -36,7 +36,7 @@
 
     /**
      * <p>Create a new <code>DatatypeConfigurationException</code> with
-     * no specified detail mesage and cause.</p>
+     * no specified detail message and cause.</p>
      */
 
     public DatatypeConfigurationException() {
diff --git a/jaxp/src/javax/xml/datatype/DatatypeFactory.java b/jaxp/src/javax/xml/datatype/DatatypeFactory.java
index 56c796b..8138f98 100644
--- a/jaxp/src/javax/xml/datatype/DatatypeFactory.java
+++ b/jaxp/src/javax/xml/datatype/DatatypeFactory.java
@@ -119,7 +119,7 @@
         Pattern.compile("[^YM]*[DT].*");
 
     /**
-     * <p>Protected constructor to prevent instaniation outside of package.</p>
+     * <p>Protected constructor to prevent instantiation outside of package.</p>
      *
      * <p>Use {@link #newInstance()} to create a <code>DatatypeFactory</code>.</p>
      */
diff --git a/jaxp/src/javax/xml/namespace/QName.java b/jaxp/src/javax/xml/namespace/QName.java
index 981a8b2..994b2a3 100644
--- a/jaxp/src/javax/xml/namespace/QName.java
+++ b/jaxp/src/javax/xml/namespace/QName.java
@@ -83,7 +83,7 @@
      *
      * <p>To workaround this issue, serialVersionUID is set with either
      * a default value or a compatibility value.  To use the
-     * compatiblity value, set the system property:</p>
+     * compatibility value, set the system property:</p>
      *
      * <code>com.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0</code>
      *
diff --git a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
index 04265f6..ed77da8 100644
--- a/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
+++ b/jaxp/src/javax/xml/parsers/DocumentBuilderFactory.java
@@ -423,7 +423,7 @@
      * <ul>
      *   <li>
      *     <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
-     *     Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
+     *     Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
      *     If XML processing is limited for security reasons, it will be reported via a call to the registered
      *    {@link org.xml.sax.ErrorHandler#fatalError(SAXParseException exception)}.
      *     See {@link  DocumentBuilder#setErrorHandler(org.xml.sax.ErrorHandler errorHandler)}.
@@ -517,7 +517,7 @@
      * modified DOM trees.
      *
      * <p>
-     * Initialy, null is set as the {@link Schema}.
+     * Initially, null is set as the {@link Schema}.
      *
      * <p>
      * This processing will take effect even if
@@ -531,7 +531,7 @@
      * exception when the {@link #newDocumentBuilder()} is invoked.</p>
      *
      *
-     * <h4>Note for implmentors</h4>
+     * <h4>Note for implementors</h4>
      *
      * <p>
      * A parser must be able to work with any {@link Schema}
diff --git a/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java b/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
index c70e4ae..be00826 100644
--- a/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
+++ b/jaxp/src/javax/xml/parsers/FactoryConfigurationError.java
@@ -45,7 +45,7 @@
 
     /**
      * Create a new <code>FactoryConfigurationError</code> with no
-     * detail mesage.
+     * detail message.
      */
 
     public FactoryConfigurationError() {
diff --git a/jaxp/src/javax/xml/parsers/ParserConfigurationException.java b/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
index 0467ca0..ed9ecfc 100644
--- a/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
+++ b/jaxp/src/javax/xml/parsers/ParserConfigurationException.java
@@ -35,7 +35,7 @@
 
     /**
      * Create a new <code>ParserConfigurationException</code> with no
-     * detail mesage.
+     * detail message.
      */
 
     public ParserConfigurationException() {
diff --git a/jaxp/src/javax/xml/parsers/SAXParser.java b/jaxp/src/javax/xml/parsers/SAXParser.java
index 5accd12..8a58bee 100644
--- a/jaxp/src/javax/xml/parsers/SAXParser.java
+++ b/jaxp/src/javax/xml/parsers/SAXParser.java
@@ -69,7 +69,7 @@
  * given {@link org.xml.sax.HandlerBase} or the
  * {@link org.xml.sax.helpers.DefaultHandler} are called.<p>
  *
- * Implementors of this class which wrap an underlaying implementation
+ * Implementors of this class which wrap an underlying implementation
  * can consider using the {@link org.xml.sax.helpers.ParserAdapter}
  * class to initially adapt their SAX1 implementation to work under
  * this revised class.
@@ -79,7 +79,7 @@
 public abstract class SAXParser {
 
     /**
-     * <p>Protected constructor to prevent instaniation.
+     * <p>Protected constructor to prevent instantiation.
      * Use {@link javax.xml.parsers.SAXParserFactory#newSAXParser()}.</p>
      */
     protected SAXParser () {
@@ -393,10 +393,10 @@
     }
 
     /**
-     * Returns the SAX parser that is encapsultated by the
+     * Returns the SAX parser that is encapsulated by the
      * implementation of this class.
      *
-     * @return The SAX parser that is encapsultated by the
+     * @return The SAX parser that is encapsulated by the
      *         implementation of this class.
      *
      * @throws SAXException If any SAX errors occur during processing.
diff --git a/jaxp/src/javax/xml/parsers/SAXParserFactory.java b/jaxp/src/javax/xml/parsers/SAXParserFactory.java
index 7163456..b0a3bb6 100644
--- a/jaxp/src/javax/xml/parsers/SAXParserFactory.java
+++ b/jaxp/src/javax/xml/parsers/SAXParserFactory.java
@@ -359,7 +359,7 @@
      * is responsible to make sure that the application will receive
      * those modified event stream.</p>
      *
-     * <p>Initialy, <code>null</code> is set as the {@link Schema}.</p>
+     * <p>Initially, <code>null</code> is set as the {@link Schema}.</p>
      *
      * <p>This processing will take effect even if
      * the {@link #isValidating()} method returns <code>false</code>.
diff --git a/jaxp/src/javax/xml/transform/ErrorListener.java b/jaxp/src/javax/xml/transform/ErrorListener.java
index bc28823..b81e611 100644
--- a/jaxp/src/javax/xml/transform/ErrorListener.java
+++ b/jaxp/src/javax/xml/transform/ErrorListener.java
@@ -28,7 +28,7 @@
 /**
  * <p>To provide customized error handling, implement this interface and
  * use the <code>setErrorListener</code> method to register an instance of the
- * implmentation with the {@link javax.xml.transform.Transformer}.  The
+ * implementation with the {@link javax.xml.transform.Transformer}.  The
  * <code>Transformer</code> then reports all errors and warnings through this
  * interface.</p>
  *
diff --git a/jaxp/src/javax/xml/transform/TransformerConfigurationException.java b/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
index 9e2f3af..7e24ac8 100644
--- a/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
+++ b/jaxp/src/javax/xml/transform/TransformerConfigurationException.java
@@ -32,7 +32,7 @@
 
     /**
      * Create a new <code>TransformerConfigurationException</code> with no
-     * detail mesage.
+     * detail message.
      */
     public TransformerConfigurationException() {
         super("Configuration Error");
diff --git a/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java b/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
index fb060b0..b8ac36c 100644
--- a/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
+++ b/jaxp/src/javax/xml/transform/TransformerFactoryConfigurationError.java
@@ -42,7 +42,7 @@
 
     /**
      * Create a new <code>TransformerFactoryConfigurationError</code> with no
-     * detail mesage.
+     * detail message.
      */
     public TransformerFactoryConfigurationError() {
 
diff --git a/jaxp/src/javax/xml/validation/SchemaFactory.java b/jaxp/src/javax/xml/validation/SchemaFactory.java
index ebbbe40..2701b19 100644
--- a/jaxp/src/javax/xml/validation/SchemaFactory.java
+++ b/jaxp/src/javax/xml/validation/SchemaFactory.java
@@ -358,7 +358,7 @@
      * <ul>
      *   <li>
      *     <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
-     *     Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
+     *     Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
      *     If XML processing is limited for security reasons, it will be reported via a call to the registered
      *    {@link ErrorHandler#fatalError(SAXParseException exception)}.
      *     See {@link #setErrorHandler(ErrorHandler errorHandler)}.
diff --git a/jaxp/src/javax/xml/validation/ValidatorHandler.java b/jaxp/src/javax/xml/validation/ValidatorHandler.java
index 2aa2cc1..ddf1468 100644
--- a/jaxp/src/javax/xml/validation/ValidatorHandler.java
+++ b/jaxp/src/javax/xml/validation/ValidatorHandler.java
@@ -379,7 +379,7 @@
      * <ul>
      *   <li>
      *     <code>true</code>: the implementation will limit XML processing to conform to implementation limits.
-     *     Examples include enity expansion limits and XML Schema constructs that would consume large amounts of resources.
+     *     Examples include entity expansion limits and XML Schema constructs that would consume large amounts of resources.
      *     If XML processing is limited for security reasons, it will be reported via a call to the registered
      *    {@link ErrorHandler#fatalError(SAXParseException exception)}.
      *     See {@link #setErrorHandler(ErrorHandler errorHandler)}.
diff --git a/jaxws/.hgtags b/jaxws/.hgtags
index ce037a8..a2cf881 100644
--- a/jaxws/.hgtags
+++ b/jaxws/.hgtags
@@ -263,3 +263,4 @@
 e9780330017a6b464a385356d77e5136f9de8d09 jdk9-b15
 1e1a3b2215b7551d88e89d1ca8c1e1ebe3d3c0ab jdk9-b16
 6b159e727dac283f424b7d19f5be3ddd9f85acf5 jdk9-b17
+275f2385aed80c84297840638d58656366350c58 jdk9-b18
diff --git a/jdk/.hgtags b/jdk/.hgtags
index 5a5e167..6f8633b 100644
--- a/jdk/.hgtags
+++ b/jdk/.hgtags
@@ -260,3 +260,4 @@
 4537360f09fe23ab339ee588747b657feb12d0c8 jdk9-b15
 ab7d2c565b0de5bee1361d282d4029371327fc9e jdk9-b16
 fd8e675f141b9bdb2f46d1ae8251f4ee3a895d64 jdk9-b17
+6ad17b31f0d30593392b1e8695b9709dbbd7fb70 jdk9-b18
diff --git a/jdk/src/aix/native/java/net/aix_close.c b/jdk/src/aix/native/java/net/aix_close.c
index 148e05d..0165c9a 100644
--- a/jdk/src/aix/native/java/net/aix_close.c
+++ b/jdk/src/aix/native/java/net/aix_close.c
@@ -370,7 +370,57 @@
 }
 
 int NET_Connect(int s, struct sockaddr *addr, int addrlen) {
-    BLOCKING_IO_RETURN_INT( s, connect(s, addr, addrlen) );
+    int crc = -1, prc = -1;
+    threadEntry_t self;
+    fdEntry_t* fdEntry = getFdEntry(s);
+
+    if (fdEntry == NULL) {
+        errno = EBADF;
+        return -1;
+    }
+
+    /* On AIX, when the system call connect() is interrupted, the connection
+     * is not aborted and it will be established asynchronously by the kernel.
+     * Hence, no need to restart connect() when EINTR is received
+     */
+    startOp(fdEntry, &self);
+    crc = connect(s, addr, addrlen);
+    endOp(fdEntry, &self);
+
+    if (crc == -1 && errno == EINTR) {
+        struct pollfd s_pollfd;
+        int sockopt_arg = 0;
+        socklen_t len;
+
+        s_pollfd.fd = s;
+        s_pollfd.events = POLLOUT | POLLERR;
+
+        /* poll the file descriptor */
+        do {
+            startOp(fdEntry, &self);
+            prc = poll(&s_pollfd, 1, -1);
+            endOp(fdEntry, &self);
+        } while (prc == -1  && errno == EINTR);
+
+        if (prc < 0)
+            return prc;
+
+        len = sizeof(sockopt_arg);
+
+        /* Check whether the connection has been established */
+        if (getsockopt(s, SOL_SOCKET, SO_ERROR, &sockopt_arg, &len) == -1)
+            return -1;
+
+        if (sockopt_arg != 0 ) {
+            errno = sockopt_arg;
+            return -1;
+        }
+    } else {
+        return crc;
+    }
+
+    /* At this point, fd is connected. Set successful return code */
+    return 0;
 }
 
 int NET_Poll(struct pollfd *ufds, unsigned int nfds, int timeout) {
diff --git a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
index 2bb5d4a..e854dd2 100644
--- a/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
+++ b/jdk/src/macosx/classes/sun/lwawt/macosx/LWCToolkit.java
@@ -523,7 +523,7 @@
      *                 that is used for menu shortcuts on this toolkit.
      * @see       java.awt.MenuBar
      * @see       java.awt.MenuShortcut
-     * @since     JDK1.1
+     * @since     1.1
      */
     @Override
     public int getMenuShortcutKeyMask() {
diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java b/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java
index aeb6b77..fd17dea 100644
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/ConstantPool.java
@@ -839,7 +839,7 @@
         return parts;
     }
 
-    /** @since JDK 7, JSR 292 */
+    /** @since 1.7, JSR 292 */
     public static
     class MethodHandleEntry extends Entry {
         final int refKind;
@@ -889,7 +889,7 @@
         }
     }
 
-    /** @since JDK 7, JSR 292 */
+    /** @since 1.7, JSR 292 */
     public static
     class MethodTypeEntry extends Entry {
         final SignatureEntry typeRef;
@@ -924,7 +924,7 @@
         }
     }
 
-    /** @since JDK 7, JSR 292 */
+    /** @since 1.7, JSR 292 */
     public static
     class InvokeDynamicEntry extends Entry {
         final BootstrapMethodEntry bssRef;
@@ -977,7 +977,7 @@
         }
     }
 
-    /** @since JDK 7, JSR 292 */
+    /** @since 1.7, JSR 292 */
     public static
     class BootstrapMethodEntry extends Entry {
         final MethodHandleEntry bsmRef;
diff --git a/jdk/src/share/classes/com/sun/java/util/jar/pack/package.html b/jdk/src/share/classes/com/sun/java/util/jar/pack/package.html
index 8090946..5fb74f6 100644
--- a/jdk/src/share/classes/com/sun/java/util/jar/pack/package.html
+++ b/jdk/src/share/classes/com/sun/java/util/jar/pack/package.html
@@ -97,7 +97,7 @@
 </ul>
 
 <li>
-@since JDK1.5.0</li>
+@since 1.5</li>
 
 <br><!-- Put @see and @since tags down here. -->
 </body>
diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java
index 076b49c..d713166 100644
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/Introspector.java
@@ -562,7 +562,7 @@
                 }
                 if (readMethod != null) {
                     ReflectUtil.checkPackageAccess(readMethod.getDeclaringClass());
-                    return MethodUtil.invoke(readMethod, complex, new Class[0]);
+                    return MethodUtil.invoke(readMethod, complex, new Class<?>[0]);
                 }
 
                 throw new AttributeNotFoundException(
diff --git a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
index 2fd2d52..3874004 100644
--- a/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
+++ b/jdk/src/share/classes/com/sun/jmx/mbeanserver/MBeanInstantiator.java
@@ -757,7 +757,7 @@
         }
     }
 
-    private static void ensureClassAccess(Class clazz)
+    private static void ensureClassAccess(Class<?> clazz)
             throws IllegalAccessException
     {
         int mod = clazz.getModifiers();
diff --git a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
index 68379a7..e5245fe 100644
--- a/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
+++ b/jdk/src/share/classes/com/sun/jmx/remote/internal/ClientNotifForwarder.java
@@ -58,7 +58,7 @@
 
     private final AccessControlContext acc;
 
-    public ClientNotifForwarder(Map env) {
+    public ClientNotifForwarder(Map<String, ?> env) {
         this(null, env);
     }
 
diff --git a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
index 59a183b..e1ef8f2 100644
--- a/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
+++ b/jdk/src/share/classes/com/sun/jmx/remote/security/MBeanServerFileAccessController.java
@@ -310,10 +310,10 @@
                     }
                 });
         if (s == null) return; /* security has not been enabled */
-        final Set principals = s.getPrincipals();
+        final Set<Principal> principals = s.getPrincipals();
         String newPropertyValue = null;
-        for (Iterator i = principals.iterator(); i.hasNext(); ) {
-            final Principal p = (Principal) i.next();
+        for (Iterator<Principal> i = principals.iterator(); i.hasNext(); ) {
+            final Principal p = i.next();
             Access access = accessMap.get(p.getName());
             if (access != null) {
                 boolean ok;
diff --git a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java
index 77e2ffc..cd3be30 100644
--- a/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java
+++ b/jdk/src/share/classes/com/sun/jmx/snmp/agent/SnmpRequestTree.java
@@ -535,7 +535,7 @@
 
                 // Save old vectors
                 SnmpOid[]     olde = entryoids;
-                Vector[]      oldl = entrylists;
+                Vector<SnmpVarBind>[]      oldl = entrylists;
                 boolean[]     oldn = isentrynew;
                 SnmpVarBind[] oldr = rowstatus;
 
diff --git a/jdk/src/share/classes/com/sun/management/DiagnosticCommandMBean.java b/jdk/src/share/classes/com/sun/management/DiagnosticCommandMBean.java
index da2d510..93f741e 100644
--- a/jdk/src/share/classes/com/sun/management/DiagnosticCommandMBean.java
+++ b/jdk/src/share/classes/com/sun/management/DiagnosticCommandMBean.java
@@ -212,7 +212,7 @@
  * {@linkplain javax.management.Notification#getUserData() userData} that
  * is the new {@code MBeanInfo}.
  *
- * @since 8
+ * @since 1.8
  */
 public interface DiagnosticCommandMBean extends DynamicMBean
 {
diff --git a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
index 2d7cc6bf..eee6d43 100644
--- a/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
+++ b/jdk/src/share/classes/com/sun/rowset/CachedRowSetImpl.java
@@ -7697,7 +7697,7 @@
      * @param columnIndex the first column is 1, the second is 2, ...
      * @return a SQLXML object that maps an SQL XML value
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public SQLXML getSQLXML(int columnIndex) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7723,7 +7723,7 @@
      * @return the column value if the value is a SQL <code>NULL</code> the
      *     value returned is <code>null</code>
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public RowId getRowId(int columnIndex) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7738,7 +7738,7 @@
      * @return the column value if the value is a SQL <code>NULL</code> the
      *     value returned is <code>null</code>
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public RowId getRowId(String columnName) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7754,7 +7754,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param x the column value
      * @throws SQLException if a database access occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateRowId(int columnIndex, RowId x) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7770,7 +7770,7 @@
      * @param columnName the name of the column
      * @param x the column value
      * @throws SQLException if a database access occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateRowId(String columnName, RowId x) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7780,7 +7780,7 @@
      * Retrieves the holdability of this ResultSet object
      * @return  either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
      * @throws SQLException if a database error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public int getHoldability() throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7791,7 +7791,7 @@
      * method close has been called on it, or if it is automatically closed.
      * @return true if this ResultSet object is closed; false if it is still open
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public boolean isClosed() throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7803,7 +7803,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param nString the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNString(int columnIndex, String nString) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7815,7 +7815,7 @@
      * @param columnName name of the Column
      * @param nString the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNString(String columnName, String nString) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7828,7 +7828,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param nClob the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7840,7 +7840,7 @@
      * @param columnName name of the column
      * @param nClob the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNClob(String columnName, NClob nClob) throws SQLException {
        throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7855,7 +7855,7 @@
      * @return a <code>NClob</code> object representing the SQL
      *         <code>NCLOB</code> value in the specified column
      * @exception SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public NClob getNClob(int i) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
@@ -7871,7 +7871,7 @@
      * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
      * value in the specified column
      * @exception SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public NClob getNClob(String colName) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("cachedrowsetimpl.opnotysupp").toString());
diff --git a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java
index a765fbf..890baf6 100644
--- a/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java
+++ b/jdk/src/share/classes/com/sun/rowset/JdbcRowSetImpl.java
@@ -4505,7 +4505,7 @@
      * @param columnIndex the first column is 1, the second is 2, ...
      * @return a SQLXML object that maps an SQL XML value
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public SQLXML getSQLXML(int columnIndex) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4531,7 +4531,7 @@
      * @return the column value if the value is a SQL <code>NULL</code> the
      *     value returned is <code>null</code>
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public RowId getRowId(int columnIndex) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4546,7 +4546,7 @@
      * @return the column value if the value is a SQL <code>NULL</code> the
      *     value returned is <code>null</code>
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public RowId getRowId(String columnName) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4562,7 +4562,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param x the column value
      * @throws SQLException if a database access occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateRowId(int columnIndex, RowId x) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4578,7 +4578,7 @@
      * @param columnName the name of the column
      * @param x the column value
      * @throws SQLException if a database access occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateRowId(String columnName, RowId x) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4588,7 +4588,7 @@
      * Retrieves the holdability of this ResultSet object
      * @return  either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
      * @throws SQLException if a database error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public int getHoldability() throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4599,7 +4599,7 @@
      * method close has been called on it, or if it is automatically closed.
      * @return true if this ResultSet object is closed; false if it is still open
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public boolean isClosed() throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4611,7 +4611,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param nString the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNString(int columnIndex, String nString) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4623,7 +4623,7 @@
      * @param columnName name of the Column
      * @param nString the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNString(String columnName, String nString) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4636,7 +4636,7 @@
      * @param columnIndex the first column is 1, the second 2, ...
      * @param nClob the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNClob(int columnIndex, NClob nClob) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4648,7 +4648,7 @@
      * @param columnName name of the column
      * @param nClob the value for the column to be updated
      * @throws SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public void updateNClob(String columnName, NClob nClob) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4663,7 +4663,7 @@
      * @return a <code>NClob</code> object representing the SQL
      *         <code>NCLOB</code> value in the specified column
      * @exception SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public NClob getNClob(int i) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
@@ -4679,7 +4679,7 @@
      * @return a <code>NClob</code> object representing the SQL <code>NCLOB</code>
      * value in the specified column
      * @exception SQLException if a database access error occurs
-     * @since 6.0
+     * @since 1.6
      */
     public NClob getNClob(String colName) throws SQLException {
         throw new SQLFeatureNotSupportedException(resBundle.handleGetObject("jdbcrowsetimpl.featnotsupp").toString());
diff --git a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java
index 642f551..e735c2c 100644
--- a/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java
+++ b/jdk/src/share/classes/com/sun/tools/attach/VirtualMachine.java
@@ -76,16 +76,10 @@
  *      // attach to target VM
  *      VirtualMachine vm = VirtualMachine.attach("2177");
  *
- *      // get system properties in target VM
- *      Properties props = vm.getSystemProperties();
- *
- *      // construct path to management agent
- *      String home = props.getProperty("java.home");
- *      String agent = home + File.separator + "lib" + File.separator
- *          + "management-agent.jar";
- *
- *      // load agent into target VM
- *      vm.loadAgent(agent, "com.sun.management.jmxremote.port=5000");
+ *      // start management agent
+ *      Properties props = new Properties();
+ *      props.put("com.sun.management.jmxremote.port", "5000");
+ *      vm.startManagementAgent(props);
  *
  *      // detach
  *      vm.detach();
@@ -93,9 +87,9 @@
  * </pre>
  *
  * <p> In this example we attach to a Java virtual machine that is identified by
- * the process identifier <code>2177</code>. The system properties from the target
- * VM are then used to construct the path to a <i>management agent</i> which is then
- * loaded into the target VM. Once loaded the client detaches from the target VM. </p>
+ * the process identifier <code>2177</code>. Then the JMX management agent is
+ * started in the target process using the supplied arguments. Finally, the
+ * client detaches from the target VM. </p>
  *
  * <p> A VirtualMachine is safe for use by multiple concurrent threads. </p>
  *
@@ -611,6 +605,68 @@
     public abstract Properties getAgentProperties() throws IOException;
 
     /**
+     * Starts the JMX management agent in the target virtual machine.
+     *
+     * <p> The configuration properties are the same as those specified on
+     * the command line when starting the JMX management agent. In the same
+     * way as on the command line, you need to specify at least the
+     * {@code com.sun.management.jmxremote.port} property.
+     *
+     * <p> See the online documentation for <a
+     * href="../../../../../../../../technotes/guides/management/agent.html">
+     * Monitoring and Management Using JMX Technology</a> for further details.
+     *
+     * @param   agentProperties
+     *          A Properties object containing the configuration properties
+     *          for the agent.
+     *
+     * @throws  AttachOperationFailedException
+     *          If the target virtual machine is unable to complete the
+     *          attach operation. A more specific error message will be
+     *          given by {@link AttachOperationFailedException#getMessage()}.
+     *
+     * @throws  IOException
+     *          If an I/O error occurs, a communication error for example,
+     *          that cannot be identified as an error to indicate that the
+     *          operation failed in the target VM.
+     *
+     * @throws  IllegalArgumentException
+     *          If keys or values in agentProperties are invalid.
+     *
+     * @throws  NullPointerException
+     *          If agentProperties is null.
+     *
+     * @since   1.9
+     */
+    public abstract void startManagementAgent(Properties agentProperties) throws IOException;
+
+    /**
+     * Starts the local JMX management agent in the target virtual machine.
+     *
+     * <p> See the online documentation for <a
+     * href="../../../../../../../../technotes/guides/management/agent.html">
+     * Monitoring and Management Using JMX Technology</a> for further details.
+     *
+     * @return  The String representation of the local connector's service address.
+     *          The value can be parsed by the
+     *          {@link javax.management.remote.JMXServiceURL#JMXServiceURL(String)}
+     *          constructor.
+     *
+     * @throws  AttachOperationFailedException
+     *          If the target virtual machine is unable to complete the
+     *          attach operation. A more specific error message will be
+     *          given by {@link AttachOperationFailedException#getMessage()}.
+     *
+     * @throws  IOException
+     *          If an I/O error occurs, a communication error for example,
+     *          that cannot be identified as an error to indicate that the
+     *          operation failed in the target VM.
+     *
+     * @since   1.9
+     */
+    public abstract String startLocalManagementAgent() throws IOException;
+
+    /**
      * Returns a hash-code value for this VirtualMachine. The hash
      * code is based upon the VirtualMachine's components, and satifies
      * the general contract of the {@link java.lang.Object#hashCode()
diff --git a/jdk/src/share/classes/java/applet/Applet.java b/jdk/src/share/classes/java/applet/Applet.java
index 9dccb7c..9fb8551 100644
--- a/jdk/src/share/classes/java/applet/Applet.java
+++ b/jdk/src/share/classes/java/applet/Applet.java
@@ -45,7 +45,7 @@
  *
  * @author      Arthur van Hoff
  * @author      Chris Warth
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Applet extends Panel {
 
@@ -375,7 +375,7 @@
      *
      * @return  the locale of the applet; if no locale has
      *          been set, the default locale is returned.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public Locale getLocale() {
       Locale locale = super.getLocale();
diff --git a/jdk/src/share/classes/java/applet/AppletContext.java b/jdk/src/share/classes/java/applet/AppletContext.java
index 47fec71..d14fd15 100644
--- a/jdk/src/share/classes/java/applet/AppletContext.java
+++ b/jdk/src/share/classes/java/applet/AppletContext.java
@@ -43,7 +43,7 @@
  * information about its environment.
  *
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public interface AppletContext {
     /**
diff --git a/jdk/src/share/classes/java/applet/AppletStub.java b/jdk/src/share/classes/java/applet/AppletStub.java
index 07e4d89..621068f 100644
--- a/jdk/src/share/classes/java/applet/AppletStub.java
+++ b/jdk/src/share/classes/java/applet/AppletStub.java
@@ -35,7 +35,7 @@
  *
  * @author      Arthur van Hoff
  * @see         java.applet.Applet#setStub(java.applet.AppletStub)
- * @since       JDK1.0
+ * @since       1.0
  */
 public interface AppletStub {
     /**
diff --git a/jdk/src/share/classes/java/applet/AudioClip.java b/jdk/src/share/classes/java/applet/AudioClip.java
index da90a0c..8356e49 100644
--- a/jdk/src/share/classes/java/applet/AudioClip.java
+++ b/jdk/src/share/classes/java/applet/AudioClip.java
@@ -32,7 +32,7 @@
  * together to produce a composite.
  *
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public interface AudioClip {
     /**
diff --git a/jdk/src/share/classes/java/applet/package.html b/jdk/src/share/classes/java/applet/package.html
index 18c9628..3315f29 100644
--- a/jdk/src/share/classes/java/applet/package.html
+++ b/jdk/src/share/classes/java/applet/package.html
@@ -55,6 +55,6 @@
 </ul>
 -->
 
-@since JDK1.0
+@since 1.0
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/awt/AWTError.java b/jdk/src/share/classes/java/awt/AWTError.java
index 9885c31..1110a64 100644
--- a/jdk/src/share/classes/java/awt/AWTError.java
+++ b/jdk/src/share/classes/java/awt/AWTError.java
@@ -41,7 +41,7 @@
      * Constructs an instance of <code>AWTError</code> with the specified
      * detail message.
      * @param   msg   the detail message.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public AWTError(String msg) {
         super(msg);
diff --git a/jdk/src/share/classes/java/awt/AWTException.java b/jdk/src/share/classes/java/awt/AWTException.java
index 3c03635..0ffe52c 100644
--- a/jdk/src/share/classes/java/awt/AWTException.java
+++ b/jdk/src/share/classes/java/awt/AWTException.java
@@ -43,7 +43,7 @@
      * instance of <code>String</code> that describes this particular
      * exception.
      * @param   msg     the detail message
-     * @since   JDK1.0
+     * @since   1.0
      */
     public AWTException(String msg) {
         super(msg);
diff --git a/jdk/src/share/classes/java/awt/BorderLayout.java b/jdk/src/share/classes/java/awt/BorderLayout.java
index c86fd51..b2f7e25 100644
--- a/jdk/src/share/classes/java/awt/BorderLayout.java
+++ b/jdk/src/share/classes/java/awt/BorderLayout.java
@@ -119,7 +119,7 @@
  * @author      Arthur van Hoff
  * @see         java.awt.Container#add(String, Component)
  * @see         java.awt.ComponentOrientation
- * @since       JDK1.0
+ * @since       1.0
  */
 public class BorderLayout implements LayoutManager2,
                                      java.io.Serializable {
@@ -367,7 +367,7 @@
 
     /**
      * Returns the horizontal gap between components.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public int getHgap() {
         return hgap;
@@ -376,7 +376,7 @@
     /**
      * Sets the horizontal gap between components.
      * @param hgap the horizontal gap between components
-     * @since   JDK1.1
+     * @since   1.1
      */
     public void setHgap(int hgap) {
         this.hgap = hgap;
@@ -384,7 +384,7 @@
 
     /**
      * Returns the vertical gap between components.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public int getVgap() {
         return vgap;
@@ -393,7 +393,7 @@
     /**
      * Sets the vertical gap between components.
      * @param vgap the vertical gap between components
-     * @since   JDK1.1
+     * @since   1.1
      */
     public void setVgap(int vgap) {
         this.vgap = vgap;
@@ -415,7 +415,7 @@
      * @see     java.awt.Container#add(java.awt.Component, java.lang.Object)
      * @exception   IllegalArgumentException  if the constraint object is not
      *              a string, or if it not one of the five specified constants.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public void addLayoutComponent(Component comp, Object constraints) {
       synchronized (comp.getTreeLock()) {
diff --git a/jdk/src/share/classes/java/awt/Button.java b/jdk/src/share/classes/java/awt/Button.java
index d002590..08e569d 100644
--- a/jdk/src/share/classes/java/awt/Button.java
+++ b/jdk/src/share/classes/java/awt/Button.java
@@ -82,7 +82,7 @@
  * @see         java.awt.event.ActionListener
  * @see         java.awt.Component#processMouseEvent
  * @see         java.awt.Component#addMouseListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Button extends Component implements Accessible {
 
@@ -228,7 +228,7 @@
      *            If the string is <code>null</code> then the action command
      *            is set to match the label of the button.
      * @see       java.awt.event.ActionEvent
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setActionCommand(String command) {
         actionCommand = command;
@@ -255,7 +255,7 @@
      * @see           #removeActionListener
      * @see           #getActionListeners
      * @see           java.awt.event.ActionListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addActionListener(ActionListener l) {
         if (l == null) {
@@ -277,7 +277,7 @@
      * @see             #addActionListener
      * @see             #getActionListeners
      * @see             java.awt.event.ActionListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeActionListener(ActionListener l) {
         if (l == null) {
@@ -370,7 +370,7 @@
      * @param        e the event
      * @see          java.awt.event.ActionEvent
      * @see          java.awt.Button#processActionEvent
-     * @since        JDK1.1
+     * @since        1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ActionEvent) {
@@ -401,7 +401,7 @@
      * @see         java.awt.event.ActionListener
      * @see         java.awt.Button#addActionListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processActionEvent(ActionEvent e) {
         ActionListener listener = actionListener;
diff --git a/jdk/src/share/classes/java/awt/Canvas.java b/jdk/src/share/classes/java/awt/Canvas.java
index 5cc819a..423a429 100644
--- a/jdk/src/share/classes/java/awt/Canvas.java
+++ b/jdk/src/share/classes/java/awt/Canvas.java
@@ -39,7 +39,7 @@
  * in order to perform custom graphics on the canvas.
  *
  * @author      Sami Shaio
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Canvas extends Component implements Accessible {
 
diff --git a/jdk/src/share/classes/java/awt/CardLayout.java b/jdk/src/share/classes/java/awt/CardLayout.java
index 5e813ff..12e4462 100644
--- a/jdk/src/share/classes/java/awt/CardLayout.java
+++ b/jdk/src/share/classes/java/awt/CardLayout.java
@@ -53,7 +53,7 @@
  *
  * @author      Arthur van Hoff
  * @see         java.awt.Container
- * @since       JDK1.0
+ * @since       1.0
  */
 
 public class CardLayout implements LayoutManager2,
@@ -148,7 +148,7 @@
      * @return    the horizontal gap between components.
      * @see       java.awt.CardLayout#setHgap(int)
      * @see       java.awt.CardLayout#getVgap()
-     * @since     JDK1.1
+     * @since     1.1
      */
     public int getHgap() {
         return hgap;
@@ -159,7 +159,7 @@
      * @param hgap the horizontal gap between components.
      * @see       java.awt.CardLayout#getHgap()
      * @see       java.awt.CardLayout#setVgap(int)
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setHgap(int hgap) {
         this.hgap = hgap;
@@ -180,7 +180,7 @@
      * @param     vgap the vertical gap between components.
      * @see       java.awt.CardLayout#getVgap()
      * @see       java.awt.CardLayout#setHgap(int)
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setVgap(int vgap) {
         this.vgap = vgap;
diff --git a/jdk/src/share/classes/java/awt/Checkbox.java b/jdk/src/share/classes/java/awt/Checkbox.java
index bf3d337..8e8b5dd 100644
--- a/jdk/src/share/classes/java/awt/Checkbox.java
+++ b/jdk/src/share/classes/java/awt/Checkbox.java
@@ -71,7 +71,7 @@
  * @author      Sami Shaio
  * @see         java.awt.GridLayout
  * @see         java.awt.CheckboxGroup
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Checkbox extends Component implements ItemSelectable, Accessible {
 
@@ -190,7 +190,7 @@
      *     <code>GraphicsEnvironment.isHeadless</code>
      *     returns <code>true</code>
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Checkbox(String label, boolean state, CheckboxGroup group)
         throws HeadlessException {
@@ -216,7 +216,7 @@
      *    <code>GraphicsEnvironment.isHeadless</code>
      *    returns <code>true</code>
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Checkbox(String label, CheckboxGroup group, boolean state)
         throws HeadlessException {
@@ -424,7 +424,7 @@
      * @see           #setState
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addItemListener(ItemListener l) {
         if (l == null) {
@@ -446,7 +446,7 @@
      * @see           #getItemListeners
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void removeItemListener(ItemListener l) {
         if (l == null) {
@@ -540,7 +540,7 @@
      * @param         e the event
      * @see           java.awt.event.ItemEvent
      * @see           #processItemEvent
-     * @since         JDK1.1
+     * @since         1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ItemEvent) {
@@ -572,7 +572,7 @@
      * @see         java.awt.event.ItemListener
      * @see         #addItemListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processItemEvent(ItemEvent e) {
         ItemListener listener = itemListener;
diff --git a/jdk/src/share/classes/java/awt/CheckboxGroup.java b/jdk/src/share/classes/java/awt/CheckboxGroup.java
index 53a8bb5..a34c337 100644
--- a/jdk/src/share/classes/java/awt/CheckboxGroup.java
+++ b/jdk/src/share/classes/java/awt/CheckboxGroup.java
@@ -52,7 +52,7 @@
  *
  * @author      Sami Shaio
  * @see         java.awt.Checkbox
- * @since       JDK1.0
+ * @since       1.0
  */
 public class CheckboxGroup implements java.io.Serializable {
     /**
@@ -84,7 +84,7 @@
      *                 "on" state, or <code>null</code>.
      * @see      java.awt.Checkbox
      * @see      java.awt.CheckboxGroup#setSelectedCheckbox
-     * @since    JDK1.1
+     * @since    1.1
      */
     public Checkbox getSelectedCheckbox() {
         return getCurrent();
@@ -113,7 +113,7 @@
      *                      current selection.
      * @see      java.awt.Checkbox
      * @see      java.awt.CheckboxGroup#getSelectedCheckbox
-     * @since    JDK1.1
+     * @since    1.1
      */
     public void setSelectedCheckbox(Checkbox box) {
         setCurrent(box);
diff --git a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
index 9278524..7ca0323 100644
--- a/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
+++ b/jdk/src/share/classes/java/awt/CheckboxMenuItem.java
@@ -59,7 +59,7 @@
  * @author      Sami Shaio
  * @see         java.awt.event.ItemEvent
  * @see         java.awt.event.ItemListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class CheckboxMenuItem extends MenuItem implements ItemSelectable, Accessible {
 
@@ -102,7 +102,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since   JDK1.1
+     * @since   1.1
      */
     public CheckboxMenuItem() throws HeadlessException {
         this("", false);
@@ -132,7 +132,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since      JDK1.1
+     * @since      1.1
      */
     public CheckboxMenuItem(String label, boolean state)
         throws HeadlessException {
@@ -231,7 +231,7 @@
      * @see           #setState
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addItemListener(ItemListener l) {
         if (l == null) {
@@ -253,7 +253,7 @@
      * @see           #getItemListeners
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void removeItemListener(ItemListener l) {
         if (l == null) {
@@ -350,7 +350,7 @@
      * @param        e the event
      * @see          java.awt.event.ItemEvent
      * @see          #processItemEvent
-     * @since        JDK1.1
+     * @since        1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ItemEvent) {
@@ -381,7 +381,7 @@
      * @see         java.awt.event.ItemListener
      * @see         #addItemListener
      * @see         java.awt.MenuItem#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processItemEvent(ItemEvent e) {
         ItemListener listener = itemListener;
diff --git a/jdk/src/share/classes/java/awt/Choice.java b/jdk/src/share/classes/java/awt/Choice.java
index 8cd6bdb..1d79dc7 100644
--- a/jdk/src/share/classes/java/awt/Choice.java
+++ b/jdk/src/share/classes/java/awt/Choice.java
@@ -68,7 +68,7 @@
  *
  * @author      Sami Shaio
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Choice extends Component implements ItemSelectable, Accessible {
     /**
@@ -158,7 +158,7 @@
      * Returns the number of items in this <code>Choice</code> menu.
      * @return the number of items in this <code>Choice</code> menu
      * @see     #getItem
-     * @since   JDK1.1
+     * @since   1.1
      */
     public int getItemCount() {
         return countItems();
@@ -196,7 +196,7 @@
      * @param      item    the item to be added
      * @exception  NullPointerException   if the item's value is
      *                  <code>null</code>
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void add(String item) {
         addItem(item);
@@ -291,7 +291,7 @@
      * @param      item  the item to remove from this <code>Choice</code> menu
      * @exception  IllegalArgumentException  if the item doesn't
      *                     exist in the choice menu
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void remove(String item) {
         synchronized (this) {
@@ -319,7 +319,7 @@
      * @param      position the position of the item
      * @throws IndexOutOfBoundsException if the specified
      *          position is out of bounds
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void remove(int position) {
         synchronized (this) {
@@ -357,7 +357,7 @@
     /**
      * Removes all items from the choice menu.
      * @see       #remove
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void removeAll() {
         synchronized (this) {
@@ -475,7 +475,7 @@
      * @see           #select
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addItemListener(ItemListener l) {
         if (l == null) {
@@ -497,7 +497,7 @@
      * @see           #getItemListeners
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void removeItemListener(ItemListener l) {
         if (l == null) {
@@ -591,7 +591,7 @@
      * @param      e the event
      * @see        java.awt.event.ItemEvent
      * @see        #processItemEvent
-     * @since      JDK1.1
+     * @since      1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ItemEvent) {
@@ -623,7 +623,7 @@
      * @see         java.awt.event.ItemListener
      * @see         #addItemListener(ItemListener)
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processItemEvent(ItemEvent e) {
         ItemListener listener = itemListener;
diff --git a/jdk/src/share/classes/java/awt/Color.java b/jdk/src/share/classes/java/awt/Color.java
index ac460d3..e80e991 100644
--- a/jdk/src/share/classes/java/awt/Color.java
+++ b/jdk/src/share/classes/java/awt/Color.java
@@ -597,7 +597,7 @@
      * @see #getRed
      * @see #getGreen
      * @see #getBlue
-     * @since JDK1.0
+     * @since 1.0
      */
     public int getRGB() {
         return value;
@@ -621,7 +621,7 @@
      *                 a brighter version of this <code>Color</code>
      *                 with the same {@code alpha} value.
      * @see        java.awt.Color#darker
-     * @since      JDK1.0
+     * @since      1.0
      */
     public Color brighter() {
         int r = getRed();
@@ -664,7 +664,7 @@
      *                    a darker version of this <code>Color</code>
      *                    with the same {@code alpha} value.
      * @see        java.awt.Color#brighter
-     * @since      JDK1.0
+     * @since      1.0
      */
     public Color darker() {
         return new Color(Math.max((int)(getRed()  *FACTOR), 0),
@@ -676,7 +676,7 @@
     /**
      * Computes the hash code for this <code>Color</code>.
      * @return     a hash code value for this object.
-     * @since      JDK1.0
+     * @since      1.0
      */
     public int hashCode() {
         return value;
@@ -693,7 +693,7 @@
      *                          <code>Color</code>
      * @return      <code>true</code> if the objects are the same;
      *                             <code>false</code> otherwise.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public boolean equals(Object obj) {
         return obj instanceof Color && ((Color)obj).getRGB() == this.getRGB();
@@ -723,7 +723,7 @@
      * @exception  NumberFormatException  if the specified string cannot
      *                      be interpreted as a decimal,
      *                      octal, or hexadecimal integer.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public static Color decode(String nm) throws NumberFormatException {
         Integer intval = Integer.decode(nm);
@@ -747,7 +747,7 @@
      * @see      java.lang.System#getProperty(java.lang.String)
      * @see      java.lang.Integer#getInteger(java.lang.String)
      * @see      java.awt.Color#Color(int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public static Color getColor(String nm) {
         return getColor(nm, null);
@@ -771,7 +771,7 @@
      * @see      java.lang.System#getProperty(java.lang.String)
      * @see      java.lang.Integer#getInteger(java.lang.String)
      * @see      java.awt.Color#Color(int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public static Color getColor(String nm, Color v) {
         Integer intval = Integer.getInteger(nm);
@@ -801,7 +801,7 @@
      * @see      java.lang.System#getProperty(java.lang.String)
      * @see      java.lang.Integer#getInteger(java.lang.String)
      * @see      java.awt.Color#Color(int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public static Color getColor(String nm, int v) {
         Integer intval = Integer.getInteger(nm);
@@ -834,7 +834,7 @@
      * @see       java.awt.Color#getRGB()
      * @see       java.awt.Color#Color(int)
      * @see       java.awt.image.ColorModel#getRGBdefault()
-     * @since     JDK1.0
+     * @since     1.0
      */
     public static int HSBtoRGB(float hue, float saturation, float brightness) {
         int r = 0, g = 0, b = 0;
@@ -902,7 +902,7 @@
      * @see       java.awt.Color#getRGB()
      * @see       java.awt.Color#Color(int)
      * @see       java.awt.image.ColorModel#getRGBdefault()
-     * @since     JDK1.0
+     * @since     1.0
      */
     public static float[] RGBtoHSB(int r, int g, int b, float[] hsbvals) {
         float hue, saturation, brightness;
@@ -957,7 +957,7 @@
      * @param  b   the brightness of the color
      * @return  a <code>Color</code> object with the specified hue,
      *                                 saturation, and brightness.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public static Color getHSBColor(float h, float s, float b) {
         return new Color(HSBtoRGB(h, s, b));
diff --git a/jdk/src/share/classes/java/awt/Component.java b/jdk/src/share/classes/java/awt/Component.java
index cd6ae69..e5659d7 100644
--- a/jdk/src/share/classes/java/awt/Component.java
+++ b/jdk/src/share/classes/java/awt/Component.java
@@ -1018,7 +1018,7 @@
      * Gets the name of the component.
      * @return this component's name
      * @see    #setName
-     * @since JDK1.1
+     * @since 1.1
      */
     public String getName() {
         if (name == null && !nameExplicitlySet) {
@@ -1035,7 +1035,7 @@
      * @param name  the string that is to be this
      *           component's name
      * @see #getName
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setName(String name) {
         String oldName;
@@ -1050,7 +1050,7 @@
     /**
      * Gets the parent of this component.
      * @return the parent container of this component
-     * @since JDK1.0
+     * @since 1.0
      */
     public Container getParent() {
         return getParent_NoClientCode();
@@ -1221,7 +1221,7 @@
      * toolkit is used by that component. Therefore if the component
      * is moved from one frame to another, the toolkit it uses may change.
      * @return  the toolkit of this component
-     * @since JDK1.0
+     * @since 1.0
      */
     public Toolkit getToolkit() {
         return getToolkitImpl();
@@ -1250,7 +1250,7 @@
      * otherwise
      * @see #validate
      * @see #invalidate
-     * @since JDK1.0
+     * @since 1.0
      */
     public boolean isValid() {
         return (peer != null) && valid;
@@ -1292,7 +1292,7 @@
      * @return <code>true</code> if the component is visible,
      * <code>false</code> otherwise
      * @see #setVisible
-     * @since JDK1.0
+     * @since 1.0
      */
     @Transient
     public boolean isVisible() {
@@ -1419,7 +1419,7 @@
      * @return <code>true</code> if the component is showing,
      *          <code>false</code> otherwise
      * @see #setVisible
-     * @since JDK1.0
+     * @since 1.0
      */
     public boolean isShowing() {
         if (visible && (peer != null)) {
@@ -1437,7 +1437,7 @@
      * @return <code>true</code> if the component is enabled,
      *          <code>false</code> otherwise
      * @see #setEnabled
-     * @since JDK1.0
+     * @since 1.0
      */
     public boolean isEnabled() {
         return isEnabledImpl();
@@ -1466,7 +1466,7 @@
      *            enabled; otherwise this component is disabled
      * @see #isEnabled
      * @see #isLightweight
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setEnabled(boolean b) {
         enable(b);
@@ -1611,7 +1611,7 @@
      * otherwise, hides this component
      * @see #isVisible
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setVisible(boolean b) {
         show(b);
@@ -1739,7 +1739,7 @@
      * not have a foreground color, the foreground color of its parent
      * is returned
      * @see #setForeground
-     * @since JDK1.0
+     * @since 1.0
      * @beaninfo
      *       bound: true
      */
@@ -1760,7 +1760,7 @@
      *          then this component will inherit
      *          the foreground color of its parent
      * @see #getForeground
-     * @since JDK1.0
+     * @since 1.0
      */
     public void setForeground(Color c) {
         Color oldColor = foreground;
@@ -1796,7 +1796,7 @@
      *          not have a background color,
      *          the background color of its parent is returned
      * @see #setBackground
-     * @since JDK1.0
+     * @since 1.0
      */
     @Transient
     public Color getBackground() {
@@ -1819,7 +1819,7 @@
      *          if this parameter is <code>null</code>, then this
      *          component will inherit the background color of its parent
      * @see #getBackground
-     * @since JDK1.0
+     * @since 1.0
      * @beaninfo
      *       bound: true
      */
@@ -1856,7 +1856,7 @@
      * @return this component's font; if a font has not been set
      * for this component, the font of its parent is returned
      * @see #setFont
-     * @since JDK1.0
+     * @since 1.0
      */
     @Transient
     public Font getFont() {
@@ -1887,7 +1887,7 @@
      *          component will inherit the font of its parent
      * @see #getFont
      * @see #invalidate
-     * @since JDK1.0
+     * @since 1.0
      * @beaninfo
      *       bound: true
      */
@@ -1940,7 +1940,7 @@
      *          does not have its own locale and has not yet been added to
      *          a containment hierarchy such that the locale can be determined
      *          from the containing parent
-     * @since  JDK1.1
+     * @since  1.1
      */
     public Locale getLocale() {
         Locale locale = this.locale;
@@ -1965,7 +1965,7 @@
      * @param l the locale to become this component's locale
      * @see #getLocale
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setLocale(Locale l) {
         Locale oldValue = locale;
@@ -1986,7 +1986,7 @@
      * @see java.awt.image.ColorModel
      * @see java.awt.peer.ComponentPeer#getColorModel()
      * @see Toolkit#getColorModel()
-     * @since JDK1.0
+     * @since 1.0
      */
     public ColorModel getColorModel() {
         ComponentPeer peer = this.peer;
@@ -2016,7 +2016,7 @@
      *          the coordinate space of the component's parent
      * @see #setLocation
      * @see #getLocationOnScreen
-     * @since JDK1.1
+     * @since 1.1
      */
     public Point getLocation() {
         return location();
@@ -2095,7 +2095,7 @@
      * @see #getLocation
      * @see #setBounds
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setLocation(int x, int y) {
         move(x, y);
@@ -2127,7 +2127,7 @@
      * @see #getLocation
      * @see #setBounds
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setLocation(Point p) {
         setLocation(p.x, p.y);
@@ -2143,7 +2143,7 @@
      * @return a <code>Dimension</code> object that indicates the
      *          size of this component
      * @see #setSize
-     * @since JDK1.1
+     * @since 1.1
      */
     public Dimension getSize() {
         return size();
@@ -2170,7 +2170,7 @@
      * @see #getSize
      * @see #setBounds
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setSize(int width, int height) {
         resize(width, height);
@@ -2201,7 +2201,7 @@
      * @see #setSize
      * @see #setBounds
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setSize(Dimension d) {
         resize(d);
@@ -2258,7 +2258,7 @@
      * @see #setSize(int, int)
      * @see #setSize(Dimension)
      * @see #invalidate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void setBounds(int x, int y, int width, int height) {
         reshape(x, y, width, height);
@@ -2402,7 +2402,7 @@
      * @see       #setSize(int, int)
      * @see       #setSize(Dimension)
      * @see #invalidate
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setBounds(Rectangle r) {
         setBounds(r.x, r.y, r.width, r.height);
@@ -2883,7 +2883,7 @@
      * @see       #doLayout()
      * @see       LayoutManager
      * @see       Container#validate
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void validate() {
         synchronized (getTreeLock()) {
@@ -2926,7 +2926,7 @@
      * @see       #doLayout
      * @see       LayoutManager
      * @see       java.awt.Container#isValidateRoot
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void invalidate() {
         synchronized (getTreeLock()) {
@@ -3021,7 +3021,7 @@
      * @return a graphics context for this component, or <code>null</code>
      *             if it has none
      * @see       #paint
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Graphics getGraphics() {
         if (peer instanceof LightweightPeer) {
@@ -3085,7 +3085,7 @@
      * @see       #getPeer
      * @see       java.awt.peer.ComponentPeer#getFontMetrics(Font)
      * @see       Toolkit#getFontMetrics(Font)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public FontMetrics getFontMetrics(Font font) {
         // This is an unsupported hack, but left in for a customer.
@@ -3125,7 +3125,7 @@
      * @see       #contains
      * @see       Toolkit#createCustomCursor
      * @see       Cursor
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setCursor(Cursor cursor) {
         this.cursor = cursor;
@@ -3158,7 +3158,7 @@
      * If no cursor is set in the entire hierarchy,
      * <code>Cursor.DEFAULT_CURSOR</code> is returned.
      * @see #setCursor
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Cursor getCursor() {
         return getCursor_NoClientCode();
@@ -3212,7 +3212,7 @@
      *
      * @param g the graphics context to use for painting
      * @see       #update
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void paint(Graphics g) {
     }
@@ -3248,7 +3248,7 @@
      * @param g the specified context to use for updating
      * @see       #paint
      * @see       #repaint()
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void update(Graphics g) {
         paint(g);
@@ -3264,7 +3264,7 @@
      *
      * @param     g   the graphics context to use for painting
      * @see       #paint
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void paintAll(Graphics g) {
         if (isShowing()) {
@@ -3308,7 +3308,7 @@
 
      *
      * @see       #update(Graphics)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void repaint() {
         repaint(0, 0, 0, width, height);
@@ -3327,7 +3327,7 @@
      * @param tm maximum time in milliseconds before update
      * @see #paint
      * @see #update(Graphics)
-     * @since JDK1.0
+     * @since 1.0
      */
     public void repaint(long tm) {
         repaint(tm, 0, 0, width, height);
@@ -3351,7 +3351,7 @@
      * @param     width   the width
      * @param     height  the height
      * @see       #update(Graphics)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void repaint(int x, int y, int width, int height) {
         repaint(0, x, y, width, height);
@@ -3377,7 +3377,7 @@
      * @param     width    the width
      * @param     height   the height
      * @see       #update(Graphics)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void repaint(long tm, int x, int y, int width, int height) {
         if (this.peer instanceof LightweightPeer) {
@@ -3430,7 +3430,7 @@
      * graphics context is the bounding rectangle of this component.
      * @param     g   the graphics context to use for printing
      * @see       #paint(Graphics)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void print(Graphics g) {
         paint(g);
@@ -3445,7 +3445,7 @@
      * graphics context is the bounding rectangle of this component.
      * @param     g   the graphics context to use for printing
      * @see       #print(Graphics)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void printAll(Graphics g) {
         if (isShowing()) {
@@ -3525,7 +3525,7 @@
      * @see     Graphics#drawImage(Image, int, int, int, int, Color, java.awt.image.ImageObserver)
      * @see     Graphics#drawImage(Image, int, int, int, int, java.awt.image.ImageObserver)
      * @see     java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since   JDK1.0
+     * @since   1.0
      */
     public boolean imageUpdate(Image img, int infoflags,
                                int x, int y, int w, int h) {
@@ -3550,7 +3550,7 @@
      * Creates an image from the specified image producer.
      * @param     producer  the image producer
      * @return    the image produced
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Image createImage(ImageProducer producer) {
         ComponentPeer peer = this.peer;
@@ -3572,7 +3572,7 @@
      *    <code>true</code>.
      * @see #isDisplayable
      * @see GraphicsEnvironment#isHeadless
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Image createImage(int width, int height) {
         ComponentPeer peer = this.peer;
@@ -3643,7 +3643,7 @@
      *                       to be notified as the image is being prepared
      * @return    <code>true</code> if the image has already been fully
      *           prepared; <code>false</code> otherwise
-     * @since     JDK1.0
+     * @since     1.0
      */
     public boolean prepareImage(Image image, ImageObserver observer) {
         return prepareImage(image, -1, -1, observer);
@@ -3665,7 +3665,7 @@
      * @return    <code>true</code> if the image has already been fully
      *          prepared; <code>false</code> otherwise
      * @see       java.awt.image.ImageObserver
-     * @since     JDK1.0
+     * @since     1.0
      */
     public boolean prepareImage(Image image, int width, int height,
                                 ImageObserver observer) {
@@ -3701,7 +3701,7 @@
      * @see      #prepareImage(Image, int, int, java.awt.image.ImageObserver)
      * @see      Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
      * @see      java.awt.image.ImageObserver
-     * @since    JDK1.0
+     * @since    1.0
      */
     public int checkImage(Image image, ImageObserver observer) {
         return checkImage(image, -1, -1, observer);
@@ -3737,7 +3737,7 @@
      * @see      #prepareImage(Image, int, int, java.awt.image.ImageObserver)
      * @see      Toolkit#checkImage(Image, int, int, java.awt.image.ImageObserver)
      * @see      java.awt.image.ImageObserver
-     * @since    JDK1.0
+     * @since    1.0
      */
     public int checkImage(Image image, int width, int height,
                           ImageObserver observer) {
@@ -4622,7 +4622,7 @@
      * @param     x   the <i>x</i> coordinate of the point
      * @param     y   the <i>y</i> coordinate of the point
      * @see       #getComponentAt(int, int)
-     * @since     JDK1.1
+     * @since     1.1
      */
     public boolean contains(int x, int y) {
         return inside(x, y);
@@ -4644,7 +4644,7 @@
      * @param     p     the point
      * @throws    NullPointerException if {@code p} is {@code null}
      * @see       #getComponentAt(Point)
-     * @since     JDK1.1
+     * @since     1.1
      */
     public boolean contains(Point p) {
         return contains(p.x, p.y);
@@ -4669,7 +4669,7 @@
      *                <code>null</code> if the location
      *                is outside this component
      * @see       #contains(int, int)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Component getComponentAt(int x, int y) {
         return locate(x, y);
@@ -4689,7 +4689,7 @@
      * specified point.
      * @param     p   the point
      * @see       java.awt.Component#contains
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Component getComponentAt(Point p) {
         return getComponentAt(p.x, p.y);
@@ -5224,7 +5224,7 @@
      * @see      java.awt.event.ComponentListener
      * @see      #removeComponentListener
      * @see      #getComponentListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void addComponentListener(ComponentListener l) {
         if (l == null) {
@@ -5248,7 +5248,7 @@
      * @see      java.awt.event.ComponentListener
      * @see      #addComponentListener
      * @see      #getComponentListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void removeComponentListener(ComponentListener l) {
         if (l == null) {
@@ -5286,7 +5286,7 @@
      * @see      java.awt.event.FocusListener
      * @see      #removeFocusListener
      * @see      #getFocusListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void addFocusListener(FocusListener l) {
         if (l == null) {
@@ -5317,7 +5317,7 @@
      * @see      java.awt.event.FocusListener
      * @see      #addFocusListener
      * @see      #getFocusListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void removeFocusListener(FocusListener l) {
         if (l == null) {
@@ -5618,7 +5618,7 @@
      * @see      java.awt.event.KeyListener
      * @see      #removeKeyListener
      * @see      #getKeyListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void addKeyListener(KeyListener l) {
         if (l == null) {
@@ -5649,7 +5649,7 @@
      * @see      java.awt.event.KeyListener
      * @see      #addKeyListener
      * @see      #getKeyListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void removeKeyListener(KeyListener l) {
         if (l == null) {
@@ -5687,7 +5687,7 @@
      * @see      java.awt.event.MouseListener
      * @see      #removeMouseListener
      * @see      #getMouseListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void addMouseListener(MouseListener l) {
         if (l == null) {
@@ -5718,7 +5718,7 @@
      * @see      java.awt.event.MouseListener
      * @see      #addMouseListener
      * @see      #getMouseListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void removeMouseListener(MouseListener l) {
         if (l == null) {
@@ -5756,7 +5756,7 @@
      * @see      java.awt.event.MouseMotionListener
      * @see      #removeMouseMotionListener
      * @see      #getMouseMotionListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void addMouseMotionListener(MouseMotionListener l) {
         if (l == null) {
@@ -5787,7 +5787,7 @@
      * @see      java.awt.event.MouseMotionListener
      * @see      #addMouseMotionListener
      * @see      #getMouseMotionListeners
-     * @since    JDK1.1
+     * @since    1.1
      */
     public synchronized void removeMouseMotionListener(MouseMotionListener l) {
         if (l == null) {
@@ -6072,7 +6072,7 @@
      * @see        #processEvent
      * @see        #disableEvents
      * @see        AWTEvent
-     * @since      JDK1.1
+     * @since      1.1
      */
     protected final void enableEvents(long eventsToEnable) {
         long notifyAncestors = 0;
@@ -6108,7 +6108,7 @@
      * from being delivered to this component.
      * @param      eventsToDisable   the event mask defining the event types
      * @see        #enableEvents
-     * @since      JDK1.1
+     * @since      1.1
      */
     protected final void disableEvents(long eventsToDisable) {
         long notifyAncestors = 0;
@@ -6285,7 +6285,7 @@
      * @see       #processInputMethodEvent
      * @see       #processHierarchyEvent
      * @see       #processMouseWheelEvent
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof FocusEvent) {
@@ -6351,7 +6351,7 @@
      * @see         java.awt.event.ComponentListener
      * @see         #addComponentListener
      * @see         #enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processComponentEvent(ComponentEvent e) {
         ComponentListener listener = componentListener;
@@ -6414,7 +6414,7 @@
      * @see         #addFocusListener
      * @see         #enableEvents
      * @see         #dispatchEvent
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processFocusEvent(FocusEvent e) {
         FocusListener listener = focusListener;
@@ -6480,7 +6480,7 @@
      * @see         #addKeyListener
      * @see         #enableEvents
      * @see         #isShowing
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processKeyEvent(KeyEvent e) {
         KeyListener listener = keyListener;
@@ -6522,7 +6522,7 @@
      * @see         java.awt.event.MouseListener
      * @see         #addMouseListener
      * @see         #enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processMouseEvent(MouseEvent e) {
         MouseListener listener = mouseListener;
@@ -6570,7 +6570,7 @@
      * @see         java.awt.event.MouseMotionListener
      * @see         #addMouseMotionListener
      * @see         #enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processMouseMotionEvent(MouseEvent e) {
         MouseMotionListener listener = mouseMotionListener;
@@ -6882,7 +6882,7 @@
      * @see       #isDisplayable
      * @see       #removeNotify
      * @see #invalidate
-     * @since JDK1.0
+     * @since 1.0
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
@@ -6985,7 +6985,7 @@
      *
      * @see       #isDisplayable
      * @see       #addNotify
-     * @since JDK1.0
+     * @since 1.0
      */
     public void removeNotify() {
         KeyboardFocusManager.clearMostRecentFocusOwner(this);
@@ -7094,7 +7094,7 @@
      * @return <code>true</code> if this <code>Component</code> is
      * focusable; <code>false</code> otherwise
      * @see #setFocusable
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated As of 1.4, replaced by <code>isFocusable()</code>.
      */
     @Deprecated
@@ -7433,7 +7433,7 @@
      * @see #isFocusable
      * @see #isDisplayable
      * @see KeyboardFocusManager#clearGlobalFocusOwner
-     * @since JDK1.0
+     * @since 1.0
      */
     public void requestFocus() {
         requestFocusHelper(false, true);
@@ -7862,7 +7862,7 @@
      * Transfers the focus to the next component, as though this Component were
      * the focus owner.
      * @see       #requestFocus()
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void transferFocus() {
         nextFocus();
@@ -8070,7 +8070,7 @@
      * @param     popup the popup menu to be added to the component.
      * @see       #remove(MenuComponent)
      * @exception NullPointerException if {@code popup} is {@code null}
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void add(PopupMenu popup) {
         synchronized (getTreeLock()) {
@@ -8095,7 +8095,7 @@
      * Removes the specified popup menu from the component.
      * @param     popup the popup menu to be removed
      * @see       #add(PopupMenu)
-     * @since     JDK1.1
+     * @since     1.1
      */
     @SuppressWarnings("unchecked")
     public void remove(MenuComponent popup) {
@@ -8126,7 +8126,7 @@
      * <code>null</code>.
      *
      * @return  a string representation of this component's state
-     * @since     JDK1.0
+     * @since     1.0
      */
     protected String paramString() {
         final String thisName = Objects.toString(getName(), "");
@@ -8140,7 +8140,7 @@
     /**
      * Returns a string representation of this component and its values.
      * @return    a string representation of this component
-     * @since     JDK1.0
+     * @since     1.0
      */
     public String toString() {
         return getClass().getName() + '[' + paramString() + ']';
@@ -8150,7 +8150,7 @@
      * Prints a listing of this component to the standard system output
      * stream <code>System.out</code>.
      * @see       java.lang.System#out
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void list() {
         list(System.out, 0);
@@ -8161,7 +8161,7 @@
      * stream.
      * @param    out   a print stream
      * @throws   NullPointerException if {@code out} is {@code null}
-     * @since    JDK1.0
+     * @since    1.0
      */
     public void list(PrintStream out) {
         list(out, 0);
@@ -8174,7 +8174,7 @@
      * @param     indent   number of spaces to indent
      * @see       java.io.PrintStream#println(java.lang.Object)
      * @throws    NullPointerException if {@code out} is {@code null}
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void list(PrintStream out, int indent) {
         for (int i = 0 ; i < indent ; i++) {
@@ -8187,7 +8187,7 @@
      * Prints a listing to the specified print writer.
      * @param  out  the print writer to print to
      * @throws NullPointerException if {@code out} is {@code null}
-     * @since JDK1.1
+     * @since 1.1
      */
     public void list(PrintWriter out) {
         list(out, 0);
@@ -8200,7 +8200,7 @@
      * @param indent the number of spaces to indent
      * @throws NullPointerException if {@code out} is {@code null}
      * @see       java.io.PrintStream#println(java.lang.Object)
-     * @since JDK1.1
+     * @since 1.1
      */
     public void list(PrintWriter out, int indent) {
         for (int i = 0 ; i < indent ; i++) {
diff --git a/jdk/src/share/classes/java/awt/Container.java b/jdk/src/share/classes/java/awt/Container.java
index 116276a..a352bab 100644
--- a/jdk/src/share/classes/java/awt/Container.java
+++ b/jdk/src/share/classes/java/awt/Container.java
@@ -85,7 +85,7 @@
  * @see       #add(java.awt.Component, int)
  * @see       #getComponent(int)
  * @see       LayoutManager
- * @since     JDK1.0
+ * @since     1.0
  */
 public class Container extends Component {
 
@@ -302,7 +302,7 @@
      *
      * @return    the number of components in this panel.
      * @see       #getComponent
-     * @since     JDK1.1
+     * @since     1.1
      * @see Component#getTreeLock()
      */
     public int getComponentCount() {
@@ -384,7 +384,7 @@
      * @return    the insets of this container.
      * @see       Insets
      * @see       LayoutManager
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Insets getInsets() {
         return insets();
@@ -975,7 +975,7 @@
      * @see #validate
      * @see javax.swing.JComponent#revalidate()
      * @see       LayoutManager
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void add(Component comp, Object constraints) {
         addImpl(comp, constraints, -1);
@@ -1078,7 +1078,7 @@
      * @see #invalidate
      * @see       LayoutManager
      * @see       LayoutManager2
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected void addImpl(Component comp, Object constraints, int index) {
         synchronized (getTreeLock()) {
@@ -1202,7 +1202,7 @@
      * @see #invalidate
      * @see #validate
      * @see #getComponentCount
-     * @since JDK1.1
+     * @since 1.1
      */
     public void remove(int index) {
         synchronized (getTreeLock()) {
@@ -1501,7 +1501,7 @@
      * @see LayoutManager#layoutContainer
      * @see #setLayout
      * @see #validate
-     * @since JDK1.1
+     * @since 1.1
      */
     public void doLayout() {
         layout();
@@ -1749,7 +1749,7 @@
      * @param f The font to become this container's font.
      * @see Component#getFont
      * @see #invalidate
-     * @since JDK1.0
+     * @since 1.0
      */
     public void setFont(Font f) {
         boolean shouldinvalidate = false;
@@ -1834,7 +1834,7 @@
      * @see       #getLayout
      * @see       LayoutManager#minimumLayoutSize(Container)
      * @see       Component#getMinimumSize
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getMinimumSize() {
         return minimumSize();
@@ -2539,7 +2539,7 @@
      * point is within the bounds of the container the container itself
      * is returned; otherwise the top-most child is returned.
      * @see Component#contains
-     * @since JDK1.1
+     * @since 1.1
      */
     public Component getComponentAt(int x, int y) {
         return locate(x, y);
@@ -2585,7 +2585,7 @@
      *                 or <code>null</code> if the component does
      *                 not contain the point.
      * @see        Component#contains
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Component getComponentAt(Point p) {
         return getComponentAt(p.x, p.y);
@@ -2837,7 +2837,7 @@
      * @param c the component
      * @return     <code>true</code> if it is an ancestor;
      *             <code>false</code> otherwise.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public boolean isAncestorOf(Component c) {
         Container p;
@@ -3012,7 +3012,7 @@
      * @param    indent   the number of spaces to indent
      * @throws   NullPointerException if {@code out} is {@code null}
      * @see      Component#list(java.io.PrintStream, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public void list(PrintStream out, int indent) {
         super.list(out, indent);
@@ -3039,7 +3039,7 @@
      * @param    indent   the number of spaces to indent
      * @throws   NullPointerException if {@code out} is {@code null}
      * @see      Component#list(java.io.PrintWriter, int)
-     * @since    JDK1.1
+     * @since    1.1
      */
     public void list(PrintWriter out, int indent) {
         super.list(out, indent);
diff --git a/jdk/src/share/classes/java/awt/Dialog.java b/jdk/src/share/classes/java/awt/Dialog.java
index 70e9ce9..3c66e8c 100644
--- a/jdk/src/share/classes/java/awt/Dialog.java
+++ b/jdk/src/share/classes/java/awt/Dialog.java
@@ -92,7 +92,7 @@
  *
  * @author      Sami Shaio
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Dialog extends Window {
 
diff --git a/jdk/src/share/classes/java/awt/Event.java b/jdk/src/share/classes/java/awt/Event.java
index ed96bb7..4235bfa 100644
--- a/jdk/src/share/classes/java/awt/Event.java
+++ b/jdk/src/share/classes/java/awt/Event.java
@@ -57,7 +57,7 @@
  * <code>PGDN</code>, <code>F1</code>, <code>F2</code>, etc).
  *
  * @author     Sami Shaio
- * @since      JDK1.0
+ * @since      1.0
  */
 public class Event implements java.io.Serializable {
     private transient long data;
@@ -871,7 +871,7 @@
      * @return    a string that represents the event and the values
      *                 of its member fields.
      * @see       java.awt.Event#paramString
-     * @since     JDK1.1
+     * @since     1.1
      */
     public String toString() {
         return getClass().getName() + "[" + paramString() + "]";
diff --git a/jdk/src/share/classes/java/awt/FileDialog.java b/jdk/src/share/classes/java/awt/FileDialog.java
index b693b9b..ff8b8f1 100644
--- a/jdk/src/share/classes/java/awt/FileDialog.java
+++ b/jdk/src/share/classes/java/awt/FileDialog.java
@@ -44,7 +44,7 @@
  *
  * @author      Sami Shaio
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public class FileDialog extends Dialog {
 
@@ -176,7 +176,7 @@
      * <code>FileDialog(parent, "", LOAD)</code>.
      *
      * @param parent the owner of the dialog
-     * @since JDK1.1
+     * @since 1.1
      */
     public FileDialog(Frame parent) {
         this(parent, "", LOAD);
@@ -353,7 +353,7 @@
      * @see        java.awt.FileDialog#getMode
      * @exception  IllegalArgumentException if an illegal file
      *                 dialog mode is supplied
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void setMode(int mode) {
         switch (mode) {
diff --git a/jdk/src/share/classes/java/awt/FlowLayout.java b/jdk/src/share/classes/java/awt/FlowLayout.java
index 38b4ac8..e63bb86 100644
--- a/jdk/src/share/classes/java/awt/FlowLayout.java
+++ b/jdk/src/share/classes/java/awt/FlowLayout.java
@@ -79,7 +79,7 @@
  *
  * @author      Arthur van Hoff
  * @author      Sami Shaio
- * @since       JDK1.0
+ * @since       1.0
  * @see ComponentOrientation
  */
 public class FlowLayout implements LayoutManager, java.io.Serializable {
@@ -246,7 +246,7 @@
      * or <code>FlowLayout.TRAILING</code>.
      * @return     the alignment value for this layout
      * @see        java.awt.FlowLayout#setAlignment
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getAlignment() {
         return newAlign;
@@ -264,7 +264,7 @@
      * </ul>
      * @param      align one of the alignment values shown above
      * @see        #getAlignment()
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void setAlignment(int align) {
         this.newAlign = align;
@@ -295,7 +295,7 @@
      *             and between the components and the borders
      *             of the <code>Container</code>
      * @see        java.awt.FlowLayout#setHgap
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getHgap() {
         return hgap;
@@ -310,7 +310,7 @@
      *             and between the components and the borders
      *             of the <code>Container</code>
      * @see        java.awt.FlowLayout#getHgap
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void setHgap(int hgap) {
         this.hgap = hgap;
@@ -325,7 +325,7 @@
      *             and between the components and the borders
      *             of the <code>Container</code>
      * @see        java.awt.FlowLayout#setVgap
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getVgap() {
         return vgap;
@@ -339,7 +339,7 @@
      *             and between the components and the borders
      *             of the <code>Container</code>
      * @see        java.awt.FlowLayout#getVgap
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void setVgap(int vgap) {
         this.vgap = vgap;
diff --git a/jdk/src/share/classes/java/awt/Font.java b/jdk/src/share/classes/java/awt/Font.java
index 3293932..41d1435 100644
--- a/jdk/src/share/classes/java/awt/Font.java
+++ b/jdk/src/share/classes/java/awt/Font.java
@@ -364,7 +364,7 @@
     /**
      * The logical name of this <code>Font</code>, as passed to the
      * constructor.
-     * @since JDK1.0
+     * @since 1.0
      *
      * @serial
      * @see #getName
@@ -374,7 +374,7 @@
     /**
      * The style of this <code>Font</code>, as passed to the constructor.
      * This style can be PLAIN, BOLD, ITALIC, or BOLD+ITALIC.
-     * @since JDK1.0
+     * @since 1.0
      *
      * @serial
      * @see #getStyle()
@@ -383,7 +383,7 @@
 
     /**
      * The point size of this <code>Font</code>, rounded to integer.
-     * @since JDK1.0
+     * @since 1.0
      *
      * @serial
      * @see #getSize()
@@ -436,7 +436,7 @@
     /**
      * Gets the peer of this <code>Font</code>.
      * @return  the peer of the <code>Font</code>.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated Font rendering is now platform independent.
      */
     @Deprecated
@@ -562,7 +562,7 @@
      * @param size the point size of the {@code Font}
      * @see GraphicsEnvironment#getAllFonts
      * @see GraphicsEnvironment#getAvailableFontFamilyNames
-     * @since JDK1.0
+     * @since 1.0
      */
     public Font(String name, int style, int size) {
         this.name = (name != null) ? name : "Default";
@@ -1180,7 +1180,7 @@
      *
      * @see #getName
      * @see #getFontName
-     * @since JDK1.1
+     * @since 1.1
      */
     public String getFamily() {
         return getFamily_NoClientCode();
@@ -1240,7 +1240,7 @@
      *          this <code>Font</code>.
      * @see #getFamily
      * @see #getFontName
-     * @since JDK1.0
+     * @since 1.0
      */
     public String getName() {
         return name;
@@ -1286,7 +1286,7 @@
      * @see #isPlain
      * @see #isBold
      * @see #isItalic
-     * @since JDK1.0
+     * @since 1.0
      */
     public int getStyle() {
         return style;
@@ -1312,7 +1312,7 @@
      * @see #getSize2D
      * @see GraphicsConfiguration#getDefaultTransform
      * @see GraphicsConfiguration#getNormalizingTransform
-     * @since JDK1.0
+     * @since 1.0
      */
     public int getSize() {
         return size;
@@ -1337,7 +1337,7 @@
      *            PLAIN style;
      *            <code>false</code> otherwise.
      * @see       java.awt.Font#getStyle
-     * @since     JDK1.0
+     * @since     1.0
      */
     public boolean isPlain() {
         return style == 0;
@@ -1350,7 +1350,7 @@
      *            style is BOLD;
      *            <code>false</code> otherwise.
      * @see       java.awt.Font#getStyle
-     * @since     JDK1.0
+     * @since     1.0
      */
     public boolean isBold() {
         return (style & BOLD) != 0;
@@ -1363,7 +1363,7 @@
      *            style is ITALIC;
      *            <code>false</code> otherwise.
      * @see       java.awt.Font#getStyle
-     * @since     JDK1.0
+     * @since     1.0
      */
     public boolean isItalic() {
         return (style & ITALIC) != 0;
@@ -1484,7 +1484,7 @@
      *          describes, or a new default <code>Font</code> if
      *          <code>str</code> is <code>null</code>.
      * @see #getFamily
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Font decode(String str) {
         String fontName = str;
@@ -1595,7 +1595,7 @@
     /**
      * Returns a hashcode for this <code>Font</code>.
      * @return     a hashcode value for this <code>Font</code>.
-     * @since      JDK1.0
+     * @since      1.0
      */
     public int hashCode() {
         if (hash == 0) {
@@ -1622,7 +1622,7 @@
      *          or if the argument is a <code>Font</code> object
      *          describing the same font as this object;
      *          <code>false</code> otherwise.
-     * @since JDK1.0
+     * @since 1.0
      */
     public boolean equals(Object obj) {
         if (obj == this) {
@@ -1667,7 +1667,7 @@
      * representation.
      * @return     a <code>String</code> representation of this
      *          <code>Font</code> object.
-     * @since      JDK1.0
+     * @since      1.0
      */
     // NOTE: This method may be called by privileged threads.
     //       DO NOT INVOKE CLIENT CODE ON THIS THREAD!
diff --git a/jdk/src/share/classes/java/awt/FontMetrics.java b/jdk/src/share/classes/java/awt/FontMetrics.java
index f83d44d..6de2767 100644
--- a/jdk/src/share/classes/java/awt/FontMetrics.java
+++ b/jdk/src/share/classes/java/awt/FontMetrics.java
@@ -94,7 +94,7 @@
  *
  * @author      Jim Graham
  * @see         java.awt.Font
- * @since       JDK1.0
+ * @since       1.0
  */
 public abstract class FontMetrics implements java.io.Serializable {
 
@@ -625,7 +625,6 @@
      * object's values as a <code>String</code>.
      * @return    a <code>String</code> representation of this
      * <code>FontMetrics</code> object.
-     * @since     JDK1.0.
      */
     public String toString() {
         return getClass().getName() +
diff --git a/jdk/src/share/classes/java/awt/Frame.java b/jdk/src/share/classes/java/awt/Frame.java
index 421565e..df3fcda 100644
--- a/jdk/src/share/classes/java/awt/Frame.java
+++ b/jdk/src/share/classes/java/awt/Frame.java
@@ -130,7 +130,7 @@
  * @author      Sami Shaio
  * @see WindowEvent
  * @see Window#addWindowListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Frame extends Window implements MenuContainer {
 
diff --git a/jdk/src/share/classes/java/awt/Graphics.java b/jdk/src/share/classes/java/awt/Graphics.java
index a634949..4f03e1c 100644
--- a/jdk/src/share/classes/java/awt/Graphics.java
+++ b/jdk/src/share/classes/java/awt/Graphics.java
@@ -99,7 +99,7 @@
  * @see     java.awt.Graphics#setPaintMode()
  * @see     java.awt.Graphics#setXORMode(java.awt.Color)
  * @see     java.awt.Graphics#setFont(java.awt.Font)
- * @since       JDK1.0
+ * @since       1.0
  */
 public abstract class Graphics {
 
@@ -283,7 +283,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract Rectangle getClipBounds();
 
@@ -321,7 +321,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(Shape)
      * @see         java.awt.Graphics#getClip
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract void setClip(int x, int y, int width, int height);
 
@@ -339,7 +339,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract Shape getClip();
 
@@ -357,7 +357,7 @@
      * @see         java.awt.Graphics#getClip()
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract void setClip(Shape clip);
 
@@ -694,7 +694,7 @@
      * @param       yPoints an array of <i>y</i> points
      * @param       nPoints the total number of points
      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract void drawPolyline(int xPoints[], int yPoints[],
                                       int nPoints);
@@ -1058,7 +1058,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract boolean drawImage(Image img,
                                       int dx1, int dy1, int dx2, int dy2,
@@ -1119,7 +1119,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public abstract boolean drawImage(Image img,
                                       int dx1, int dy1, int dx2, int dy2,
diff --git a/jdk/src/share/classes/java/awt/Graphics2D.java b/jdk/src/share/classes/java/awt/Graphics2D.java
index b535b6c..080ac3f 100644
--- a/jdk/src/share/classes/java/awt/Graphics2D.java
+++ b/jdk/src/share/classes/java/awt/Graphics2D.java
@@ -662,7 +662,7 @@
      *         <code>null</code>
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     public abstract void drawString(String str, int x, int y);
 
@@ -968,7 +968,7 @@
      * context are relative to this new origin.
      * @param  x the specified x coordinate
      * @param  y the specified y coordinate
-     * @since   JDK1.0
+     * @since   1.0
      */
     public abstract void translate(int x, int y);
 
diff --git a/jdk/src/share/classes/java/awt/GridBagConstraints.java b/jdk/src/share/classes/java/awt/GridBagConstraints.java
index a926e2c..7b7dd2c 100644
--- a/jdk/src/share/classes/java/awt/GridBagConstraints.java
+++ b/jdk/src/share/classes/java/awt/GridBagConstraints.java
@@ -32,7 +32,7 @@
  * @author Doug Stein
  * @author Bill Spitzak (orignial NeWS &amp; OLIT implementation)
  * @see java.awt.GridBagLayout
- * @since JDK1.0
+ * @since 1.0
  */
 public class GridBagConstraints implements Cloneable, java.io.Serializable {
 
diff --git a/jdk/src/share/classes/java/awt/GridBagLayout.java b/jdk/src/share/classes/java/awt/GridBagLayout.java
index 20e772a..0b2c32b 100644
--- a/jdk/src/share/classes/java/awt/GridBagLayout.java
+++ b/jdk/src/share/classes/java/awt/GridBagLayout.java
@@ -359,7 +359,7 @@
  * @see       java.awt.GridBagConstraints
  * @see       java.awt.GridBagLayoutInfo
  * @see       java.awt.ComponentOrientation
- * @since JDK1.0
+ * @since 1.0
  */
 public class GridBagLayout implements LayoutManager2,
 java.io.Serializable {
@@ -562,7 +562,7 @@
      * @return     the graphics origin of the cell in the top-left
      *             corner of the layout grid
      * @see        java.awt.ComponentOrientation
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Point getLayoutOrigin () {
         Point origin = new Point(0,0);
@@ -580,7 +580,7 @@
      * @return     an array of two arrays, containing the widths
      *                       of the layout columns and
      *                       the heights of the layout rows
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int [][] getLayoutDimensions () {
         if (layoutInfo == null)
@@ -606,7 +606,7 @@
      * @return      an array of two arrays, representing the
      *                    horizontal weights of the layout columns
      *                    and the vertical weights of the layout rows
-     * @since       JDK1.1
+     * @since       1.1
      */
     public double [][] getLayoutWeights () {
         if (layoutInfo == null)
@@ -647,7 +647,7 @@
      *             in the layout grid contains the point
      *             (<i>x</i>,&nbsp;<i>y</i>).
      * @see        java.awt.ComponentOrientation
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Point location(int x, int y) {
         Point loc = new Point(0,0);
diff --git a/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java b/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java
index f92cc70..63d7601 100644
--- a/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java
+++ b/jdk/src/share/classes/java/awt/GridBagLayoutInfo.java
@@ -62,7 +62,7 @@
      * grid cells with it's own parameters.
      * @param width the columns
      * @param height the rows
-     * @since 6.0
+     * @since 1.6
      */
     GridBagLayoutInfo(int width, int height) {
         this.width = width;
diff --git a/jdk/src/share/classes/java/awt/GridLayout.java b/jdk/src/share/classes/java/awt/GridLayout.java
index 717be62..26b0bef 100644
--- a/jdk/src/share/classes/java/awt/GridLayout.java
+++ b/jdk/src/share/classes/java/awt/GridLayout.java
@@ -88,7 +88,7 @@
  * number of rows is set to zero.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public class GridLayout implements LayoutManager, java.io.Serializable {
     /*
@@ -144,7 +144,7 @@
     /**
      * Creates a grid layout with a default of one column per component,
      * in a single row.
-     * @since JDK1.1
+     * @since 1.1
      */
     public GridLayout() {
         this(1, 0, 0, 0);
@@ -203,7 +203,7 @@
     /**
      * Gets the number of rows in this layout.
      * @return    the number of rows in this layout
-     * @since     JDK1.1
+     * @since     1.1
      */
     public int getRows() {
         return rows;
@@ -214,7 +214,7 @@
      * @param        rows   the number of rows in this layout
      * @exception    IllegalArgumentException  if the value of both
      *               <code>rows</code> and <code>cols</code> is set to zero
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setRows(int rows) {
         if ((rows == 0) && (this.cols == 0)) {
@@ -226,7 +226,7 @@
     /**
      * Gets the number of columns in this layout.
      * @return     the number of columns in this layout
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getColumns() {
         return cols;
@@ -242,7 +242,7 @@
      * @param        cols   the number of columns in this layout
      * @exception    IllegalArgumentException  if the value of both
      *               <code>rows</code> and <code>cols</code> is set to zero
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setColumns(int cols) {
         if ((cols == 0) && (this.rows == 0)) {
@@ -254,7 +254,7 @@
     /**
      * Gets the horizontal gap between components.
      * @return       the horizontal gap between components
-     * @since        JDK1.1
+     * @since        1.1
      */
     public int getHgap() {
         return hgap;
@@ -263,7 +263,7 @@
     /**
      * Sets the horizontal gap between components to the specified value.
      * @param        hgap   the horizontal gap between components
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setHgap(int hgap) {
         this.hgap = hgap;
@@ -272,7 +272,7 @@
     /**
      * Gets the vertical gap between components.
      * @return       the vertical gap between components
-     * @since        JDK1.1
+     * @since        1.1
      */
     public int getVgap() {
         return vgap;
@@ -281,7 +281,7 @@
     /**
      * Sets the vertical gap between components to the specified value.
      * @param         vgap  the vertical gap between components
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setVgap(int vgap) {
         this.vgap = vgap;
diff --git a/jdk/src/share/classes/java/awt/Image.java b/jdk/src/share/classes/java/awt/Image.java
index b7629f1..d18e02d 100644
--- a/jdk/src/share/classes/java/awt/Image.java
+++ b/jdk/src/share/classes/java/awt/Image.java
@@ -41,7 +41,7 @@
  *
  * @author      Sami Shaio
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public abstract class Image {
 
@@ -164,7 +164,7 @@
      * @see        java.awt.Image#SCALE_SMOOTH
      * @see        java.awt.Image#SCALE_REPLICATE
      * @see        java.awt.Image#SCALE_AREA_AVERAGING
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Image getScaledInstance(int width, int height, int hints) {
         ImageFilter filter;
@@ -180,21 +180,21 @@
 
     /**
      * Use the default image-scaling algorithm.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCALE_DEFAULT = 1;
 
     /**
      * Choose an image-scaling algorithm that gives higher priority
      * to scaling speed than smoothness of the scaled image.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCALE_FAST = 2;
 
     /**
      * Choose an image-scaling algorithm that gives higher priority
      * to image smoothness than scaling speed.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCALE_SMOOTH = 4;
 
@@ -205,7 +205,7 @@
      * that performs the same algorithm yet integrates more efficiently
      * into the imaging infrastructure supplied by the toolkit.
      * @see        java.awt.image.ReplicateScaleFilter
-     * @since      JDK1.1
+     * @since      1.1
      */
     public static final int SCALE_REPLICATE = 8;
 
@@ -215,7 +215,7 @@
      * performs the same algorithm yet integrates more efficiently
      * into the image infrastructure supplied by the toolkit.
      * @see java.awt.image.AreaAveragingScaleFilter
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCALE_AREA_AVERAGING = 16;
 
diff --git a/jdk/src/share/classes/java/awt/Insets.java b/jdk/src/share/classes/java/awt/Insets.java
index c404cc6..66542fc 100644
--- a/jdk/src/share/classes/java/awt/Insets.java
+++ b/jdk/src/share/classes/java/awt/Insets.java
@@ -35,7 +35,7 @@
  * @author      Sami Shaio
  * @see         java.awt.LayoutManager
  * @see         java.awt.Container
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Insets implements Cloneable, java.io.Serializable {
 
@@ -130,7 +130,7 @@
      * <code>bottom</code>, and <code>right</code> are all equal.
      * @return      <code>true</code> if the two insets are equal;
      *                          otherwise <code>false</code>.
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean equals(Object obj) {
         if (obj instanceof Insets) {
diff --git a/jdk/src/share/classes/java/awt/Label.java b/jdk/src/share/classes/java/awt/Label.java
index 7e33534..20ccdcd 100644
--- a/jdk/src/share/classes/java/awt/Label.java
+++ b/jdk/src/share/classes/java/awt/Label.java
@@ -49,7 +49,7 @@
  * style="float:center; margin: 7px 10px;">
  *
  * @author      Sami Shaio
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Label extends Component implements Accessible {
 
@@ -73,7 +73,6 @@
 
     /**
      * Indicates that the label should be right justified.
-     * @since   JDK1.0t.
      */
     public static final int RIGHT       = 2;
 
diff --git a/jdk/src/share/classes/java/awt/List.java b/jdk/src/share/classes/java/awt/List.java
index 7542918..df638c2 100644
--- a/jdk/src/share/classes/java/awt/List.java
+++ b/jdk/src/share/classes/java/awt/List.java
@@ -104,7 +104,7 @@
  * @see         java.awt.event.ItemListener
  * @see         java.awt.event.ActionEvent
  * @see         java.awt.event.ActionListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class List extends Component implements ItemSelectable, Accessible {
     /**
@@ -199,7 +199,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since       JDK1.1
+     * @since       1.1
      */
     public List(int rows) throws HeadlessException {
         this(rows, false);
@@ -275,7 +275,7 @@
      * Gets the number of items in the list.
      * @return     the number of items in the list
      * @see        #getItem
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getItemCount() {
         return countItems();
@@ -315,7 +315,7 @@
      * @see          #select
      * @see          #deselect
      * @see          #isIndexSelected
-     * @since        JDK1.1
+     * @since        1.1
      */
     public synchronized String[] getItems() {
         String itemCopies[] = new String[items.size()];
@@ -326,7 +326,7 @@
     /**
      * Adds the specified item to the end of scrolling list.
      * @param item the item to be added
-     * @since JDK1.1
+     * @since 1.1
      */
     public void add(String item) {
         addItem(item);
@@ -351,7 +351,7 @@
      *              if this parameter is <code>null</code> then the item is
      *              treated as an empty string, <code>""</code>
      * @param       index  the position at which to add the item
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void add(String item, int index) {
         addItem(item, index);
@@ -399,7 +399,7 @@
      * Removes all items from this list.
      * @see #remove
      * @see #delItems
-     * @since JDK1.1
+     * @since 1.1
      */
     public void removeAll() {
         clear();
@@ -426,7 +426,7 @@
      * @param        item  the item to remove from the list
      * @exception    IllegalArgumentException
      *                     if the item doesn't exist in the list
-     * @since        JDK1.1
+     * @since        1.1
      */
     public synchronized void remove(String item) {
         int index = items.indexOf(item);
@@ -445,7 +445,7 @@
      * only selected item in the list, the list is set to have no selection.
      * @param      position   the index of the item to delete
      * @see        #add(String, int)
-     * @since      JDK1.1
+     * @since      1.1
      * @exception    ArrayIndexOutOfBoundsException
      *               if the <code>position</code> is less than 0 or
      *               greater than <code>getItemCount()-1</code>
@@ -639,7 +639,7 @@
      *                       selected; <code>false</code> otherwise
      * @see        #select
      * @see        #deselect
-     * @since      JDK1.1
+     * @since      1.1
      */
     public boolean isIndexSelected(int index) {
         return isSelected(index);
@@ -675,7 +675,7 @@
      * @return     <code>true</code> if this list allows multiple
      *                 selections; otherwise, <code>false</code>
      * @see        #setMultipleMode
-     * @since      JDK1.1
+     * @since      1.1
      */
     public boolean isMultipleMode() {
         return allowsMultipleSelections();
@@ -702,7 +702,7 @@
      *                      are allowed; otherwise, only one item from
      *                      the list can be selected at once
      * @see         #isMultipleMode
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setMultipleMode(boolean b) {
         setMultipleSelections(b);
@@ -753,7 +753,7 @@
      * @return     the preferred dimensions for displaying this scrolling list
      *             given that the specified number of rows must be visible
      * @see        java.awt.Component#getPreferredSize
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Dimension getPreferredSize(int rows) {
         return preferredSize(rows);
@@ -777,7 +777,7 @@
      * Gets the preferred size of this scrolling list.
      * @return     the preferred dimensions for displaying this scrolling list
      * @see        java.awt.Component#getPreferredSize
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Dimension getPreferredSize() {
         return preferredSize();
@@ -803,7 +803,7 @@
      * @return     the minimum dimensions for displaying this scrolling list
      *             given that the specified number of rows must be visible
      * @see        java.awt.Component#getMinimumSize
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Dimension getMinimumSize(int rows) {
         return minimumSize(rows);
@@ -828,7 +828,7 @@
      * @return       the minimum dimensions needed
      *                        to display this scrolling list
      * @see          java.awt.Component#getMinimumSize()
-     * @since        JDK1.1
+     * @since        1.1
      */
     public Dimension getMinimumSize() {
         return minimumSize();
@@ -861,7 +861,7 @@
      * @see           #deselect
      * @see           java.awt.event.ItemEvent
      * @see           java.awt.event.ItemListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addItemListener(ItemListener l) {
         if (l == null) {
@@ -884,7 +884,7 @@
      * @see             #getItemListeners
      * @see             java.awt.event.ItemEvent
      * @see             java.awt.event.ItemListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeItemListener(ItemListener l) {
         if (l == null) {
@@ -927,7 +927,7 @@
      * @see           #getActionListeners
      * @see           java.awt.event.ActionEvent
      * @see           java.awt.event.ActionListener
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void addActionListener(ActionListener l) {
         if (l == null) {
@@ -951,7 +951,7 @@
      * @see             #getActionListeners
      * @see             java.awt.event.ActionEvent
      * @see             java.awt.event.ActionListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeActionListener(ActionListener l) {
         if (l == null) {
@@ -1061,7 +1061,7 @@
      * @see          java.awt.event.ItemEvent
      * @see          #processActionEvent
      * @see          #processItemEvent
-     * @since        JDK1.1
+     * @since        1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ItemEvent) {
@@ -1096,7 +1096,7 @@
      * @see         java.awt.event.ItemListener
      * @see         #addItemListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processItemEvent(ItemEvent e) {
         ItemListener listener = itemListener;
@@ -1127,7 +1127,7 @@
      * @see         java.awt.event.ActionListener
      * @see         #addActionListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processActionEvent(ActionEvent e) {
         ActionListener listener = actionListener;
diff --git a/jdk/src/share/classes/java/awt/MediaTracker.java b/jdk/src/share/classes/java/awt/MediaTracker.java
index 4dd0fb5..e8e8212 100644
--- a/jdk/src/share/classes/java/awt/MediaTracker.java
+++ b/jdk/src/share/classes/java/awt/MediaTracker.java
@@ -164,7 +164,7 @@
  * } </pre></blockquote><hr>
  *
  * @author      Jim Graham
- * @since       JDK1.0
+ * @since       1.0
  */
 public class MediaTracker implements java.io.Serializable {
 
@@ -724,7 +724,7 @@
      * @param   image     the image to be removed
      * @see     java.awt.MediaTracker#removeImage(java.awt.Image, int)
      * @see     java.awt.MediaTracker#removeImage(java.awt.Image, int, int, int)
-     * @since   JDK1.1
+     * @since   1.1
      */
     public synchronized void removeImage(Image image) {
         removeImageImpl(image);
@@ -763,7 +763,7 @@
      * @param      id the tracking ID from which to remove the image
      * @see        java.awt.MediaTracker#removeImage(java.awt.Image)
      * @see        java.awt.MediaTracker#removeImage(java.awt.Image, int, int, int)
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized void removeImage(Image image, int id) {
         removeImageImpl(image, id);
@@ -803,7 +803,7 @@
      * @param   height the height to remove (-1 for unscaled)
      * @see     java.awt.MediaTracker#removeImage(java.awt.Image)
      * @see     java.awt.MediaTracker#removeImage(java.awt.Image, int)
-     * @since   JDK1.1
+     * @since   1.1
      */
     public synchronized void removeImage(Image image, int id,
                                          int width, int height) {
diff --git a/jdk/src/share/classes/java/awt/Menu.java b/jdk/src/share/classes/java/awt/Menu.java
index ae8e50e..177f208 100644
--- a/jdk/src/share/classes/java/awt/Menu.java
+++ b/jdk/src/share/classes/java/awt/Menu.java
@@ -53,7 +53,7 @@
  * @author Sami Shaio
  * @see     java.awt.MenuItem
  * @see     java.awt.CheckboxMenuItem
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Menu extends MenuItem implements MenuContainer, Accessible {
 
@@ -118,7 +118,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Menu() throws HeadlessException {
         this("", false);
@@ -151,7 +151,6 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since       JDK1.0.
      */
     public Menu(String label, boolean tearOff) throws HeadlessException {
         super(label);
@@ -215,7 +214,7 @@
     /**
       * Get the number of items in this menu.
       * @return     the number of items in this menu.
-      * @since      JDK1.1
+      * @since      1.1
       */
     public int getItemCount() {
         return countItems();
@@ -303,7 +302,7 @@
      * @see           java.awt.Menu#add(java.awt.MenuItem)
      * @exception     IllegalArgumentException if the value of
      *                    <code>index</code> is less than zero
-     * @since         JDK1.1
+     * @since         1.1
      */
 
     public void insert(MenuItem menuitem, int index) {
@@ -347,7 +346,7 @@
      * @see         java.awt.Menu#add(java.awt.MenuItem)
      * @exception     IllegalArgumentException if the value of
      *                    <code>index</code> is less than zero
-     * @since       JDK1.1
+     * @since       1.1
      */
 
     public void insert(String label, int index) {
@@ -369,7 +368,7 @@
      * @exception   IllegalArgumentException if the value of
      *                       <code>index</code> is less than 0.
      * @see         java.awt.Menu#addSeparator
-     * @since       JDK1.1
+     * @since       1.1
      */
 
     public void insertSeparator(int index) {
@@ -436,7 +435,7 @@
 
     /**
      * Removes all items from this menu.
-     * @since       JDK1.0.
+     * @since       1.1
      */
     public void removeAll() {
         synchronized (getTreeLock()) {
diff --git a/jdk/src/share/classes/java/awt/MenuBar.java b/jdk/src/share/classes/java/awt/MenuBar.java
index a31745a..4e48c7c 100644
--- a/jdk/src/share/classes/java/awt/MenuBar.java
+++ b/jdk/src/share/classes/java/awt/MenuBar.java
@@ -65,7 +65,7 @@
  * @see        java.awt.Menu
  * @see        java.awt.MenuItem
  * @see        java.awt.MenuShortcut
- * @since      JDK1.0
+ * @since      1.0
  */
 public class MenuBar extends MenuComponent implements MenuContainer, Accessible {
 
@@ -272,7 +272,7 @@
     /**
      * Gets the number of menus on the menu bar.
      * @return     the number of menus on the menu bar.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getMenuCount() {
         return countMenus();
@@ -318,7 +318,7 @@
      * @return      an enumeration of menu shortcuts that this
      *                      menu bar is managing.
      * @see         java.awt.MenuShortcut
-     * @since       JDK1.1
+     * @since       1.1
      */
     public synchronized Enumeration<MenuShortcut> shortcuts() {
         Vector<MenuShortcut> shortcuts = new Vector<>();
@@ -341,7 +341,7 @@
      * @param        s the specified menu shortcut.
      * @see          java.awt.MenuItem
      * @see          java.awt.MenuShortcut
-     * @since        JDK1.1
+     * @since        1.1
      */
      public MenuItem getShortcutMenuItem(MenuShortcut s) {
         int nmenus = getMenuCount();
@@ -387,7 +387,7 @@
     /**
      * Deletes the specified menu shortcut.
      * @param     s the menu shortcut to delete.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void deleteShortcut(MenuShortcut s) {
         int nmenus = getMenuCount();
diff --git a/jdk/src/share/classes/java/awt/MenuComponent.java b/jdk/src/share/classes/java/awt/MenuComponent.java
index b65c843..28fb9ab 100644
--- a/jdk/src/share/classes/java/awt/MenuComponent.java
+++ b/jdk/src/share/classes/java/awt/MenuComponent.java
@@ -45,7 +45,7 @@
  * through the method <code>processEvent</code>.
  *
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public abstract class MenuComponent implements java.io.Serializable {
 
@@ -175,7 +175,7 @@
      * Gets the name of the menu component.
      * @return        the name of the menu component
      * @see           java.awt.MenuComponent#setName(java.lang.String)
-     * @since         JDK1.1
+     * @since         1.1
      */
     public String getName() {
         if (name == null && !nameExplicitlySet) {
@@ -191,7 +191,7 @@
      * Sets the name of the component to the specified string.
      * @param         name    the name of the menu component
      * @see           java.awt.MenuComponent#getName
-     * @since         JDK1.1
+     * @since         1.1
      */
     public void setName(String name) {
         synchronized(this) {
@@ -373,7 +373,7 @@
      * exception.
      *
      * @param e the event
-     * @since JDK1.1
+     * @since 1.1
      */
     protected void processEvent(AWTEvent e) {
     }
diff --git a/jdk/src/share/classes/java/awt/MenuItem.java b/jdk/src/share/classes/java/awt/MenuItem.java
index e3514f5..a81c131 100644
--- a/jdk/src/share/classes/java/awt/MenuItem.java
+++ b/jdk/src/share/classes/java/awt/MenuItem.java
@@ -176,7 +176,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since    JDK1.1
+     * @since    1.1
      */
     public MenuItem() throws HeadlessException {
         this("", null);
@@ -192,7 +192,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since       JDK1.0
+     * @since       1.0
      */
     public MenuItem(String label) throws HeadlessException {
         this(label, null);
@@ -209,7 +209,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since       JDK1.1
+     * @since       1.1
      */
     public MenuItem(String label, MenuShortcut s) throws HeadlessException {
         this.label = label;
@@ -242,7 +242,7 @@
      * @return  the label of this menu item, or <code>null</code>
                        if this menu item has no label.
      * @see     java.awt.MenuItem#setLabel
-     * @since   JDK1.0
+     * @since   1.0
      */
     public String getLabel() {
         return label;
@@ -252,7 +252,7 @@
      * Sets the label for this menu item to the specified label.
      * @param     label   the new label, or <code>null</code> for no label.
      * @see       java.awt.MenuItem#getLabel
-     * @since     JDK1.0
+     * @since     1.0
      */
     public synchronized void setLabel(String label) {
         this.label = label;
@@ -265,7 +265,7 @@
     /**
      * Checks whether this menu item is enabled.
      * @see        java.awt.MenuItem#setEnabled
-     * @since      JDK1.0
+     * @since      1.0
      */
     public boolean isEnabled() {
         return enabled;
@@ -276,7 +276,7 @@
      * @param      b  if <code>true</code>, enables this menu item;
      *                       if <code>false</code>, disables it.
      * @see        java.awt.MenuItem#isEnabled
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized void setEnabled(boolean b) {
         enable(b);
@@ -327,7 +327,7 @@
      * @return      the menu shortcut associated with this menu item,
      *                   or <code>null</code> if none has been specified.
      * @see         java.awt.MenuItem#setShortcut
-     * @since       JDK1.1
+     * @since       1.1
      */
     public MenuShortcut getShortcut() {
         return shortcut;
@@ -340,7 +340,7 @@
      * @param       s  the menu shortcut to associate
      *                           with this menu item.
      * @see         java.awt.MenuItem#getShortcut
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setShortcut(MenuShortcut s) {
         shortcut = s;
@@ -353,7 +353,7 @@
     /**
      * Delete any <code>MenuShortcut</code> object associated
      * with this menu item.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void deleteShortcut() {
         shortcut = null;
@@ -455,7 +455,7 @@
      * @see         java.awt.MenuItem#processEvent
      * @see         java.awt.MenuItem#disableEvents
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected final void enableEvents(long eventsToEnable) {
         eventMask |= eventsToEnable;
@@ -470,7 +470,7 @@
      * @see         java.awt.MenuItem#processEvent
      * @see         java.awt.MenuItem#enableEvents
      * @see         java.awt.Component#disableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected final void disableEvents(long eventsToDisable) {
         eventMask &= ~eventsToDisable;
@@ -485,7 +485,7 @@
      * @param       command   the action command to be set
      *                                for this menu item.
      * @see         java.awt.MenuItem#getActionCommand
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setActionCommand(String command) {
         actionCommand = command;
@@ -495,7 +495,7 @@
      * Gets the command name of the action event that is fired
      * by this menu item.
      * @see         java.awt.MenuItem#setActionCommand
-     * @since       JDK1.1
+     * @since       1.1
      */
     public String getActionCommand() {
         return getActionCommandImpl();
@@ -518,7 +518,7 @@
      * @see        #getActionListeners
      * @see        java.awt.event.ActionEvent
      * @see        java.awt.event.ActionListener
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized void addActionListener(ActionListener l) {
         if (l == null) {
@@ -540,7 +540,7 @@
      * @see        #getActionListeners
      * @see        java.awt.event.ActionEvent
      * @see        java.awt.event.ActionListener
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized void removeActionListener(ActionListener l) {
         if (l == null) {
@@ -621,7 +621,7 @@
      *
      * @param       e the event
      * @see         java.awt.MenuItem#processActionEvent
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ActionEvent) {
@@ -661,7 +661,7 @@
      * @see         java.awt.event.ActionEvent
      * @see         java.awt.event.ActionListener
      * @see         java.awt.MenuItem#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processActionEvent(ActionEvent e) {
         ActionListener listener = actionListener;
diff --git a/jdk/src/share/classes/java/awt/MenuShortcut.java b/jdk/src/share/classes/java/awt/MenuShortcut.java
index f69f445..f7ffdcb 100644
--- a/jdk/src/share/classes/java/awt/MenuShortcut.java
+++ b/jdk/src/share/classes/java/awt/MenuShortcut.java
@@ -54,7 +54,7 @@
  * via {@link Toolkit#getMenuShortcutKeyMask}.
  *
  * @author Thomas Ball
- * @since JDK1.1
+ * @since 1.1
  */
 public class MenuShortcut implements java.io.Serializable
 {
@@ -71,7 +71,7 @@
      * @see #getKey()
      * @see #usesShiftModifier()
      * @see java.awt.event.KeyEvent
-     * @since JDK1.1
+     * @since 1.1
      */
     int key;
 
@@ -82,7 +82,7 @@
      *
      * @serial
      * @see #usesShiftModifier()
-     * @since JDK1.1
+     * @since 1.1
      */
     boolean usesShift;
 
@@ -120,7 +120,7 @@
      * Returns the raw keycode of this MenuShortcut.
      * @return the raw keycode of this MenuShortcut.
      * @see java.awt.event.KeyEvent
-     * @since JDK1.1
+     * @since 1.1
      */
     public int getKey() {
         return key;
@@ -130,7 +130,7 @@
      * Returns whether this MenuShortcut must be invoked using the SHIFT key.
      * @return <code>true</code> if this MenuShortcut must be invoked using the
      * SHIFT key, <code>false</code> otherwise.
-     * @since JDK1.1
+     * @since 1.1
      */
     public boolean usesShiftModifier() {
         return usesShift;
@@ -143,7 +143,7 @@
      * @param s the MenuShortcut to compare with this.
      * @return <code>true</code> if this MenuShortcut is the same as another,
      * <code>false</code> otherwise.
-     * @since JDK1.1
+     * @since 1.1
      */
     public boolean equals(MenuShortcut s) {
         return (s != null && (s.getKey() == key) &&
@@ -178,7 +178,7 @@
     /**
      * Returns an internationalized description of the MenuShortcut.
      * @return a string representation of this MenuShortcut.
-     * @since JDK1.1
+     * @since 1.1
      */
     public String toString() {
         int modifiers = 0;
@@ -196,7 +196,7 @@
      * Returns the parameter string representing the state of this
      * MenuShortcut. This string is useful for debugging.
      * @return    the parameter string of this MenuShortcut.
-     * @since JDK1.1
+     * @since 1.1
      */
     protected String paramString() {
         String str = "key=" + key;
diff --git a/jdk/src/share/classes/java/awt/Panel.java b/jdk/src/share/classes/java/awt/Panel.java
index b0fab2f..bb35035 100644
--- a/jdk/src/share/classes/java/awt/Panel.java
+++ b/jdk/src/share/classes/java/awt/Panel.java
@@ -36,7 +36,7 @@
  *
  * @author      Sami Shaio
  * @see     java.awt.FlowLayout
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Panel extends Container implements Accessible {
     private static final String base = "panel";
@@ -59,7 +59,7 @@
     /**
      * Creates a new panel with the specified layout manager.
      * @param layout the layout manager for this panel.
-     * @since JDK1.1
+     * @since 1.1
      */
     public Panel(LayoutManager layout) {
         setLayout(layout);
diff --git a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java
index 5f38896..7ee26f5 100644
--- a/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java
+++ b/jdk/src/share/classes/java/awt/ScrollPaneAdjustable.java
@@ -393,7 +393,7 @@
      * @see           #getAdjustmentListeners
      * @see           java.awt.event.AdjustmentListener
      * @see           java.awt.event.AdjustmentEvent
-     * @since         JDK1.1
+     * @since         1.1
      */
     public synchronized void removeAdjustmentListener(AdjustmentListener l){
         if (l == null) {
diff --git a/jdk/src/share/classes/java/awt/Scrollbar.java b/jdk/src/share/classes/java/awt/Scrollbar.java
index af03158..bf119ae 100644
--- a/jdk/src/share/classes/java/awt/Scrollbar.java
+++ b/jdk/src/share/classes/java/awt/Scrollbar.java
@@ -161,7 +161,7 @@
  * @author      Sami Shaio
  * @see         java.awt.event.AdjustmentEvent
  * @see         java.awt.event.AdjustmentListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Scrollbar extends Component implements Adjustable, Accessible {
 
@@ -460,7 +460,7 @@
      * @exception   IllegalArgumentException  if the value supplied
      *                   for <code>orientation</code> is not a
      *                   legal value
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setOrientation(int orientation) {
         synchronized (getTreeLock()) {
@@ -566,7 +566,7 @@
      * @param       newMinimum   the new minimum value for this scroll bar
      * @see         java.awt.Scrollbar#setValues
      * @see         java.awt.Scrollbar#setMaximum
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setMinimum(int newMinimum) {
         // No checks are necessary in this method since minimum is
@@ -611,7 +611,7 @@
      *                     for this scroll bar
      * @see         java.awt.Scrollbar#setValues
      * @see         java.awt.Scrollbar#setMinimum
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setMaximum(int newMaximum) {
         // minimum is checked first in setValues, so we need to
@@ -649,7 +649,7 @@
      *
      * @return      the visible amount of this scroll bar
      * @see         java.awt.Scrollbar#setVisibleAmount
-     * @since       JDK1.1
+     * @since       1.1
      */
     public int getVisibleAmount() {
         return getVisible();
@@ -697,7 +697,7 @@
      * @param       newAmount the new visible amount
      * @see         java.awt.Scrollbar#getVisibleAmount
      * @see         java.awt.Scrollbar#setValues
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setVisibleAmount(int newAmount) {
         // Use setValues so that a consistent policy relating
@@ -722,7 +722,7 @@
      * @param        v  the amount by which to increment or decrement
      *                         the scroll bar's value
      * @see          java.awt.Scrollbar#getUnitIncrement
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setUnitIncrement(int v) {
         setLineIncrement(v);
@@ -761,7 +761,7 @@
      *
      * @return      the unit increment of this scroll bar
      * @see         java.awt.Scrollbar#setUnitIncrement
-     * @since       JDK1.1
+     * @since       1.1
      */
     public int getUnitIncrement() {
         return getLineIncrement();
@@ -790,7 +790,7 @@
      * @param        v  the amount by which to increment or decrement
      *                         the scroll bar's value
      * @see          java.awt.Scrollbar#getBlockIncrement
-     * @since        JDK1.1
+     * @since        1.1
      */
     public void setBlockIncrement(int v) {
         setPageIncrement(v);
@@ -826,7 +826,7 @@
      *
      * @return      the block increment of this scroll bar
      * @see         java.awt.Scrollbar#setBlockIncrement
-     * @since       JDK1.1
+     * @since       1.1
      */
     public int getBlockIncrement() {
         return getPageIncrement();
@@ -972,7 +972,7 @@
      * @see          #getAdjustmentListeners
      * @see          java.awt.event.AdjustmentEvent
      * @see          java.awt.event.AdjustmentListener
-     * @since        JDK1.1
+     * @since        1.1
      */
     public synchronized void addAdjustmentListener(AdjustmentListener l) {
         if (l == null) {
@@ -995,7 +995,7 @@
      * @see             #getAdjustmentListeners
      * @see             java.awt.event.AdjustmentEvent
      * @see             java.awt.event.AdjustmentListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeAdjustmentListener(AdjustmentListener l) {
         if (l == null) {
@@ -1086,7 +1086,7 @@
      * @param        e the event
      * @see          java.awt.event.AdjustmentEvent
      * @see          java.awt.Scrollbar#processAdjustmentEvent
-     * @since        JDK1.1
+     * @since        1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof AdjustmentEvent) {
@@ -1118,7 +1118,7 @@
      * @see         java.awt.event.AdjustmentListener
      * @see         java.awt.Scrollbar#addAdjustmentListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processAdjustmentEvent(AdjustmentEvent e) {
         AdjustmentListener listener = adjustmentListener;
diff --git a/jdk/src/share/classes/java/awt/TextArea.java b/jdk/src/share/classes/java/awt/TextArea.java
index f86de9a..dd90aa7 100644
--- a/jdk/src/share/classes/java/awt/TextArea.java
+++ b/jdk/src/share/classes/java/awt/TextArea.java
@@ -51,7 +51,7 @@
  * </pre></blockquote><hr>
  *
  * @author      Sami Shaio
- * @since       JDK1.0
+ * @since       1.0
  */
 public class TextArea extends TextComponent {
 
@@ -84,25 +84,25 @@
 
     /**
      * Create and display both vertical and horizontal scrollbars.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCROLLBARS_BOTH = 0;
 
     /**
      * Create and display vertical scrollbar only.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCROLLBARS_VERTICAL_ONLY = 1;
 
     /**
      * Create and display horizontal scrollbar only.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCROLLBARS_HORIZONTAL_ONLY = 2;
 
     /**
      * Do not create or display any scrollbars for the text area.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static final int SCROLLBARS_NONE = 3;
 
@@ -248,7 +248,7 @@
      *             <code>columns</code> is set to <code>0</code>
      * @param      scrollbars  a constant that determines what
      *             scrollbars are created to view the text area
-     * @since      JDK1.1
+     * @since      1.1
      * @exception HeadlessException if
      *    <code>GraphicsEnvironment.isHeadless</code> returns true
      * @see java.awt.GraphicsEnvironment#isHeadless()
@@ -307,7 +307,7 @@
      * @see        java.awt.TextComponent#setText
      * @see        java.awt.TextArea#replaceRange
      * @see        java.awt.TextArea#append
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void insert(String str, int pos) {
         insertText(str, pos);
@@ -335,7 +335,7 @@
      *
      * @param     str the non-<code>null</code> text to append
      * @see       java.awt.TextArea#insert
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void append(String str) {
         appendText(str);
@@ -371,7 +371,7 @@
      * @param     start    the start position
      * @param     end      the end position
      * @see       java.awt.TextArea#insert
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void replaceRange(String str, int start, int end) {
         replaceText(str, start, end);
@@ -396,7 +396,7 @@
      * @return    the number of rows in the text area
      * @see       #setRows(int)
      * @see       #getColumns()
-     * @since     JDK1
+     * @since     1.0
      */
     public int getRows() {
         return rows;
@@ -410,7 +410,7 @@
      * @exception   IllegalArgumentException   if the value
      *                 supplied for <code>rows</code>
      *                 is less than <code>0</code>
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setRows(int rows) {
         int oldVal = this.rows;
@@ -441,7 +441,7 @@
      * @exception   IllegalArgumentException   if the value
      *                 supplied for <code>columns</code>
      *                 is less than <code>0</code>
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setColumns(int columns) {
         int oldVal = this.columns;
@@ -469,7 +469,7 @@
      * @see        java.awt.TextArea#SCROLLBARS_HORIZONTAL_ONLY
      * @see        java.awt.TextArea#SCROLLBARS_NONE
      * @see        java.awt.TextArea#TextArea(java.lang.String, int, int, int)
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getScrollbarVisibility() {
         return scrollbarVisibility;
@@ -485,7 +485,7 @@
      *                       the text area with the specified
      *                       number of rows and columns
      * @see       java.awt.Component#getPreferredSize
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getPreferredSize(int rows, int columns) {
         return preferredSize(rows, columns);
@@ -509,7 +509,7 @@
      * Determines the preferred size of this text area.
      * @return    the preferred dimensions needed for this text area
      * @see       java.awt.Component#getPreferredSize
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getPreferredSize() {
         return preferredSize();
@@ -537,7 +537,7 @@
      *                       the text area with the specified
      *                       number of rows and columns
      * @see       java.awt.Component#getMinimumSize
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getMinimumSize(int rows, int columns) {
         return minimumSize(rows, columns);
@@ -561,7 +561,7 @@
      * Determines the minimum size of this text area.
      * @return    the preferred dimensions needed for this text area
      * @see       java.awt.Component#getPreferredSize
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getMinimumSize() {
         return minimumSize();
diff --git a/jdk/src/share/classes/java/awt/TextComponent.java b/jdk/src/share/classes/java/awt/TextComponent.java
index 70d0532..104fe02 100644
--- a/jdk/src/share/classes/java/awt/TextComponent.java
+++ b/jdk/src/share/classes/java/awt/TextComponent.java
@@ -55,7 +55,7 @@
  *
  * @author      Sami Shaio
  * @author      Arthur van Hoff
- * @since       JDK1.0
+ * @since       1.0
  */
 public class TextComponent extends Component implements Accessible {
 
@@ -268,7 +268,7 @@
      * @return     <code>true</code> if this text component is
      *                  editable; <code>false</code> otherwise.
      * @see        java.awt.TextComponent#setEditable
-     * @since      JDK1.0
+     * @since      1.0
      */
     public boolean isEditable() {
         return editable;
@@ -288,7 +288,7 @@
      * @param     b   a flag indicating whether this text component
      *                      is user editable.
      * @see       java.awt.TextComponent#isEditable
-     * @since     JDK1.0
+     * @since     1.0
      */
     public synchronized void setEditable(boolean b) {
         if (editable == b) {
@@ -313,7 +313,7 @@
      *         If this text component does not have a background color,
      *         the background color of its parent is returned.
      * @see #setBackground(Color)
-     * @since JDK1.0
+     * @since 1.0
      */
     public Color getBackground() {
         if (!editable && !backgroundSetByClientCode) {
@@ -330,7 +330,7 @@
      *        If this parameter is null then this text component
      *        will inherit the background color of its parent.
      * @see #getBackground()
-     * @since JDK1.0
+     * @since 1.0
      */
     public void setBackground(Color c) {
         backgroundSetByClientCode = true;
@@ -365,7 +365,7 @@
      *                        selected text
      * @see         java.awt.TextComponent#getSelectionStart
      * @see         java.awt.TextComponent#setSelectionEnd
-     * @since       JDK1.1
+     * @since       1.1
      */
     public synchronized void setSelectionStart(int selectionStart) {
         /* Route through select method to enforce consistent policy
@@ -401,7 +401,7 @@
      *                        selected text
      * @see         java.awt.TextComponent#getSelectionEnd
      * @see         java.awt.TextComponent#setSelectionStart
-     * @since       JDK1.1
+     * @since       1.1
      */
     public synchronized void setSelectionEnd(int selectionEnd) {
         /* Route through select method to enforce consistent policy
@@ -494,7 +494,7 @@
      * @param        position the position of the text insertion caret
      * @exception    IllegalArgumentException if <code>position</code>
      *               is less than zero
-     * @since        JDK1.1
+     * @since        1.1
      */
     public synchronized void setCaretPosition(int position) {
         if (position < 0) {
@@ -523,7 +523,7 @@
      *
      * @return       the position of the text insertion caret
      * @see #setCaretPosition(int)
-     * @since        JDK1.1
+     * @since        1.1
      */
     public synchronized int getCaretPosition() {
         TextComponentPeer peer = (TextComponentPeer)this.peer;
@@ -574,7 +574,7 @@
      * @see             #addTextListener
      * @see             #getTextListeners
      * @see             java.awt.event.TextListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeTextListener(TextListener l) {
         if (l == null) {
diff --git a/jdk/src/share/classes/java/awt/TextField.java b/jdk/src/share/classes/java/awt/TextField.java
index 533c6a7..3b46468 100644
--- a/jdk/src/share/classes/java/awt/TextField.java
+++ b/jdk/src/share/classes/java/awt/TextField.java
@@ -92,7 +92,7 @@
  * @see         java.awt.TextField#processEvent
  * @see         java.awt.TextField#processActionEvent
  * @see         java.awt.TextField#addActionListener
- * @since       JDK1.0
+ * @since       1.0
  */
 public class TextField extends TextComponent {
 
@@ -265,7 +265,7 @@
      * @param       c   the echo character for this text field.
      * @see         java.awt.TextField#echoCharIsSet
      * @see         java.awt.TextField#getEchoChar
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setEchoChar(char c) {
         setEchoCharacter(c);
@@ -321,7 +321,7 @@
      * approximate average character width that is platform-dependent.
      * @return     the number of columns.
      * @see        java.awt.TextField#setColumns
-     * @since      JDK1.1
+     * @since      1.1
      */
     public int getColumns() {
         return columns;
@@ -335,7 +335,7 @@
      * @exception  IllegalArgumentException   if the value
      *                 supplied for <code>columns</code>
      *                 is less than <code>0</code>.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public void setColumns(int columns) {
         int oldVal;
@@ -361,7 +361,7 @@
      *                 in this text field.
      * @return    the preferred dimensions for
      *                 displaying this text field.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Dimension getPreferredSize(int columns) {
         return preferredSize(columns);
@@ -385,7 +385,7 @@
      * Gets the preferred size of this text field.
      * @return     the preferred dimensions for
      *                         displaying this text field.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Dimension getPreferredSize() {
         return preferredSize();
@@ -409,7 +409,7 @@
      * the specified number of columns.
      * @param    columns   the number of columns in
      *                          this text field.
-     * @since    JDK1.1
+     * @since    1.1
      */
     public Dimension getMinimumSize(int columns) {
         return minimumSize(columns);
@@ -433,7 +433,7 @@
      * Gets the minimum dimensions for this text field.
      * @return     the minimum dimensions for
      *                  displaying this text field.
-     * @since      JDK1.1
+     * @since      1.1
      */
     public Dimension getMinimumSize() {
         return minimumSize();
@@ -463,7 +463,7 @@
      * @see        #removeActionListener
      * @see        #getActionListeners
      * @see        java.awt.event.ActionListener
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized void addActionListener(ActionListener l) {
         if (l == null) {
@@ -484,7 +484,7 @@
      * @see             #addActionListener
      * @see             #getActionListeners
      * @see             java.awt.event.ActionListener
-     * @since           JDK1.1
+     * @since           1.1
      */
     public synchronized void removeActionListener(ActionListener l) {
         if (l == null) {
@@ -578,7 +578,7 @@
      * @param      e the event
      * @see        java.awt.event.ActionEvent
      * @see        java.awt.TextField#processActionEvent
-     * @since      JDK1.1
+     * @since      1.1
      */
     protected void processEvent(AWTEvent e) {
         if (e instanceof ActionEvent) {
@@ -609,7 +609,7 @@
      * @see         java.awt.event.ActionListener
      * @see         java.awt.TextField#addActionListener
      * @see         java.awt.Component#enableEvents
-     * @since       JDK1.1
+     * @since       1.1
      */
     protected void processActionEvent(ActionEvent e) {
         ActionListener listener = actionListener;
diff --git a/jdk/src/share/classes/java/awt/Toolkit.java b/jdk/src/share/classes/java/awt/Toolkit.java
index 90f9f24..7bc8c24 100644
--- a/jdk/src/share/classes/java/awt/Toolkit.java
+++ b/jdk/src/share/classes/java/awt/Toolkit.java
@@ -108,7 +108,7 @@
  * @author      Sami Shaio
  * @author      Arthur van Hoff
  * @author      Fred Ecks
- * @since       JDK1.0
+ * @since       1.0
  */
 public abstract class Toolkit {
 
@@ -222,7 +222,7 @@
      * @see       java.awt.GraphicsEnvironment#isHeadless
      * @see       java.awt.ScrollPane
      * @see       java.awt.peer.ScrollPanePeer
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected abstract ScrollPanePeer createScrollPane(ScrollPane target)
         throws HeadlessException;
@@ -355,7 +355,7 @@
      * @see       java.awt.GraphicsEnvironment#isHeadless
      * @see       java.awt.PopupMenu
      * @see       java.awt.peer.PopupMenuPeer
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected abstract PopupMenuPeer createPopupMenu(PopupMenu target)
         throws HeadlessException;
@@ -457,7 +457,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true
      * @see       java.awt.GraphicsEnvironment#isHeadless
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected void loadSystemColors(int[] systemColors)
         throws HeadlessException {
@@ -1105,7 +1105,7 @@
      * @param     imagedata   an array of bytes, representing
      *                         image data in a supported image format.
      * @return    an image.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Image createImage(byte[] imagedata) {
         return createImage(imagedata, 0, imagedata.length);
@@ -1122,7 +1122,7 @@
      *                         of the data in the array.
      * @param     imagelength  the length of the data in the array.
      * @return    an image.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public abstract Image createImage(byte[] imagedata,
                                       int imageoffset,
@@ -1159,7 +1159,7 @@
      * @see     java.awt.GraphicsEnvironment#isHeadless
      * @see     java.awt.PrintJob
      * @see     java.lang.RuntimePermission
-     * @since   JDK1.1
+     * @since   1.1
      */
     public abstract PrintJob getPrintJob(Frame frame, String jobtitle,
                                          Properties props);
@@ -1230,7 +1230,7 @@
     /**
      * Emits an audio beep depending on native system settings and hardware
      * capabilities.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public abstract void beep();
 
@@ -1273,7 +1273,7 @@
      * @see       java.awt.datatransfer.DataFlavor#plainTextFlavor
      * @see       java.io.Reader
      * @see       java.awt.AWTPermission
-     * @since     JDK1.1
+     * @since     1.1
      */
     public abstract Clipboard getSystemClipboard()
         throws HeadlessException;
@@ -1353,7 +1353,7 @@
      * @see       java.awt.GraphicsEnvironment#isHeadless
      * @see       java.awt.MenuBar
      * @see       java.awt.MenuShortcut
-     * @since     JDK1.1
+     * @since     1.1
      */
     public int getMenuShortcutKeyMask() throws HeadlessException {
         GraphicsEnvironment.checkHeadless();
diff --git a/jdk/src/share/classes/java/awt/Window.java b/jdk/src/share/classes/java/awt/Window.java
index 801b643..47bcdf3 100644
--- a/jdk/src/share/classes/java/awt/Window.java
+++ b/jdk/src/share/classes/java/awt/Window.java
@@ -143,7 +143,7 @@
  * @see WindowEvent
  * @see #addWindowListener
  * @see java.awt.BorderLayout
- * @since       JDK1.0
+ * @since       1.0
  */
 public class Window extends Container implements Accessible {
 
@@ -753,7 +753,7 @@
      * not be called directly by programs.
      * @see Component#isDisplayable
      * @see Container#removeNotify
-     * @since JDK1.0
+     * @since 1.0
      */
     public void addNotify() {
         synchronized (getTreeLock()) {
@@ -1405,7 +1405,7 @@
      * is returned.
      * @return    the locale that is set for this window.
      * @see       java.util.Locale
-     * @since     JDK1.1
+     * @since     1.1
      */
     public Locale getLocale() {
       if (this.locale == null) {
@@ -1441,7 +1441,7 @@
      *            Cursor.DEFAULT_CURSOR.
      * @see       Component#getCursor
      * @see       Cursor
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void setCursor(Cursor cursor) {
         if (cursor == null) {
diff --git a/jdk/src/share/classes/java/awt/datatransfer/package.html b/jdk/src/share/classes/java/awt/datatransfer/package.html
index abaf6b8..c3b55e8 100644
--- a/jdk/src/share/classes/java/awt/datatransfer/package.html
+++ b/jdk/src/share/classes/java/awt/datatransfer/package.html
@@ -59,6 +59,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/awt/event/InputEvent.java b/jdk/src/share/classes/java/awt/event/InputEvent.java
index ad3d87b..d495301 100644
--- a/jdk/src/share/classes/java/awt/event/InputEvent.java
+++ b/jdk/src/share/classes/java/awt/event/InputEvent.java
@@ -162,7 +162,7 @@
      * @see getButtonDownMasks
      * There are twenty buttons fit into 4byte space.
      * one more bit is reserved for FIRST_HIGH_BIT.
-     * @since 7.0
+     * @since 1.7
      */
     private static final int [] BUTTON_DOWN_MASK = new int [] { BUTTON1_DOWN_MASK,
                                                                BUTTON2_DOWN_MASK,
@@ -187,7 +187,7 @@
 
     /**
      * A method to access an array of extended modifiers for additional buttons.
-     * @since 7.0
+     * @since 1.7
      */
     private static int [] getButtonDownMasks(){
         return Arrays.copyOf(BUTTON_DOWN_MASK, BUTTON_DOWN_MASK.length);
@@ -237,7 +237,7 @@
      * @return a mask for an existing mouse button.
      * @throws IllegalArgumentException if {@code button} is less than zero or greater than the number
      *         of button masks reserved for buttons
-     * @since 7.0
+     * @since 1.7
      * @see java.awt.MouseInfo#getNumberOfButtons()
      * @see Toolkit#areExtraMouseButtonsEnabled()
      * @see MouseEvent#getModifiers()
diff --git a/jdk/src/share/classes/java/awt/event/WindowEvent.java b/jdk/src/share/classes/java/awt/event/WindowEvent.java
index 6750805..92e28af 100644
--- a/jdk/src/share/classes/java/awt/event/WindowEvent.java
+++ b/jdk/src/share/classes/java/awt/event/WindowEvent.java
@@ -54,7 +54,7 @@
  * @see WindowListener
  * @see <a href="http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html">Tutorial: Writing a Window Listener</a>
  *
- * @since JDK1.1
+ * @since 1.1
  */
 public class WindowEvent extends ComponentEvent {
 
diff --git a/jdk/src/share/classes/java/awt/event/package.html b/jdk/src/share/classes/java/awt/event/package.html
index 5da7989..0e2ae75 100644
--- a/jdk/src/share/classes/java/awt/event/package.html
+++ b/jdk/src/share/classes/java/awt/event/package.html
@@ -53,6 +53,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/awt/im/spi/package.html b/jdk/src/share/classes/java/awt/im/spi/package.html
index 58e77ee..11d28e6 100644
--- a/jdk/src/share/classes/java/awt/im/spi/package.html
+++ b/jdk/src/share/classes/java/awt/im/spi/package.html
@@ -121,6 +121,6 @@
    Method Engine SPI Tutorial</A></B>
 </UL>
 
-@since JDK1.3
+@since 1.3
 </BODY>
 </HTML>
diff --git a/jdk/src/share/classes/java/awt/image/package.html b/jdk/src/share/classes/java/awt/image/package.html
index 5f47da4..5ea3b80 100644
--- a/jdk/src/share/classes/java/awt/image/package.html
+++ b/jdk/src/share/classes/java/awt/image/package.html
@@ -53,6 +53,6 @@
 </ul>
 -->
 
-@since JDK1.0
+@since 1.0
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/awt/package.html b/jdk/src/share/classes/java/awt/package.html
index 3d157e5..ebab6ec 100644
--- a/jdk/src/share/classes/java/awt/package.html
+++ b/jdk/src/share/classes/java/awt/package.html
@@ -78,6 +78,6 @@
 </ul>
 -->
 
-@since JDK1.0
+@since 1.0
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/io/BufferedInputStream.java b/jdk/src/share/classes/java/io/BufferedInputStream.java
index fede2fe..acf3258 100644
--- a/jdk/src/share/classes/java/io/BufferedInputStream.java
+++ b/jdk/src/share/classes/java/io/BufferedInputStream.java
@@ -45,7 +45,7 @@
  * the contained input stream.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class BufferedInputStream extends FilterInputStream {
diff --git a/jdk/src/share/classes/java/io/BufferedOutputStream.java b/jdk/src/share/classes/java/io/BufferedOutputStream.java
index 0579704..f15f58d 100644
--- a/jdk/src/share/classes/java/io/BufferedOutputStream.java
+++ b/jdk/src/share/classes/java/io/BufferedOutputStream.java
@@ -32,7 +32,7 @@
  * system for each byte written.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class BufferedOutputStream extends FilterOutputStream {
diff --git a/jdk/src/share/classes/java/io/BufferedReader.java b/jdk/src/share/classes/java/io/BufferedReader.java
index ee9f66a..b44d2b2 100644
--- a/jdk/src/share/classes/java/io/BufferedReader.java
+++ b/jdk/src/share/classes/java/io/BufferedReader.java
@@ -64,7 +64,7 @@
  * @see java.nio.file.Files#newBufferedReader
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class BufferedReader extends Reader {
diff --git a/jdk/src/share/classes/java/io/BufferedWriter.java b/jdk/src/share/classes/java/io/BufferedWriter.java
index a5d810a..be4b6cd 100644
--- a/jdk/src/share/classes/java/io/BufferedWriter.java
+++ b/jdk/src/share/classes/java/io/BufferedWriter.java
@@ -60,7 +60,7 @@
  * @see java.nio.file.Files#newBufferedWriter
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class BufferedWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/ByteArrayInputStream.java b/jdk/src/share/classes/java/io/ByteArrayInputStream.java
index d07f074..28fb1af 100644
--- a/jdk/src/share/classes/java/io/ByteArrayInputStream.java
+++ b/jdk/src/share/classes/java/io/ByteArrayInputStream.java
@@ -38,7 +38,7 @@
  *
  * @author  Arthur van Hoff
  * @see     java.io.StringBufferInputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ByteArrayInputStream extends InputStream {
@@ -73,7 +73,7 @@
      * If no mark has been set, then the value of mark is the offset
      * passed to the constructor (or 0 if the offset was not supplied).
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected int mark = 0;
 
@@ -237,7 +237,7 @@
      * <code>markSupported</code> method of <code>ByteArrayInputStream</code>
      * always returns <code>true</code>.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public boolean markSupported() {
         return true;
@@ -256,7 +256,7 @@
      * <p> Note: The <code>readAheadLimit</code> for this class
      *  has no meaning.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public void mark(int readAheadLimit) {
         mark = pos;
diff --git a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java
index 257104c..71be2db 100644
--- a/jdk/src/share/classes/java/io/ByteArrayOutputStream.java
+++ b/jdk/src/share/classes/java/io/ByteArrayOutputStream.java
@@ -39,7 +39,7 @@
  * generating an <tt>IOException</tt>.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class ByteArrayOutputStream extends OutputStream {
@@ -202,7 +202,7 @@
      * required.
      *
      * @return String decoded from the buffer's contents.
-     * @since  JDK1.1
+     * @since  1.1
      */
     public synchronized String toString() {
         return new String(buf, 0, count);
@@ -224,7 +224,7 @@
      * @return     String decoded from the buffer's contents.
      * @exception  UnsupportedEncodingException
      *             If the named charset is not supported
-     * @since      JDK1.1
+     * @since      1.1
      */
     public synchronized String toString(String charsetName)
         throws UnsupportedEncodingException
diff --git a/jdk/src/share/classes/java/io/CharArrayReader.java b/jdk/src/share/classes/java/io/CharArrayReader.java
index 08d447a..89ac47b 100644
--- a/jdk/src/share/classes/java/io/CharArrayReader.java
+++ b/jdk/src/share/classes/java/io/CharArrayReader.java
@@ -30,7 +30,7 @@
  * character-input stream.
  *
  * @author      Herb Jellinek
- * @since       JDK1.1
+ * @since       1.1
  */
 public class CharArrayReader extends Reader {
     /** The character buffer. */
diff --git a/jdk/src/share/classes/java/io/CharArrayWriter.java b/jdk/src/share/classes/java/io/CharArrayWriter.java
index 56a5821..317df3d 100644
--- a/jdk/src/share/classes/java/io/CharArrayWriter.java
+++ b/jdk/src/share/classes/java/io/CharArrayWriter.java
@@ -37,7 +37,7 @@
  * without generating an IOException.
  *
  * @author      Herb Jellinek
- * @since       JDK1.1
+ * @since       1.1
  */
 public
 class CharArrayWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/CharConversionException.java b/jdk/src/share/classes/java/io/CharConversionException.java
index ba79fe3..832dc49 100644
--- a/jdk/src/share/classes/java/io/CharConversionException.java
+++ b/jdk/src/share/classes/java/io/CharConversionException.java
@@ -28,7 +28,7 @@
  * Base class for character conversion exceptions.
  *
  * @author      Asmus Freytag
- * @since       JDK1.1
+ * @since       1.1
  */
 public class CharConversionException
     extends java.io.IOException
diff --git a/jdk/src/share/classes/java/io/DataInput.java b/jdk/src/share/classes/java/io/DataInput.java
index 3e0f0dd..dca9187 100644
--- a/jdk/src/share/classes/java/io/DataInput.java
+++ b/jdk/src/share/classes/java/io/DataInput.java
@@ -143,7 +143,7 @@
  * @author  Frank Yellin
  * @see     java.io.DataInputStream
  * @see     java.io.DataOutput
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 interface DataInput {
diff --git a/jdk/src/share/classes/java/io/DataInputStream.java b/jdk/src/share/classes/java/io/DataInputStream.java
index 7b24b74..0ef3c35 100644
--- a/jdk/src/share/classes/java/io/DataInputStream.java
+++ b/jdk/src/share/classes/java/io/DataInputStream.java
@@ -37,7 +37,7 @@
  *
  * @author  Arthur van Hoff
  * @see     java.io.DataOutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class DataInputStream extends FilterInputStream implements DataInput {
diff --git a/jdk/src/share/classes/java/io/DataOutput.java b/jdk/src/share/classes/java/io/DataOutput.java
index c6692a6..50de041 100644
--- a/jdk/src/share/classes/java/io/DataOutput.java
+++ b/jdk/src/share/classes/java/io/DataOutput.java
@@ -44,7 +44,7 @@
  * @author  Frank Yellin
  * @see     java.io.DataInput
  * @see     java.io.DataOutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 interface DataOutput {
diff --git a/jdk/src/share/classes/java/io/DataOutputStream.java b/jdk/src/share/classes/java/io/DataOutputStream.java
index 99fafed..392abba 100644
--- a/jdk/src/share/classes/java/io/DataOutputStream.java
+++ b/jdk/src/share/classes/java/io/DataOutputStream.java
@@ -32,7 +32,7 @@
  *
  * @author  unascribed
  * @see     java.io.DataInputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class DataOutputStream extends FilterOutputStream implements DataOutput {
diff --git a/jdk/src/share/classes/java/io/EOFException.java b/jdk/src/share/classes/java/io/EOFException.java
index 536669f..446373e 100644
--- a/jdk/src/share/classes/java/io/EOFException.java
+++ b/jdk/src/share/classes/java/io/EOFException.java
@@ -36,7 +36,7 @@
  * @author  Frank Yellin
  * @see     java.io.DataInputStream
  * @see     java.io.IOException
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class EOFException extends IOException {
diff --git a/jdk/src/share/classes/java/io/Externalizable.java b/jdk/src/share/classes/java/io/Externalizable.java
index f9e88fe..f5f3f9a 100644
--- a/jdk/src/share/classes/java/io/Externalizable.java
+++ b/jdk/src/share/classes/java/io/Externalizable.java
@@ -61,7 +61,7 @@
  * @see java.io.ObjectOutput
  * @see java.io.ObjectInput
  * @see java.io.Serializable
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface Externalizable extends java.io.Serializable {
     /**
diff --git a/jdk/src/share/classes/java/io/File.java b/jdk/src/share/classes/java/io/File.java
index 846ddc3..f0528c7 100644
--- a/jdk/src/share/classes/java/io/File.java
+++ b/jdk/src/share/classes/java/io/File.java
@@ -143,7 +143,7 @@
  * diagnose errors when an operation on a file fails.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class File
@@ -608,7 +608,7 @@
      *          java.lang.SecurityManager#checkRead}</code> method denies
      *          read access to the file
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @see     Path#toRealPath
      */
     public String getCanonicalPath() throws IOException {
diff --git a/jdk/src/share/classes/java/io/FileInputStream.java b/jdk/src/share/classes/java/io/FileInputStream.java
index cc6710e..6f13156 100644
--- a/jdk/src/share/classes/java/io/FileInputStream.java
+++ b/jdk/src/share/classes/java/io/FileInputStream.java
@@ -43,7 +43,7 @@
  * @see     java.io.FileDescriptor
  * @see     java.io.FileOutputStream
  * @see     java.nio.file.Files#newInputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class FileInputStream extends InputStream
diff --git a/jdk/src/share/classes/java/io/FileNotFoundException.java b/jdk/src/share/classes/java/io/FileNotFoundException.java
index 278fa1d..898a9b79 100644
--- a/jdk/src/share/classes/java/io/FileNotFoundException.java
+++ b/jdk/src/share/classes/java/io/FileNotFoundException.java
@@ -37,7 +37,7 @@
  * example when an attempt is made to open a read-only file for writing.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class FileNotFoundException extends IOException {
diff --git a/jdk/src/share/classes/java/io/FileOutputStream.java b/jdk/src/share/classes/java/io/FileOutputStream.java
index 8377261..1f7cff5 100644
--- a/jdk/src/share/classes/java/io/FileOutputStream.java
+++ b/jdk/src/share/classes/java/io/FileOutputStream.java
@@ -47,7 +47,7 @@
  * @see     java.io.FileDescriptor
  * @see     java.io.FileInputStream
  * @see     java.nio.file.Files#newOutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class FileOutputStream extends OutputStream
@@ -125,7 +125,7 @@
      *               <code>checkWrite</code> method denies write access
      *               to the file.
      * @see        java.lang.SecurityManager#checkWrite(java.lang.String)
-     * @since     JDK1.1
+     * @since     1.1
      */
     public FileOutputStream(String name, boolean append)
         throws FileNotFoundException
diff --git a/jdk/src/share/classes/java/io/FileReader.java b/jdk/src/share/classes/java/io/FileReader.java
index acc3a19..39aa197 100644
--- a/jdk/src/share/classes/java/io/FileReader.java
+++ b/jdk/src/share/classes/java/io/FileReader.java
@@ -40,7 +40,7 @@
  * @see FileInputStream
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 public class FileReader extends InputStreamReader {
 
diff --git a/jdk/src/share/classes/java/io/FileWriter.java b/jdk/src/share/classes/java/io/FileWriter.java
index 7475ea4..e6b8c6a 100644
--- a/jdk/src/share/classes/java/io/FileWriter.java
+++ b/jdk/src/share/classes/java/io/FileWriter.java
@@ -46,7 +46,7 @@
  * @see FileOutputStream
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class FileWriter extends OutputStreamWriter {
diff --git a/jdk/src/share/classes/java/io/FilenameFilter.java b/jdk/src/share/classes/java/io/FilenameFilter.java
index 71b88af..e727813 100644
--- a/jdk/src/share/classes/java/io/FilenameFilter.java
+++ b/jdk/src/share/classes/java/io/FilenameFilter.java
@@ -37,7 +37,7 @@
  * @see     java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
  * @see     java.io.File
  * @see     java.io.File#list(java.io.FilenameFilter)
- * @since   JDK1.0
+ * @since   1.0
  */
 @FunctionalInterface
 public interface FilenameFilter {
diff --git a/jdk/src/share/classes/java/io/FilterInputStream.java b/jdk/src/share/classes/java/io/FilterInputStream.java
index 10beaea..2046fc7 100644
--- a/jdk/src/share/classes/java/io/FilterInputStream.java
+++ b/jdk/src/share/classes/java/io/FilterInputStream.java
@@ -40,7 +40,7 @@
  * and fields.
  *
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class FilterInputStream extends InputStream {
diff --git a/jdk/src/share/classes/java/io/FilterOutputStream.java b/jdk/src/share/classes/java/io/FilterOutputStream.java
index 209e63b..7d5b0c9 100644
--- a/jdk/src/share/classes/java/io/FilterOutputStream.java
+++ b/jdk/src/share/classes/java/io/FilterOutputStream.java
@@ -39,7 +39,7 @@
  * methods as well as provide additional methods and fields.
  *
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class FilterOutputStream extends OutputStream {
diff --git a/jdk/src/share/classes/java/io/FilterReader.java b/jdk/src/share/classes/java/io/FilterReader.java
index 0826230..35110ba 100644
--- a/jdk/src/share/classes/java/io/FilterReader.java
+++ b/jdk/src/share/classes/java/io/FilterReader.java
@@ -35,7 +35,7 @@
  * additional methods and fields.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public abstract class FilterReader extends Reader {
diff --git a/jdk/src/share/classes/java/io/FilterWriter.java b/jdk/src/share/classes/java/io/FilterWriter.java
index fb307d5..303c674 100644
--- a/jdk/src/share/classes/java/io/FilterWriter.java
+++ b/jdk/src/share/classes/java/io/FilterWriter.java
@@ -35,7 +35,7 @@
  * provide additional methods and fields.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public abstract class FilterWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/IOException.java b/jdk/src/share/classes/java/io/IOException.java
index 745b579..c0d6ea5 100644
--- a/jdk/src/share/classes/java/io/IOException.java
+++ b/jdk/src/share/classes/java/io/IOException.java
@@ -33,7 +33,7 @@
  * @author  unascribed
  * @see     java.io.InputStream
  * @see     java.io.OutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class IOException extends Exception {
diff --git a/jdk/src/share/classes/java/io/InputStream.java b/jdk/src/share/classes/java/io/InputStream.java
index 6c46a40..06634ae 100644
--- a/jdk/src/share/classes/java/io/InputStream.java
+++ b/jdk/src/share/classes/java/io/InputStream.java
@@ -40,7 +40,7 @@
  * @see     java.io.InputStream#read()
  * @see     java.io.OutputStream
  * @see     java.io.PushbackInputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class InputStream implements Closeable {
 
diff --git a/jdk/src/share/classes/java/io/InputStreamReader.java b/jdk/src/share/classes/java/io/InputStreamReader.java
index e131dca..564537e 100644
--- a/jdk/src/share/classes/java/io/InputStreamReader.java
+++ b/jdk/src/share/classes/java/io/InputStreamReader.java
@@ -56,7 +56,7 @@
  * @see java.nio.charset.Charset
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class InputStreamReader extends Reader {
diff --git a/jdk/src/share/classes/java/io/InterruptedIOException.java b/jdk/src/share/classes/java/io/InterruptedIOException.java
index da738de..96d3361 100644
--- a/jdk/src/share/classes/java/io/InterruptedIOException.java
+++ b/jdk/src/share/classes/java/io/InterruptedIOException.java
@@ -37,7 +37,7 @@
  * @see     java.io.InputStream
  * @see     java.io.OutputStream
  * @see     java.lang.Thread#interrupt()
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class InterruptedIOException extends IOException {
diff --git a/jdk/src/share/classes/java/io/InvalidClassException.java b/jdk/src/share/classes/java/io/InvalidClassException.java
index 77f0a5a..3d78c6b 100644
--- a/jdk/src/share/classes/java/io/InvalidClassException.java
+++ b/jdk/src/share/classes/java/io/InvalidClassException.java
@@ -36,7 +36,7 @@
  * </UL>
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class InvalidClassException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/InvalidObjectException.java b/jdk/src/share/classes/java/io/InvalidObjectException.java
index fbe1108..5853911 100644
--- a/jdk/src/share/classes/java/io/InvalidObjectException.java
+++ b/jdk/src/share/classes/java/io/InvalidObjectException.java
@@ -30,10 +30,10 @@
  * tests.  The argument should provide the reason for the failure.
  *
  * @see ObjectInputValidation
- * @since JDK1.1
+ * @since 1.1
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class InvalidObjectException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/LineNumberInputStream.java b/jdk/src/share/classes/java/io/LineNumberInputStream.java
index 1f37a98..2235a2b 100644
--- a/jdk/src/share/classes/java/io/LineNumberInputStream.java
+++ b/jdk/src/share/classes/java/io/LineNumberInputStream.java
@@ -40,7 +40,7 @@
  *
  * @author     Arthur van Hoff
  * @see        java.io.LineNumberReader
- * @since      JDK1.0
+ * @since      1.0
  * @deprecated This class incorrectly assumes that bytes adequately represent
  *             characters.  As of JDK&nbsp;1.1, the preferred way to operate on
  *             character streams is via the new character-stream classes, which
diff --git a/jdk/src/share/classes/java/io/LineNumberReader.java b/jdk/src/share/classes/java/io/LineNumberReader.java
index 29884fd..efd8290 100644
--- a/jdk/src/share/classes/java/io/LineNumberReader.java
+++ b/jdk/src/share/classes/java/io/LineNumberReader.java
@@ -44,7 +44,7 @@
  * immediately by a linefeed.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class LineNumberReader extends BufferedReader {
diff --git a/jdk/src/share/classes/java/io/NotActiveException.java b/jdk/src/share/classes/java/io/NotActiveException.java
index 13291e6..231598c 100644
--- a/jdk/src/share/classes/java/io/NotActiveException.java
+++ b/jdk/src/share/classes/java/io/NotActiveException.java
@@ -29,7 +29,7 @@
  * Thrown when serialization or deserialization is not active.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class NotActiveException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/NotSerializableException.java b/jdk/src/share/classes/java/io/NotSerializableException.java
index 70e4f57..43dbc1a 100644
--- a/jdk/src/share/classes/java/io/NotSerializableException.java
+++ b/jdk/src/share/classes/java/io/NotSerializableException.java
@@ -31,7 +31,7 @@
  * this exception. The argument should be the name of the class.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class NotSerializableException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/ObjectInput.java b/jdk/src/share/classes/java/io/ObjectInput.java
index bc7c26b..92d3b70 100644
--- a/jdk/src/share/classes/java/io/ObjectInput.java
+++ b/jdk/src/share/classes/java/io/ObjectInput.java
@@ -34,7 +34,7 @@
  * @see java.io.InputStream
  * @see java.io.ObjectOutputStream
  * @see java.io.ObjectInputStream
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface ObjectInput extends DataInput, AutoCloseable {
     /**
diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java
index e662270..e65c8ae 100644
--- a/jdk/src/share/classes/java/io/ObjectInputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectInputStream.java
@@ -200,7 +200,7 @@
  * @see java.io.ObjectOutputStream
  * @see java.io.Serializable
  * @see <a href="../../../platform/serialization/spec/input.html"> Object Serialization Specification, Section 3, Object Input Classes</a>
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ObjectInputStream
     extends InputStream implements ObjectInput, ObjectStreamConstants
diff --git a/jdk/src/share/classes/java/io/ObjectInputValidation.java b/jdk/src/share/classes/java/io/ObjectInputValidation.java
index dc6f842..09ee8a6 100644
--- a/jdk/src/share/classes/java/io/ObjectInputValidation.java
+++ b/jdk/src/share/classes/java/io/ObjectInputValidation.java
@@ -33,7 +33,7 @@
  * @author  unascribed
  * @see     ObjectInputStream
  * @see     ObjectInputStream#registerValidation(java.io.ObjectInputValidation, int)
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface ObjectInputValidation {
     /**
diff --git a/jdk/src/share/classes/java/io/ObjectOutput.java b/jdk/src/share/classes/java/io/ObjectOutput.java
index 7c2cbeb..720d198 100644
--- a/jdk/src/share/classes/java/io/ObjectOutput.java
+++ b/jdk/src/share/classes/java/io/ObjectOutput.java
@@ -34,7 +34,7 @@
  * @see java.io.InputStream
  * @see java.io.ObjectOutputStream
  * @see java.io.ObjectInputStream
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface ObjectOutput extends DataOutput, AutoCloseable {
     /**
diff --git a/jdk/src/share/classes/java/io/ObjectOutputStream.java b/jdk/src/share/classes/java/io/ObjectOutputStream.java
index 68888d4..7dc6dde 100644
--- a/jdk/src/share/classes/java/io/ObjectOutputStream.java
+++ b/jdk/src/share/classes/java/io/ObjectOutputStream.java
@@ -156,7 +156,7 @@
  * @see java.io.Serializable
  * @see java.io.Externalizable
  * @see <a href="../../../platform/serialization/spec/output.html">Object Serialization Specification, Section 2, Object Output Classes</a>
- * @since       JDK1.1
+ * @since       1.1
  */
 public class ObjectOutputStream
     extends OutputStream implements ObjectOutput, ObjectStreamConstants
diff --git a/jdk/src/share/classes/java/io/ObjectStreamClass.java b/jdk/src/share/classes/java/io/ObjectStreamClass.java
index 0ae46f0..1e8a434 100644
--- a/jdk/src/share/classes/java/io/ObjectStreamClass.java
+++ b/jdk/src/share/classes/java/io/ObjectStreamClass.java
@@ -67,7 +67,7 @@
  * @author      Roger Riggs
  * @see ObjectStreamField
  * @see <a href="../../../platform/serialization/spec/class.html">Object Serialization Specification, Section 4, Class Descriptors</a>
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ObjectStreamClass implements Serializable {
 
diff --git a/jdk/src/share/classes/java/io/ObjectStreamConstants.java b/jdk/src/share/classes/java/io/ObjectStreamConstants.java
index 23f72b4..fd7e766 100644
--- a/jdk/src/share/classes/java/io/ObjectStreamConstants.java
+++ b/jdk/src/share/classes/java/io/ObjectStreamConstants.java
@@ -29,7 +29,7 @@
  * Constants written into the Object Serialization Stream.
  *
  * @author  unascribed
- * @since JDK 1.1
+ * @since 1.1
  */
 public interface ObjectStreamConstants {
 
diff --git a/jdk/src/share/classes/java/io/ObjectStreamException.java b/jdk/src/share/classes/java/io/ObjectStreamException.java
index 889cad3..d87a56f 100644
--- a/jdk/src/share/classes/java/io/ObjectStreamException.java
+++ b/jdk/src/share/classes/java/io/ObjectStreamException.java
@@ -29,7 +29,7 @@
  * Superclass of all exceptions specific to Object Stream classes.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public abstract class ObjectStreamException extends IOException {
 
diff --git a/jdk/src/share/classes/java/io/OptionalDataException.java b/jdk/src/share/classes/java/io/OptionalDataException.java
index 91283fd..f51e0ac 100644
--- a/jdk/src/share/classes/java/io/OptionalDataException.java
+++ b/jdk/src/share/classes/java/io/OptionalDataException.java
@@ -43,7 +43,7 @@
  * </ul>
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class OptionalDataException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/OutputStream.java b/jdk/src/share/classes/java/io/OutputStream.java
index c6dd7de..08c4b26 100644
--- a/jdk/src/share/classes/java/io/OutputStream.java
+++ b/jdk/src/share/classes/java/io/OutputStream.java
@@ -41,7 +41,7 @@
  * @see     java.io.FilterOutputStream
  * @see     java.io.InputStream
  * @see     java.io.OutputStream#write(int)
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class OutputStream implements Closeable, Flushable {
     /**
diff --git a/jdk/src/share/classes/java/io/OutputStreamWriter.java b/jdk/src/share/classes/java/io/OutputStreamWriter.java
index 5f7b9e3..3896c38 100644
--- a/jdk/src/share/classes/java/io/OutputStreamWriter.java
+++ b/jdk/src/share/classes/java/io/OutputStreamWriter.java
@@ -71,7 +71,7 @@
  * @see java.nio.charset.Charset
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class OutputStreamWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/PipedInputStream.java b/jdk/src/share/classes/java/io/PipedInputStream.java
index 83dde31..7f27fde 100644
--- a/jdk/src/share/classes/java/io/PipedInputStream.java
+++ b/jdk/src/share/classes/java/io/PipedInputStream.java
@@ -45,7 +45,7 @@
  *
  * @author  James Gosling
  * @see     java.io.PipedOutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public class PipedInputStream extends InputStream {
     boolean closedByWriter = false;
@@ -63,7 +63,7 @@
 
     /**
      * The default size of the pipe's circular input buffer.
-     * @since   JDK1.1
+     * @since   1.1
      */
     // This used to be a constant before the pipe size was allowed
     // to change. This field will continue to be maintained
@@ -72,7 +72,7 @@
 
     /**
      * The circular buffer into which incoming data is placed.
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected byte buffer[];
 
@@ -81,14 +81,14 @@
      * next byte of data will be stored when received from the connected
      * piped output stream. <code>in&lt;0</code> implies the buffer is empty,
      * <code>in==out</code> implies the buffer is full
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected int in = -1;
 
     /**
      * The index of the position in the circular buffer at which the next
      * byte of data will be read by this piped input stream.
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected int out = 0;
 
@@ -195,7 +195,7 @@
      * @exception IOException If the pipe is <a href="#BROKEN"> <code>broken</code></a>,
      *          {@link #connect(java.io.PipedOutputStream) unconnected},
      *          closed, or if an I/O error occurs.
-     * @since     JDK1.1
+     * @since     1.1
      */
     protected synchronized void receive(int b) throws IOException {
         checkStateForReceive();
@@ -421,7 +421,7 @@
      *          <a href="#BROKEN"> <code>broken</code></a>.
      *
      * @exception  IOException  if an I/O error occurs.
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public synchronized int available() throws IOException {
         if(in < 0)
diff --git a/jdk/src/share/classes/java/io/PipedOutputStream.java b/jdk/src/share/classes/java/io/PipedOutputStream.java
index feed73a..d49e050 100644
--- a/jdk/src/share/classes/java/io/PipedOutputStream.java
+++ b/jdk/src/share/classes/java/io/PipedOutputStream.java
@@ -41,7 +41,7 @@
  *
  * @author  James Gosling
  * @see     java.io.PipedInputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class PipedOutputStream extends OutputStream {
diff --git a/jdk/src/share/classes/java/io/PipedReader.java b/jdk/src/share/classes/java/io/PipedReader.java
index 1167ff1..3c5db67 100644
--- a/jdk/src/share/classes/java/io/PipedReader.java
+++ b/jdk/src/share/classes/java/io/PipedReader.java
@@ -30,7 +30,7 @@
  * Piped character-input streams.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class PipedReader extends Reader {
diff --git a/jdk/src/share/classes/java/io/PipedWriter.java b/jdk/src/share/classes/java/io/PipedWriter.java
index 46e1455..02201fb 100644
--- a/jdk/src/share/classes/java/io/PipedWriter.java
+++ b/jdk/src/share/classes/java/io/PipedWriter.java
@@ -30,7 +30,7 @@
  * Piped character-output streams.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class PipedWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/PrintStream.java b/jdk/src/share/classes/java/io/PrintStream.java
index d4ebd84..f62ebb8 100644
--- a/jdk/src/share/classes/java/io/PrintStream.java
+++ b/jdk/src/share/classes/java/io/PrintStream.java
@@ -51,7 +51,7 @@
  *
  * @author     Frank Yellin
  * @author     Mark Reinhold
- * @since      JDK1.0
+ * @since      1.0
  */
 
 public class PrintStream extends FilterOutputStream
@@ -404,7 +404,7 @@
      * #checkError()} to return <tt>true</tt> until {@link
      * #clearError()} is invoked.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     protected void setError() {
         trouble = true;
diff --git a/jdk/src/share/classes/java/io/PrintWriter.java b/jdk/src/share/classes/java/io/PrintWriter.java
index 9287a19..c56c1bd 100644
--- a/jdk/src/share/classes/java/io/PrintWriter.java
+++ b/jdk/src/share/classes/java/io/PrintWriter.java
@@ -50,7 +50,7 @@
  *
  * @author      Frank Yellin
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class PrintWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/PushbackInputStream.java b/jdk/src/share/classes/java/io/PushbackInputStream.java
index b44848d..d70c73b 100644
--- a/jdk/src/share/classes/java/io/PushbackInputStream.java
+++ b/jdk/src/share/classes/java/io/PushbackInputStream.java
@@ -46,13 +46,13 @@
  *
  * @author  David Connelly
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class PushbackInputStream extends FilterInputStream {
     /**
      * The pushback buffer.
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected byte[] buf;
 
@@ -62,7 +62,7 @@
      * <code>buf.length</code>; when the buffer is full, <code>pos</code> is
      * equal to zero.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected int pos;
 
@@ -86,7 +86,7 @@
      * @param  in    the input stream from which bytes will be read.
      * @param  size  the size of the pushback buffer.
      * @exception IllegalArgumentException if {@code size <= 0}
-     * @since  JDK1.1
+     * @since  1.1
      */
     public PushbackInputStream(InputStream in, int size) {
         super(in);
@@ -224,7 +224,7 @@
      *            buffer for the specified number of bytes,
      *            or this input stream has been closed by
      *            invoking its {@link #close()} method.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void unread(byte[] b, int off, int len) throws IOException {
         ensureOpen();
@@ -246,7 +246,7 @@
      *            buffer for the specified number of bytes,
      *            or this input stream has been closed by
      *            invoking its {@link #close()} method.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public void unread(byte[] b) throws IOException {
         unread(b, 0, b.length);
diff --git a/jdk/src/share/classes/java/io/PushbackReader.java b/jdk/src/share/classes/java/io/PushbackReader.java
index f918621..28dc1f5 100644
--- a/jdk/src/share/classes/java/io/PushbackReader.java
+++ b/jdk/src/share/classes/java/io/PushbackReader.java
@@ -31,7 +31,7 @@
  * stream.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class PushbackReader extends FilterReader {
diff --git a/jdk/src/share/classes/java/io/RandomAccessFile.java b/jdk/src/share/classes/java/io/RandomAccessFile.java
index 58d8c89..d570393 100644
--- a/jdk/src/share/classes/java/io/RandomAccessFile.java
+++ b/jdk/src/share/classes/java/io/RandomAccessFile.java
@@ -53,7 +53,7 @@
  * {@code IOException} may be thrown if the stream has been closed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class RandomAccessFile implements DataOutput, DataInput, Closeable {
diff --git a/jdk/src/share/classes/java/io/Reader.java b/jdk/src/share/classes/java/io/Reader.java
index 1c9cca6..60f12d0 100644
--- a/jdk/src/share/classes/java/io/Reader.java
+++ b/jdk/src/share/classes/java/io/Reader.java
@@ -45,7 +45,7 @@
  * @see Writer
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public abstract class Reader implements Readable, Closeable {
diff --git a/jdk/src/share/classes/java/io/SequenceInputStream.java b/jdk/src/share/classes/java/io/SequenceInputStream.java
index 01da7f6..f68f7d2 100644
--- a/jdk/src/share/classes/java/io/SequenceInputStream.java
+++ b/jdk/src/share/classes/java/io/SequenceInputStream.java
@@ -40,7 +40,7 @@
  * on the last of the contained input streams.
  *
  * @author  Author van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class SequenceInputStream extends InputStream {
@@ -132,7 +132,7 @@
      *         has been closed by invoking its {@link #close()} method
      * @exception  IOException  if an I/O error occurs.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public int available() throws IOException {
         if (in == null) {
diff --git a/jdk/src/share/classes/java/io/Serializable.java b/jdk/src/share/classes/java/io/Serializable.java
index 39d7c46..1431795 100644
--- a/jdk/src/share/classes/java/io/Serializable.java
+++ b/jdk/src/share/classes/java/io/Serializable.java
@@ -164,7 +164,7 @@
  * @see java.io.ObjectOutput
  * @see java.io.ObjectInput
  * @see java.io.Externalizable
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface Serializable {
 }
diff --git a/jdk/src/share/classes/java/io/StreamCorruptedException.java b/jdk/src/share/classes/java/io/StreamCorruptedException.java
index 57af82c..22e2216 100644
--- a/jdk/src/share/classes/java/io/StreamCorruptedException.java
+++ b/jdk/src/share/classes/java/io/StreamCorruptedException.java
@@ -30,7 +30,7 @@
  * violates internal consistency checks.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class StreamCorruptedException extends ObjectStreamException {
 
diff --git a/jdk/src/share/classes/java/io/StreamTokenizer.java b/jdk/src/share/classes/java/io/StreamTokenizer.java
index 3c7c7cc..9de1405 100644
--- a/jdk/src/share/classes/java/io/StreamTokenizer.java
+++ b/jdk/src/share/classes/java/io/StreamTokenizer.java
@@ -59,7 +59,7 @@
  * @author  James Gosling
  * @see     java.io.StreamTokenizer#nextToken()
  * @see     java.io.StreamTokenizer#TT_EOF
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class StreamTokenizer {
@@ -240,7 +240,7 @@
      * Create a tokenizer that parses the given character stream.
      *
      * @param r  a Reader object providing the input stream.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public StreamTokenizer(Reader r) {
         this();
diff --git a/jdk/src/share/classes/java/io/StringBufferInputStream.java b/jdk/src/share/classes/java/io/StringBufferInputStream.java
index 509a96c..3e64f78 100644
--- a/jdk/src/share/classes/java/io/StringBufferInputStream.java
+++ b/jdk/src/share/classes/java/io/StringBufferInputStream.java
@@ -37,7 +37,7 @@
  * @author     Arthur van Hoff
  * @see        java.io.ByteArrayInputStream
  * @see        java.io.StringReader
- * @since      JDK1.0
+ * @since      1.0
  * @deprecated This class does not properly convert characters into bytes.  As
  *             of JDK&nbsp;1.1, the preferred way to create a stream from a
  *             string is via the <code>StringReader</code> class.
diff --git a/jdk/src/share/classes/java/io/StringReader.java b/jdk/src/share/classes/java/io/StringReader.java
index ce9ff60..9e3d883 100644
--- a/jdk/src/share/classes/java/io/StringReader.java
+++ b/jdk/src/share/classes/java/io/StringReader.java
@@ -30,7 +30,7 @@
  * A character stream whose source is a string.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class StringReader extends Reader {
diff --git a/jdk/src/share/classes/java/io/StringWriter.java b/jdk/src/share/classes/java/io/StringWriter.java
index c4e5d40..63ca2f0 100644
--- a/jdk/src/share/classes/java/io/StringWriter.java
+++ b/jdk/src/share/classes/java/io/StringWriter.java
@@ -35,7 +35,7 @@
  * <tt>IOException</tt>.
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public class StringWriter extends Writer {
diff --git a/jdk/src/share/classes/java/io/SyncFailedException.java b/jdk/src/share/classes/java/io/SyncFailedException.java
index 7e553a7..dc1228ad 100644
--- a/jdk/src/share/classes/java/io/SyncFailedException.java
+++ b/jdk/src/share/classes/java/io/SyncFailedException.java
@@ -31,7 +31,7 @@
  * @author  Ken Arnold
  * @see     java.io.FileDescriptor#sync
  * @see     java.io.IOException
- * @since   JDK1.1
+ * @since   1.1
  */
 public class SyncFailedException extends IOException {
     private static final long serialVersionUID = -2353342684412443330L;
diff --git a/jdk/src/share/classes/java/io/UTFDataFormatException.java b/jdk/src/share/classes/java/io/UTFDataFormatException.java
index 422d28b..88a1cf7 100644
--- a/jdk/src/share/classes/java/io/UTFDataFormatException.java
+++ b/jdk/src/share/classes/java/io/UTFDataFormatException.java
@@ -40,7 +40,7 @@
  * @see     java.io.DataInput
  * @see     java.io.DataInputStream#readUTF(java.io.DataInput)
  * @see     java.io.IOException
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class UTFDataFormatException extends IOException {
diff --git a/jdk/src/share/classes/java/io/UnsupportedEncodingException.java b/jdk/src/share/classes/java/io/UnsupportedEncodingException.java
index b59f9c3..48b2224 100644
--- a/jdk/src/share/classes/java/io/UnsupportedEncodingException.java
+++ b/jdk/src/share/classes/java/io/UnsupportedEncodingException.java
@@ -28,7 +28,7 @@
  * The Character Encoding is not supported.
  *
  * @author  Asmus Freytag
- * @since   JDK1.1
+ * @since   1.1
  */
 public class UnsupportedEncodingException
     extends IOException
diff --git a/jdk/src/share/classes/java/io/WriteAbortedException.java b/jdk/src/share/classes/java/io/WriteAbortedException.java
index c39950d..202575c 100644
--- a/jdk/src/share/classes/java/io/WriteAbortedException.java
+++ b/jdk/src/share/classes/java/io/WriteAbortedException.java
@@ -41,7 +41,7 @@
  * method, as well as the aforementioned "legacy field."
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class WriteAbortedException extends ObjectStreamException {
     private static final long serialVersionUID = -3326426625597282442L;
diff --git a/jdk/src/share/classes/java/io/Writer.java b/jdk/src/share/classes/java/io/Writer.java
index 8747a13..68ae7b3 100644
--- a/jdk/src/share/classes/java/io/Writer.java
+++ b/jdk/src/share/classes/java/io/Writer.java
@@ -44,7 +44,7 @@
  * @see Reader
  *
  * @author      Mark Reinhold
- * @since       JDK1.1
+ * @since       1.1
  */
 
 public abstract class Writer implements Appendable, Closeable, Flushable {
diff --git a/jdk/src/share/classes/java/io/package.html b/jdk/src/share/classes/java/io/package.html
index 1b909ad..5d80e56 100644
--- a/jdk/src/share/classes/java/io/package.html
+++ b/jdk/src/share/classes/java/io/package.html
@@ -47,6 +47,6 @@
   <li><a href="../../../technotes/guides/serialization">Serialization Enhancements</a>
 </ul>
 
-@since JDK1.0
+@since 1.0
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/lang/AbstractMethodError.java b/jdk/src/share/classes/java/lang/AbstractMethodError.java
index e266107..af02ba8 100644
--- a/jdk/src/share/classes/java/lang/AbstractMethodError.java
+++ b/jdk/src/share/classes/java/lang/AbstractMethodError.java
@@ -33,7 +33,7 @@
  * compiled.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class AbstractMethodError extends IncompatibleClassChangeError {
diff --git a/jdk/src/share/classes/java/lang/ArithmeticException.java b/jdk/src/share/classes/java/lang/ArithmeticException.java
index af00777..7c48f7c 100644
--- a/jdk/src/share/classes/java/lang/ArithmeticException.java
+++ b/jdk/src/share/classes/java/lang/ArithmeticException.java
@@ -36,7 +36,7 @@
  * stack trace was not writable}.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public class ArithmeticException extends RuntimeException {
     private static final long serialVersionUID = 2256477558314496007L;
diff --git a/jdk/src/share/classes/java/lang/ArrayIndexOutOfBoundsException.java b/jdk/src/share/classes/java/lang/ArrayIndexOutOfBoundsException.java
index 875fc9d..155da1b 100644
--- a/jdk/src/share/classes/java/lang/ArrayIndexOutOfBoundsException.java
+++ b/jdk/src/share/classes/java/lang/ArrayIndexOutOfBoundsException.java
@@ -31,7 +31,7 @@
  * equal to the size of the array.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
diff --git a/jdk/src/share/classes/java/lang/ArrayStoreException.java b/jdk/src/share/classes/java/lang/ArrayStoreException.java
index 5ea0aa9..04696ac 100644
--- a/jdk/src/share/classes/java/lang/ArrayStoreException.java
+++ b/jdk/src/share/classes/java/lang/ArrayStoreException.java
@@ -35,7 +35,7 @@
  * </pre></blockquote>
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ArrayStoreException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/Boolean.java b/jdk/src/share/classes/java/lang/Boolean.java
index a9293ba..4e9f6e4 100644
--- a/jdk/src/share/classes/java/lang/Boolean.java
+++ b/jdk/src/share/classes/java/lang/Boolean.java
@@ -38,7 +38,7 @@
  * {@code boolean}.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class Boolean implements java.io.Serializable,
                                       Comparable<Boolean>
@@ -58,7 +58,7 @@
     /**
      * The Class object representing the primitive type boolean.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     @SuppressWarnings("unchecked")
     public static final Class<Boolean> TYPE = (Class<Boolean>) Class.getPrimitiveClass("boolean");
diff --git a/jdk/src/share/classes/java/lang/Byte.java b/jdk/src/share/classes/java/lang/Byte.java
index 3a894a5..e2a0246 100644
--- a/jdk/src/share/classes/java/lang/Byte.java
+++ b/jdk/src/share/classes/java/lang/Byte.java
@@ -39,7 +39,7 @@
  * @author  Nakul Saraiya
  * @author  Joseph D. Darcy
  * @see     java.lang.Number
- * @since   JDK1.1
+ * @since   1.1
  */
 public final class Byte extends Number implements Comparable<Byte> {
 
diff --git a/jdk/src/share/classes/java/lang/Character.java b/jdk/src/share/classes/java/lang/Character.java
index 3251a49..f546ab5 100644
--- a/jdk/src/share/classes/java/lang/Character.java
+++ b/jdk/src/share/classes/java/lang/Character.java
@@ -5875,7 +5875,7 @@
      * @see     Character#isLetter(char)
      * @see     Character#isLetterOrDigit(char)
      * @see     Character#isUnicodeIdentifierStart(char)
-     * @since   1.02
+     * @since   1.0.2
      * @deprecated Replaced by isJavaIdentifierStart(char).
      */
     @Deprecated
@@ -5911,7 +5911,7 @@
      * @see     Character#isLetterOrDigit(char)
      * @see     Character#isUnicodeIdentifierPart(char)
      * @see     Character#isIdentifierIgnorable(char)
-     * @since   1.02
+     * @since   1.0.2
      * @deprecated Replaced by isJavaIdentifierPart(char).
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/lang/Class.java b/jdk/src/share/classes/java/lang/Class.java
index 262a126..71daa39 100644
--- a/jdk/src/share/classes/java/lang/Class.java
+++ b/jdk/src/share/classes/java/lang/Class.java
@@ -114,7 +114,7 @@
  *
  * @author  unascribed
  * @see     java.lang.ClassLoader#defineClass(byte[], int, int)
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class Class<T> implements java.io.Serializable,
                               GenericDeclaration,
@@ -469,7 +469,7 @@
      * @param   obj the object to check
      * @return  true if {@code obj} is an instance of this class
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     public native boolean isInstance(Object obj);
 
@@ -496,7 +496,7 @@
      * type {@code cls} can be assigned to objects of this class
      * @exception NullPointerException if the specified Class parameter is
      *            null.
-     * @since JDK1.1
+     * @since 1.1
      */
     public native boolean isAssignableFrom(Class<?> cls);
 
@@ -516,7 +516,7 @@
      *
      * @return  {@code true} if this object represents an array class;
      *          {@code false} otherwise.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public native boolean isArray();
 
@@ -547,7 +547,7 @@
      * @see     java.lang.Float#TYPE
      * @see     java.lang.Double#TYPE
      * @see     java.lang.Void#TYPE
-     * @since JDK1.1
+     * @since 1.1
      */
     public native boolean isPrimitive();
 
@@ -909,7 +909,7 @@
      * @return the {@code Class} representing the component type of this
      * class if this class is an array
      * @see     java.lang.reflect.Array
-     * @since JDK1.1
+     * @since 1.1
      */
     public native Class<?> getComponentType();
 
@@ -939,7 +939,7 @@
      *
      * @return the {@code int} representing the modifiers for this class
      * @see     java.lang.reflect.Modifier
-     * @since JDK1.1
+     * @since 1.1
      */
     public native int getModifiers();
 
@@ -950,7 +950,7 @@
      * @return  the signers of this class, or null if there are no signers.  In
      *          particular, this method returns null if this object represents
      *          a primitive type or void.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public native Object[] getSigners();
 
@@ -1215,7 +1215,7 @@
      *         loader for the declaring class and invocation of {@link
      *         SecurityManager#checkPackageAccess s.checkPackageAccess()}
      *         denies access to the package of the declaring class
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Class<?> getDeclaringClass() throws SecurityException {
@@ -1470,7 +1470,7 @@
      *         s.checkPackageAccess()} denies access to the package
      *         of this class.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Class<?>[] getClasses() {
@@ -1533,7 +1533,7 @@
      *         s.checkPackageAccess()} denies access to the package
      *         of this class.
      *
-     * @since JDK1.1
+     * @since 1.1
      * @jls 8.2 Class Members
      * @jls 8.3 Field Declarations
      */
@@ -1593,7 +1593,7 @@
      *
      * @jls 8.2 Class Members
      * @jls 8.4 Method Declarations
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Method[] getMethods() throws SecurityException {
@@ -1629,7 +1629,7 @@
      *         s.checkPackageAccess()} denies access to the package
      *         of this class.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Constructor<?>[] getConstructors() throws SecurityException {
@@ -1676,7 +1676,7 @@
      *         s.checkPackageAccess()} denies access to the package
      *         of this class.
      *
-     * @since JDK1.1
+     * @since 1.1
      * @jls 8.2 Class Members
      * @jls 8.3 Field Declarations
      */
@@ -1761,7 +1761,7 @@
      *
      * @jls 8.2 Class Members
      * @jls 8.4 Method Declarations
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Method getMethod(String name, Class<?>... parameterTypes)
@@ -1802,7 +1802,7 @@
      *         s.checkPackageAccess()} denies access to the package
      *         of this class.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Constructor<T> getConstructor(Class<?>... parameterTypes)
@@ -1845,7 +1845,7 @@
      *
      *         </ul>
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Class<?>[] getDeclaredClasses() throws SecurityException {
@@ -1892,7 +1892,7 @@
      *
      *          </ul>
      *
-     * @since JDK1.1
+     * @since 1.1
      * @jls 8.2 Class Members
      * @jls 8.3 Field Declarations
      */
@@ -1953,7 +1953,7 @@
      *
      * @jls 8.2 Class Members
      * @jls 8.4 Method Declarations
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Method[] getDeclaredMethods() throws SecurityException {
@@ -1998,7 +1998,7 @@
      *
      *          </ul>
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Constructor<?>[] getDeclaredConstructors() throws SecurityException {
@@ -2043,7 +2043,7 @@
      *
      *          </ul>
      *
-     * @since JDK1.1
+     * @since 1.1
      * @jls 8.2 Class Members
      * @jls 8.3 Field Declarations
      */
@@ -2105,7 +2105,7 @@
      *
      * @jls 8.2 Class Members
      * @jls 8.4 Method Declarations
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Method getDeclaredMethod(String name, Class<?>... parameterTypes)
@@ -2155,7 +2155,7 @@
      *
      *          </ul>
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @CallerSensitive
     public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes)
@@ -2197,7 +2197,7 @@
      * @return      A {@link java.io.InputStream} object or {@code null} if
      *              no resource with this name is found
      * @throws  NullPointerException If {@code name} is {@code null}
-     * @since  JDK1.1
+     * @since  1.1
      */
      public InputStream getResourceAsStream(String name) {
         name = resolveName(name);
@@ -2241,7 +2241,7 @@
      * @param  name name of the desired resource
      * @return      A  {@link java.net.URL} object or {@code null} if no
      *              resource with this name is found
-     * @since  JDK1.1
+     * @since  1.1
      */
     public java.net.URL getResource(String name) {
         name = resolveName(name);
@@ -2696,12 +2696,26 @@
     }
 
     static class MethodArray {
+        // Don't add or remove methods except by add() or remove() calls.
         private Method[] methods;
         private int length;
+        private int defaults;
 
         MethodArray() {
-            methods = new Method[20];
+            this(20);
+        }
+
+        MethodArray(int initialSize) {
+            if (initialSize < 2)
+                throw new IllegalArgumentException("Size should be 2 or more");
+
+            methods = new Method[initialSize];
             length = 0;
+            defaults = 0;
+        }
+
+        boolean hasDefaults() {
+            return defaults != 0;
         }
 
         void add(Method m) {
@@ -2709,6 +2723,9 @@
                 methods = Arrays.copyOf(methods, 2 * methods.length);
             }
             methods[length++] = m;
+
+            if (m != null && m.isDefault())
+                defaults++;
         }
 
         void addAll(Method[] ma) {
@@ -2742,7 +2759,10 @@
             }
         }
 
-        void addAllNonStatic(Method[] methods) {
+        /* Add Methods declared in an interface to this MethodArray.
+         * Static methods declared in interfaces are not inherited.
+         */
+        void addInterfaceMethods(Method[] methods) {
             for (Method candidate : methods) {
                 if (!Modifier.isStatic(candidate.getModifiers())) {
                     add(candidate);
@@ -2758,19 +2778,35 @@
             return methods[i];
         }
 
-        void removeByNameAndSignature(Method toRemove) {
+        Method getFirst() {
+            for (Method m : methods)
+                if (m != null)
+                    return m;
+            return null;
+        }
+
+        void removeByNameAndDescriptor(Method toRemove) {
             for (int i = 0; i < length; i++) {
                 Method m = methods[i];
-                if (m != null &&
-                    m.getReturnType() == toRemove.getReturnType() &&
-                    m.getName() == toRemove.getName() &&
-                    arrayContentsEq(m.getParameterTypes(),
-                                    toRemove.getParameterTypes())) {
-                    methods[i] = null;
+                if (m != null && matchesNameAndDescriptor(m, toRemove)) {
+                    remove(i);
                 }
             }
         }
 
+        private void remove(int i) {
+            if (methods[i] != null && methods[i].isDefault())
+                defaults--;
+            methods[i] = null;
+        }
+
+        private boolean matchesNameAndDescriptor(Method m1, Method m2) {
+            return m1.getReturnType() == m2.getReturnType() &&
+                   m1.getName() == m2.getName() && // name is guaranteed to be interned
+                   arrayContentsEq(m1.getParameterTypes(),
+                           m2.getParameterTypes());
+        }
+
         void compactAndTrim() {
             int newPos = 0;
             // Get rid of null slots
@@ -2788,9 +2824,48 @@
             }
         }
 
+        /* Removes all Methods from this MethodArray that have a more specific
+         * default Method in this MethodArray.
+         *
+         * Users of MethodArray are responsible for pruning Methods that have
+         * a more specific <em>concrete</em> Method.
+         */
+        void removeLessSpecifics() {
+            if (!hasDefaults())
+                return;
+
+            for (int i = 0; i < length; i++) {
+                Method m = get(i);
+                if  (m == null || !m.isDefault())
+                    continue;
+
+                for (int j  = 0; j < length; j++) {
+                    if (i == j)
+                        continue;
+
+                    Method candidate = get(j);
+                    if (candidate == null)
+                        continue;
+
+                    if (!matchesNameAndDescriptor(m, candidate))
+                        continue;
+
+                    if (hasMoreSpecificClass(m, candidate))
+                        remove(j);
+                }
+            }
+        }
+
         Method[] getArray() {
             return methods;
         }
+
+        // Returns true if m1 is more specific than m2
+        static boolean hasMoreSpecificClass(Method m1, Method m2) {
+            Class<?> m1Class = m1.getDeclaringClass();
+            Class<?> m2Class = m2.getDeclaringClass();
+            return m1Class != m2Class && m2Class.isAssignableFrom(m1Class);
+        }
     }
 
 
@@ -2819,7 +2894,7 @@
         // the end.
         MethodArray inheritedMethods = new MethodArray();
         for (Class<?> i : getInterfaces()) {
-            inheritedMethods.addAllNonStatic(i.privateGetPublicMethods());
+            inheritedMethods.addInterfaceMethods(i.privateGetPublicMethods());
         }
         if (!isInterface()) {
             Class<?> c = getSuperclass();
@@ -2830,8 +2905,10 @@
                 // interface methods
                 for (int i = 0; i < supers.length(); i++) {
                     Method m = supers.get(i);
-                    if (m != null && !Modifier.isAbstract(m.getModifiers())) {
-                        inheritedMethods.removeByNameAndSignature(m);
+                    if (m != null &&
+                            !Modifier.isAbstract(m.getModifiers()) &&
+                            !m.isDefault()) {
+                        inheritedMethods.removeByNameAndDescriptor(m);
                     }
                 }
                 // Insert superclass's inherited methods before
@@ -2844,9 +2921,10 @@
         // Filter out all local methods from inherited ones
         for (int i = 0; i < methods.length(); i++) {
             Method m = methods.get(i);
-            inheritedMethods.removeByNameAndSignature(m);
+            inheritedMethods.removeByNameAndDescriptor(m);
         }
         methods.addAllIfNotPresent(inheritedMethods);
+        methods.removeLessSpecifics();
         methods.compactAndTrim();
         res = methods.getArray();
         if (rd != null) {
@@ -2919,8 +2997,21 @@
         return (res == null ? res : getReflectionFactory().copyMethod(res));
     }
 
-
     private Method getMethod0(String name, Class<?>[] parameterTypes, boolean includeStaticMethods) {
+        MethodArray interfaceCandidates = new MethodArray(2);
+        Method res =  privateGetMethodRecursive(name, parameterTypes, includeStaticMethods, interfaceCandidates);
+        if (res != null)
+            return res;
+
+        // Not found on class or superclass directly
+        interfaceCandidates.removeLessSpecifics();
+        return interfaceCandidates.getFirst(); // may be null
+    }
+
+    private Method privateGetMethodRecursive(String name,
+            Class<?>[] parameterTypes,
+            boolean includeStaticMethods,
+            MethodArray allInterfaceCandidates) {
         // Note: the intent is that the search algorithm this routine
         // uses be equivalent to the ordering imposed by
         // privateGetPublicMethods(). It fetches only the declared
@@ -2928,6 +3019,14 @@
         // number of Method objects which have to be created for the
         // common case where the method being requested is declared in
         // the class which is being queried.
+        //
+        // Due to default methods, unless a method is found on a superclass,
+        // methods declared in any superinterface needs to be considered.
+        // Collect all candidates declared in superinterfaces in {@code
+        // allInterfaceCandidates} and select the most specific if no match on
+        // a superclass is found.
+
+        // Must _not_ return root methods
         Method res;
         // Search declared public methods
         if ((res = searchMethods(privateGetDeclaredMethods(true),
@@ -2949,7 +3048,7 @@
         Class<?>[] interfaces = getInterfaces();
         for (Class<?> c : interfaces)
             if ((res = c.getMethod0(name, parameterTypes, false)) != null)
-                return res;
+                allInterfaceCandidates.add(res);
         // Not found
         return null;
     }
diff --git a/jdk/src/share/classes/java/lang/ClassCastException.java b/jdk/src/share/classes/java/lang/ClassCastException.java
index e4ca76c..d7abe40 100644
--- a/jdk/src/share/classes/java/lang/ClassCastException.java
+++ b/jdk/src/share/classes/java/lang/ClassCastException.java
@@ -35,7 +35,7 @@
  * </pre></blockquote>
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ClassCastException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/ClassCircularityError.java b/jdk/src/share/classes/java/lang/ClassCircularityError.java
index 64e5361..76f2aaf 100644
--- a/jdk/src/share/classes/java/lang/ClassCircularityError.java
+++ b/jdk/src/share/classes/java/lang/ClassCircularityError.java
@@ -30,7 +30,7 @@
  * superclass hierarchy of a class being loaded.
  *
  * @author     unascribed
- * @since      JDK1.0
+ * @since      1.0
  */
 public class ClassCircularityError extends LinkageError {
     private static final long serialVersionUID = 1054362542914539689L;
diff --git a/jdk/src/share/classes/java/lang/ClassFormatError.java b/jdk/src/share/classes/java/lang/ClassFormatError.java
index 2dc81db..d06cac0 100644
--- a/jdk/src/share/classes/java/lang/ClassFormatError.java
+++ b/jdk/src/share/classes/java/lang/ClassFormatError.java
@@ -31,7 +31,7 @@
  * be interpreted as a class file.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ClassFormatError extends LinkageError {
diff --git a/jdk/src/share/classes/java/lang/ClassNotFoundException.java b/jdk/src/share/classes/java/lang/ClassNotFoundException.java
index 1211e9f..7ac8374 100644
--- a/jdk/src/share/classes/java/lang/ClassNotFoundException.java
+++ b/jdk/src/share/classes/java/lang/ClassNotFoundException.java
@@ -48,7 +48,7 @@
  * @see     java.lang.Class#forName(java.lang.String)
  * @see     java.lang.ClassLoader#findSystemClass(java.lang.String)
  * @see     java.lang.ClassLoader#loadClass(java.lang.String, boolean)
- * @since   JDK1.0
+ * @since   1.0
  */
 public class ClassNotFoundException extends ReflectiveOperationException {
     /**
diff --git a/jdk/src/share/classes/java/lang/CloneNotSupportedException.java b/jdk/src/share/classes/java/lang/CloneNotSupportedException.java
index e43901c..fdc0147 100644
--- a/jdk/src/share/classes/java/lang/CloneNotSupportedException.java
+++ b/jdk/src/share/classes/java/lang/CloneNotSupportedException.java
@@ -38,7 +38,7 @@
  * @author  unascribed
  * @see     java.lang.Cloneable
  * @see     java.lang.Object#clone()
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public
diff --git a/jdk/src/share/classes/java/lang/Cloneable.java b/jdk/src/share/classes/java/lang/Cloneable.java
index 14cf2a9..d251449 100644
--- a/jdk/src/share/classes/java/lang/Cloneable.java
+++ b/jdk/src/share/classes/java/lang/Cloneable.java
@@ -48,7 +48,7 @@
  * @author  unascribed
  * @see     java.lang.CloneNotSupportedException
  * @see     java.lang.Object#clone()
- * @since   JDK1.0
+ * @since   1.0
  */
 public interface Cloneable {
 }
diff --git a/jdk/src/share/classes/java/lang/Compiler.java b/jdk/src/share/classes/java/lang/Compiler.java
index 316534d..e934f5e 100644
--- a/jdk/src/share/classes/java/lang/Compiler.java
+++ b/jdk/src/share/classes/java/lang/Compiler.java
@@ -42,7 +42,7 @@
  * <p> If no compiler is available, these methods do nothing.
  *
  * @author  Frank Yellin
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class Compiler  {
     private Compiler() {}               // don't make instances
diff --git a/jdk/src/share/classes/java/lang/Double.java b/jdk/src/share/classes/java/lang/Double.java
index d76c934..11bda19 100644
--- a/jdk/src/share/classes/java/lang/Double.java
+++ b/jdk/src/share/classes/java/lang/Double.java
@@ -43,7 +43,7 @@
  * @author  Lee Boynton
  * @author  Arthur van Hoff
  * @author  Joseph D. Darcy
- * @since JDK1.0
+ * @since 1.0
  */
 public final class Double extends Number implements Comparable<Double> {
     /**
@@ -132,7 +132,7 @@
      * The {@code Class} instance representing the primitive type
      * {@code double}.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @SuppressWarnings("unchecked")
     public static final Class<Double>   TYPE = (Class<Double>) Class.getPrimitiveClass("double");
@@ -650,7 +650,7 @@
      * @return  the {@code double} value represented by this object
      *          converted to type {@code byte}
      * @jls 5.1.3 Narrowing Primitive Conversions
-     * @since JDK1.1
+     * @since 1.1
      */
     public byte byteValue() {
         return (byte)value;
@@ -663,7 +663,7 @@
      * @return  the {@code double} value represented by this object
      *          converted to type {@code short}
      * @jls 5.1.3 Narrowing Primitive Conversions
-     * @since JDK1.1
+     * @since 1.1
      */
     public short shortValue() {
         return (short)value;
@@ -700,7 +700,7 @@
      * @return  the {@code double} value represented by this object
      *          converted to type {@code float}
      * @jls 5.1.3 Narrowing Primitive Conversions
-     * @since JDK1.0
+     * @since 1.0
      */
     public float floatValue() {
         return (float)value;
diff --git a/jdk/src/share/classes/java/lang/Error.java b/jdk/src/share/classes/java/lang/Error.java
index d18c15f..e2012a5 100644
--- a/jdk/src/share/classes/java/lang/Error.java
+++ b/jdk/src/share/classes/java/lang/Error.java
@@ -44,7 +44,7 @@
  * @author  Frank Yellin
  * @see     java.lang.ThreadDeath
  * @jls 11.2 Compile-Time Checking of Exceptions
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Error extends Throwable {
     static final long serialVersionUID = 4980196508277280342L;
diff --git a/jdk/src/share/classes/java/lang/Exception.java b/jdk/src/share/classes/java/lang/Exception.java
index 0bcbf9c..034f4de 100644
--- a/jdk/src/share/classes/java/lang/Exception.java
+++ b/jdk/src/share/classes/java/lang/Exception.java
@@ -40,7 +40,7 @@
  * @author  Frank Yellin
  * @see     java.lang.Error
  * @jls 11.2 Compile-Time Checking of Exceptions
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Exception extends Throwable {
     static final long serialVersionUID = -3387516993124229948L;
diff --git a/jdk/src/share/classes/java/lang/ExceptionInInitializerError.java b/jdk/src/share/classes/java/lang/ExceptionInInitializerError.java
index 0259766..d5d0bb3 100644
--- a/jdk/src/share/classes/java/lang/ExceptionInInitializerError.java
+++ b/jdk/src/share/classes/java/lang/ExceptionInInitializerError.java
@@ -39,7 +39,7 @@
  * as the aforementioned "legacy method."
  *
  * @author  Frank Yellin
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ExceptionInInitializerError extends LinkageError {
     /**
diff --git a/jdk/src/share/classes/java/lang/Float.java b/jdk/src/share/classes/java/lang/Float.java
index 17d2cd7..0407b06 100644
--- a/jdk/src/share/classes/java/lang/Float.java
+++ b/jdk/src/share/classes/java/lang/Float.java
@@ -44,7 +44,7 @@
  * @author  Lee Boynton
  * @author  Arthur van Hoff
  * @author  Joseph D. Darcy
- * @since JDK1.0
+ * @since 1.0
  */
 public final class Float extends Number implements Comparable<Float> {
     /**
@@ -131,7 +131,7 @@
      * The {@code Class} instance representing the primitive type
      * {@code float}.
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @SuppressWarnings("unchecked")
     public static final Class<Float> TYPE = (Class<Float>) Class.getPrimitiveClass("float");
@@ -587,7 +587,7 @@
      * @return  the {@code float} value represented by this object
      *          converted to type {@code short}
      * @jls 5.1.3 Narrowing Primitive Conversions
-     * @since JDK1.1
+     * @since 1.1
      */
     public short shortValue() {
         return (short)value;
diff --git a/jdk/src/share/classes/java/lang/IllegalAccessError.java b/jdk/src/share/classes/java/lang/IllegalAccessError.java
index ce045cd..b2a50a5 100644
--- a/jdk/src/share/classes/java/lang/IllegalAccessError.java
+++ b/jdk/src/share/classes/java/lang/IllegalAccessError.java
@@ -34,7 +34,7 @@
  * incompatibly changed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public class IllegalAccessError extends IncompatibleClassChangeError {
     private static final long serialVersionUID = -8988904074992417891L;
diff --git a/jdk/src/share/classes/java/lang/IllegalAccessException.java b/jdk/src/share/classes/java/lang/IllegalAccessException.java
index c7b1df8..b0e039a 100644
--- a/jdk/src/share/classes/java/lang/IllegalAccessException.java
+++ b/jdk/src/share/classes/java/lang/IllegalAccessException.java
@@ -54,7 +54,7 @@
  * @see     java.lang.reflect.Field#getDouble(Object)
  * @see     java.lang.reflect.Method#invoke(Object, Object[])
  * @see     java.lang.reflect.Constructor#newInstance(Object[])
- * @since   JDK1.0
+ * @since   1.0
  */
 public class IllegalAccessException extends ReflectiveOperationException {
     private static final long serialVersionUID = 6616958222490762034L;
diff --git a/jdk/src/share/classes/java/lang/IllegalArgumentException.java b/jdk/src/share/classes/java/lang/IllegalArgumentException.java
index c29a9d5..4c9a014 100644
--- a/jdk/src/share/classes/java/lang/IllegalArgumentException.java
+++ b/jdk/src/share/classes/java/lang/IllegalArgumentException.java
@@ -30,7 +30,7 @@
  * inappropriate argument.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class IllegalArgumentException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/IllegalMonitorStateException.java b/jdk/src/share/classes/java/lang/IllegalMonitorStateException.java
index 3985066..b2be5c0 100644
--- a/jdk/src/share/classes/java/lang/IllegalMonitorStateException.java
+++ b/jdk/src/share/classes/java/lang/IllegalMonitorStateException.java
@@ -36,7 +36,7 @@
  * @see     java.lang.Object#wait()
  * @see     java.lang.Object#wait(long)
  * @see     java.lang.Object#wait(long, int)
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class IllegalMonitorStateException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/IllegalStateException.java b/jdk/src/share/classes/java/lang/IllegalStateException.java
index 9c0c06a..9b1cf30 100644
--- a/jdk/src/share/classes/java/lang/IllegalStateException.java
+++ b/jdk/src/share/classes/java/lang/IllegalStateException.java
@@ -32,7 +32,7 @@
  * operation.
  *
  * @author  Jonni Kanerva
- * @since   JDK1.1
+ * @since   1.1
  */
 public
 class IllegalStateException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/IllegalThreadStateException.java b/jdk/src/share/classes/java/lang/IllegalThreadStateException.java
index c59ab59..c926bea 100644
--- a/jdk/src/share/classes/java/lang/IllegalThreadStateException.java
+++ b/jdk/src/share/classes/java/lang/IllegalThreadStateException.java
@@ -34,7 +34,7 @@
  * @author  unascribed
  * @see     java.lang.Thread#resume()
  * @see     java.lang.Thread#suspend()
- * @since   JDK1.0
+ * @since   1.0
  */
 public class IllegalThreadStateException extends IllegalArgumentException {
     private static final long serialVersionUID = -7626246362397460174L;
diff --git a/jdk/src/share/classes/java/lang/IncompatibleClassChangeError.java b/jdk/src/share/classes/java/lang/IncompatibleClassChangeError.java
index edffaee..03ca3f3 100644
--- a/jdk/src/share/classes/java/lang/IncompatibleClassChangeError.java
+++ b/jdk/src/share/classes/java/lang/IncompatibleClassChangeError.java
@@ -31,7 +31,7 @@
  * executing method depends, has since changed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class IncompatibleClassChangeError extends LinkageError {
diff --git a/jdk/src/share/classes/java/lang/IndexOutOfBoundsException.java b/jdk/src/share/classes/java/lang/IndexOutOfBoundsException.java
index 4dc7948..ace8f89 100644
--- a/jdk/src/share/classes/java/lang/IndexOutOfBoundsException.java
+++ b/jdk/src/share/classes/java/lang/IndexOutOfBoundsException.java
@@ -32,7 +32,7 @@
  * Applications can subclass this class to indicate similar exceptions.
  *
  * @author  Frank Yellin
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class IndexOutOfBoundsException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/InstantiationError.java b/jdk/src/share/classes/java/lang/InstantiationError.java
index 89c10b3..1410fa7 100644
--- a/jdk/src/share/classes/java/lang/InstantiationError.java
+++ b/jdk/src/share/classes/java/lang/InstantiationError.java
@@ -34,7 +34,7 @@
  * incompatibly changed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 
 
diff --git a/jdk/src/share/classes/java/lang/InstantiationException.java b/jdk/src/share/classes/java/lang/InstantiationException.java
index afeeb17..877812b 100644
--- a/jdk/src/share/classes/java/lang/InstantiationException.java
+++ b/jdk/src/share/classes/java/lang/InstantiationException.java
@@ -40,7 +40,7 @@
  *
  * @author  unascribed
  * @see     java.lang.Class#newInstance()
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class InstantiationException extends ReflectiveOperationException {
diff --git a/jdk/src/share/classes/java/lang/Integer.java b/jdk/src/share/classes/java/lang/Integer.java
index 6897880..a6a06bc 100644
--- a/jdk/src/share/classes/java/lang/Integer.java
+++ b/jdk/src/share/classes/java/lang/Integer.java
@@ -47,7 +47,7 @@
  * @author  Arthur van Hoff
  * @author  Josh Bloch
  * @author  Joseph D. Darcy
- * @since JDK1.0
+ * @since 1.0
  */
 public final class Integer extends Number implements Comparable<Integer> {
     /**
@@ -66,7 +66,7 @@
      * The {@code Class} instance representing the primitive type
      * {@code int}.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     @SuppressWarnings("unchecked")
     public static final Class<Integer>  TYPE = (Class<Integer>) Class.getPrimitiveClass("int");
@@ -227,7 +227,7 @@
      *          represented by the argument in hexadecimal (base&nbsp;16).
      * @see #parseUnsignedInt(String, int)
      * @see #toUnsignedString(int, int)
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public static String toHexString(int i) {
         return toUnsignedString0(i, 4);
@@ -265,7 +265,7 @@
      *          represented by the argument in octal (base&nbsp;8).
      * @see #parseUnsignedInt(String, int)
      * @see #toUnsignedString(int, int)
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public static String toOctalString(int i) {
         return toUnsignedString0(i, 3);
@@ -297,7 +297,7 @@
      *          represented by the argument in binary (base&nbsp;2).
      * @see #parseUnsignedInt(String, int)
      * @see #toUnsignedString(int, int)
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public static String toBinaryString(int i) {
         return toUnsignedString0(i, 1);
diff --git a/jdk/src/share/classes/java/lang/InternalError.java b/jdk/src/share/classes/java/lang/InternalError.java
index 8d33821..69ce7f7 100644
--- a/jdk/src/share/classes/java/lang/InternalError.java
+++ b/jdk/src/share/classes/java/lang/InternalError.java
@@ -30,7 +30,7 @@
  * the Java Virtual Machine.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public class InternalError extends VirtualMachineError {
     private static final long serialVersionUID = -9062593416125562365L;
diff --git a/jdk/src/share/classes/java/lang/InterruptedException.java b/jdk/src/share/classes/java/lang/InterruptedException.java
index 27bc5a8..2c649bd 100644
--- a/jdk/src/share/classes/java/lang/InterruptedException.java
+++ b/jdk/src/share/classes/java/lang/InterruptedException.java
@@ -44,7 +44,7 @@
  * @see     java.lang.Thread#sleep(long)
  * @see     java.lang.Thread#interrupt()
  * @see     java.lang.Thread#interrupted()
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class InterruptedException extends Exception {
diff --git a/jdk/src/share/classes/java/lang/LinkageError.java b/jdk/src/share/classes/java/lang/LinkageError.java
index 6b5f060..4dbc784 100644
--- a/jdk/src/share/classes/java/lang/LinkageError.java
+++ b/jdk/src/share/classes/java/lang/LinkageError.java
@@ -32,7 +32,7 @@
  *
  *
  * @author  Frank Yellin
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class LinkageError extends Error {
diff --git a/jdk/src/share/classes/java/lang/Long.java b/jdk/src/share/classes/java/lang/Long.java
index 0f2794c..63a7cb3 100644
--- a/jdk/src/share/classes/java/lang/Long.java
+++ b/jdk/src/share/classes/java/lang/Long.java
@@ -49,7 +49,7 @@
  * @author  Arthur van Hoff
  * @author  Josh Bloch
  * @author  Joseph D. Darcy
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class Long extends Number implements Comparable<Long> {
     /**
@@ -68,7 +68,7 @@
      * The {@code Class} instance representing the primitive type
      * {@code long}.
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     @SuppressWarnings("unchecked")
     public static final Class<Long>     TYPE = (Class<Long>) Class.getPrimitiveClass("long");
@@ -266,7 +266,7 @@
      *          (base&nbsp;16).
      * @see #parseUnsignedLong(String, int)
      * @see #toUnsignedString(long, int)
-     * @since   JDK 1.0.2
+     * @since   1.0.2
      */
     public static String toHexString(long i) {
         return toUnsignedString0(i, 4);
@@ -305,7 +305,7 @@
      *          value represented by the argument in octal (base&nbsp;8).
      * @see #parseUnsignedLong(String, int)
      * @see #toUnsignedString(long, int)
-     * @since   JDK 1.0.2
+     * @since   1.0.2
      */
     public static String toOctalString(long i) {
         return toUnsignedString0(i, 3);
@@ -338,7 +338,7 @@
      *          value represented by the argument in binary (base&nbsp;2).
      * @see #parseUnsignedLong(String, int)
      * @see #toUnsignedString(long, int)
-     * @since   JDK 1.0.2
+     * @since   1.0.2
      */
     public static String toBinaryString(long i) {
         return toUnsignedString0(i, 1);
diff --git a/jdk/src/share/classes/java/lang/Math.java b/jdk/src/share/classes/java/lang/Math.java
index 8740bb1..1befa43 100644
--- a/jdk/src/share/classes/java/lang/Math.java
+++ b/jdk/src/share/classes/java/lang/Math.java
@@ -99,7 +99,7 @@
  *
  * @author  unascribed
  * @author  Joseph D. Darcy
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public final class Math {
diff --git a/jdk/src/share/classes/java/lang/NegativeArraySizeException.java b/jdk/src/share/classes/java/lang/NegativeArraySizeException.java
index a90c815..baccdf7 100644
--- a/jdk/src/share/classes/java/lang/NegativeArraySizeException.java
+++ b/jdk/src/share/classes/java/lang/NegativeArraySizeException.java
@@ -29,7 +29,7 @@
  * Thrown if an application tries to create an array with negative size.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NegativeArraySizeException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/NoClassDefFoundError.java b/jdk/src/share/classes/java/lang/NoClassDefFoundError.java
index 5620e7f..9b44a3e 100644
--- a/jdk/src/share/classes/java/lang/NoClassDefFoundError.java
+++ b/jdk/src/share/classes/java/lang/NoClassDefFoundError.java
@@ -36,7 +36,7 @@
  * found.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NoClassDefFoundError extends LinkageError {
diff --git a/jdk/src/share/classes/java/lang/NoSuchFieldError.java b/jdk/src/share/classes/java/lang/NoSuchFieldError.java
index 735adbb..ae00589 100644
--- a/jdk/src/share/classes/java/lang/NoSuchFieldError.java
+++ b/jdk/src/share/classes/java/lang/NoSuchFieldError.java
@@ -34,7 +34,7 @@
  * incompatibly changed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NoSuchFieldError extends IncompatibleClassChangeError {
diff --git a/jdk/src/share/classes/java/lang/NoSuchFieldException.java b/jdk/src/share/classes/java/lang/NoSuchFieldException.java
index 0058264..933c5b5 100644
--- a/jdk/src/share/classes/java/lang/NoSuchFieldException.java
+++ b/jdk/src/share/classes/java/lang/NoSuchFieldException.java
@@ -29,7 +29,7 @@
  * Signals that the class doesn't have a field of a specified name.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public class NoSuchFieldException extends ReflectiveOperationException {
     private static final long serialVersionUID = -6143714805279938260L;
diff --git a/jdk/src/share/classes/java/lang/NoSuchMethodError.java b/jdk/src/share/classes/java/lang/NoSuchMethodError.java
index 248de62..3e373a0 100644
--- a/jdk/src/share/classes/java/lang/NoSuchMethodError.java
+++ b/jdk/src/share/classes/java/lang/NoSuchMethodError.java
@@ -35,7 +35,7 @@
  * incompatibly changed.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NoSuchMethodError extends IncompatibleClassChangeError {
diff --git a/jdk/src/share/classes/java/lang/NoSuchMethodException.java b/jdk/src/share/classes/java/lang/NoSuchMethodException.java
index 701437c..e9f901d 100644
--- a/jdk/src/share/classes/java/lang/NoSuchMethodException.java
+++ b/jdk/src/share/classes/java/lang/NoSuchMethodException.java
@@ -29,7 +29,7 @@
  * Thrown when a particular method cannot be found.
  *
  * @author     unascribed
- * @since      JDK1.0
+ * @since      1.0
  */
 public
 class NoSuchMethodException extends ReflectiveOperationException {
diff --git a/jdk/src/share/classes/java/lang/NullPointerException.java b/jdk/src/share/classes/java/lang/NullPointerException.java
index 5b87ec4..d91d56f 100644
--- a/jdk/src/share/classes/java/lang/NullPointerException.java
+++ b/jdk/src/share/classes/java/lang/NullPointerException.java
@@ -47,7 +47,7 @@
  * stack trace was not writable}.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NullPointerException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/lang/Number.java b/jdk/src/share/classes/java/lang/Number.java
index d901609..b89ed71 100644
--- a/jdk/src/share/classes/java/lang/Number.java
+++ b/jdk/src/share/classes/java/lang/Number.java
@@ -50,7 +50,7 @@
  * @author      Arthur van Hoff
  * @jls 5.1.2 Widening Primitive Conversions
  * @jls 5.1.3 Narrowing Primitive Conversions
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class Number implements java.io.Serializable {
     /**
@@ -98,7 +98,7 @@
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code byte}.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public byte byteValue() {
         return (byte)intValue();
@@ -113,7 +113,7 @@
      *
      * @return  the numeric value represented by this object after conversion
      *          to type {@code short}.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public short shortValue() {
         return (short)intValue();
diff --git a/jdk/src/share/classes/java/lang/NumberFormatException.java b/jdk/src/share/classes/java/lang/NumberFormatException.java
index ea1ec9f..1774ce5 100644
--- a/jdk/src/share/classes/java/lang/NumberFormatException.java
+++ b/jdk/src/share/classes/java/lang/NumberFormatException.java
@@ -32,7 +32,7 @@
  *
  * @author  unascribed
  * @see     java.lang.Integer#parseInt(String)
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NumberFormatException extends IllegalArgumentException {
diff --git a/jdk/src/share/classes/java/lang/Object.java b/jdk/src/share/classes/java/lang/Object.java
index d4bf7f6..bf61331 100644
--- a/jdk/src/share/classes/java/lang/Object.java
+++ b/jdk/src/share/classes/java/lang/Object.java
@@ -32,7 +32,7 @@
  *
  * @author  unascribed
  * @see     java.lang.Class
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Object {
 
diff --git a/jdk/src/share/classes/java/lang/OutOfMemoryError.java b/jdk/src/share/classes/java/lang/OutOfMemoryError.java
index 0f9df4e..2297ed6 100644
--- a/jdk/src/share/classes/java/lang/OutOfMemoryError.java
+++ b/jdk/src/share/classes/java/lang/OutOfMemoryError.java
@@ -36,7 +36,7 @@
  * writable}.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public class OutOfMemoryError extends VirtualMachineError {
     private static final long serialVersionUID = 8228564086184010517L;
diff --git a/jdk/src/share/classes/java/lang/Process.java b/jdk/src/share/classes/java/lang/Process.java
index 9d9bc33..b05d19f 100644
--- a/jdk/src/share/classes/java/lang/Process.java
+++ b/jdk/src/share/classes/java/lang/Process.java
@@ -72,7 +72,7 @@
  * <p>As of 1.5, {@link ProcessBuilder#start()} is the preferred way
  * to create a {@code Process}.
  *
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class Process {
     /**
diff --git a/jdk/src/share/classes/java/lang/Runnable.java b/jdk/src/share/classes/java/lang/Runnable.java
index b9f1df7..f876324 100644
--- a/jdk/src/share/classes/java/lang/Runnable.java
+++ b/jdk/src/share/classes/java/lang/Runnable.java
@@ -50,7 +50,7 @@
  * @author  Arthur van Hoff
  * @see     java.lang.Thread
  * @see     java.util.concurrent.Callable
- * @since   JDK1.0
+ * @since   1.0
  */
 @FunctionalInterface
 public interface Runnable {
diff --git a/jdk/src/share/classes/java/lang/Runtime.java b/jdk/src/share/classes/java/lang/Runtime.java
index d91b8ad..f28528d 100644
--- a/jdk/src/share/classes/java/lang/Runtime.java
+++ b/jdk/src/share/classes/java/lang/Runtime.java
@@ -40,7 +40,7 @@
  *
  * @author  unascribed
  * @see     java.lang.Runtime#getRuntime()
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class Runtime {
@@ -299,7 +299,7 @@
      * @see     java.lang.Runtime#exit(int)
      * @see     java.lang.Runtime#gc()
      * @see     java.lang.SecurityManager#checkExit(int)
-     * @since   JDK1.1
+     * @since   1.1
      */
     @Deprecated
     public static void runFinalizersOnExit(boolean value) {
diff --git a/jdk/src/share/classes/java/lang/RuntimeException.java b/jdk/src/share/classes/java/lang/RuntimeException.java
index c9731e8..8ed5c9b 100644
--- a/jdk/src/share/classes/java/lang/RuntimeException.java
+++ b/jdk/src/share/classes/java/lang/RuntimeException.java
@@ -38,7 +38,7 @@
  *
  * @author  Frank Yellin
  * @jls 11.2 Compile-Time Checking of Exceptions
- * @since   JDK1.0
+ * @since   1.0
  */
 public class RuntimeException extends Exception {
     static final long serialVersionUID = -7034897190745766939L;
diff --git a/jdk/src/share/classes/java/lang/SecurityException.java b/jdk/src/share/classes/java/lang/SecurityException.java
index 7e07178..061e0c7 100644
--- a/jdk/src/share/classes/java/lang/SecurityException.java
+++ b/jdk/src/share/classes/java/lang/SecurityException.java
@@ -29,7 +29,7 @@
  *
  * @author  unascribed
  * @see     java.lang.SecurityManager
- * @since   JDK1.0
+ * @since   1.0
  */
 public class SecurityException extends RuntimeException {
 
diff --git a/jdk/src/share/classes/java/lang/SecurityManager.java b/jdk/src/share/classes/java/lang/SecurityManager.java
index f7f3a58..1714cf0 100644
--- a/jdk/src/share/classes/java/lang/SecurityManager.java
+++ b/jdk/src/share/classes/java/lang/SecurityManager.java
@@ -216,7 +216,7 @@
  * @see     java.security.SecurityPermission SecurityPermission
  * @see     java.security.ProtectionDomain
  *
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class SecurityManager {
@@ -1179,7 +1179,7 @@
      *  use (join/leave/send/receive) IP multicast.
      * @exception  NullPointerException if the address argument is
      *             <code>null</code>.
-     * @since      JDK1.1
+     * @since      1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkMulticast(InetAddress maddr) {
@@ -1213,7 +1213,7 @@
      *  use (join/leave/send/receive) IP multicast.
      * @exception  NullPointerException if the address argument is
      *             <code>null</code>.
-     * @since      JDK1.1
+     * @since      1.1
      * @deprecated Use #checkPermission(java.security.Permission) instead
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
@@ -1322,7 +1322,7 @@
      *
      * @exception  SecurityException  if the calling thread does not have
      *             permission to initiate a print job request.
-     * @since   JDK1.1
+     * @since   1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkPrintJobAccess() {
@@ -1333,7 +1333,7 @@
      * Throws {@code SecurityException} if the calling thread does
      * not have {@code AllPermission}.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @exception  SecurityException  if the calling thread does not have
      *             {@code AllPermission}
      * @deprecated This method was originally used to check if the calling
@@ -1351,7 +1351,7 @@
      * Throws {@code SecurityException} if the calling thread does
      * not have {@code AllPermission}.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @exception  SecurityException  if the calling thread does not have
      *             {@code AllPermission}
      * @deprecated This method was originally used to check if the calling
@@ -1610,7 +1610,7 @@
      *             to check the permission {@code java.security.AllPermission}.
      *
      * @see java.lang.reflect.Member
-     * @since JDK1.1
+     * @since 1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     @Deprecated
@@ -1666,7 +1666,7 @@
      * @exception NullPointerException if <code>target</code> is null.
      * @exception IllegalArgumentException if <code>target</code> is empty.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @see        #checkPermission(java.security.Permission) checkPermission
      */
     public void checkSecurityAccess(String target) {
@@ -1683,7 +1683,7 @@
      * manager to return the appropriate thread group.
      *
      * @return  ThreadGroup that new threads are instantiated into
-     * @since   JDK1.1
+     * @since   1.1
      * @see     java.lang.ThreadGroup
      */
     public ThreadGroup getThreadGroup() {
diff --git a/jdk/src/share/classes/java/lang/Short.java b/jdk/src/share/classes/java/lang/Short.java
index 9fb3913..e6a6c75 100644
--- a/jdk/src/share/classes/java/lang/Short.java
+++ b/jdk/src/share/classes/java/lang/Short.java
@@ -38,7 +38,7 @@
  * @author  Nakul Saraiya
  * @author  Joseph D. Darcy
  * @see     java.lang.Number
- * @since   JDK1.1
+ * @since   1.1
  */
 public final class Short extends Number implements Comparable<Short> {
 
diff --git a/jdk/src/share/classes/java/lang/StackOverflowError.java b/jdk/src/share/classes/java/lang/StackOverflowError.java
index 73fd8c1..8099e71 100644
--- a/jdk/src/share/classes/java/lang/StackOverflowError.java
+++ b/jdk/src/share/classes/java/lang/StackOverflowError.java
@@ -30,7 +30,7 @@
  * recurses too deeply.
  *
  * @author unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class StackOverflowError extends VirtualMachineError {
diff --git a/jdk/src/share/classes/java/lang/String.java b/jdk/src/share/classes/java/lang/String.java
index 2227a6f..c4f6777 100644
--- a/jdk/src/share/classes/java/lang/String.java
+++ b/jdk/src/share/classes/java/lang/String.java
@@ -105,7 +105,7 @@
  * @see     java.lang.StringBuffer
  * @see     java.lang.StringBuilder
  * @see     java.nio.charset.Charset
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public final class String
@@ -404,7 +404,7 @@
      *          If the {@code offset} and {@code length} arguments index
      *          characters outside the bounds of the {@code bytes} array
      *
-     * @since  JDK1.1
+     * @since  1.1
      */
     public String(byte bytes[], int offset, int length, String charsetName)
             throws UnsupportedEncodingException {
@@ -472,7 +472,7 @@
      * @throws  UnsupportedEncodingException
      *          If the named charset is not supported
      *
-     * @since  JDK1.1
+     * @since  1.1
      */
     public String(byte bytes[], String charsetName)
             throws UnsupportedEncodingException {
@@ -527,7 +527,7 @@
      *          If the {@code offset} and the {@code length} arguments index
      *          characters outside the bounds of the {@code bytes} array
      *
-     * @since  JDK1.1
+     * @since  1.1
      */
     public String(byte bytes[], int offset, int length) {
         checkBounds(bytes, offset, length);
@@ -548,7 +548,7 @@
      * @param  bytes
      *         The bytes to be decoded into characters
      *
-     * @since  JDK1.1
+     * @since  1.1
      */
     public String(byte bytes[]) {
         this(bytes, 0, bytes.length);
@@ -898,7 +898,7 @@
      * @throws  UnsupportedEncodingException
      *          If the named charset is not supported
      *
-     * @since  JDK1.1
+     * @since  1.1
      */
     public byte[] getBytes(String charsetName)
             throws UnsupportedEncodingException {
@@ -940,7 +940,7 @@
      *
      * @return  The resultant byte array
      *
-     * @since      JDK1.1
+     * @since      1.1
      */
     public byte[] getBytes() {
         return StringCoding.encode(value, 0, value.length);
@@ -1415,7 +1415,7 @@
      *          argument is an empty string or is equal to this
      *          {@code String} object as determined by the
      *          {@link #equals(Object)} method.
-     * @since   1. 0
+     * @since   1.0
      */
     public boolean startsWith(String prefix) {
         return startsWith(prefix, 0);
diff --git a/jdk/src/share/classes/java/lang/StringBuffer.java b/jdk/src/share/classes/java/lang/StringBuffer.java
index 9bc8f3b..a53c7c4 100644
--- a/jdk/src/share/classes/java/lang/StringBuffer.java
+++ b/jdk/src/share/classes/java/lang/StringBuffer.java
@@ -92,7 +92,7 @@
  * @author      Arthur van Hoff
  * @see     java.lang.StringBuilder
  * @see     java.lang.String
- * @since   JDK1.0
+ * @since   1.0
  */
  public final class StringBuffer
     extends AbstractStringBuilder
@@ -656,7 +656,7 @@
     }
 
     /**
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     @Override
     public synchronized StringBuffer reverse() {
diff --git a/jdk/src/share/classes/java/lang/StringIndexOutOfBoundsException.java b/jdk/src/share/classes/java/lang/StringIndexOutOfBoundsException.java
index c3aa9b7..96a7250 100644
--- a/jdk/src/share/classes/java/lang/StringIndexOutOfBoundsException.java
+++ b/jdk/src/share/classes/java/lang/StringIndexOutOfBoundsException.java
@@ -33,7 +33,7 @@
  *
  * @author  unascribed
  * @see     java.lang.String#charAt(int)
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
@@ -42,8 +42,6 @@
     /**
      * Constructs a {@code StringIndexOutOfBoundsException} with no
      * detail message.
-     *
-     * @since   JDK1.0.
      */
     public StringIndexOutOfBoundsException() {
         super();
diff --git a/jdk/src/share/classes/java/lang/System.java b/jdk/src/share/classes/java/lang/System.java
index 0a8cc3a..e96bd3b 100644
--- a/jdk/src/share/classes/java/lang/System.java
+++ b/jdk/src/share/classes/java/lang/System.java
@@ -54,7 +54,7 @@
  * method for quickly copying a portion of an array.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class System {
 
@@ -144,7 +144,7 @@
      * @see SecurityManager#checkPermission
      * @see java.lang.RuntimePermission
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public static void setIn(InputStream in) {
         checkIO();
@@ -168,7 +168,7 @@
      * @see SecurityManager#checkPermission
      * @see java.lang.RuntimePermission
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public static void setOut(PrintStream out) {
         checkIO();
@@ -192,7 +192,7 @@
      * @see SecurityManager#checkPermission
      * @see java.lang.RuntimePermission
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public static void setErr(PrintStream err) {
         checkIO();
@@ -502,7 +502,7 @@
      *
      * @param x object for which the hashCode is to be calculated
      * @return  the hashCode
-     * @since   JDK1.1
+     * @since   1.1
      */
     public static native int identityHashCode(Object x);
 
@@ -1032,7 +1032,7 @@
      * @see     java.lang.Runtime#exit(int)
      * @see     java.lang.Runtime#gc()
      * @see     java.lang.SecurityManager#checkExit(int)
-     * @since   JDK1.1
+     * @since   1.1
      */
     @Deprecated
     public static void runFinalizersOnExit(boolean value) {
diff --git a/jdk/src/share/classes/java/lang/Thread.java b/jdk/src/share/classes/java/lang/Thread.java
index d7fd8eb9..adcc982 100644
--- a/jdk/src/share/classes/java/lang/Thread.java
+++ b/jdk/src/share/classes/java/lang/Thread.java
@@ -135,7 +135,7 @@
  * @see     Runtime#exit(int)
  * @see     #run()
  * @see     #stop()
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class Thread implements Runnable {
diff --git a/jdk/src/share/classes/java/lang/ThreadDeath.java b/jdk/src/share/classes/java/lang/ThreadDeath.java
index 79e8bb5..0fa350d 100644
--- a/jdk/src/share/classes/java/lang/ThreadDeath.java
+++ b/jdk/src/share/classes/java/lang/ThreadDeath.java
@@ -43,7 +43,7 @@
  * "normal occurrence", because many applications catch all
  * occurrences of {@code Exception} and then discard the exception.
  *
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public class ThreadDeath extends Error {
diff --git a/jdk/src/share/classes/java/lang/ThreadGroup.java b/jdk/src/share/classes/java/lang/ThreadGroup.java
index 983fcde..57489eb 100644
--- a/jdk/src/share/classes/java/lang/ThreadGroup.java
+++ b/jdk/src/share/classes/java/lang/ThreadGroup.java
@@ -40,7 +40,7 @@
  * parent thread group or any other thread groups.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 /* The locking strategy for this code is to try to lock only one level of the
  * tree wherever possible, but otherwise to lock from the bottom up.
@@ -90,7 +90,7 @@
      * @exception  SecurityException  if the current thread cannot create a
      *               thread in the specified thread group.
      * @see     java.lang.ThreadGroup#checkAccess()
-     * @since   JDK1.0
+     * @since   1.0
      */
     public ThreadGroup(String name) {
         this(Thread.currentThread().getThreadGroup(), name);
@@ -111,7 +111,7 @@
      *               thread in the specified thread group.
      * @see     java.lang.SecurityException
      * @see     java.lang.ThreadGroup#checkAccess()
-     * @since   JDK1.0
+     * @since   1.0
      */
     public ThreadGroup(ThreadGroup parent, String name) {
         this(checkParentAccess(parent), parent, name);
@@ -140,7 +140,7 @@
      * Returns the name of this thread group.
      *
      * @return  the name of this thread group.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public final String getName() {
         return name;
@@ -160,7 +160,7 @@
      * @see        java.lang.ThreadGroup#checkAccess()
      * @see        java.lang.SecurityException
      * @see        java.lang.RuntimePermission
-     * @since   JDK1.0
+     * @since   1.0
      */
     public final ThreadGroup getParent() {
         if (parent != null)
@@ -176,7 +176,7 @@
      * @return  the maximum priority that a thread in this thread group
      *          can have.
      * @see     #setMaxPriority
-     * @since   JDK1.0
+     * @since   1.0
      */
     public final int getMaxPriority() {
         return maxPriority;
@@ -189,7 +189,7 @@
      *
      * @return  <code>true</code> if this thread group is a daemon thread group;
      *          <code>false</code> otherwise.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public final boolean isDaemon() {
         return daemon;
@@ -199,7 +199,7 @@
      * Tests if this thread group has been destroyed.
      *
      * @return  true if this object is destroyed
-     * @since   JDK1.1
+     * @since   1.1
      */
     public synchronized boolean isDestroyed() {
         return destroyed;
@@ -221,7 +221,7 @@
      *               this thread group.
      * @see        java.lang.SecurityException
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      */
     public final void setDaemon(boolean daemon) {
         checkAccess();
@@ -254,7 +254,7 @@
      * @see        #getMaxPriority
      * @see        java.lang.SecurityException
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      */
     public final void setMaxPriority(int pri) {
         int ngroupsSnapshot;
@@ -285,7 +285,7 @@
      * @return  <code>true</code> if this thread group is the thread group
      *          argument or one of its ancestor thread groups;
      *          <code>false</code> otherwise.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public final boolean parentOf(ThreadGroup g) {
         for (; g != null ; g = g.parent) {
@@ -307,7 +307,7 @@
      * @exception  SecurityException  if the current thread is not allowed to
      *               access this thread group.
      * @see        java.lang.SecurityManager#checkAccess(java.lang.ThreadGroup)
-     * @since      JDK1.0
+     * @since      1.0
      */
     public final void checkAccess() {
         SecurityManager security = System.getSecurityManager();
@@ -331,7 +331,7 @@
      *          group and in any other thread group that has this thread
      *          group as an ancestor
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int activeCount() {
         int result;
@@ -377,7 +377,7 @@
      *          if {@linkplain #checkAccess checkAccess} determines that
      *          the current thread cannot access this thread group
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int enumerate(Thread list[]) {
         checkAccess();
@@ -415,7 +415,7 @@
      *          if {@linkplain #checkAccess checkAccess} determines that
      *          the current thread cannot access this thread group
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int enumerate(Thread list[], boolean recurse) {
         checkAccess();
@@ -468,7 +468,7 @@
      * @return  the number of active thread groups with this thread group as
      *          an ancestor
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int activeGroupCount() {
         int ngroupsSnapshot;
@@ -511,7 +511,7 @@
      *          if {@linkplain #checkAccess checkAccess} determines that
      *          the current thread cannot access this thread group
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int enumerate(ThreadGroup list[]) {
         checkAccess();
@@ -549,7 +549,7 @@
      *          if {@linkplain #checkAccess checkAccess} determines that
      *          the current thread cannot access this thread group
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public int enumerate(ThreadGroup list[], boolean recurse) {
         checkAccess();
@@ -603,7 +603,7 @@
      * @see        java.lang.SecurityException
      * @see        java.lang.Thread#stop()
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      * @deprecated    This method is inherently unsafe.  See
      *     {@link Thread#stop} for details.
      */
@@ -665,7 +665,7 @@
      * @see        java.lang.Thread#suspend()
      * @see        java.lang.SecurityException
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      * @deprecated    This method is inherently deadlock-prone.  See
      *     {@link Thread#suspend} for details.
      */
@@ -726,7 +726,7 @@
      * @see        java.lang.SecurityException
      * @see        java.lang.Thread#resume()
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      * @deprecated    This method is used solely in conjunction with
      *      <tt>Thread.suspend</tt> and <tt>ThreadGroup.suspend</tt>,
      *       both of which have been deprecated, as they are inherently
@@ -767,7 +767,7 @@
      * @exception  SecurityException  if the current thread cannot modify this
      *               thread group.
      * @see        java.lang.ThreadGroup#checkAccess()
-     * @since      JDK1.0
+     * @since      1.0
      */
     public final void destroy() {
         int ngroupsSnapshot;
@@ -980,7 +980,7 @@
      * Prints information about this thread group to the standard
      * output. This method is useful only for debugging.
      *
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void list() {
         list(System.out, 0);
@@ -1045,7 +1045,7 @@
      *
      * @param   t   the thread that is about to exit.
      * @param   e   the uncaught exception.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void uncaughtException(Thread t, Throwable e) {
         if (parent != null) {
@@ -1068,7 +1068,7 @@
      *
      * @param b boolean to allow or disallow suspension
      * @return true on success
-     * @since   JDK1.1
+     * @since   1.1
      * @deprecated The definition of this call depends on {@link #suspend},
      *             which is deprecated.  Further, the behavior of this call
      *             was never specified.
@@ -1086,7 +1086,7 @@
      * Returns a string representation of this Thread group.
      *
      * @return  a string representation of this thread group.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public String toString() {
         return getClass().getName() + "[name=" + getName() + ",maxpri=" + maxPriority + "]";
diff --git a/jdk/src/share/classes/java/lang/Throwable.java b/jdk/src/share/classes/java/lang/Throwable.java
index abdb3fc..396d8e9 100644
--- a/jdk/src/share/classes/java/lang/Throwable.java
+++ b/jdk/src/share/classes/java/lang/Throwable.java
@@ -109,7 +109,7 @@
  * @author  Josh Bloch (Added exception chaining and programmatic access to
  *          stack trace in 1.4.)
  * @jls 11.2 Compile-Time Checking of Exceptions
- * @since JDK1.0
+ * @since 1.0
  */
 public class Throwable implements Serializable {
     /** use serialVersionUID from JDK 1.0.2 for interoperability */
@@ -385,7 +385,7 @@
      * {@code getMessage()}.
      *
      * @return  The localized description of this throwable.
-     * @since   JDK1.1
+     * @since   1.1
      */
     public String getLocalizedMessage() {
         return getMessage();
@@ -714,7 +714,7 @@
      * print writer.
      *
      * @param s {@code PrintWriter} to use for output
-     * @since   JDK1.1
+     * @since   1.1
      */
     public void printStackTrace(PrintWriter s) {
         printStackTrace(new WrappedPrintWriter(s));
diff --git a/jdk/src/share/classes/java/lang/UnknownError.java b/jdk/src/share/classes/java/lang/UnknownError.java
index 0706f81..a88a6a8 100644
--- a/jdk/src/share/classes/java/lang/UnknownError.java
+++ b/jdk/src/share/classes/java/lang/UnknownError.java
@@ -30,7 +30,7 @@
  * Java Virtual Machine.
  *
  * @author unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class UnknownError extends VirtualMachineError {
diff --git a/jdk/src/share/classes/java/lang/UnsatisfiedLinkError.java b/jdk/src/share/classes/java/lang/UnsatisfiedLinkError.java
index 32a8ba8..482fdbd 100644
--- a/jdk/src/share/classes/java/lang/UnsatisfiedLinkError.java
+++ b/jdk/src/share/classes/java/lang/UnsatisfiedLinkError.java
@@ -31,7 +31,7 @@
  *
  * @author unascribed
  * @see     java.lang.Runtime
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class UnsatisfiedLinkError extends LinkageError {
diff --git a/jdk/src/share/classes/java/lang/VerifyError.java b/jdk/src/share/classes/java/lang/VerifyError.java
index 9ca9f90..3f991a7 100644
--- a/jdk/src/share/classes/java/lang/VerifyError.java
+++ b/jdk/src/share/classes/java/lang/VerifyError.java
@@ -31,7 +31,7 @@
  * or security problem.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class VerifyError extends LinkageError {
diff --git a/jdk/src/share/classes/java/lang/VirtualMachineError.java b/jdk/src/share/classes/java/lang/VirtualMachineError.java
index c0a2a92..a8b5807 100644
--- a/jdk/src/share/classes/java/lang/VirtualMachineError.java
+++ b/jdk/src/share/classes/java/lang/VirtualMachineError.java
@@ -31,7 +31,7 @@
  *
  *
  * @author  Frank Yellin
- * @since   JDK1.0
+ * @since   1.0
  */
 abstract public class VirtualMachineError extends Error {
     private static final long serialVersionUID = 4161983926571568670L;
diff --git a/jdk/src/share/classes/java/lang/Void.java b/jdk/src/share/classes/java/lang/Void.java
index 96dbe6d..581d0d6 100644
--- a/jdk/src/share/classes/java/lang/Void.java
+++ b/jdk/src/share/classes/java/lang/Void.java
@@ -31,7 +31,7 @@
  * void.
  *
  * @author  unascribed
- * @since   JDK1.1
+ * @since   1.1
  */
 public final
 class Void {
diff --git a/jdk/src/share/classes/java/lang/instrument/package.html b/jdk/src/share/classes/java/lang/instrument/package.html
index b8e34f3..6c6e380 100644
--- a/jdk/src/share/classes/java/lang/instrument/package.html
+++ b/jdk/src/share/classes/java/lang/instrument/package.html
@@ -274,7 +274,7 @@
   <li><a href="{@docRoot}/../technotes/tools/index.html">JDK Tools and Utilities</a>
 </ul>
 
-@since JDK1.5
+@since 1.5
 @revised 1.6
 
 </body>
diff --git a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
index 48a937c..0c5931d 100644
--- a/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
+++ b/jdk/src/share/classes/java/lang/invoke/MethodHandles.java
@@ -1612,23 +1612,30 @@
                 checkSecurityManager(refc, method);
             assert(!method.isMethodHandleInvoke());
 
-            Class<?> refcAsSuper;
             if (refKind == REF_invokeSpecial &&
                 refc != lookupClass() &&
                 !refc.isInterface() &&
-                refc != (refcAsSuper = lookupClass().getSuperclass()) &&
+                refc != lookupClass().getSuperclass() &&
                 refc.isAssignableFrom(lookupClass())) {
                 assert(!method.getName().equals("<init>"));  // not this code path
                 // Per JVMS 6.5, desc. of invokespecial instruction:
                 // If the method is in a superclass of the LC,
                 // and if our original search was above LC.super,
-                // repeat the search (symbolic lookup) from LC.super.
+                // repeat the search (symbolic lookup) from LC.super
+                // and continue with the direct superclass of that class,
+                // and so forth, until a match is found or no further superclasses exist.
                 // FIXME: MemberName.resolve should handle this instead.
-                MemberName m2 = new MemberName(refcAsSuper,
-                                               method.getName(),
-                                               method.getMethodType(),
-                                               REF_invokeSpecial);
-                m2 = IMPL_NAMES.resolveOrNull(refKind, m2, lookupClassOrNull());
+                Class<?> refcAsSuper = lookupClass();
+                MemberName m2;
+                do {
+                    refcAsSuper = refcAsSuper.getSuperclass();
+                    m2 = new MemberName(refcAsSuper,
+                                        method.getName(),
+                                        method.getMethodType(),
+                                        REF_invokeSpecial);
+                    m2 = IMPL_NAMES.resolveOrNull(refKind, m2, lookupClassOrNull());
+                } while (m2 == null &&         // no method is found yet
+                         refc != refcAsSuper); // search up to refc
                 if (m2 == null)  throw new InternalError(method.toString());
                 method = m2;
                 refc = refcAsSuper;
diff --git a/jdk/src/share/classes/java/lang/package-info.java b/jdk/src/share/classes/java/lang/package-info.java
index aa7a79d..26a0daf 100644
--- a/jdk/src/share/classes/java/lang/package-info.java
+++ b/jdk/src/share/classes/java/lang/package-info.java
@@ -66,6 +66,6 @@
  * that must be supported by every implementation of the Java
  * platform.
  *
- * @since JDK1.0
+ * @since 1.0
  */
 package java.lang;
diff --git a/jdk/src/share/classes/java/lang/reflect/package-info.java b/jdk/src/share/classes/java/lang/reflect/package-info.java
index 258a07e..cf0a1a2 100644
--- a/jdk/src/share/classes/java/lang/reflect/package-info.java
+++ b/jdk/src/share/classes/java/lang/reflect/package-info.java
@@ -44,6 +44,6 @@
  * members of a target object (based on its runtime class) or the
  * members declared by a given class.
  *
- * @since JDK1.1
+ * @since 1.1
  */
 package java.lang.reflect;
diff --git a/jdk/src/share/classes/java/math/BigInteger.java b/jdk/src/share/classes/java/math/BigInteger.java
index 84d691e..487ed22 100644
--- a/jdk/src/share/classes/java/math/BigInteger.java
+++ b/jdk/src/share/classes/java/math/BigInteger.java
@@ -117,7 +117,7 @@
  * @author  Michael McCloskey
  * @author  Alan Eliasen
  * @author  Timothy Buktu
- * @since JDK1.1
+ * @since 1.1
  */
 
 public class BigInteger extends Number implements Comparable<BigInteger> {
diff --git a/jdk/src/share/classes/java/math/package-info.java b/jdk/src/share/classes/java/math/package-info.java
index 377cc25..ed3a8dc 100644
--- a/jdk/src/share/classes/java/math/package-info.java
+++ b/jdk/src/share/classes/java/math/package-info.java
@@ -40,6 +40,6 @@
  * allowing the user to choose from a comprehensive set of eight
  * rounding modes.
  *
- * @since JDK1.1
+ * @since 1.1
  */
 package java.math;
diff --git a/jdk/src/share/classes/java/net/BindException.java b/jdk/src/share/classes/java/net/BindException.java
index f893909..e2b75b8 100644
--- a/jdk/src/share/classes/java/net/BindException.java
+++ b/jdk/src/share/classes/java/net/BindException.java
@@ -30,7 +30,7 @@
  * socket to a local address and port.  Typically, the port is
  * in use, or the requested local address could not be assigned.
  *
- * @since   JDK1.1
+ * @since   1.1
  */
 
 public class BindException extends SocketException {
diff --git a/jdk/src/share/classes/java/net/ConnectException.java b/jdk/src/share/classes/java/net/ConnectException.java
index 7e41220..721f59c 100644
--- a/jdk/src/share/classes/java/net/ConnectException.java
+++ b/jdk/src/share/classes/java/net/ConnectException.java
@@ -31,7 +31,7 @@
  * was refused remotely (e.g., no process is listening on the
  * remote address/port).
  *
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ConnectException extends SocketException {
     private static final long serialVersionUID = 3831404271622369215L;
diff --git a/jdk/src/share/classes/java/net/ContentHandler.java b/jdk/src/share/classes/java/net/ContentHandler.java
index ef5b74c..7e71b25 100644
--- a/jdk/src/share/classes/java/net/ContentHandler.java
+++ b/jdk/src/share/classes/java/net/ContentHandler.java
@@ -79,7 +79,7 @@
  * @see     java.net.URLConnection
  * @see     java.net.URLConnection#getContent()
  * @see     java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
- * @since   JDK1.0
+ * @since   1.0
  */
 abstract public class ContentHandler {
     /**
diff --git a/jdk/src/share/classes/java/net/ContentHandlerFactory.java b/jdk/src/share/classes/java/net/ContentHandlerFactory.java
index 64112e3..1e75e71 100644
--- a/jdk/src/share/classes/java/net/ContentHandlerFactory.java
+++ b/jdk/src/share/classes/java/net/ContentHandlerFactory.java
@@ -36,7 +36,7 @@
  * @author  James Gosling
  * @see     java.net.ContentHandler
  * @see     java.net.URLStreamHandler
- * @since   JDK1.0
+ * @since   1.0
  */
 public interface ContentHandlerFactory {
     /**
diff --git a/jdk/src/share/classes/java/net/DatagramPacket.java b/jdk/src/share/classes/java/net/DatagramPacket.java
index 0c9bceb..eb8e400 100644
--- a/jdk/src/share/classes/java/net/DatagramPacket.java
+++ b/jdk/src/share/classes/java/net/DatagramPacket.java
@@ -37,7 +37,7 @@
  *
  * @author  Pavani Diwanji
  * @author  Benjamin Renaud
- * @since   JDK1.0
+ * @since   1.0
  */
 public final
 class DatagramPacket {
@@ -276,7 +276,7 @@
      * Sets the IP address of the machine to which this datagram
      * is being sent.
      * @param iaddr the {@code InetAddress}
-     * @since   JDK1.1
+     * @since   1.1
      * @see #getAddress()
      */
     public synchronized void setAddress(InetAddress iaddr) {
@@ -287,7 +287,7 @@
      * Sets the port number on the remote host to which this datagram
      * is being sent.
      * @param iport the port number
-     * @since   JDK1.1
+     * @since   1.1
      * @see #getPort()
      */
     public synchronized void setPort(int iport) {
@@ -342,7 +342,7 @@
      * @see #getLength
      * @see #getData
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized void setData(byte[] buf) {
         if (buf == null) {
@@ -370,7 +370,7 @@
      * @see #getLength
      * @see #setData
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized void setLength(int length) {
         if ((length + offset) > buf.length || length < 0 ||
diff --git a/jdk/src/share/classes/java/net/DatagramSocket.java b/jdk/src/share/classes/java/net/DatagramSocket.java
index e983726..d2a0104 100644
--- a/jdk/src/share/classes/java/net/DatagramSocket.java
+++ b/jdk/src/share/classes/java/net/DatagramSocket.java
@@ -63,7 +63,7 @@
  * @author  Pavani Diwanji
  * @see     java.net.DatagramPacket
  * @see     java.nio.channels.DatagramChannel
- * @since JDK1.0
+ * @since 1.0
  */
 public
 class DatagramSocket implements java.io.Closeable {
@@ -275,7 +275,7 @@
      *             {@code checkListen} method doesn't allow the operation.
      *
      * @see SecurityManager#checkListen
-     * @since   JDK1.1
+     * @since   1.1
      */
     public DatagramSocket(int port, InetAddress laddr) throws SocketException {
         this(new InetSocketAddress(laddr, port));
@@ -852,7 +852,7 @@
      *
      * @param timeout the specified timeout in milliseconds.
      * @throws SocketException if there is an error in the underlying protocol, such as an UDP error.
-     * @since   JDK1.1
+     * @since   1.1
      * @see #getSoTimeout()
      */
     public synchronized void setSoTimeout(int timeout) throws SocketException {
@@ -867,7 +867,7 @@
      *
      * @return the setting for SO_TIMEOUT
      * @throws SocketException if there is an error in the underlying protocol, such as an UDP error.
-     * @since   JDK1.1
+     * @since   1.1
      * @see #setSoTimeout(int)
      */
     public synchronized int getSoTimeout() throws SocketException {
diff --git a/jdk/src/share/classes/java/net/DatagramSocketImpl.java b/jdk/src/share/classes/java/net/DatagramSocketImpl.java
index 73a7ba3..50d5369 100644
--- a/jdk/src/share/classes/java/net/DatagramSocketImpl.java
+++ b/jdk/src/share/classes/java/net/DatagramSocketImpl.java
@@ -34,7 +34,7 @@
 /**
  * Abstract datagram and multicast socket implementation base class.
  * @author Pavani Diwanji
- * @since  JDK1.1
+ * @since  1.1
  */
 
 public abstract class DatagramSocketImpl implements SocketOptions {
diff --git a/jdk/src/share/classes/java/net/FileNameMap.java b/jdk/src/share/classes/java/net/FileNameMap.java
index 393b5aa..857787d 100644
--- a/jdk/src/share/classes/java/net/FileNameMap.java
+++ b/jdk/src/share/classes/java/net/FileNameMap.java
@@ -30,7 +30,7 @@
  * between a file name and a MIME type string.
  *
  * @author  Steven B. Byrne
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface FileNameMap {
 
diff --git a/jdk/src/share/classes/java/net/HttpURLConnection.java b/jdk/src/share/classes/java/net/HttpURLConnection.java
index a98fd37..de9ac33 100644
--- a/jdk/src/share/classes/java/net/HttpURLConnection.java
+++ b/jdk/src/share/classes/java/net/HttpURLConnection.java
@@ -64,7 +64,7 @@
  * redirected host/URL.
  *
  * @see     java.net.HttpURLConnection#disconnect()
- * @since JDK1.1
+ * @since 1.1
  */
 abstract public class HttpURLConnection extends URLConnection {
     /* instance variables */
diff --git a/jdk/src/share/classes/java/net/Inet4Address.java b/jdk/src/share/classes/java/net/Inet4Address.java
index 528b276..08559f3 100644
--- a/jdk/src/share/classes/java/net/Inet4Address.java
+++ b/jdk/src/share/classes/java/net/Inet4Address.java
@@ -155,7 +155,7 @@
      * address i.e first four bits of the address are 1110.
      * @return a {@code boolean} indicating if the InetAddress is
      * an IP multicast address
-     * @since   JDK1.1
+     * @since   1.1
      */
     public boolean isMulticastAddress() {
         return ((holder().getAddress() & 0xf0000000) == 0xe0000000);
@@ -320,7 +320,7 @@
      * Returns the IP address string in textual presentation form.
      *
      * @return  the raw IP address in a string format.
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public String getHostAddress() {
         return numericToTextFormat(getAddress());
diff --git a/jdk/src/share/classes/java/net/Inet6Address.java b/jdk/src/share/classes/java/net/Inet6Address.java
index 58393f7..bbe2263 100644
--- a/jdk/src/share/classes/java/net/Inet6Address.java
+++ b/jdk/src/share/classes/java/net/Inet6Address.java
@@ -683,7 +683,7 @@
      * @return a {@code boolean} indicating if the InetAddress is an IP
      *         multicast address
      *
-     * @since JDK1.1
+     * @since 1.1
      */
     @Override
     public boolean isMulticastAddress() {
diff --git a/jdk/src/share/classes/java/net/InetAddress.java b/jdk/src/share/classes/java/net/InetAddress.java
index 5bbdf0f..09b645d 100644
--- a/jdk/src/share/classes/java/net/InetAddress.java
+++ b/jdk/src/share/classes/java/net/InetAddress.java
@@ -183,7 +183,7 @@
  * @see     java.net.InetAddress#getAllByName(java.lang.String)
  * @see     java.net.InetAddress#getByName(java.lang.String)
  * @see     java.net.InetAddress#getLocalHost()
- * @since JDK1.0
+ * @since 1.0
  */
 public
 class InetAddress implements java.io.Serializable {
@@ -305,7 +305,7 @@
      * IP multicast address.
      * @return a {@code boolean} indicating if the InetAddress is
      * an IP multicast address
-     * @since   JDK1.1
+     * @since   1.1
      */
     public boolean isMulticastAddress() {
         return false;
@@ -654,7 +654,7 @@
      * Returns the IP address string in textual presentation.
      *
      * @return  the raw IP address in a string format.
-     * @since   JDK1.0.2
+     * @since   1.0.2
      */
     public String getHostAddress() {
         return null;
diff --git a/jdk/src/share/classes/java/net/MalformedURLException.java b/jdk/src/share/classes/java/net/MalformedURLException.java
index 7aef75c..5f9ab51 100644
--- a/jdk/src/share/classes/java/net/MalformedURLException.java
+++ b/jdk/src/share/classes/java/net/MalformedURLException.java
@@ -33,7 +33,7 @@
  * string could not be parsed.
  *
  * @author  Arthur van Hoff
- * @since   JDK1.0
+ * @since   1.0
  */
 public class MalformedURLException extends IOException {
     private static final long serialVersionUID = -182787522200415866L;
diff --git a/jdk/src/share/classes/java/net/MulticastSocket.java b/jdk/src/share/classes/java/net/MulticastSocket.java
index 1d42dfe..cfb3a62 100644
--- a/jdk/src/share/classes/java/net/MulticastSocket.java
+++ b/jdk/src/share/classes/java/net/MulticastSocket.java
@@ -77,7 +77,7 @@
  * Currently applets are not allowed to use multicast sockets.
  *
  * @author Pavani Diwanji
- * @since  JDK1.1
+ * @since  1.1
  */
 public
 class MulticastSocket extends DatagramSocket {
diff --git a/jdk/src/share/classes/java/net/NoRouteToHostException.java b/jdk/src/share/classes/java/net/NoRouteToHostException.java
index 76f0814..cf6e68c 100644
--- a/jdk/src/share/classes/java/net/NoRouteToHostException.java
+++ b/jdk/src/share/classes/java/net/NoRouteToHostException.java
@@ -31,7 +31,7 @@
  * host cannot be reached because of an intervening firewall, or
  * if an intermediate router is down.
  *
- * @since   JDK1.1
+ * @since   1.1
  */
 public class NoRouteToHostException extends SocketException {
     private static final long serialVersionUID = -1897550894873493790L;
diff --git a/jdk/src/share/classes/java/net/ProtocolException.java b/jdk/src/share/classes/java/net/ProtocolException.java
index ebb94eb..828636e 100644
--- a/jdk/src/share/classes/java/net/ProtocolException.java
+++ b/jdk/src/share/classes/java/net/ProtocolException.java
@@ -32,7 +32,7 @@
  * protocol, such as a TCP error.
  *
  * @author  Chris Warth
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ProtocolException extends IOException {
diff --git a/jdk/src/share/classes/java/net/ServerSocket.java b/jdk/src/share/classes/java/net/ServerSocket.java
index e60719e..e2180b8 100644
--- a/jdk/src/share/classes/java/net/ServerSocket.java
+++ b/jdk/src/share/classes/java/net/ServerSocket.java
@@ -48,7 +48,7 @@
  * @see     java.net.SocketImpl
  * @see     java.net.ServerSocket#setSocketFactory(java.net.SocketImplFactory)
  * @see     java.nio.channels.ServerSocketChannel
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class ServerSocket implements java.io.Closeable {
@@ -225,7 +225,7 @@
      * @see SocketOptions
      * @see SocketImpl
      * @see SecurityManager#checkListen
-     * @since   JDK1.1
+     * @since   1.1
      */
     public ServerSocket(int port, int backlog, InetAddress bindAddr) throws IOException {
         setImpl();
@@ -527,7 +527,7 @@
      *         and the channel is in non-blocking mode
      * @throws IOException if an I/O error occurs when waiting
      * for a connection.
-     * @since   JDK1.1
+     * @since   1.1
      * @revised 1.4
      * @spec JSR-51
      */
@@ -644,7 +644,7 @@
      * @param timeout the specified timeout, in milliseconds
      * @exception SocketException if there is an error in
      * the underlying protocol, such as a TCP error.
-     * @since   JDK1.1
+     * @since   1.1
      * @see #getSoTimeout()
      */
     public synchronized void setSoTimeout(int timeout) throws SocketException {
@@ -658,7 +658,7 @@
      * 0 returns implies that the option is disabled (i.e., timeout of infinity).
      * @return the {@link SocketOptions#SO_TIMEOUT SO_TIMEOUT} value
      * @exception IOException if an I/O error occurs
-     * @since   JDK1.1
+     * @since   1.1
      * @see #setSoTimeout(int)
      */
     public synchronized int getSoTimeout() throws IOException {
diff --git a/jdk/src/share/classes/java/net/Socket.java b/jdk/src/share/classes/java/net/Socket.java
index 43fe4bf..8638f45 100644
--- a/jdk/src/share/classes/java/net/Socket.java
+++ b/jdk/src/share/classes/java/net/Socket.java
@@ -50,7 +50,7 @@
  * @see     java.net.Socket#setSocketImplFactory(java.net.SocketImplFactory)
  * @see     java.net.SocketImpl
  * @see     java.nio.channels.SocketChannel
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class Socket implements java.io.Closeable {
@@ -79,7 +79,7 @@
      * Creates an unconnected socket, with the
      * system-default type of SocketImpl.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @revised 1.4
      */
     public Socket() {
@@ -161,7 +161,7 @@
      *
      * @exception SocketException if there is an error in the underlying protocol,
      * such as a TCP error.
-     * @since   JDK1.1
+     * @since   1.1
      */
     protected Socket(SocketImpl impl) throws SocketException {
         this.impl = impl;
@@ -281,7 +281,7 @@
      *             parameter is outside the specified range of valid port values,
      *             which is between 0 and 65535, inclusive.
      * @see        SecurityManager#checkConnect
-     * @since   JDK1.1
+     * @since   1.1
      */
     public Socket(String host, int port, InetAddress localAddr,
                   int localPort) throws IOException {
@@ -323,7 +323,7 @@
      *             which is between 0 and 65535, inclusive.
      * @exception  NullPointerException if {@code address} is null.
      * @see        SecurityManager#checkConnect
-     * @since   JDK1.1
+     * @since   1.1
      */
     public Socket(InetAddress address, int port, InetAddress localAddr,
                   int localPort) throws IOException {
@@ -708,7 +708,7 @@
      * @return the local address to which the socket is bound,
      *         the loopback address if denied by the security manager, or
      *         the wildcard address if the socket is closed or not bound yet.
-     * @since   JDK1.1
+     * @since   1.1
      *
      * @see SecurityManager#checkConnect
      */
@@ -972,7 +972,7 @@
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
      *
-     * @since   JDK1.1
+     * @since   1.1
      *
      * @see #getTcpNoDelay()
      */
@@ -989,7 +989,7 @@
      *         {@link SocketOptions#TCP_NODELAY TCP_NODELAY} is enabled.
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
-     * @since   JDK1.1
+     * @since   1.1
      * @see #setTcpNoDelay(boolean)
      */
     public boolean getTcpNoDelay() throws SocketException {
@@ -1010,7 +1010,7 @@
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
      * @exception IllegalArgumentException if the linger value is negative.
-     * @since JDK1.1
+     * @since 1.1
      * @see #getSoLinger()
      */
     public void setSoLinger(boolean on, int linger) throws SocketException {
@@ -1038,7 +1038,7 @@
      * @return the setting for {@link SocketOptions#SO_LINGER SO_LINGER}.
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
-     * @since   JDK1.1
+     * @since   1.1
      * @see #setSoLinger(boolean, int)
      */
     public int getSoLinger() throws SocketException {
@@ -1131,7 +1131,7 @@
      * @param timeout the specified timeout, in milliseconds.
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
-     * @since   JDK 1.1
+     * @since   1.1
      * @see #getSoTimeout()
      */
     public synchronized void setSoTimeout(int timeout) throws SocketException {
@@ -1151,7 +1151,7 @@
      * @exception SocketException if there is an error
      * in the underlying protocol, such as a TCP error.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @see #setSoTimeout(int)
      */
     public synchronized int getSoTimeout() throws SocketException {
diff --git a/jdk/src/share/classes/java/net/SocketException.java b/jdk/src/share/classes/java/net/SocketException.java
index 690fc4f..72e9454 100644
--- a/jdk/src/share/classes/java/net/SocketException.java
+++ b/jdk/src/share/classes/java/net/SocketException.java
@@ -31,7 +31,7 @@
  * Thrown to indicate that there is an error creating or accessing a Socket.
  *
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class SocketException extends IOException {
diff --git a/jdk/src/share/classes/java/net/SocketImpl.java b/jdk/src/share/classes/java/net/SocketImpl.java
index ebc527b..ad53e0a 100644
--- a/jdk/src/share/classes/java/net/SocketImpl.java
+++ b/jdk/src/share/classes/java/net/SocketImpl.java
@@ -42,7 +42,7 @@
  * described, without attempting to go through a firewall or proxy.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class SocketImpl implements SocketOptions {
     /**
diff --git a/jdk/src/share/classes/java/net/SocketImplFactory.java b/jdk/src/share/classes/java/net/SocketImplFactory.java
index 7aa6363..57b40da 100644
--- a/jdk/src/share/classes/java/net/SocketImplFactory.java
+++ b/jdk/src/share/classes/java/net/SocketImplFactory.java
@@ -34,7 +34,7 @@
  * @author  Arthur van Hoff
  * @see     java.net.Socket
  * @see     java.net.ServerSocket
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 interface SocketImplFactory {
diff --git a/jdk/src/share/classes/java/net/URL.java b/jdk/src/share/classes/java/net/URL.java
index cb89e21..9987bc0 100644
--- a/jdk/src/share/classes/java/net/URL.java
+++ b/jdk/src/share/classes/java/net/URL.java
@@ -131,7 +131,7 @@
  * as the encoding scheme defined in RFC2396.
  *
  * @author  James Gosling
- * @since JDK1.0
+ * @since 1.0
  */
 public final class URL implements java.io.Serializable {
 
diff --git a/jdk/src/share/classes/java/net/URLConnection.java b/jdk/src/share/classes/java/net/URLConnection.java
index 4abf5a4..afa80c3 100644
--- a/jdk/src/share/classes/java/net/URLConnection.java
+++ b/jdk/src/share/classes/java/net/URLConnection.java
@@ -155,7 +155,7 @@
  * @see     java.net.URLConnection#setIfModifiedSince(long)
  * @see     java.net.URLConnection#setRequestProperty(java.lang.String, java.lang.String)
  * @see     java.net.URLConnection#setUseCaches(boolean)
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class URLConnection {
 
@@ -283,7 +283,7 @@
     private MessageHeader requests;
 
    /**
-    * @since   JDK1.1
+    * @since   1.1
     */
     private static FileNameMap fileNameMap;
 
@@ -495,7 +495,7 @@
      * @return  the content length of the resource that this connection's URL
      *          references, or {@code -1} if the content length is
      *          not known.
-     * @since 7.0
+     * @since 1.7
      */
     public long getContentLengthLong() {
         return getHeaderFieldLong("content-length", -1);
@@ -623,7 +623,7 @@
      * @return  the value of the named field, parsed as a long. The
      *          {@code Default} value is returned if the field is
      *          missing or malformed.
-     * @since 7.0
+     * @since 1.7
      */
     public long getHeaderFieldLong(String name, long Default) {
         String value = getHeaderField(name);
diff --git a/jdk/src/share/classes/java/net/URLEncoder.java b/jdk/src/share/classes/java/net/URLEncoder.java
index 86377b7..657572c 100644
--- a/jdk/src/share/classes/java/net/URLEncoder.java
+++ b/jdk/src/share/classes/java/net/URLEncoder.java
@@ -77,7 +77,7 @@
  * character @ is encoded as one byte 40 (hex).
  *
  * @author  Herb Jellinek
- * @since   JDK1.0
+ * @since   1.0
  */
 public class URLEncoder {
     static BitSet dontNeedEncoding;
diff --git a/jdk/src/share/classes/java/net/URLStreamHandler.java b/jdk/src/share/classes/java/net/URLStreamHandler.java
index f758db5..0a8f1f1 100644
--- a/jdk/src/share/classes/java/net/URLStreamHandler.java
+++ b/jdk/src/share/classes/java/net/URLStreamHandler.java
@@ -47,7 +47,7 @@
  *
  * @author  James Gosling
  * @see     java.net.URL#URL(java.lang.String, java.lang.String, int, java.lang.String)
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract class URLStreamHandler {
     /**
diff --git a/jdk/src/share/classes/java/net/URLStreamHandlerFactory.java b/jdk/src/share/classes/java/net/URLStreamHandlerFactory.java
index e46e028..0b3c862 100644
--- a/jdk/src/share/classes/java/net/URLStreamHandlerFactory.java
+++ b/jdk/src/share/classes/java/net/URLStreamHandlerFactory.java
@@ -35,7 +35,7 @@
  * @author  Arthur van Hoff
  * @see     java.net.URL
  * @see     java.net.URLStreamHandler
- * @since   JDK1.0
+ * @since   1.0
  */
 public interface URLStreamHandlerFactory {
     /**
diff --git a/jdk/src/share/classes/java/net/UnknownHostException.java b/jdk/src/share/classes/java/net/UnknownHostException.java
index 21a9d14..a990f69 100644
--- a/jdk/src/share/classes/java/net/UnknownHostException.java
+++ b/jdk/src/share/classes/java/net/UnknownHostException.java
@@ -31,7 +31,7 @@
  * Thrown to indicate that the IP address of a host could not be determined.
  *
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class UnknownHostException extends IOException {
diff --git a/jdk/src/share/classes/java/net/UnknownServiceException.java b/jdk/src/share/classes/java/net/UnknownServiceException.java
index 4eea4a7..7daa8a4 100644
--- a/jdk/src/share/classes/java/net/UnknownServiceException.java
+++ b/jdk/src/share/classes/java/net/UnknownServiceException.java
@@ -34,7 +34,7 @@
  * read-only URL connection.
  *
  * @author  unascribed
- * @since   JDK1.0
+ * @since   1.0
  */
 public class UnknownServiceException extends IOException {
     private static final long serialVersionUID = -4169033248853639508L;
diff --git a/jdk/src/share/classes/java/net/package-info.java b/jdk/src/share/classes/java/net/package-info.java
index fda2e4f..ce812d7 100644
--- a/jdk/src/share/classes/java/net/package-info.java
+++ b/jdk/src/share/classes/java/net/package-info.java
@@ -156,6 +156,6 @@
  *            Networking System Properties</a></li>
  * </ul>
  *
- * @since JDK1.0
+ * @since 1.0
  */
 package java.net;
diff --git a/jdk/src/share/classes/java/rmi/AccessException.java b/jdk/src/share/classes/java/rmi/AccessException.java
index c694376..f6244f2 100644
--- a/jdk/src/share/classes/java/rmi/AccessException.java
+++ b/jdk/src/share/classes/java/rmi/AccessException.java
@@ -36,7 +36,7 @@
  *
  * @author  Ann Wollrath
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.Naming
  * @see     java.rmi.activation.ActivationSystem
  */
@@ -50,7 +50,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public AccessException(String s) {
         super(s);
@@ -62,7 +62,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public AccessException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/AlreadyBoundException.java b/jdk/src/share/classes/java/rmi/AlreadyBoundException.java
index 292b331..e24524c 100644
--- a/jdk/src/share/classes/java/rmi/AlreadyBoundException.java
+++ b/jdk/src/share/classes/java/rmi/AlreadyBoundException.java
@@ -29,7 +29,7 @@
  * is made to bind an object in the registry to a name that already
  * has an associated binding.
  *
- * @since   JDK1.1
+ * @since   1.1
  * @author  Ann Wollrath
  * @author  Roger Riggs
  * @see     java.rmi.Naming#bind(String, java.rmi.Remote)
@@ -43,7 +43,7 @@
     /**
      * Constructs an <code>AlreadyBoundException</code> with no
      * specified detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public AlreadyBoundException() {
         super();
@@ -54,7 +54,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public AlreadyBoundException(String s) {
         super(s);
diff --git a/jdk/src/share/classes/java/rmi/ConnectException.java b/jdk/src/share/classes/java/rmi/ConnectException.java
index 781a5f1..68da62f 100644
--- a/jdk/src/share/classes/java/rmi/ConnectException.java
+++ b/jdk/src/share/classes/java/rmi/ConnectException.java
@@ -30,7 +30,7 @@
  * to the remote host for a remote method call.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ConnectException extends RemoteException {
 
@@ -42,7 +42,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public ConnectException(String s) {
         super(s);
@@ -54,7 +54,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public ConnectException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/ConnectIOException.java b/jdk/src/share/classes/java/rmi/ConnectIOException.java
index d19aabf..d1b0419 100644
--- a/jdk/src/share/classes/java/rmi/ConnectIOException.java
+++ b/jdk/src/share/classes/java/rmi/ConnectIOException.java
@@ -31,7 +31,7 @@
  * to the remote host for a remote method call.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ConnectIOException extends RemoteException {
 
@@ -43,7 +43,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public ConnectIOException(String s) {
         super(s);
@@ -56,7 +56,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public ConnectIOException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/MarshalException.java b/jdk/src/share/classes/java/rmi/MarshalException.java
index db93f10..240b927 100644
--- a/jdk/src/share/classes/java/rmi/MarshalException.java
+++ b/jdk/src/share/classes/java/rmi/MarshalException.java
@@ -39,7 +39,7 @@
  * "at most once" call semantics.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class MarshalException extends RemoteException {
 
@@ -51,7 +51,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public MarshalException(String s) {
         super(s);
@@ -63,7 +63,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public MarshalException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/Naming.java b/jdk/src/share/classes/java/rmi/Naming.java
index 6e98924..01ffa88 100644
--- a/jdk/src/share/classes/java/rmi/Naming.java
+++ b/jdk/src/share/classes/java/rmi/Naming.java
@@ -64,7 +64,7 @@
  *
  * @author  Ann Wollrath
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.registry.Registry
  * @see     java.rmi.registry.LocateRegistry
  * @see     java.rmi.registry.LocateRegistry#createRegistry(int)
@@ -86,7 +86,7 @@
      * @exception AccessException if this operation is not permitted
      * @exception MalformedURLException if the name is not an appropriately
      *  formatted URL
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Remote lookup(String name)
         throws NotBoundException,
@@ -112,7 +112,7 @@
      * @exception RemoteException if registry could not be contacted
      * @exception AccessException if this operation is not permitted (if
      * originating from a non-local host, for example)
-     * @since JDK1.1
+     * @since 1.1
      */
     public static void bind(String name, Remote obj)
         throws AlreadyBoundException,
@@ -139,7 +139,7 @@
      * @exception RemoteException if registry could not be contacted
      * @exception AccessException if this operation is not permitted (if
      * originating from a non-local host, for example)
-     * @since JDK1.1
+     * @since 1.1
      */
     public static void unbind(String name)
         throws RemoteException,
@@ -163,7 +163,7 @@
      * @exception RemoteException if registry could not be contacted
      * @exception AccessException if this operation is not permitted (if
      * originating from a non-local host, for example)
-     * @since JDK1.1
+     * @since 1.1
      */
     public static void rebind(String name, Remote obj)
         throws RemoteException, java.net.MalformedURLException
@@ -190,7 +190,7 @@
      * @exception MalformedURLException if the name is not an appropriately
      *  formatted URL
      * @exception RemoteException if registry could not be contacted.
-     * @since JDK1.1
+     * @since 1.1
      */
     public static String[] list(String name)
         throws RemoteException, java.net.MalformedURLException
diff --git a/jdk/src/share/classes/java/rmi/NoSuchObjectException.java b/jdk/src/share/classes/java/rmi/NoSuchObjectException.java
index 47bf664..4767c39 100644
--- a/jdk/src/share/classes/java/rmi/NoSuchObjectException.java
+++ b/jdk/src/share/classes/java/rmi/NoSuchObjectException.java
@@ -39,7 +39,7 @@
  * <code>java.rmi.activation.Activatable</code> and
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.server.RemoteObject#toStub(Remote)
  * @see     java.rmi.server.UnicastRemoteObject#unexportObject(Remote,boolean)
  * @see     java.rmi.activation.Activatable#unexportObject(Remote,boolean)
@@ -54,7 +54,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since   JDK1.1
+     * @since   1.1
      */
     public NoSuchObjectException(String s) {
         super(s);
diff --git a/jdk/src/share/classes/java/rmi/NotBoundException.java b/jdk/src/share/classes/java/rmi/NotBoundException.java
index 888a7f4..e3593e5 100644
--- a/jdk/src/share/classes/java/rmi/NotBoundException.java
+++ b/jdk/src/share/classes/java/rmi/NotBoundException.java
@@ -29,7 +29,7 @@
  * is made to lookup or unbind in the registry a name that has
  * no associated binding.
  *
- * @since   JDK1.1
+ * @since   1.1
  * @author  Ann Wollrath
  * @author  Roger Riggs
  * @see     java.rmi.Naming#lookup(String)
@@ -45,7 +45,7 @@
     /**
      * Constructs a <code>NotBoundException</code> with no
      * specified detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public NotBoundException() {
         super();
@@ -56,7 +56,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public NotBoundException(String s) {
         super(s);
diff --git a/jdk/src/share/classes/java/rmi/RMISecurityException.java b/jdk/src/share/classes/java/rmi/RMISecurityException.java
index 5d26d23..ea4eaa7 100644
--- a/jdk/src/share/classes/java/rmi/RMISecurityException.java
+++ b/jdk/src/share/classes/java/rmi/RMISecurityException.java
@@ -30,7 +30,7 @@
  * <code>java.rmi.RMISecurityManager</code>'s methods.
  *
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated Use {@link java.lang.SecurityException} instead.
  * Application code should never directly reference this class, and
  * <code>RMISecurityManager</code> no longer throws this subclass of
@@ -45,7 +45,7 @@
     /**
      * Construct an <code>RMISecurityException</code> with a detail message.
      * @param name the detail message
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -57,7 +57,7 @@
      * Construct an <code>RMISecurityException</code> with a detail message.
      * @param name the detail message
      * @param arg ignored
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/RMISecurityManager.java b/jdk/src/share/classes/java/rmi/RMISecurityManager.java
index b260c49..841dc63 100644
--- a/jdk/src/share/classes/java/rmi/RMISecurityManager.java
+++ b/jdk/src/share/classes/java/rmi/RMISecurityManager.java
@@ -52,7 +52,7 @@
  *
  * @author  Roger Riggs
  * @author  Peter Jones
- * @since JDK1.1
+ * @since 1.1
  * @deprecated Use {@link SecurityManager} instead.
  */
 @Deprecated
@@ -60,7 +60,7 @@
 
     /**
      * Constructs a new {@code RMISecurityManager}.
-     * @since JDK1.1
+     * @since 1.1
      */
     public RMISecurityManager() {
     }
diff --git a/jdk/src/share/classes/java/rmi/Remote.java b/jdk/src/share/classes/java/rmi/Remote.java
index b3af381..86a53a3 100644
--- a/jdk/src/share/classes/java/rmi/Remote.java
+++ b/jdk/src/share/classes/java/rmi/Remote.java
@@ -42,7 +42,7 @@
  * <p>For complete details on RMI, see the <a
  href=../../../platform/rmi/spec/rmiTOC.html>RMI Specification</a> which describes the RMI API and system.
  *
- * @since   JDK1.1
+ * @since   1.1
  * @author  Ann Wollrath
  * @see     java.rmi.server.UnicastRemoteObject
  * @see     java.rmi.activation.Activatable
diff --git a/jdk/src/share/classes/java/rmi/RemoteException.java b/jdk/src/share/classes/java/rmi/RemoteException.java
index 28963db..b125932 100644
--- a/jdk/src/share/classes/java/rmi/RemoteException.java
+++ b/jdk/src/share/classes/java/rmi/RemoteException.java
@@ -44,7 +44,7 @@
  * IllegalStateException}.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class RemoteException extends java.io.IOException {
 
diff --git a/jdk/src/share/classes/java/rmi/ServerError.java b/jdk/src/share/classes/java/rmi/ServerError.java
index e9a01d2..59cb6aa 100644
--- a/jdk/src/share/classes/java/rmi/ServerError.java
+++ b/jdk/src/share/classes/java/rmi/ServerError.java
@@ -35,7 +35,7 @@
  * <code>Error</code> that occurred as its cause.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ServerError extends RemoteException {
 
@@ -48,7 +48,7 @@
      *
      * @param s the detail message
      * @param err the nested error
-     * @since JDK1.1
+     * @since 1.1
      */
     public ServerError(String s, Error err) {
         super(s, err);
diff --git a/jdk/src/share/classes/java/rmi/ServerException.java b/jdk/src/share/classes/java/rmi/ServerException.java
index 0ba1a51..a519958 100644
--- a/jdk/src/share/classes/java/rmi/ServerException.java
+++ b/jdk/src/share/classes/java/rmi/ServerException.java
@@ -35,7 +35,7 @@
  * <code>RemoteException</code> that occurred as its cause.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class ServerException extends RemoteException {
 
@@ -47,7 +47,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public ServerException(String s) {
         super(s);
@@ -59,7 +59,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public ServerException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/ServerRuntimeException.java b/jdk/src/share/classes/java/rmi/ServerRuntimeException.java
index 0d4d706..ff1821c 100644
--- a/jdk/src/share/classes/java/rmi/ServerRuntimeException.java
+++ b/jdk/src/share/classes/java/rmi/ServerRuntimeException.java
@@ -40,7 +40,7 @@
  * executing on the Java 2 platform v1.2 or later versions.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement
  */
 @Deprecated
@@ -56,7 +56,7 @@
      * @param s the detail message
      * @param ex the nested exception
      * @deprecated no replacement
-     * @since JDK1.1
+     * @since 1.1
      */
     @Deprecated
     public ServerRuntimeException(String s, Exception ex) {
diff --git a/jdk/src/share/classes/java/rmi/StubNotFoundException.java b/jdk/src/share/classes/java/rmi/StubNotFoundException.java
index e0b4d04..1d9c5ec 100644
--- a/jdk/src/share/classes/java/rmi/StubNotFoundException.java
+++ b/jdk/src/share/classes/java/rmi/StubNotFoundException.java
@@ -33,7 +33,7 @@
  * <code>java.rmi.activation.Activatable.register</code> method.
  *
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.server.UnicastRemoteObject
  * @see     java.rmi.activation.Activatable
  */
@@ -47,7 +47,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public StubNotFoundException(String s) {
         super(s);
@@ -59,7 +59,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public StubNotFoundException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/UnexpectedException.java b/jdk/src/share/classes/java/rmi/UnexpectedException.java
index 01c3e62..affbfb9 100644
--- a/jdk/src/share/classes/java/rmi/UnexpectedException.java
+++ b/jdk/src/share/classes/java/rmi/UnexpectedException.java
@@ -32,7 +32,7 @@
  * <code>throws</code> clause of the method in the remote interface.
  *
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  */
 public class UnexpectedException extends RemoteException {
 
@@ -44,7 +44,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnexpectedException(String s) {
         super(s);
@@ -56,7 +56,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnexpectedException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/UnknownHostException.java b/jdk/src/share/classes/java/rmi/UnknownHostException.java
index ae72c28..01ccb55 100644
--- a/jdk/src/share/classes/java/rmi/UnknownHostException.java
+++ b/jdk/src/share/classes/java/rmi/UnknownHostException.java
@@ -30,7 +30,7 @@
  * <code>java.net.UnknownHostException</code> occurs while creating
  * a connection to the remote host for a remote method call.
  *
- * @since   JDK1.1
+ * @since   1.1
  */
 public class UnknownHostException extends RemoteException {
 
@@ -42,7 +42,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnknownHostException(String s) {
         super(s);
@@ -54,7 +54,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnknownHostException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/UnmarshalException.java b/jdk/src/share/classes/java/rmi/UnmarshalException.java
index 4e47e64..45c7e40 100644
--- a/jdk/src/share/classes/java/rmi/UnmarshalException.java
+++ b/jdk/src/share/classes/java/rmi/UnmarshalException.java
@@ -44,7 +44,7 @@
  * </ul>
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public class UnmarshalException extends RemoteException {
 
@@ -56,7 +56,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnmarshalException(String s) {
         super(s);
@@ -68,7 +68,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public UnmarshalException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/dgc/package.html b/jdk/src/share/classes/java/rmi/dgc/package.html
index a1b63b6..35a89ea 100644
--- a/jdk/src/share/classes/java/rmi/dgc/package.html
+++ b/jdk/src/share/classes/java/rmi/dgc/package.html
@@ -50,6 +50,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/rmi/package.html b/jdk/src/share/classes/java/rmi/package.html
index 1551d1b..812f521 100644
--- a/jdk/src/share/classes/java/rmi/package.html
+++ b/jdk/src/share/classes/java/rmi/package.html
@@ -54,6 +54,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java b/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java
index 033ccaf..98d134e 100644
--- a/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java
+++ b/jdk/src/share/classes/java/rmi/registry/LocateRegistry.java
@@ -51,7 +51,7 @@
  *
  * @author  Ann Wollrath
  * @author  Peter Jones
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.registry.Registry
  */
 public final class LocateRegistry {
@@ -67,7 +67,7 @@
      *
      * @return reference (a stub) to the remote object registry
      * @exception RemoteException if the reference could not be created
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Registry getRegistry()
         throws RemoteException
@@ -82,7 +82,7 @@
      * @param port port on which the registry accepts requests
      * @return reference (a stub) to the remote object registry
      * @exception RemoteException if the reference could not be created
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Registry getRegistry(int port)
         throws RemoteException
@@ -98,7 +98,7 @@
      * @param host host for the remote registry
      * @return reference (a stub) to the remote object registry
      * @exception RemoteException if the reference could not be created
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Registry getRegistry(String host)
         throws RemoteException
@@ -115,7 +115,7 @@
      * @param port port on which the registry accepts requests
      * @return reference (a stub) to the remote object registry
      * @exception RemoteException if the reference could not be created
-     * @since JDK1.1
+     * @since 1.1
      */
     public static Registry getRegistry(String host, int port)
         throws RemoteException
@@ -197,7 +197,7 @@
      * @param port the port on which the registry accepts requests
      * @return the registry
      * @exception RemoteException if the registry could not be exported
-     * @since JDK1.1
+     * @since 1.1
      **/
     public static Registry createRegistry(int port) throws RemoteException {
         return new RegistryImpl(port);
diff --git a/jdk/src/share/classes/java/rmi/registry/Registry.java b/jdk/src/share/classes/java/rmi/registry/Registry.java
index d5e3151..6dca81f 100644
--- a/jdk/src/share/classes/java/rmi/registry/Registry.java
+++ b/jdk/src/share/classes/java/rmi/registry/Registry.java
@@ -72,7 +72,7 @@
  *
  * @author      Ann Wollrath
  * @author      Peter Jones
- * @since       JDK1.1
+ * @since       1.1
  * @see         LocateRegistry
  */
 public interface Registry extends Remote {
diff --git a/jdk/src/share/classes/java/rmi/registry/RegistryHandler.java b/jdk/src/share/classes/java/rmi/registry/RegistryHandler.java
index b7fbc4e..4768f1c 100644
--- a/jdk/src/share/classes/java/rmi/registry/RegistryHandler.java
+++ b/jdk/src/share/classes/java/rmi/registry/RegistryHandler.java
@@ -34,7 +34,7 @@
  * by application code.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement
  */
 @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/registry/package.html b/jdk/src/share/classes/java/rmi/registry/package.html
index 2451d22..7d2426b 100644
--- a/jdk/src/share/classes/java/rmi/registry/package.html
+++ b/jdk/src/share/classes/java/rmi/registry/package.html
@@ -52,6 +52,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/rmi/server/ExportException.java b/jdk/src/share/classes/java/rmi/server/ExportException.java
index a3da034..6f5714c 100644
--- a/jdk/src/share/classes/java/rmi/server/ExportException.java
+++ b/jdk/src/share/classes/java/rmi/server/ExportException.java
@@ -33,7 +33,7 @@
  * <code>java.rmi.activation.Activatable</code>.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @see java.rmi.server.UnicastRemoteObject
  * @see java.rmi.activation.Activatable
  */
@@ -47,7 +47,7 @@
      * detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      */
     public ExportException(String s) {
         super(s);
@@ -59,7 +59,7 @@
      *
      * @param s the detail message
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public ExportException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/server/LoaderHandler.java b/jdk/src/share/classes/java/rmi/server/LoaderHandler.java
index fb46f0c..e15a68d 100644
--- a/jdk/src/share/classes/java/rmi/server/LoaderHandler.java
+++ b/jdk/src/share/classes/java/rmi/server/LoaderHandler.java
@@ -34,7 +34,7 @@
  * by application code.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  *
  * @deprecated no replacement
  */
@@ -56,7 +56,7 @@
      * @exception ClassNotFoundException
      *            if a definition for the class could not
      *            be found at the codebase location.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -75,7 +75,7 @@
      * @exception ClassNotFoundException
      *            if a definition for the class could not
      *            be found at the specified URL
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -87,7 +87,7 @@
      *
      * @param loader  a class loader from which to get the security context
      * @return the security context
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/server/LogStream.java b/jdk/src/share/classes/java/rmi/server/LogStream.java
index 60adea3..3accfe4 100644
--- a/jdk/src/share/classes/java/rmi/server/LogStream.java
+++ b/jdk/src/share/classes/java/rmi/server/LogStream.java
@@ -32,7 +32,7 @@
  * of possible interest to those monitoring a system.
  *
  * @author  Ann Wollrath (lots of code stolen from Ken Arnold)
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement
  */
 @Deprecated
@@ -64,7 +64,7 @@
      * method.
      * @param name string identifying messages from this log
      * @out output stream that log messages will be sent to
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -83,7 +83,7 @@
      * the default stream is created.
      * @param name name identifying the desired LogStream
      * @return log associated with given name
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -103,7 +103,7 @@
      * Return the current default stream for new logs.
      * @return default log stream
      * @see #setDefaultStream
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -115,7 +115,7 @@
      * Set the default stream for new logs.
      * @param newDefault new default log stream
      * @see #getDefaultStream
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -134,7 +134,7 @@
      * Return the current stream to which output from this log is sent.
      * @return output stream for this log
      * @see #setOutputStream
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -147,7 +147,7 @@
      * Set the stream to which output from this log is sent.
      * @param out new output stream for this log
      * @see #getOutputStream
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -164,7 +164,7 @@
      * the byte is appended to the internal buffer.  If it is a newline,
      * then the currently buffered line is sent to the log's output
      * stream, prefixed with the appropriate logging information.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -208,7 +208,7 @@
 
     /**
      * Write a subarray of bytes.  Pass each through write byte method.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -223,7 +223,7 @@
     /**
      * Return log name as string representation.
      * @return log name
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -244,7 +244,7 @@
      * integer representation.
      * @param s name of logging level (e.g., 'SILENT', 'BRIEF', 'VERBOSE')
      * @return corresponding integer log level
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/server/ObjID.java b/jdk/src/share/classes/java/rmi/server/ObjID.java
index 221e652..b7f1b90 100644
--- a/jdk/src/share/classes/java/rmi/server/ObjID.java
+++ b/jdk/src/share/classes/java/rmi/server/ObjID.java
@@ -65,7 +65,7 @@
  *
  * @author      Ann Wollrath
  * @author      Peter Jones
- * @since       JDK1.1
+ * @since       1.1
  */
 public final class ObjID implements Serializable {
 
diff --git a/jdk/src/share/classes/java/rmi/server/Operation.java b/jdk/src/share/classes/java/rmi/server/Operation.java
index 56c4ea6..4a6377d 100644
--- a/jdk/src/share/classes/java/rmi/server/Operation.java
+++ b/jdk/src/share/classes/java/rmi/server/Operation.java
@@ -32,7 +32,7 @@
  * stubs (stubs generated with <code>rmic -v1.2</code>); hence, this class
  * is deprecated.
  *
- * @since JDK1.1
+ * @since 1.1
  * @deprecated no replacement
  */
 @Deprecated
@@ -43,7 +43,7 @@
      * Creates a new Operation object.
      * @param op method name
      * @deprecated no replacement
-     * @since JDK1.1
+     * @since 1.1
      */
     @Deprecated
     public Operation(String op) {
@@ -54,7 +54,7 @@
      * Returns the name of the method.
      * @return method name
      * @deprecated no replacement
-     * @since JDK1.1
+     * @since 1.1
      */
     @Deprecated
     public String getOperation() {
@@ -64,7 +64,7 @@
     /**
      * Returns the string representation of the operation.
      * @deprecated no replacement
-     * @since JDK1.1
+     * @since 1.1
      */
     @Deprecated
     public String toString() {
diff --git a/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java b/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java
index f9f23dd..59e29d5 100644
--- a/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java
+++ b/jdk/src/share/classes/java/rmi/server/RMIClassLoader.java
@@ -105,7 +105,7 @@
  * @author      Peter Jones
  * @author      Laird Dornin
  * @see         RMIClassLoaderSpi
- * @since       JDK1.1
+ * @since       1.1
  */
 public class RMIClassLoader {
 
diff --git a/jdk/src/share/classes/java/rmi/server/RMIFailureHandler.java b/jdk/src/share/classes/java/rmi/server/RMIFailureHandler.java
index 11bcc5f..d25f22a 100644
--- a/jdk/src/share/classes/java/rmi/server/RMIFailureHandler.java
+++ b/jdk/src/share/classes/java/rmi/server/RMIFailureHandler.java
@@ -35,7 +35,7 @@
  * <code>ServerSocket</code>.
  *
  * @author      Ann Wollrath
- * @since       JDK1.1
+ * @since       1.1
  */
 public interface RMIFailureHandler {
 
@@ -53,7 +53,7 @@
      * @return if true, the RMI runtime attempts to retry
      * <code>ServerSocket</code> creation
      * @see java.rmi.server.RMISocketFactory#setFailureHandler(RMIFailureHandler)
-     * @since JDK1.1
+     * @since 1.1
      */
     public boolean failure(Exception ex);
 
diff --git a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
index c9b8a47..e69c269 100644
--- a/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
+++ b/jdk/src/share/classes/java/rmi/server/RMISocketFactory.java
@@ -85,7 +85,7 @@
  *
  * @author  Ann Wollrath
  * @author  Peter Jones
- * @since   JDK1.1
+ * @since   1.1
  */
 public abstract class RMISocketFactory
         implements RMIClientSocketFactory, RMIServerSocketFactory
@@ -100,7 +100,7 @@
 
     /**
      * Constructs an <code>RMISocketFactory</code>.
-     * @since JDK1.1
+     * @since 1.1
      */
     public RMISocketFactory() {
         super();
@@ -112,7 +112,7 @@
      * @param  port   the port number
      * @return a socket connected to the specified host and port.
      * @exception IOException if an I/O error occurs during socket creation
-     * @since JDK1.1
+     * @since 1.1
      */
     public abstract Socket createSocket(String host, int port)
         throws IOException;
@@ -124,7 +124,7 @@
      * @return the server socket on the specified port
      * @exception IOException if an I/O error occurs during server socket
      * creation
-     * @since JDK1.1
+     * @since 1.1
      */
     public abstract ServerSocket createServerSocket(int port)
         throws IOException;
@@ -142,7 +142,7 @@
      *             <code>checkSetFactory</code> method doesn't allow the operation.
      * @see #getSocketFactory
      * @see java.lang.SecurityManager#checkSetFactory()
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized static void setSocketFactory(RMISocketFactory fac)
         throws IOException
@@ -163,7 +163,7 @@
      * set.
      * @return the socket factory
      * @see #setSocketFactory(RMISocketFactory)
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized static RMISocketFactory getSocketFactory()
     {
@@ -176,7 +176,7 @@
      * by the RMI runtime when <code>getSocketFactory</code>
      * returns <code>null</code>.
      * @return the default RMI socket factory
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized static RMISocketFactory getDefaultSocketFactory() {
         if (defaultSocketFactory == null) {
@@ -203,7 +203,7 @@
      *          operation.
      * @see #getFailureHandler
      * @see java.rmi.server.RMIFailureHandler#failure(Exception)
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized static void setFailureHandler(RMIFailureHandler fh)
     {
@@ -219,7 +219,7 @@
      * <code>setFailureHandler</code> method.
      * @return the failure handler
      * @see #setFailureHandler(RMIFailureHandler)
-     * @since JDK1.1
+     * @since 1.1
      */
     public synchronized static RMIFailureHandler getFailureHandler()
     {
diff --git a/jdk/src/share/classes/java/rmi/server/RemoteCall.java b/jdk/src/share/classes/java/rmi/server/RemoteCall.java
index d2c9740..67b5494 100644
--- a/jdk/src/share/classes/java/rmi/server/RemoteCall.java
+++ b/jdk/src/share/classes/java/rmi/server/RemoteCall.java
@@ -37,7 +37,7 @@
  * deprecated because it is only used by deprecated methods of
  * <code>java.rmi.server.RemoteRef</code>.
  *
- * @since   JDK1.1
+ * @since   1.1
  * @author  Ann Wollrath
  * @author  Roger Riggs
  * @see     java.rmi.server.RemoteRef
@@ -52,7 +52,7 @@
      *
      * @return output stream for arguments/results
      * @exception java.io.IOException if an I/O error occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -63,7 +63,7 @@
      * the stream.
      *
      * @exception java.io.IOException if an I/O error occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -75,7 +75,7 @@
      *
      * @return input stream for reading arguments/results
      * @exception java.io.IOException if an I/O error occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -87,7 +87,7 @@
      * the channel early.
      *
      * @exception java.io.IOException if an I/O error occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -103,7 +103,7 @@
      * @return output stream for writing call result
      * @exception java.io.IOException              if an I/O error occurs.
      * @exception java.io.StreamCorruptedException If already been called.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -114,7 +114,7 @@
      * Do whatever it takes to execute the call.
      *
      * @exception java.lang.Exception if a general exception occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -124,7 +124,7 @@
      * Allow cleanup after the remote call has completed.
      *
      * @exception java.io.IOException if an I/O error occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/server/RemoteObject.java b/jdk/src/share/classes/java/rmi/server/RemoteObject.java
index 77fb409..c504692 100644
--- a/jdk/src/share/classes/java/rmi/server/RemoteObject.java
+++ b/jdk/src/share/classes/java/rmi/server/RemoteObject.java
@@ -39,7 +39,7 @@
  * @author      Ann Wollrath
  * @author      Laird Dornin
  * @author      Peter Jones
- * @since       JDK1.1
+ * @since       1.1
  */
 public abstract class RemoteObject implements Remote, java.io.Serializable {
 
diff --git a/jdk/src/share/classes/java/rmi/server/RemoteRef.java b/jdk/src/share/classes/java/rmi/server/RemoteRef.java
index a7b75a3..98b7d46 100644
--- a/jdk/src/share/classes/java/rmi/server/RemoteRef.java
+++ b/jdk/src/share/classes/java/rmi/server/RemoteRef.java
@@ -33,7 +33,7 @@
  * remote method invocation to a remote object.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.server.RemoteStub
  */
 public interface RemoteRef extends java.io.Externalizable {
@@ -84,7 +84,7 @@
      * interpret them. The remote reference may need the operation to
      * encode in the call.
      *
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated 1.2 style stubs no longer use this method. Instead of
      * using a sequence of method calls on the stub's the remote reference
      * (<code>newCall</code>, <code>invoke</code>, and <code>done</code>), a
@@ -114,7 +114,7 @@
      * take care of cleaning up the connection before raising the
      * "user" or remote exception.
      *
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated 1.2 style stubs no longer use this method. Instead of
      * using a sequence of method calls to the remote reference
      * (<code>newCall</code>, <code>invoke</code>, and <code>done</code>), a
@@ -135,7 +135,7 @@
      * Done should only be called if the invoke returns successfully
      * (non-exceptionally) to the stub.
      *
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated 1.2 style stubs no longer use this method. Instead of
      * using a sequence of method calls to the remote reference
      * (<code>newCall</code>, <code>invoke</code>, and <code>done</code>), a
@@ -157,7 +157,7 @@
      * @param out the output stream to which the reference will be serialized
      * @return the class name (without package qualification) of the reference
      * type
-     * @since JDK1.1
+     * @since 1.1
      */
     String getRefClass(java.io.ObjectOutput out);
 
@@ -168,7 +168,7 @@
      *
      * @return remote object hashcode
      * @see             java.util.Hashtable
-     * @since JDK1.1
+     * @since 1.1
      */
     int remoteHashCode();
 
@@ -180,7 +180,7 @@
      * @param   obj     the Object to compare with
      * @return  true if these Objects are equal; false otherwise.
      * @see             java.util.Hashtable
-     * @since JDK1.1
+     * @since 1.1
      */
     boolean remoteEquals(RemoteRef obj);
 
@@ -188,7 +188,7 @@
      * Returns a String that represents the reference of this remote
      * object.
      * @return string representing remote object reference
-     * @since JDK1.1
+     * @since 1.1
      */
     String remoteToString();
 
diff --git a/jdk/src/share/classes/java/rmi/server/RemoteServer.java b/jdk/src/share/classes/java/rmi/server/RemoteServer.java
index b41ad74..a591b52 100644
--- a/jdk/src/share/classes/java/rmi/server/RemoteServer.java
+++ b/jdk/src/share/classes/java/rmi/server/RemoteServer.java
@@ -37,7 +37,7 @@
  * concretely by its subclass(es).
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  */
 public abstract class RemoteServer extends RemoteObject
 {
@@ -46,7 +46,7 @@
 
     /**
      * Constructs a <code>RemoteServer</code>.
-     * @since JDK1.1
+     * @since 1.1
      */
     protected RemoteServer() {
         super();
@@ -56,7 +56,7 @@
      * Constructs a <code>RemoteServer</code> with the given reference type.
      *
      * @param ref the remote reference
-     * @since JDK1.1
+     * @since 1.1
      */
     protected RemoteServer(RemoteRef ref) {
         super(ref);
@@ -71,7 +71,7 @@
      * @throws  ServerNotActiveException if no remote method invocation
      * is being processed in the current thread
      *
-     * @since   JDK1.1
+     * @since   1.1
      */
     public static String getClientHost() throws ServerNotActiveException {
         return sun.rmi.transport.tcp.TCPTransport.getClientHost();
@@ -91,7 +91,7 @@
      *          the invocation of its <code>checkPermission</code> method
      *          fails
      * @see #getLog
-     * @since JDK1.1
+     * @since 1.1
      */
     public static void setLog(java.io.OutputStream out)
     {
@@ -103,7 +103,7 @@
      * Returns stream for the RMI call log.
      * @return the call log
      * @see #setLog
-     * @since JDK1.1
+     * @since 1.1
      */
     public static java.io.PrintStream getLog()
     {
diff --git a/jdk/src/share/classes/java/rmi/server/RemoteStub.java b/jdk/src/share/classes/java/rmi/server/RemoteStub.java
index 36f8eb0..536a29c 100644
--- a/jdk/src/share/classes/java/rmi/server/RemoteStub.java
+++ b/jdk/src/share/classes/java/rmi/server/RemoteStub.java
@@ -33,7 +33,7 @@
  * implementation of the remote object.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  *
  * @deprecated Statically generated stubs are deprecated, since
  * stubs are generated dynamically. See {@link UnicastRemoteObject}
@@ -57,7 +57,7 @@
      * reference.
      *
      * @param ref the remote reference
-     * @since JDK1.1
+     * @since 1.1
      */
     protected RemoteStub(RemoteRef ref) {
         super(ref);
@@ -69,7 +69,7 @@
      * @param stub the remote stub
      * @param ref the remote reference
      * @throws UnsupportedOperationException always
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated No replacement.  The {@code setRef} method
      * was intended for setting the remote reference of a remote
      * stub. This is unnecessary, since {@code RemoteStub}s can be created
diff --git a/jdk/src/share/classes/java/rmi/server/ServerCloneException.java b/jdk/src/share/classes/java/rmi/server/ServerCloneException.java
index f100b35..b93c565 100644
--- a/jdk/src/share/classes/java/rmi/server/ServerCloneException.java
+++ b/jdk/src/share/classes/java/rmi/server/ServerCloneException.java
@@ -41,7 +41,7 @@
  * IllegalStateException}.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @see     java.rmi.server.UnicastRemoteObject#clone()
  */
 public class ServerCloneException extends CloneNotSupportedException {
diff --git a/jdk/src/share/classes/java/rmi/server/ServerNotActiveException.java b/jdk/src/share/classes/java/rmi/server/ServerNotActiveException.java
index c477f7e..b12a91d 100644
--- a/jdk/src/share/classes/java/rmi/server/ServerNotActiveException.java
+++ b/jdk/src/share/classes/java/rmi/server/ServerNotActiveException.java
@@ -32,7 +32,7 @@
  * method call.
  *
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @see java.rmi.server.RemoteServer#getClientHost()
  */
 public class ServerNotActiveException extends java.lang.Exception {
@@ -43,7 +43,7 @@
     /**
      * Constructs an <code>ServerNotActiveException</code> with no specified
      * detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public ServerNotActiveException() {}
 
@@ -52,7 +52,7 @@
      * detail message.
      *
      * @param s the detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public ServerNotActiveException(String s)
     {
diff --git a/jdk/src/share/classes/java/rmi/server/ServerRef.java b/jdk/src/share/classes/java/rmi/server/ServerRef.java
index f0b521e..6b591d6 100644
--- a/jdk/src/share/classes/java/rmi/server/ServerRef.java
+++ b/jdk/src/share/classes/java/rmi/server/ServerRef.java
@@ -32,7 +32,7 @@
  * implementation.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated No replacement. This interface is unused and is obsolete.
  */
 @Deprecated
@@ -50,7 +50,7 @@
      * @return the stub for the remote object
      * @exception RemoteException if an exception occurs attempting
      * to export the object (e.g., stub class could not be found)
-     * @since JDK1.1
+     * @since 1.1
      */
     RemoteStub exportObject(Remote obj, Object data)
         throws RemoteException;
@@ -62,7 +62,7 @@
      * @return the client's host name
      * @exception ServerNotActiveException if called outside of servicing
      * a remote method invocation
-     * @since JDK1.1
+     * @since 1.1
      */
     String getClientHost() throws ServerNotActiveException;
 }
diff --git a/jdk/src/share/classes/java/rmi/server/Skeleton.java b/jdk/src/share/classes/java/rmi/server/Skeleton.java
index 4594620..b4a2ac4 100644
--- a/jdk/src/share/classes/java/rmi/server/Skeleton.java
+++ b/jdk/src/share/classes/java/rmi/server/Skeleton.java
@@ -37,7 +37,7 @@
  * implementation.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement.  Skeletons are no longer required for remote
  * method calls in the Java 2 platform v1.2 and greater.
  */
@@ -52,7 +52,7 @@
      * @param opnum operation number
      * @param hash stub/skeleton interface hash
      * @exception java.lang.Exception if a general exception occurs.
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
@@ -62,7 +62,7 @@
     /**
      * Returns the operations supported by the skeleton.
      * @return operations supported by skeleton
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/server/SkeletonMismatchException.java b/jdk/src/share/classes/java/rmi/server/SkeletonMismatchException.java
index 0c10424..901c27d 100644
--- a/jdk/src/share/classes/java/rmi/server/SkeletonMismatchException.java
+++ b/jdk/src/share/classes/java/rmi/server/SkeletonMismatchException.java
@@ -36,7 +36,7 @@
  * the stub compiler (<code>rmic</code>).
  *
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement.  Skeletons are no longer required for remote
  * method calls in the Java 2 platform v1.2 and greater.
  */
@@ -51,7 +51,7 @@
      * a specified detail message.
      *
      * @param s the detail message
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated no replacement
      */
     @Deprecated
diff --git a/jdk/src/share/classes/java/rmi/server/SkeletonNotFoundException.java b/jdk/src/share/classes/java/rmi/server/SkeletonNotFoundException.java
index 39c5fe4..3c9e0cb 100644
--- a/jdk/src/share/classes/java/rmi/server/SkeletonNotFoundException.java
+++ b/jdk/src/share/classes/java/rmi/server/SkeletonNotFoundException.java
@@ -33,7 +33,7 @@
  * exported is not found.  Skeletons are no longer required, so this
  * exception is never thrown.
  *
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated no replacement.  Skeletons are no longer required for remote
  * method calls in the Java 2 platform v1.2 and greater.
  */
@@ -48,7 +48,7 @@
      * detail message.
      *
      * @param s the detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public SkeletonNotFoundException(String s) {
         super(s);
@@ -60,7 +60,7 @@
      *
      * @param s the detail message.
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public SkeletonNotFoundException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java b/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java
index 3fbec26..bed8e77 100644
--- a/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java
+++ b/jdk/src/share/classes/java/rmi/server/SocketSecurityException.java
@@ -29,7 +29,7 @@
  * An obsolete subclass of {@link ExportException}.
  *
  * @author  Ann Wollrath
- * @since   JDK1.1
+ * @since   1.1
  * @deprecated This class is obsolete. Use {@link ExportException} instead.
  */
 @Deprecated
@@ -43,7 +43,7 @@
      * detail message.
      *
      * @param s the detail message.
-     * @since JDK1.1
+     * @since 1.1
      */
     public SocketSecurityException(String s) {
         super(s);
@@ -55,7 +55,7 @@
      *
      * @param s the detail message.
      * @param ex the nested exception
-     * @since JDK1.1
+     * @since 1.1
      */
     public SocketSecurityException(String s, Exception ex) {
         super(s, ex);
diff --git a/jdk/src/share/classes/java/rmi/server/UID.java b/jdk/src/share/classes/java/rmi/server/UID.java
index b84e80d..5e9812e 100644
--- a/jdk/src/share/classes/java/rmi/server/UID.java
+++ b/jdk/src/share/classes/java/rmi/server/UID.java
@@ -66,7 +66,7 @@
  *
  * @author      Ann Wollrath
  * @author      Peter Jones
- * @since       JDK1.1
+ * @since       1.1
  */
 public final class UID implements Serializable {
 
diff --git a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
index 802d714..0ded217 100644
--- a/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
+++ b/jdk/src/share/classes/java/rmi/server/UnicastRemoteObject.java
@@ -142,7 +142,7 @@
  *
  * @author  Ann Wollrath
  * @author  Peter Jones
- * @since   JDK1.1
+ * @since   1.1
  **/
 public class UnicastRemoteObject extends RemoteServer {
 
@@ -173,7 +173,7 @@
      * created using the {@link RMISocketFactory} class.
      *
      * @throws RemoteException if failed to export object
-     * @since JDK1.1
+     * @since 1.1
      */
     protected UnicastRemoteObject() throws RemoteException
     {
@@ -242,7 +242,7 @@
      * @exception CloneNotSupportedException if clone failed due to
      * a RemoteException.
      * @return the new remote object
-     * @since JDK1.1
+     * @since 1.1
      */
     public Object clone() throws CloneNotSupportedException
     {
@@ -280,7 +280,7 @@
      * @param obj the remote object to be exported
      * @return remote object stub
      * @exception RemoteException if export fails
-     * @since JDK1.1
+     * @since 1.1
      * @deprecated This method is deprecated because it supports only static stubs.
      * Use {@link #exportObject(Remote, int) exportObject(Remote, port)} or
      * {@link #exportObject(Remote, int, RMIClientSocketFactory, RMIServerSocketFactory)
diff --git a/jdk/src/share/classes/java/rmi/server/Unreferenced.java b/jdk/src/share/classes/java/rmi/server/Unreferenced.java
index 816d2b5..a70b3bc 100644
--- a/jdk/src/share/classes/java/rmi/server/Unreferenced.java
+++ b/jdk/src/share/classes/java/rmi/server/Unreferenced.java
@@ -32,14 +32,14 @@
  *
  * @author  Ann Wollrath
  * @author  Roger Riggs
- * @since   JDK1.1
+ * @since   1.1
  */
 public interface Unreferenced {
     /**
      * Called by the RMI runtime sometime after the runtime determines that
      * the reference list, the list of clients referencing the remote object,
      * becomes empty.
-     * @since JDK1.1
+     * @since 1.1
      */
     public void unreferenced();
 }
diff --git a/jdk/src/share/classes/java/rmi/server/package.html b/jdk/src/share/classes/java/rmi/server/package.html
index 1bfa46d..02b6f43 100644
--- a/jdk/src/share/classes/java/rmi/server/package.html
+++ b/jdk/src/share/classes/java/rmi/server/package.html
@@ -69,6 +69,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/security/acl/package-info.java b/jdk/src/share/classes/java/security/acl/package-info.java
index 356c102..fbe5a8d 100644
--- a/jdk/src/share/classes/java/security/acl/package-info.java
+++ b/jdk/src/share/classes/java/security/acl/package-info.java
@@ -28,6 +28,6 @@
  * superseded by classes in the java.security package.
  * See that package and, for example, java.security.Permission for details.
  *
- * @since JDK1.1
+ * @since 1.1
  */
 package java.security.acl;
diff --git a/jdk/src/share/classes/java/security/interfaces/package-info.java b/jdk/src/share/classes/java/security/interfaces/package-info.java
index 54c9397..426c56e 100644
--- a/jdk/src/share/classes/java/security/interfaces/package-info.java
+++ b/jdk/src/share/classes/java/security/interfaces/package-info.java
@@ -69,6 +69,6 @@
  *       </b></a></li>
  * </ul>
  *
- * @since JDK1.1
+ * @since 1.1
  */
 package java.security.interfaces;
diff --git a/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java b/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java
index 932a9f0..b5e57f7 100644
--- a/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java
+++ b/jdk/src/share/classes/java/security/spec/DSAGenParameterSpec.java
@@ -31,7 +31,7 @@
  *
  * @see AlgorithmParameterSpec
  *
- * @since 8
+ * @since 1.8
  */
 public final class DSAGenParameterSpec implements AlgorithmParameterSpec {
 
diff --git a/jdk/src/share/classes/java/text/DecimalFormatSymbols.java b/jdk/src/share/classes/java/text/DecimalFormatSymbols.java
index 55a344f..d64fa56 100644
--- a/jdk/src/share/classes/java/text/DecimalFormatSymbols.java
+++ b/jdk/src/share/classes/java/text/DecimalFormatSymbols.java
@@ -679,7 +679,7 @@
      * default serialization will work properly if this object is streamed out again.
      * Initializes the currency from the intlCurrencySymbol field.
      *
-     * @since JDK 1.1.6
+     * @since  1.1.6
      */
     private void readObject(ObjectInputStream stream)
             throws IOException, ClassNotFoundException {
@@ -802,7 +802,7 @@
     /**
      * The decimal separator used when formatting currency values.
      * @serial
-     * @since JDK 1.1.6
+     * @since  1.1.6
      * @see #getMonetaryDecimalSeparator
      */
     private  char    monetarySeparator; // Field new in JDK 1.1.6
@@ -816,7 +816,7 @@
      * The intent is that this will be added to the API in the future.
      *
      * @serial
-     * @since JDK 1.1.6
+     * @since  1.1.6
      */
     private  char    exponential;       // Field new in JDK 1.1.6
 
@@ -872,7 +872,7 @@
      * is always written.
      *
      * @serial
-     * @since JDK 1.1.6
+     * @since  1.1.6
      */
     private int serialVersionOnStream = currentSerialVersion;
 }
diff --git a/jdk/src/share/classes/java/text/SimpleDateFormat.java b/jdk/src/share/classes/java/text/SimpleDateFormat.java
index c510d2d..f76b402 100644
--- a/jdk/src/share/classes/java/text/SimpleDateFormat.java
+++ b/jdk/src/share/classes/java/text/SimpleDateFormat.java
@@ -441,7 +441,7 @@
      * and the highest allowable <code>serialVersionOnStream</code>
      * is written.
      * @serial
-     * @since JDK1.1.4
+     * @since 1.1.4
      */
     private int serialVersionOnStream = currentSerialVersion;
 
@@ -506,7 +506,7 @@
      * <code>defaultCenturyStart</code>, which may be any date.  May
      * not be null.
      * @serial
-     * @since JDK1.1.4
+     * @since 1.1.4
      */
     private Date defaultCenturyStart;
 
diff --git a/jdk/src/share/classes/java/text/package.html b/jdk/src/share/classes/java/text/package.html
index a8b0397..3e9e51f 100644
--- a/jdk/src/share/classes/java/text/package.html
+++ b/jdk/src/share/classes/java/text/package.html
@@ -60,6 +60,6 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/time/chrono/package-info.java b/jdk/src/share/classes/java/time/chrono/package-info.java
index 9273a77..d829700 100644
--- a/jdk/src/share/classes/java/time/chrono/package-info.java
+++ b/jdk/src/share/classes/java/time/chrono/package-info.java
@@ -166,6 +166,6 @@
  * All calculations should check for numeric overflow and throw either an {@link java.lang.ArithmeticException}
  * or a {@link java.time.DateTimeException}.
  * </p>
- * @since JDK1.8
+ * @since 1.8
  */
 package java.time.chrono;
diff --git a/jdk/src/share/classes/java/time/format/TextStyle.java b/jdk/src/share/classes/java/time/format/TextStyle.java
index ed65d27..27a6f91 100644
--- a/jdk/src/share/classes/java/time/format/TextStyle.java
+++ b/jdk/src/share/classes/java/time/format/TextStyle.java
@@ -82,6 +82,8 @@
  *
  * @implSpec
  * This is immutable and thread-safe enum.
+ *
+ * @since 1.8
  */
 public enum TextStyle {
     // ordered from large to small
diff --git a/jdk/src/share/classes/java/time/format/package-info.java b/jdk/src/share/classes/java/time/format/package-info.java
index 140bb6d..3b5d096 100644
--- a/jdk/src/share/classes/java/time/format/package-info.java
+++ b/jdk/src/share/classes/java/time/format/package-info.java
@@ -90,6 +90,6 @@
  * All calculations should check for numeric overflow and throw either an {@link java.lang.ArithmeticException}
  * or a {@link java.time.DateTimeException}.
  * </p>
- * @since JDK1.8
+ * @since 1.8
  */
 package java.time.format;
diff --git a/jdk/src/share/classes/java/time/package-info.java b/jdk/src/share/classes/java/time/package-info.java
index 5bc4283..b97a56b 100644
--- a/jdk/src/share/classes/java/time/package-info.java
+++ b/jdk/src/share/classes/java/time/package-info.java
@@ -282,6 +282,6 @@
  *
  * </pre>
  *
- * @since JDK1.8
+ * @since 1.8
  */
 package java.time;
diff --git a/jdk/src/share/classes/java/time/temporal/package-info.java b/jdk/src/share/classes/java/time/temporal/package-info.java
index d3e9c05..1cb16dd 100644
--- a/jdk/src/share/classes/java/time/temporal/package-info.java
+++ b/jdk/src/share/classes/java/time/temporal/package-info.java
@@ -154,6 +154,6 @@
  * All calculations should check for numeric overflow and throw either an {@link java.lang.ArithmeticException}
  * or a {@link java.time.DateTimeException}.
  * </p>
- * @since JDK1.8
+ * @since 1.8
  */
 package java.time.temporal;
diff --git a/jdk/src/share/classes/java/time/zone/package-info.java b/jdk/src/share/classes/java/time/zone/package-info.java
index f50b3de..06256bc 100644
--- a/jdk/src/share/classes/java/time/zone/package-info.java
+++ b/jdk/src/share/classes/java/time/zone/package-info.java
@@ -81,6 +81,6 @@
  * All calculations should check for numeric overflow and throw either an {@link java.lang.ArithmeticException}
  * or a {@link java.time.DateTimeException}.
  * </p>
- * @since JDK1.8
+ * @since 1.8
  */
 package java.time.zone;
diff --git a/jdk/src/share/classes/java/util/BitSet.java b/jdk/src/share/classes/java/util/BitSet.java
index 261a77c..901a5a7 100644
--- a/jdk/src/share/classes/java/util/BitSet.java
+++ b/jdk/src/share/classes/java/util/BitSet.java
@@ -60,7 +60,7 @@
  * @author  Arthur van Hoff
  * @author  Michael McCloskey
  * @author  Martin Buchholz
- * @since   JDK1.0
+ * @since   1.0
  */
 public class BitSet implements Cloneable, java.io.Serializable {
     /*
@@ -437,7 +437,7 @@
      *
      * @param  bitIndex a bit index
      * @throws IndexOutOfBoundsException if the specified index is negative
-     * @since  JDK1.0
+     * @since  1.0
      */
     public void set(int bitIndex) {
         if (bitIndex < 0)
@@ -533,7 +533,7 @@
      *
      * @param  bitIndex the index of the bit to be cleared
      * @throws IndexOutOfBoundsException if the specified index is negative
-     * @since  JDK1.0
+     * @since  1.0
      */
     public void clear(int bitIndex) {
         if (bitIndex < 0)
diff --git a/jdk/src/share/classes/java/util/Calendar.java b/jdk/src/share/classes/java/util/Calendar.java
index 3ddf59a..8ad1aa4 100644
--- a/jdk/src/share/classes/java/util/Calendar.java
+++ b/jdk/src/share/classes/java/util/Calendar.java
@@ -308,7 +308,7 @@
  * @see          TimeZone
  * @see          java.text.DateFormat
  * @author Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
- * @since JDK1.1
+ * @since 1.1
  */
 public abstract class Calendar implements Serializable, Cloneable, Comparable<Calendar> {
 
@@ -994,7 +994,7 @@
      * and the highest allowable <code>serialVersionOnStream</code>
      * is written.
      * @serial
-     * @since JDK1.1.6
+     * @since 1.1.6
      */
     private int             serialVersionOnStream = currentSerialVersion;
 
diff --git a/jdk/src/share/classes/java/util/Date.java b/jdk/src/share/classes/java/util/Date.java
index b5a26b4..c05f50c 100644
--- a/jdk/src/share/classes/java/util/Date.java
+++ b/jdk/src/share/classes/java/util/Date.java
@@ -126,7 +126,7 @@
  * @see     java.text.DateFormat
  * @see     java.util.Calendar
  * @see     java.util.TimeZone
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Date
     implements java.io.Serializable, Cloneable, Comparable<Date>
diff --git a/jdk/src/share/classes/java/util/Dictionary.java b/jdk/src/share/classes/java/util/Dictionary.java
index 4c4574b..5f439b3 100644
--- a/jdk/src/share/classes/java/util/Dictionary.java
+++ b/jdk/src/share/classes/java/util/Dictionary.java
@@ -44,7 +44,7 @@
  * @see     java.lang.Object#equals(java.lang.Object)
  * @see     java.lang.Object#hashCode()
  * @see     java.util.Hashtable
- * @since   JDK1.0
+ * @since   1.0
  */
 public abstract
 class Dictionary<K,V> {
diff --git a/jdk/src/share/classes/java/util/EmptyStackException.java b/jdk/src/share/classes/java/util/EmptyStackException.java
index 1f1e878..ea1c49d 100644
--- a/jdk/src/share/classes/java/util/EmptyStackException.java
+++ b/jdk/src/share/classes/java/util/EmptyStackException.java
@@ -31,7 +31,7 @@
  *
  * @author  Jonathan Payne
  * @see     java.util.Stack
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class EmptyStackException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/util/Enumeration.java b/jdk/src/share/classes/java/util/Enumeration.java
index 8aebb5c..03095ed 100644
--- a/jdk/src/share/classes/java/util/Enumeration.java
+++ b/jdk/src/share/classes/java/util/Enumeration.java
@@ -56,7 +56,7 @@
  * @see     java.util.Vector#elements()
  *
  * @author  Lee Boynton
- * @since   JDK1.0
+ * @since   1.0
  */
 public interface Enumeration<E> {
     /**
diff --git a/jdk/src/share/classes/java/util/EventListener.java b/jdk/src/share/classes/java/util/EventListener.java
index 1daf446..9e51158 100644
--- a/jdk/src/share/classes/java/util/EventListener.java
+++ b/jdk/src/share/classes/java/util/EventListener.java
@@ -27,7 +27,7 @@
 
 /**
  * A tagging interface that all event listener interfaces must extend.
- * @since JDK1.1
+ * @since 1.1
  */
 public interface EventListener {
 }
diff --git a/jdk/src/share/classes/java/util/EventObject.java b/jdk/src/share/classes/java/util/EventObject.java
index 3bccae1..99f58eb 100644
--- a/jdk/src/share/classes/java/util/EventObject.java
+++ b/jdk/src/share/classes/java/util/EventObject.java
@@ -33,7 +33,7 @@
  * that is logically deemed to be the object upon which the Event in question
  * initially occurred upon.
  *
- * @since JDK1.1
+ * @since 1.1
  */
 
 public class EventObject implements java.io.Serializable {
diff --git a/jdk/src/share/classes/java/util/GregorianCalendar.java b/jdk/src/share/classes/java/util/GregorianCalendar.java
index eadb5d0..692b238 100644
--- a/jdk/src/share/classes/java/util/GregorianCalendar.java
+++ b/jdk/src/share/classes/java/util/GregorianCalendar.java
@@ -325,7 +325,7 @@
  *
  * @see          TimeZone
  * @author David Goldsmith, Mark Davis, Chen-Lieh Huang, Alan Liu
- * @since JDK1.1
+ * @since 1.1
  */
 public class GregorianCalendar extends Calendar {
     /*
diff --git a/jdk/src/share/classes/java/util/HashMap.java b/jdk/src/share/classes/java/util/HashMap.java
index a59c98d4a..d3b1df4 100644
--- a/jdk/src/share/classes/java/util/HashMap.java
+++ b/jdk/src/share/classes/java/util/HashMap.java
@@ -1967,7 +1967,7 @@
                     dir = -1;
                 else if (ph < h)
                     dir = 1;
-                else if ((pk = p.key) == k || (pk != null && k.equals(pk)))
+                else if ((pk = p.key) == k || (k != null && k.equals(pk)))
                     return p;
                 else if ((kc == null &&
                           (kc = comparableClassFor(k)) == null) ||
diff --git a/jdk/src/share/classes/java/util/Hashtable.java b/jdk/src/share/classes/java/util/Hashtable.java
index c2f42b1..3cef9ad 100644
--- a/jdk/src/share/classes/java/util/Hashtable.java
+++ b/jdk/src/share/classes/java/util/Hashtable.java
@@ -129,7 +129,7 @@
  * @see     Map
  * @see     HashMap
  * @see     TreeMap
- * @since JDK1.0
+ * @since 1.0
  */
 public class Hashtable<K,V>
     extends Dictionary<K,V>
diff --git a/jdk/src/share/classes/java/util/ListResourceBundle.java b/jdk/src/share/classes/java/util/ListResourceBundle.java
index 44d2179..493f70b 100644
--- a/jdk/src/share/classes/java/util/ListResourceBundle.java
+++ b/jdk/src/share/classes/java/util/ListResourceBundle.java
@@ -113,7 +113,7 @@
  *
  * @see ResourceBundle
  * @see PropertyResourceBundle
- * @since JDK1.1
+ * @since 1.1
  */
 public abstract class ListResourceBundle extends ResourceBundle {
     /**
diff --git a/jdk/src/share/classes/java/util/MissingResourceException.java b/jdk/src/share/classes/java/util/MissingResourceException.java
index 4586480..5602739 100644
--- a/jdk/src/share/classes/java/util/MissingResourceException.java
+++ b/jdk/src/share/classes/java/util/MissingResourceException.java
@@ -45,7 +45,7 @@
  * @see java.lang.Exception
  * @see ResourceBundle
  * @author      Mark Davis
- * @since       JDK1.1
+ * @since       1.1
  */
 public
 class MissingResourceException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/util/NoSuchElementException.java b/jdk/src/share/classes/java/util/NoSuchElementException.java
index 15e1aad..0469cd9 100644
--- a/jdk/src/share/classes/java/util/NoSuchElementException.java
+++ b/jdk/src/share/classes/java/util/NoSuchElementException.java
@@ -32,7 +32,7 @@
  * @author  unascribed
  * @see     java.util.Enumeration#nextElement()
  * @see     java.util.Iterator#next()
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class NoSuchElementException extends RuntimeException {
diff --git a/jdk/src/share/classes/java/util/Observable.java b/jdk/src/share/classes/java/util/Observable.java
index 5878b1b..af39bda 100644
--- a/jdk/src/share/classes/java/util/Observable.java
+++ b/jdk/src/share/classes/java/util/Observable.java
@@ -57,7 +57,7 @@
  * @see     java.util.Observable#notifyObservers(java.lang.Object)
  * @see     java.util.Observer
  * @see     java.util.Observer#update(java.util.Observable, java.lang.Object)
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Observable {
     private boolean changed = false;
diff --git a/jdk/src/share/classes/java/util/Observer.java b/jdk/src/share/classes/java/util/Observer.java
index ef64e14..e9694fe 100644
--- a/jdk/src/share/classes/java/util/Observer.java
+++ b/jdk/src/share/classes/java/util/Observer.java
@@ -30,7 +30,7 @@
  *
  * @author  Chris Warth
  * @see     java.util.Observable
- * @since   JDK1.0
+ * @since   1.0
  */
 public interface Observer {
     /**
diff --git a/jdk/src/share/classes/java/util/Properties.java b/jdk/src/share/classes/java/util/Properties.java
index d9d9ce3..1df838e 100644
--- a/jdk/src/share/classes/java/util/Properties.java
+++ b/jdk/src/share/classes/java/util/Properties.java
@@ -116,7 +116,7 @@
  * @author  Arthur van Hoff
  * @author  Michael McCloskey
  * @author  Xueming Shen
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class Properties extends Hashtable<Object,Object> {
@@ -1065,7 +1065,7 @@
      * @param   out   an output stream.
      * @throws  ClassCastException if any key in this property list
      *          is not a string.
-     * @since   JDK1.1
+     * @since   1.1
      */
     /*
      * Rather than use an anonymous inner class to share common code, this
diff --git a/jdk/src/share/classes/java/util/PropertyResourceBundle.java b/jdk/src/share/classes/java/util/PropertyResourceBundle.java
index 13a1e20..ff9c6b4 100644
--- a/jdk/src/share/classes/java/util/PropertyResourceBundle.java
+++ b/jdk/src/share/classes/java/util/PropertyResourceBundle.java
@@ -117,7 +117,7 @@
  * @see ResourceBundle
  * @see ListResourceBundle
  * @see Properties
- * @since JDK1.1
+ * @since 1.1
  */
 public class PropertyResourceBundle extends ResourceBundle {
     /**
diff --git a/jdk/src/share/classes/java/util/ResourceBundle.java b/jdk/src/share/classes/java/util/ResourceBundle.java
index 142b619..151f1fd 100644
--- a/jdk/src/share/classes/java/util/ResourceBundle.java
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java
@@ -282,7 +282,7 @@
  * @see ListResourceBundle
  * @see PropertyResourceBundle
  * @see MissingResourceException
- * @since JDK1.1
+ * @since 1.1
  */
 public abstract class ResourceBundle {
 
diff --git a/jdk/src/share/classes/java/util/Stack.java b/jdk/src/share/classes/java/util/Stack.java
index ebea11e..540ac2d 100644
--- a/jdk/src/share/classes/java/util/Stack.java
+++ b/jdk/src/share/classes/java/util/Stack.java
@@ -43,7 +43,7 @@
  *   Deque<Integer> stack = new ArrayDeque<Integer>();}</pre>
  *
  * @author  Jonathan Payne
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class Stack<E> extends Vector<E> {
diff --git a/jdk/src/share/classes/java/util/StringTokenizer.java b/jdk/src/share/classes/java/util/StringTokenizer.java
index 15285ca..f9a4b46 100644
--- a/jdk/src/share/classes/java/util/StringTokenizer.java
+++ b/jdk/src/share/classes/java/util/StringTokenizer.java
@@ -97,7 +97,7 @@
  *
  * @author  unascribed
  * @see     java.io.StreamTokenizer
- * @since   JDK1.0
+ * @since   1.0
  */
 public
 class StringTokenizer implements Enumeration<Object> {
diff --git a/jdk/src/share/classes/java/util/TimeZone.java b/jdk/src/share/classes/java/util/TimeZone.java
index 356f33b..6847a80 100644
--- a/jdk/src/share/classes/java/util/TimeZone.java
+++ b/jdk/src/share/classes/java/util/TimeZone.java
@@ -128,7 +128,7 @@
  * @see          GregorianCalendar
  * @see          SimpleTimeZone
  * @author       Mark Davis, David Goldsmith, Chen-Lieh Huang, Alan Liu
- * @since        JDK1.1
+ * @since        1.1
  */
 abstract public class TimeZone implements Serializable, Cloneable {
     /**
diff --git a/jdk/src/share/classes/java/util/TooManyListenersException.java b/jdk/src/share/classes/java/util/TooManyListenersException.java
index 134dea8..9635a5c 100644
--- a/jdk/src/share/classes/java/util/TooManyListenersException.java
+++ b/jdk/src/share/classes/java/util/TooManyListenersException.java
@@ -44,7 +44,7 @@
  * @see java.util.EventListener
  *
  * @author Laurence P. G. Cable
- * @since  JDK1.1
+ * @since  1.1
  */
 
 public class TooManyListenersException extends Exception {
diff --git a/jdk/src/share/classes/java/util/Vector.java b/jdk/src/share/classes/java/util/Vector.java
index 01d505e..d89f0cd 100644
--- a/jdk/src/share/classes/java/util/Vector.java
+++ b/jdk/src/share/classes/java/util/Vector.java
@@ -82,7 +82,7 @@
  * @author  Jonathan Payne
  * @see Collection
  * @see LinkedList
- * @since   JDK1.0
+ * @since   1.0
  */
 public class Vector<E>
     extends AbstractList<E>
diff --git a/jdk/src/share/classes/java/util/package.html b/jdk/src/share/classes/java/util/package.html
index a655934..abcf84b 100644
--- a/jdk/src/share/classes/java/util/package.html
+++ b/jdk/src/share/classes/java/util/package.html
@@ -50,6 +50,6 @@
     Framework Design FAQ</b></a>
 </ul>
 
-@since JDK1.0
+@since 1.0
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/util/prefs/package.html b/jdk/src/share/classes/java/util/prefs/package.html
index f3160b3..cd5a0a7 100644
--- a/jdk/src/share/classes/java/util/prefs/package.html
+++ b/jdk/src/share/classes/java/util/prefs/package.html
@@ -39,6 +39,6 @@
 <h2>Related Documentation</h2>
 -->
 
-@since JDK1.4
+@since 1.4
 </body>
 </html>
diff --git a/jdk/src/share/classes/java/util/zip/ZipException.java b/jdk/src/share/classes/java/util/zip/ZipException.java
index 4bcfe03..7031292 100644
--- a/jdk/src/share/classes/java/util/zip/ZipException.java
+++ b/jdk/src/share/classes/java/util/zip/ZipException.java
@@ -32,7 +32,7 @@
  *
  * @author  unascribed
  * @see     java.io.IOException
- * @since   JDK1.0
+ * @since   1.0
  */
 
 public
diff --git a/jdk/src/share/classes/java/util/zip/package.html b/jdk/src/share/classes/java/util/zip/package.html
index e2afc37..9b80819 100644
--- a/jdk/src/share/classes/java/util/zip/package.html
+++ b/jdk/src/share/classes/java/util/zip/package.html
@@ -81,7 +81,7 @@
 </ul>
 -->
 
-@since JDK1.1
+@since 1.1
 </body>
 </html>
 
diff --git a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
index 7483ab1..869a2c8 100644
--- a/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
+++ b/jdk/src/share/classes/javax/management/modelmbean/RequiredModelMBean.java
@@ -1215,7 +1215,7 @@
                         ReflectUtil.checkPackageAccess(className);
                         final ClassLoader targetClassLoader =
                             rmmbClass.getClassLoader();
-                        Class clz = Class.forName(className, false,
+                        Class<?> clz = Class.forName(className, false,
                                                     targetClassLoader);
                         if (!rmmbClass.isAssignableFrom(clz))
                             return null;
@@ -1673,12 +1673,12 @@
                             // inequality may come from type subclassing
                             boolean subtype;
                             try {
-                                final Class respClass = response.getClass();
+                                final Class<?> respClass = response.getClass();
                                 final Exception[] caughException = new Exception[1];
 
                                 AccessControlContext stack = AccessController.getContext();
 
-                                Class c = javaSecurityAccess.doIntersectionPrivilege(new PrivilegedAction<Class<?>>() {
+                                Class<?> c = javaSecurityAccess.doIntersectionPrivilege(new PrivilegedAction<Class<?>>() {
 
                                     @Override
                                     public Class<?> run() {
@@ -2855,7 +2855,7 @@
         AccessControlContext stack = AccessController.getContext();
         final ClassNotFoundException[] caughtException = new ClassNotFoundException[1];
 
-        Class c = javaSecurityAccess.doIntersectionPrivilege(new PrivilegedAction<Class<?>>() {
+        Class<?> c = javaSecurityAccess.doIntersectionPrivilege(new PrivilegedAction<Class<?>>() {
 
             @Override
             public Class<?> run() {
diff --git a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java
index 9d71ed9..545a79a 100644
--- a/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java
+++ b/jdk/src/share/classes/javax/management/remote/rmi/RMIConnector.java
@@ -2011,13 +2011,13 @@
             if (nullSubjectConnRef == null
                     || (conn = nullSubjectConnRef.get()) == null) {
                 conn = new RemoteMBeanServerConnection(null);
-                nullSubjectConnRef = new WeakReference(conn);
+                nullSubjectConnRef = new WeakReference<MBeanServerConnection>(conn);
             }
         } else {
             WeakReference<MBeanServerConnection> wr = rmbscMap.get(delegationSubject);
             if (wr == null || (conn = wr.get()) == null) {
                 conn = new RemoteMBeanServerConnection(delegationSubject);
-                rmbscMap.put(delegationSubject, new WeakReference(conn));
+                rmbscMap.put(delegationSubject, new WeakReference<MBeanServerConnection>(conn));
             }
         }
         return conn;
@@ -2115,7 +2115,7 @@
         PrivilegedExceptionAction<Constructor<?>> action =
                 new PrivilegedExceptionAction<Constructor<?>>() {
             public Constructor<?> run() throws Exception {
-                Class thisClass = RMIConnector.class;
+                Class<RMIConnector> thisClass = RMIConnector.class;
                 ClassLoader thisLoader = thisClass.getClassLoader();
                 ProtectionDomain thisProtectionDomain =
                         thisClass.getProtectionDomain();
@@ -2354,7 +2354,7 @@
             PrivilegedExceptionAction<Class<?>> action =
                 new PrivilegedExceptionAction<Class<?>>() {
               public Class<?> run() throws Exception {
-                Class thisClass = RMIConnector.class;
+                Class<RMIConnector> thisClass = RMIConnector.class;
                 ClassLoader thisLoader = thisClass.getClassLoader();
                 ProtectionDomain thisProtectionDomain =
                         thisClass.getProtectionDomain();
diff --git a/jdk/src/share/classes/javax/security/auth/callback/package-info.java b/jdk/src/share/classes/javax/security/auth/callback/package-info.java
index 4cd5daf..a8ee2da 100644
--- a/jdk/src/share/classes/javax/security/auth/callback/package-info.java
+++ b/jdk/src/share/classes/javax/security/auth/callback/package-info.java
@@ -30,6 +30,6 @@
  * or passwords, for example) or to display information
  * (error and warning messages, for example).
  *
- * @since JDK1.4
+ * @since 1.4
  */
 package javax.security.auth.callback;
diff --git a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java
index 0853663..01d4b53 100644
--- a/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java
+++ b/jdk/src/share/classes/javax/security/auth/kerberos/package-info.java
@@ -54,6 +54,6 @@
  * string or a boolean value. A boolean value can be one of "true", "false",
  * "yes", or "no", case-insensitive.<p>
  *
- * @since JDK1.4
+ * @since 1.4
  */
 package javax.security.auth.kerberos;
diff --git a/jdk/src/share/classes/javax/security/auth/package-info.java b/jdk/src/share/classes/javax/security/auth/package-info.java
index b4ac0827..7b63418 100644
--- a/jdk/src/share/classes/javax/security/auth/package-info.java
+++ b/jdk/src/share/classes/javax/security/auth/package-info.java
@@ -33,6 +33,6 @@
  * based on code location, code signers and code executors
  * (Subjects).
  *
- * @since JDK1.4
+ * @since 1.4
  */
 package javax.security.auth;
diff --git a/jdk/src/share/classes/javax/security/auth/spi/package-info.java b/jdk/src/share/classes/javax/security/auth/spi/package-info.java
index da7cbcb..bb6e0a0 100644
--- a/jdk/src/share/classes/javax/security/auth/spi/package-info.java
+++ b/jdk/src/share/classes/javax/security/auth/spi/package-info.java
@@ -27,6 +27,6 @@
  * This package provides the interface to be used for
  * implementing pluggable authentication modules.
  *
- * @since JDK1.4
+ * @since 1.4
  */
 package javax.security.auth.spi;
diff --git a/jdk/src/share/classes/javax/security/auth/x500/package-info.java b/jdk/src/share/classes/javax/security/auth/x500/package-info.java
index 12f8a53..e0febd2 100644
--- a/jdk/src/share/classes/javax/security/auth/x500/package-info.java
+++ b/jdk/src/share/classes/javax/security/auth/x500/package-info.java
@@ -44,6 +44,6 @@
  *     Directory Information Models</a></li>
  * </ul>
  *
- * @since JDK1.4
+ * @since 1.4
  */
 package javax.security.auth.x500;
diff --git a/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java b/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
index 7d537ad..0e925a5 100644
--- a/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
+++ b/jdk/src/share/classes/javax/swing/plaf/nimbus/DerivedColor.java
@@ -106,7 +106,7 @@
      * @see #getRed
      * @see #getGreen
      * @see #getBlue
-     * @since JDK1.0
+     * @since 1.0
      */
     @Override public int getRGB() {
         return argbValue;
diff --git a/jdk/src/share/classes/javax/swing/text/ComponentView.java b/jdk/src/share/classes/javax/swing/text/ComponentView.java
index d15ccf6..083e3b2 100644
--- a/jdk/src/share/classes/javax/swing/text/ComponentView.java
+++ b/jdk/src/share/classes/javax/swing/text/ComponentView.java
@@ -439,7 +439,7 @@
          * @param b If <code>true</code>, shows this component;
          * otherwise, hides this component.
          * @see #isVisible
-         * @since JDK1.1
+         * @since 1.1
          */
         public void setVisible(boolean b) {
             super.setVisible(b);
diff --git a/jdk/src/share/classes/javax/swing/text/StyleContext.java b/jdk/src/share/classes/javax/swing/text/StyleContext.java
index 8d7975b..d8577af 100644
--- a/jdk/src/share/classes/javax/swing/text/StyleContext.java
+++ b/jdk/src/share/classes/javax/swing/text/StyleContext.java
@@ -1013,7 +1013,7 @@
          *
          * @return  <code>true</code> if this enumeration contains more elements;
          *          <code>false</code> otherwise.
-         * @since   JDK1.0
+         * @since   1.0
          */
         public boolean hasMoreElements() {
             return i < attr.length;
@@ -1024,7 +1024,7 @@
          *
          * @return     the next element of this enumeration.
          * @exception  NoSuchElementException  if no more elements exist.
-         * @since      JDK1.0
+         * @since      1.0
          */
         public Object nextElement() {
             if (i < attr.length) {
diff --git a/jdk/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java b/jdk/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java
index 4589959..41608cb 100644
--- a/jdk/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java
+++ b/jdk/src/share/classes/jdk/internal/util/xml/PropertiesDefaultHandler.java
@@ -42,7 +42,7 @@
  * re-implemented using a subset of SAX
  *
  * @author Joe Wang
- * @since 8
+ * @since 1.8
  */
 public class PropertiesDefaultHandler extends DefaultHandler {
 
diff --git a/jdk/src/share/classes/sun/applet/AppletClassLoader.java b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
index f732ad2..e894d24 100644
--- a/jdk/src/share/classes/sun/applet/AppletClassLoader.java
+++ b/jdk/src/share/classes/sun/applet/AppletClassLoader.java
@@ -357,7 +357,7 @@
      * @param  name the resource name
      * @return an input stream for reading the resource, or <code>null</code>
      *         if the resource could not be found
-     * @since  JDK1.1
+     * @since  1.1
      */
     public InputStream getResourceAsStream(String name)
     {
@@ -417,7 +417,7 @@
      * @param  name the resource name
      * @return an input stream for reading the resource, or <code>null</code>
      *         if the resource could not be found
-     * @since  JDK1.1
+     * @since  1.1
      */
     public InputStream getResourceAsStreamFromJar(String name) {
 
diff --git a/jdk/src/share/classes/sun/applet/AppletSecurity.java b/jdk/src/share/classes/sun/applet/AppletSecurity.java
index 7df2f96..9fb20e9 100644
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java
@@ -303,7 +303,7 @@
      * This method calls <code>checkPermission</code> with the
      * <code>AWTPermission("accessEventQueue")</code> permission.
      *
-     * @since   JDK1.1
+     * @since   1.1
      * @exception  SecurityException  if the caller does not have
      *             permission to access the AWT event queue.
      */
@@ -347,7 +347,7 @@
       * @return  the AppContext corresponding to the current context.
       * @see     sun.awt.AppContext
       * @see     java.lang.SecurityManager
-      * @since   JDK1.2.1
+      * @since   1.2.1
       */
     public AppContext getAppContext() {
         AppletClassLoader appletLoader = currentAppletClassLoader();
diff --git a/jdk/src/share/classes/sun/applet/AppletThreadGroup.java b/jdk/src/share/classes/sun/applet/AppletThreadGroup.java
index 43cbf4d..fab6685 100644
--- a/jdk/src/share/classes/sun/applet/AppletThreadGroup.java
+++ b/jdk/src/share/classes/sun/applet/AppletThreadGroup.java
@@ -55,7 +55,7 @@
      * @exception  SecurityException  if the current thread cannot create a
      *               thread in the specified thread group.
      * @see     java.lang.SecurityException
-     * @since   JDK1.1.1
+     * @since   1.1.1
      */
     public AppletThreadGroup(ThreadGroup parent, String name) {
         super(parent, name);
diff --git a/jdk/src/share/classes/sun/awt/AWTSecurityManager.java b/jdk/src/share/classes/sun/awt/AWTSecurityManager.java
index 42e3b97..991a37e 100644
--- a/jdk/src/share/classes/sun/awt/AWTSecurityManager.java
+++ b/jdk/src/share/classes/sun/awt/AWTSecurityManager.java
@@ -56,7 +56,7 @@
       * @return  the AppContext corresponding to the current context.
       * @see     sun.awt.AppContext
       * @see     java.lang.SecurityManager
-      * @since   JDK1.2.1
+      * @since   1.2.1
       */
     public AppContext getAppContext() {
         return null; // Default implementation returns null
diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
index 8baa689..46b4333 100644
--- a/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDragSourceContextPeer.java
@@ -60,7 +60,7 @@
  * TBC
  * </p>
  *
- * @since JDK1.3.1
+ * @since 1.3.1
  *
  */
 public abstract class SunDragSourceContextPeer implements DragSourceContextPeer {
diff --git a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
index a880f12..dbb17e9 100644
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
@@ -65,7 +65,7 @@
  * the interaction between a windowing systems DnD system and Java.
  * </p>
  *
- * @since JDK1.3.1
+ * @since 1.3.1
  *
  */
 
diff --git a/jdk/src/share/classes/sun/awt/image/MultiResolutionImage.java b/jdk/src/share/classes/sun/awt/image/MultiResolutionImage.java
index 40be02e..525267d 100644
--- a/jdk/src/share/classes/sun/awt/image/MultiResolutionImage.java
+++ b/jdk/src/share/classes/sun/awt/image/MultiResolutionImage.java
@@ -69,7 +69,7 @@
      * @param height the desired image resolution height.
      * @return image resolution variant.
      *
-     * @since JDK1.8
+     * @since 1.8
      */
     public Image getResolutionVariant(int width, int height);
 
@@ -77,7 +77,7 @@
      * Gets list of all resolution variants including the base image
      *
      * @return list of resolution variants.
-     * @since JDK1.8
+     * @since 1.8
      */
     public List<Image> getResolutionVariants();
 }
diff --git a/jdk/src/share/classes/sun/management/DiagnosticCommandArgumentInfo.java b/jdk/src/share/classes/sun/management/DiagnosticCommandArgumentInfo.java
index 37bccb0..1ad267b 100644
--- a/jdk/src/share/classes/sun/management/DiagnosticCommandArgumentInfo.java
+++ b/jdk/src/share/classes/sun/management/DiagnosticCommandArgumentInfo.java
@@ -43,7 +43,7 @@
  * argumentA's position is 0, argumentB's position is 1 and argumentC's
  * position is 2.
  *
- * @since 8
+ * @since 1.8
  */
 
 class DiagnosticCommandArgumentInfo {
diff --git a/jdk/src/share/classes/sun/management/DiagnosticCommandImpl.java b/jdk/src/share/classes/sun/management/DiagnosticCommandImpl.java
index eeeee9a..27f6399 100644
--- a/jdk/src/share/classes/sun/management/DiagnosticCommandImpl.java
+++ b/jdk/src/share/classes/sun/management/DiagnosticCommandImpl.java
@@ -35,7 +35,7 @@
 /**
  * Implementation class for the diagnostic commands subsystem.
  *
- * @since 8
+ * @since 1.8
  */
 class DiagnosticCommandImpl extends NotificationEmitterSupport
     implements DiagnosticCommandMBean {
diff --git a/jdk/src/share/classes/sun/management/DiagnosticCommandInfo.java b/jdk/src/share/classes/sun/management/DiagnosticCommandInfo.java
index 4ad0a96..08541b3 100644
--- a/jdk/src/share/classes/sun/management/DiagnosticCommandInfo.java
+++ b/jdk/src/share/classes/sun/management/DiagnosticCommandInfo.java
@@ -31,7 +31,7 @@
  * Diagnostic command information. It contains the description of a
  * diagnostic command.
  *
- * @since 8
+ * @since 1.8
  */
 
 class DiagnosticCommandInfo {
diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
index 7e02ea4..781f772 100644
--- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
+++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java
@@ -552,7 +552,7 @@
             }
             requests.setIfNotSet("User-Agent", userAgent);
             int port = url.getPort();
-            String host = url.getHost();
+            String host = stripIPv6ZoneId(url.getHost());
             if (port != -1 && port != url.getDefaultPort()) {
                 host += ":" + String.valueOf(port);
             }
@@ -2659,7 +2659,7 @@
                     requests.set(0, method + " " + getRequestURI()+" "  +
                                  httpVersion, null);
                     int port = url.getPort();
-                    String host = url.getHost();
+                    String host = stripIPv6ZoneId(url.getHost());
                     if (port != -1 && port != url.getDefaultPort()) {
                         host += ":" + String.valueOf(port);
                     }
@@ -3204,6 +3204,24 @@
         return headers;
     }
 
+    /**
+     * Returns the given host, without the IPv6 Zone Id, if present.
+     * (e.g. [fe80::a00:27ff:aaaa:aaaa%eth0] -> [fe80::a00:27ff:aaaa:aaaa])
+     *
+     * @param host host address (not null, not empty)
+     * @return host address without Zone Id
+     */
+    static String stripIPv6ZoneId(String host) {
+        if (host.charAt(0) != '[') { // not an IPv6-literal
+            return host;
+        }
+        int i = host.lastIndexOf('%');
+        if (i == -1) { // doesn't contain zone_id
+            return host;
+        }
+        return host.substring(0, i) + "]";
+    }
+
     /* The purpose of this wrapper is just to capture the close() call
      * so we can check authentication information that may have
      * arrived in a Trailer field
diff --git a/jdk/src/share/classes/sun/print/PSPathGraphics.java b/jdk/src/share/classes/sun/print/PSPathGraphics.java
index edd3e1d..73a77ff 100644
--- a/jdk/src/share/classes/sun/print/PSPathGraphics.java
+++ b/jdk/src/share/classes/sun/print/PSPathGraphics.java
@@ -76,7 +76,7 @@
      * a copy of this <code>Graphics</code> object.
      * @return     a new graphics context that is a copy of
      *                       this graphics context.
-     * @since      JDK1.0
+     * @since      1.0
      */
     public Graphics create() {
 
@@ -108,7 +108,7 @@
      * @param       y        the <i>y</i> coordinate.
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawString(String str, int x, int y) {
         drawString(str, (float) x, (float) y);
diff --git a/jdk/src/share/classes/sun/print/PathGraphics.java b/jdk/src/share/classes/sun/print/PathGraphics.java
index f7f82c8..1538546 100644
--- a/jdk/src/share/classes/sun/print/PathGraphics.java
+++ b/jdk/src/share/classes/sun/print/PathGraphics.java
@@ -332,7 +332,7 @@
      * @param       width the width of the oval to be drawn.
      * @param       height the height of the oval to be drawn.
      * @see         java.awt.Graphics#fillOval
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawOval(int x, int y, int width, int height) {
         draw(new Ellipse2D.Float(x, y, width, height));
@@ -453,7 +453,7 @@
      * @param       yPoints an array of <i>y</i> points
      * @param       nPoints the total number of points
      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void drawPolyline(int xPoints[], int yPoints[],
                              int nPoints) {
@@ -564,7 +564,7 @@
      * @param       y        the <i>y</i> coordinate.
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawString(String str, int x, int y) {
         drawString(str, (float) x, (float) y);
@@ -1388,7 +1388,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              ImageObserver observer) {
@@ -1428,7 +1428,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -1472,7 +1472,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              Color bgcolor,
@@ -1533,7 +1533,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -1605,7 +1605,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                              int dx1, int dy1, int dx2, int dy2,
@@ -1670,7 +1670,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                              int dx1, int dy1, int dx2, int dy2,
diff --git a/jdk/src/share/classes/sun/print/PeekGraphics.java b/jdk/src/share/classes/sun/print/PeekGraphics.java
index 8f4f04c..32d882e 100644
--- a/jdk/src/share/classes/sun/print/PeekGraphics.java
+++ b/jdk/src/share/classes/sun/print/PeekGraphics.java
@@ -166,7 +166,7 @@
      * a copy of this <code>Graphics</code> object.
      * @return     a new graphics context that is a copy of
      *                       this graphics context.
-     * @since      JDK1.0
+     * @since      1.0
      */
     public Graphics create() {
         PeekGraphics newGraphics = null;
@@ -196,7 +196,7 @@
      * to this new origin.
      * @param  x   the <i>x</i> coordinate.
      * @param  y   the <i>y</i> coordinate.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void translate(int x, int y) {
         mGraphics.translate(x, y);
@@ -293,7 +293,7 @@
      * @return    this graphics context's current color.
      * @see       java.awt.Color
      * @see       java.awt.Graphics#setColor
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Color getColor() {
         return mGraphics.getColor();
@@ -306,7 +306,7 @@
      * @param     c   the new rendering color.
      * @see       java.awt.Color
      * @see       java.awt.Graphics#getColor
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void setColor(Color c) {
         mGraphics.setColor(c);
@@ -318,7 +318,7 @@
      * This sets the logical pixel operation function to the paint or
      * overwrite mode.  All subsequent rendering operations will
      * overwrite the destination with the current color.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void setPaintMode() {
         mGraphics.setPaintMode();
@@ -338,7 +338,7 @@
      * in an unpredictable but reversible manner; if the same figure is
      * drawn twice, then all pixels are restored to their original values.
      * @param     c1 the XOR alternation color
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void setXORMode(Color c1) {
         mGraphics.setXORMode(c1);
@@ -349,7 +349,7 @@
      * @return    this graphics context's current font.
      * @see       java.awt.Font
      * @see       java.awt.Graphics#setFont
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Font getFont() {
         return mGraphics.getFont();
@@ -364,7 +364,7 @@
      * @see     java.awt.Graphics#drawChars(java.lang.String, int, int)
      * @see     java.awt.Graphics#drawString(byte[], int, int, int, int)
      * @see     java.awt.Graphics#drawBytes(char[], int, int, int, int)
-     * @since   JDK1.0
+     * @since   1.0
     */
     public void setFont(Font font) {
         mGraphics.setFont(font);
@@ -377,7 +377,7 @@
      * @see       java.awt.Graphics#getFont
      * @see       java.awt.FontMetrics
      * @see       java.awt.Graphics#getFontMetrics()
-     * @since     JDK1.0
+     * @since     1.0
      */
     public FontMetrics getFontMetrics(Font f) {
         return mGraphics.getFontMetrics(f);
@@ -400,7 +400,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Rectangle getClipBounds() {
         return mGraphics.getClipBounds();
@@ -436,7 +436,7 @@
      * @param       height the height of the new clip rectangle.
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(int x, int y, int width, int height) {
         mGraphics.setClip(x, y, width, height);
@@ -450,7 +450,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Shape getClip() {
         return mGraphics.getClip();
@@ -468,7 +468,7 @@
      * @see         java.awt.Graphics#getClip()
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(Shape clip) {
         mGraphics.setClip(clip);
@@ -493,7 +493,7 @@
      * @param       height the height of the source rectangle.
      * @param       dx the horizontal distance to copy the pixels.
      * @param       dy the vertical distance to copy the pixels.
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void copyArea(int x, int y, int width, int height,
                          int dx, int dy) {
@@ -508,7 +508,7 @@
      * @param   y1  the first point's <i>y</i> coordinate.
      * @param   x2  the second point's <i>x</i> coordinate.
      * @param   y2  the second point's <i>y</i> coordinate.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void drawLine(int x1, int y1, int x2, int y2) {
         addStrokeShape(new Line2D.Float(x1, y1, x2, y2));
@@ -535,7 +535,7 @@
      * @param         height   the height of the rectangle to be filled.
      * @see           java.awt.Graphics#fillRect
      * @see           java.awt.Graphics#clearRect
-     * @since         JDK1.0
+     * @since         1.0
      */
     public void fillRect(int x, int y, int width, int height) {
 
@@ -562,7 +562,7 @@
      * @see         java.awt.Graphics#setColor(java.awt.Color)
      * @see         java.awt.Graphics#setPaintMode
      * @see         java.awt.Graphics#setXORMode(java.awt.Color)
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void clearRect(int x, int y, int width, int height) {
         Rectangle2D.Float rect = new Rectangle2D.Float(x, y, width, height);
@@ -585,7 +585,7 @@
      * @param      arcHeight the vertical diameter of the arc
      *                    at the four corners.
      * @see        java.awt.Graphics#fillRoundRect
-     * @since      JDK1.0
+     * @since      1.0
      */
     public void drawRoundRect(int x, int y, int width, int height,
                               int arcWidth, int arcHeight) {
@@ -609,7 +609,7 @@
      * @param       arcHeight the vertical diameter
      *                     of the arc at the four corners.
      * @see         java.awt.Graphics#drawRoundRect
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillRoundRect(int x, int y, int width, int height,
                                        int arcWidth, int arcHeight) {
@@ -634,7 +634,7 @@
      * @param       width the width of the oval to be drawn.
      * @param       height the height of the oval to be drawn.
      * @see         java.awt.Graphics#fillOval
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawOval(int x, int y, int width, int height) {
         addStrokeShape(new Rectangle2D.Float(x, y,  width, height));
@@ -651,7 +651,7 @@
      * @param       width the width of the oval to be filled.
      * @param       height the height of the oval to be filled.
      * @see         java.awt.Graphics#drawOval
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillOval(int x, int y, int width, int height) {
         Rectangle2D.Float rect = new Rectangle2D.Float(x, y, width, height);
@@ -689,7 +689,7 @@
      * @param        arcAngle the angular extent of the arc,
      *                    relative to the start angle.
      * @see         java.awt.Graphics#fillArc
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawArc(int x, int y, int width, int height,
                                  int startAngle, int arcAngle) {
@@ -725,7 +725,7 @@
      * @param        arcAngle the angular extent of the arc,
      *                    relative to the start angle.
      * @see         java.awt.Graphics#drawArc
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillArc(int x, int y, int width, int height,
                         int startAngle, int arcAngle) {
@@ -745,7 +745,7 @@
      * @param       yPoints an array of <i>y</i> points
      * @param       nPoints the total number of points
      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since       JDK1.1
+     * @since       1.1
      */
    public void drawPolyline(int xPoints[], int yPoints[],
                              int nPoints) {
@@ -780,7 +780,7 @@
      * @param        nPoints   a the total number of points.
      * @see          java.awt.Graphics#fillPolygon
      * @see          java.awt.Graphics#drawPolyline
-     * @since        JDK1.0
+     * @since        1.0
      */
     public void drawPolygon(int xPoints[], int yPoints[],
                             int nPoints) {
@@ -811,7 +811,7 @@
      * @param        yPoints   a an array of <code>y</code> coordinates.
      * @param        nPoints   a the total number of points.
      * @see          java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since        JDK1.0
+     * @since        1.0
      */
     public void fillPolygon(int xPoints[], int yPoints[],
                             int nPoints) {
@@ -854,7 +854,7 @@
      * @param       y        the <i>y</i> coordinate.
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawString(String str, int x, int y) {
 
@@ -942,7 +942,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              ImageObserver observer) {
@@ -995,7 +995,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -1040,7 +1040,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
    public boolean drawImage(Image img, int x, int y,
                              Color bgcolor,
@@ -1099,7 +1099,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -1162,7 +1162,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                              int dx1, int dy1, int dx2, int dy2,
@@ -1236,7 +1236,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                              int dx1, int dy1, int dx2, int dy2,
@@ -1327,7 +1327,7 @@
      * @see         java.awt.Component#update
      * @see         java.awt.Component#getGraphics
      * @see         java.awt.Graphics#create
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void dispose() {
         mGraphics.dispose();
diff --git a/jdk/src/share/classes/sun/print/ProxyGraphics.java b/jdk/src/share/classes/sun/print/ProxyGraphics.java
index e9047a2..9bb3bd2 100644
--- a/jdk/src/share/classes/sun/print/ProxyGraphics.java
+++ b/jdk/src/share/classes/sun/print/ProxyGraphics.java
@@ -241,7 +241,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Rectangle getClipBounds() {
         return g.getClipBounds();
@@ -282,7 +282,7 @@
      * @param       height the height of the new clip rectangle.
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(int x, int y, int width, int height) {
         g.setClip(x, y, width, height);
@@ -302,7 +302,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Shape getClip() {
         return g.getClip();
@@ -322,7 +322,7 @@
      * @see         java.awt.Graphics#getClip()
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(Shape clip) {
         g.setClip(clip);
@@ -647,7 +647,7 @@
      * @param       yPoints an array of <i>y</i> points
      * @param       nPoints the total number of points
      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void drawPolyline(int xPoints[], int yPoints[],
                                       int nPoints) {
@@ -988,7 +988,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                                       int dx1, int dy1, int dx2, int dy2,
@@ -1051,7 +1051,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                                       int dx1, int dy1, int dx2, int dy2,
diff --git a/jdk/src/share/classes/sun/print/ProxyGraphics2D.java b/jdk/src/share/classes/sun/print/ProxyGraphics2D.java
index ae3c013..5a4b3845a 100644
--- a/jdk/src/share/classes/sun/print/ProxyGraphics2D.java
+++ b/jdk/src/share/classes/sun/print/ProxyGraphics2D.java
@@ -115,7 +115,7 @@
      * a copy of this <code>Graphics</code> object.
      * @return     a new graphics context that is a copy of
      *                       this graphics context.
-     * @since      JDK1.0
+     * @since      1.0
      */
     public Graphics create() {
         return new ProxyGraphics2D((Graphics2D) mGraphics.create(),
@@ -132,7 +132,7 @@
      * to this new origin.
      * @param  x   the <i>x</i> coordinate.
      * @param  y   the <i>y</i> coordinate.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void translate(int x, int y) {
         mGraphics.translate(x, y);
@@ -229,7 +229,7 @@
      * @return    this graphics context's current color.
      * @see       java.awt.Color
      * @see       java.awt.Graphics#setColor
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Color getColor() {
         return mGraphics.getColor();
@@ -242,7 +242,7 @@
      * @param     c   the new rendering color.
      * @see       java.awt.Color
      * @see       java.awt.Graphics#getColor
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void setColor(Color c) {
         mGraphics.setColor(c);
@@ -254,7 +254,7 @@
      * This sets the logical pixel operation function to the paint or
      * overwrite mode.  All subsequent rendering operations will
      * overwrite the destination with the current color.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void setPaintMode() {
         mGraphics.setPaintMode();
@@ -274,7 +274,7 @@
      * in an unpredictable but reversible manner; if the same figure is
      * drawn twice, then all pixels are restored to their original values.
      * @param     c1 the XOR alternation color
-     * @since     JDK1.0
+     * @since     1.0
      */
     public void setXORMode(Color c1) {
         mGraphics.setXORMode(c1);
@@ -285,7 +285,7 @@
      * @return    this graphics context's current font.
      * @see       java.awt.Font
      * @see       java.awt.Graphics#setFont
-     * @since     JDK1.0
+     * @since     1.0
      */
     public Font getFont() {
         return mGraphics.getFont();
@@ -300,7 +300,7 @@
      * @see     java.awt.Graphics#drawChars(java.lang.String, int, int)
      * @see     java.awt.Graphics#drawString(byte[], int, int, int, int)
      * @see     java.awt.Graphics#drawBytes(char[], int, int, int, int)
-     * @since   JDK1.0
+     * @since   1.0
     */
     public void setFont(Font font) {
         mGraphics.setFont(font);
@@ -313,7 +313,7 @@
      * @see       java.awt.Graphics#getFont
      * @see       java.awt.FontMetrics
      * @see       java.awt.Graphics#getFontMetrics()
-     * @since     JDK1.0
+     * @since     1.0
      */
     public FontMetrics getFontMetrics(Font f) {
         return mGraphics.getFontMetrics(f);
@@ -336,7 +336,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Rectangle getClipBounds() {
         return mGraphics.getClipBounds();
@@ -372,7 +372,7 @@
      * @param       height the height of the new clip rectangle.
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(int x, int y, int width, int height) {
         mGraphics.setClip(x, y, width, height);
@@ -386,7 +386,7 @@
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
      * @see         java.awt.Graphics#setClip(Shape)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public Shape getClip() {
         return mGraphics.getClip();
@@ -404,7 +404,7 @@
      * @see         java.awt.Graphics#getClip()
      * @see         java.awt.Graphics#clipRect
      * @see         java.awt.Graphics#setClip(int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void setClip(Shape clip) {
         mGraphics.setClip(clip);
@@ -429,7 +429,7 @@
      * @param       height the height of the source rectangle.
      * @param       dx the horizontal distance to copy the pixels.
      * @param       dy the vertical distance to copy the pixels.
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void copyArea(int x, int y, int width, int height,
                          int dx, int dy) {
@@ -444,7 +444,7 @@
      * @param   y1  the first point's <i>y</i> coordinate.
      * @param   x2  the second point's <i>x</i> coordinate.
      * @param   y2  the second point's <i>y</i> coordinate.
-     * @since   JDK1.0
+     * @since   1.0
      */
     public void drawLine(int x1, int y1, int x2, int y2) {
         mGraphics.drawLine(x1, y1, x2, y2);
@@ -469,7 +469,7 @@
      * @param         height   the height of the rectangle to be filled.
      * @see           java.awt.Graphics#fillRect
      * @see           java.awt.Graphics#clearRect
-     * @since         JDK1.0
+     * @since         1.0
      */
     public void fillRect(int x, int y, int width, int height) {
         mGraphics.fillRect(x, y, width, height);
@@ -493,7 +493,7 @@
      * @see         java.awt.Graphics#setColor(java.awt.Color)
      * @see         java.awt.Graphics#setPaintMode
      * @see         java.awt.Graphics#setXORMode(java.awt.Color)
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void clearRect(int x, int y, int width, int height) {
         mGraphics.clearRect(x, y, width, height);
@@ -514,7 +514,7 @@
      * @param      arcHeight the vertical diameter of the arc
      *                    at the four corners.
      * @see        java.awt.Graphics#fillRoundRect
-     * @since      JDK1.0
+     * @since      1.0
      */
     public void drawRoundRect(int x, int y, int width, int height,
                               int arcWidth, int arcHeight) {
@@ -536,7 +536,7 @@
      * @param       arcHeight the vertical diameter
      *                     of the arc at the four corners.
      * @see         java.awt.Graphics#drawRoundRect
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillRoundRect(int x, int y, int width, int height,
                                        int arcWidth, int arcHeight) {
@@ -559,7 +559,7 @@
      * @param       width the width of the oval to be drawn.
      * @param       height the height of the oval to be drawn.
      * @see         java.awt.Graphics#fillOval
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawOval(int x, int y, int width, int height) {
         mGraphics.drawOval(x, y, width, height);
@@ -575,7 +575,7 @@
      * @param       width the width of the oval to be filled.
      * @param       height the height of the oval to be filled.
      * @see         java.awt.Graphics#drawOval
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillOval(int x, int y, int width, int height) {
         mGraphics.fillOval(x, y, width, height);
@@ -609,7 +609,7 @@
      * @param        arcAngle the angular extent of the arc,
      *                    relative to the start angle.
      * @see         java.awt.Graphics#fillArc
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawArc(int x, int y, int width, int height,
                                  int startAngle, int arcAngle) {
@@ -643,7 +643,7 @@
      * @param        arcAngle the angular extent of the arc,
      *                    relative to the start angle.
      * @see         java.awt.Graphics#drawArc
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void fillArc(int x, int y, int width, int height,
                         int startAngle, int arcAngle) {
@@ -660,7 +660,7 @@
      * @param       yPoints an array of <i>y</i> points
      * @param       nPoints the total number of points
      * @see         java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public void drawPolyline(int xPoints[], int yPoints[],
                              int nPoints) {
@@ -685,7 +685,7 @@
      * @param        nPoints   a the total number of points.
      * @see          java.awt.Graphics#fillPolygon
      * @see          java.awt.Graphics#drawPolyline
-     * @since        JDK1.0
+     * @since        1.0
      */
     public void drawPolygon(int xPoints[], int yPoints[],
                             int nPoints) {
@@ -711,7 +711,7 @@
      * @param        yPoints   a an array of <code>y</code> coordinates.
      * @param        nPoints   a the total number of points.
      * @see          java.awt.Graphics#drawPolygon(int[], int[], int)
-     * @since        JDK1.0
+     * @since        1.0
      */
     public void fillPolygon(int xPoints[], int yPoints[],
                             int nPoints) {
@@ -728,7 +728,7 @@
      * @param       y        the <i>y</i> coordinate.
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void drawString(String str, int x, int y) {
         mGraphics.drawString(str, x, y);
@@ -807,7 +807,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              ImageObserver observer) {
@@ -847,7 +847,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -885,7 +885,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              Color bgcolor,
@@ -944,7 +944,7 @@
      * @see      java.awt.Image
      * @see      java.awt.image.ImageObserver
      * @see      java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since    JDK1.0
+     * @since    1.0
      */
     public boolean drawImage(Image img, int x, int y,
                              int width, int height,
@@ -1013,7 +1013,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                                       int dx1, int dy1, int dx2, int dy2,
@@ -1075,7 +1075,7 @@
      * @see         java.awt.Image
      * @see         java.awt.image.ImageObserver
      * @see         java.awt.image.ImageObserver#imageUpdate(java.awt.Image, int, int, int, int, int)
-     * @since       JDK1.1
+     * @since       1.1
      */
     public boolean drawImage(Image img,
                              int dx1, int dy1, int dx2, int dy2,
@@ -1255,7 +1255,7 @@
      * @see         java.awt.Component#update
      * @see         java.awt.Component#getGraphics
      * @see         java.awt.Graphics#create
-     * @since       JDK1.0
+     * @since       1.0
      */
     public void dispose() {
         mGraphics.dispose();
diff --git a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java
index c4438da..b4c2e77 100644
--- a/jdk/src/share/classes/sun/security/provider/SeedGenerator.java
+++ b/jdk/src/share/classes/sun/security/provider/SeedGenerator.java
@@ -150,14 +150,13 @@
      * Retrieve some system information, hashed.
      */
     static byte[] getSystemEntropy() {
-        byte[] ba;
         final MessageDigest md;
 
         try {
             md = MessageDigest.getInstance("SHA");
         } catch (NoSuchAlgorithmException nsae) {
-            throw new InternalError("internal error: SHA-1 not available."
-                    , nsae);
+            throw new InternalError("internal error: SHA-1 not available.",
+                    nsae);
         }
 
         // The current time in millis
@@ -170,11 +169,8 @@
                 public Void run() {
                     try {
                         // System properties can change from machine to machine
-                        String s;
                         Properties p = System.getProperties();
-                        Enumeration<?> e = p.propertyNames();
-                        while (e.hasMoreElements()) {
-                            s =(String)e.nextElement();
+                        for (String s: p.stringPropertyNames()) {
                             md.update(s.getBytes());
                             md.update(p.getProperty(s).getBytes());
                         }
diff --git a/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java b/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
index a5ec5d3..6ac455f 100644
--- a/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
+++ b/jdk/src/share/classes/sun/security/provider/certpath/URICertStore.java
@@ -84,7 +84,7 @@
  *
  * @author Andreas Sterbenz
  * @author Sean Mullan
- * @since 7.0
+ * @since 1.7
  */
 class URICertStore extends CertStoreSpi {
 
diff --git a/jdk/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java b/jdk/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
index d816a58..56333eb 100644
--- a/jdk/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
+++ b/jdk/src/share/classes/sun/security/ssl/BaseSSLSocketImpl.java
@@ -307,7 +307,7 @@
      * Gets the local address to which the socket is bound.
      *
      * @return the local address to which the socket is bound.
-     * @since   JDK1.1
+     * @since   1.1
      */
     @Override
     public final InetAddress getLocalAddress() {
diff --git a/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java b/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
index ecfba5f..a99a204 100644
--- a/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
+++ b/jdk/src/share/classes/sun/security/tools/KeyStoreUtil.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,19 +25,28 @@
 
 package sun.security.tools;
 
+
 import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
 import java.io.InputStreamReader;
 
+import java.io.StreamTokenizer;
+import java.io.StringReader;
 import java.net.URL;
 
 import java.security.KeyStore;
 
 import java.text.Collator;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 import java.util.Locale;
+import java.util.Properties;
+
+import sun.security.util.PropertyExpander;
 
 /**
  * <p> This class provides several utilities to <code>KeyStore</code>.
@@ -151,4 +160,83 @@
             return null;
         }
     }
+
+    /**
+     * Parses a option line likes
+     *    -genkaypair -dname "CN=Me"
+     * and add the results into a list
+     * @param list the list to fill into
+     * @param s the line
+     */
+    private static void parseArgsLine(List<String> list, String s)
+            throws IOException, PropertyExpander.ExpandException {
+        StreamTokenizer st = new StreamTokenizer(new StringReader(s));
+
+        st.resetSyntax();
+        st.whitespaceChars(0x00, 0x20);
+        st.wordChars(0x21, 0xFF);
+        // Everything is a word char except for quotation and apostrophe
+        st.quoteChar('"');
+        st.quoteChar('\'');
+
+        while (true) {
+            if (st.nextToken() == StreamTokenizer.TT_EOF) {
+                break;
+            }
+            list.add(PropertyExpander.expand(st.sval));
+        }
+    }
+
+    /**
+     * Prepends matched options from a pre-configured options file.
+     * @param tool the name of the tool, can be "keytool" or "jarsigner"
+     * @param file the pre-configured options file
+     * @param c1 the name of the command, with the "-" prefix,
+     *        must not be null
+     * @param c2 the alternative command name, with the "-" prefix,
+     *        null if none. For example, "genkey" is alt name for
+     *        "genkeypair". A command can only have one alt name now.
+     * @param args existing arguments
+     * @return arguments combined
+     * @throws IOException if there is a file I/O or format error
+     * @throws PropertyExpander.ExpandException
+     *         if there is a property expansion error
+     */
+    public static String[] expandArgs(String tool, String file,
+                    String c1, String c2, String[] args)
+            throws IOException, PropertyExpander.ExpandException {
+
+        List<String> result = new ArrayList<>();
+        Properties p = new Properties();
+        p.load(new FileInputStream(file));
+
+        String s = p.getProperty(tool + ".all");
+        if (s != null) {
+            parseArgsLine(result, s);
+        }
+
+        // Cannot provide both -genkey and -genkeypair
+        String s1 = p.getProperty(tool + "." + c1.substring(1));
+        String s2 = null;
+        if (c2 != null) {
+            s2 = p.getProperty(tool + "." + c2.substring(1));
+        }
+        if (s1 != null && s2 != null) {
+            throw new IOException("Cannot have both " + c1 + " and "
+                    + c2 + " as pre-configured options");
+        }
+        if (s1 == null) {
+            s1 = s2;
+        }
+        if (s1 != null) {
+            parseArgsLine(result, s1);
+        }
+
+        if (result.isEmpty()) {
+            return args;
+        } else {
+            result.addAll(Arrays.asList(args));
+            return result.toArray(new String[result.size()]);
+        }
+    }
 }
diff --git a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
index 63afd87..97f5dd2 100644
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -178,7 +178,7 @@
 
     public void run(String args[]) {
         try {
-            parseArgs(args);
+            args = parseArgs(args);
 
             // Try to load and install the specified providers
             if (providers != null) {
@@ -282,11 +282,39 @@
     /*
      * Parse command line arguments.
      */
-    void parseArgs(String args[]) {
+    String[] parseArgs(String args[]) throws Exception {
         /* parse flags */
         int n = 0;
 
         if (args.length == 0) fullusage();
+
+        String confFile = null;
+        String command = "-sign";
+        for (n=0; n < args.length; n++) {
+            if (collator.compare(args[n], "-verify") == 0) {
+                command = "-verify";
+            } else if (collator.compare(args[n], "-conf") == 0) {
+                if (n == args.length - 1) {
+                    usageNoArg();
+                }
+                confFile = args[++n];
+            }
+        }
+
+        if (confFile != null) {
+            args = KeyStoreUtil.expandArgs(
+                    "jarsigner", confFile, command, null, args);
+        }
+
+        debug = Arrays.stream(args).anyMatch(
+                x -> collator.compare(x, "-debug") == 0);
+
+        if (debug) {
+            // No need to localize debug output
+            System.out.println("Command line args: " +
+                    Arrays.toString(args));
+        }
+
         for (n=0; n < args.length; n++) {
 
             String flags = args[n];
@@ -307,6 +335,8 @@
                     alias = flags;
                     ckaliases.add(alias);
                 }
+            } else if (collator.compare(flags, "-conf") == 0) {
+                if (++n == args.length) usageNoArg();
             } else if (collator.compare(flags, "-keystore") == 0) {
                 if (++n == args.length) usageNoArg();
                 keystore = args[n];
@@ -347,7 +377,7 @@
                 if (++n == args.length) usageNoArg();
                 tSADigestAlg = args[n];
             } else if (collator.compare(flags, "-debug") ==0) {
-                debug = true;
+                // Already processed
             } else if (collator.compare(flags, "-keypass") ==0) {
                 if (++n == args.length) usageNoArg();
                 keypass = getPass(modifier, args[n]);
@@ -466,6 +496,7 @@
                 usage();
             }
         }
+        return args;
     }
 
     static char[] getPass(String modifier, String arg) {
@@ -568,6 +599,9 @@
         System.out.println(rb.getString
                 (".strict.treat.warnings.as.errors"));
         System.out.println();
+        System.out.println(rb.getString
+                (".conf.url.specify.a.pre.configured.options.file"));
+        System.out.println();
 
         System.exit(0);
     }
diff --git a/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java b/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
index db35b1e..e858523 100644
--- a/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
+++ b/jdk/src/share/classes/sun/security/tools/jarsigner/Resources.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -108,6 +108,8 @@
                 "  [-providerArg <arg>]] ... master class file and constructor argument"},
         {".strict.treat.warnings.as.errors",
                 "[-strict]                   treat warnings as errors"},
+        {".conf.url.specify.a.pre.configured.options.file",
+                "[-conf <url>]               specify a pre-configured options file"},
         {"Option.lacks.argument", "Option lacks argument"},
         {"Please.type.jarsigner.help.for.usage", "Please type jarsigner -help for usage"},
         {"Please.specify.jarfile.name", "Please specify jarfile name"},
diff --git a/jdk/src/share/classes/sun/security/tools/keytool/Main.java b/jdk/src/share/classes/sun/security/tools/keytool/Main.java
index 7cd92d6..8eb4b0a 100644
--- a/jdk/src/share/classes/sun/security/tools/keytool/Main.java
+++ b/jdk/src/share/classes/sun/security/tools/keytool/Main.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -38,7 +38,6 @@
 import java.security.Timestamp;
 import java.security.UnrecoverableEntryException;
 import java.security.UnrecoverableKeyException;
-import java.security.NoSuchAlgorithmException;
 import java.security.Principal;
 import java.security.Provider;
 import java.security.cert.Certificate;
@@ -64,6 +63,7 @@
 import java.security.cert.X509CRLSelector;
 import javax.security.auth.x500.X500Principal;
 import java.util.Base64;
+
 import sun.security.util.ObjectIdentifier;
 import sun.security.pkcs10.PKCS10;
 import sun.security.pkcs10.PKCS10Attribute;
@@ -242,16 +242,44 @@
 
         final String description;
         final Option[] options;
+        final String name;
+
+        String altName;     // "genkey" is altName for "genkeypair"
+
         Command(String d, Option... o) {
             description = d;
             options = o;
+            name = "-" + name().toLowerCase(Locale.ENGLISH);
         }
         @Override
         public String toString() {
-            return "-" + name().toLowerCase(Locale.ENGLISH);
+            return name;
+        }
+        public String getAltName() {
+            return altName;
+        }
+        public void setAltName(String altName) {
+            this.altName = altName;
+        }
+        public static Command getCommand(String cmd) {
+            for (Command c: Command.values()) {
+                if (collator.compare(cmd, c.name) == 0
+                        || (c.altName != null
+                            && collator.compare(cmd, c.altName) == 0)) {
+                    return c;
+                }
+            }
+            return null;
         }
     };
 
+    static {
+        Command.GENKEYPAIR.setAltName("-genkey");
+        Command.IMPORTCERT.setAltName("-import");
+        Command.EXPORTCERT.setAltName("-export");
+        Command.IMPORTPASS.setAltName("-importpassword");
+    }
+
     enum Option {
         ALIAS("alias", "<alias>", "alias.name.of.the.entry.to.process"),
         DESTALIAS("destalias", "<destalias>", "destination.alias"),
@@ -335,7 +363,7 @@
 
     private void run(String[] args, PrintStream out) throws Exception {
         try {
-            parseArgs(args);
+            args = parseArgs(args);
             if (command != null) {
                 doCommands(out);
             }
@@ -366,11 +394,43 @@
     /**
      * Parse command line arguments.
      */
-    void parseArgs(String[] args) {
+    String[] parseArgs(String[] args) throws Exception {
 
         int i=0;
         boolean help = args.length == 0;
 
+        String confFile = null;
+
+        for (i=0; i < args.length; i++) {
+            String flags = args[i];
+            if (flags.startsWith("-")) {
+                if (collator.compare(flags, "-conf") == 0) {
+                    if (i == args.length - 1) {
+                        errorNeedArgument(flags);
+                    }
+                    confFile = args[++i];
+                } else {
+                    Command c = Command.getCommand(flags);
+                    if (c != null) command = c;
+                }
+            }
+        }
+
+        if (confFile != null && command != null) {
+            args = KeyStoreUtil.expandArgs("keytool", confFile,
+                    command.toString(),
+                    command.getAltName(), args);
+        }
+
+        debug = Arrays.stream(args).anyMatch(
+                x -> collator.compare(x, "-debug") == 0);
+
+        if (debug) {
+            // No need to localize debug output
+            System.out.println("Command line args: " +
+                    Arrays.toString(args));
+        }
+
         for (i=0; (i < args.length) && args[i].startsWith("-"); i++) {
 
             String flags = args[i];
@@ -395,34 +455,18 @@
                 modifier = flags.substring(pos+1);
                 flags = flags.substring(0, pos);
             }
+
             /*
              * command modes
              */
-            boolean isCommand = false;
-            for (Command c: Command.values()) {
-                if (collator.compare(flags, c.toString()) == 0) {
-                    command = c;
-                    isCommand = true;
-                    break;
-                }
-            }
+            Command c = Command.getCommand(flags);
 
-            if (isCommand) {
-                // already recognized as a command
-            } else if (collator.compare(flags, "-export") == 0) {
-                command = EXPORTCERT;
-            } else if (collator.compare(flags, "-genkey") == 0) {
-                command = GENKEYPAIR;
-            } else if (collator.compare(flags, "-import") == 0) {
-                command = IMPORTCERT;
-            } else if (collator.compare(flags, "-importpassword") == 0) {
-                command = IMPORTPASS;
-            }
-            /*
-             * Help
-             */
-            else if (collator.compare(flags, "-help") == 0) {
+            if (c != null) {
+                command = c;
+            } else if (collator.compare(flags, "-help") == 0) {
                 help = true;
+            } else if (collator.compare(flags, "-conf") == 0) {
+                i++;
             }
 
             /*
@@ -522,7 +566,7 @@
             else if (collator.compare(flags, "-v") == 0) {
                 verbose = true;
             } else if (collator.compare(flags, "-debug") == 0) {
-                debug = true;
+                // Already processed
             } else if (collator.compare(flags, "-rfc") == 0) {
                 rfc = true;
             } else if (collator.compare(flags, "-noprompt") == 0) {
@@ -556,6 +600,8 @@
             usage();
             command = null;
         }
+
+        return args;
     }
 
     boolean isKeyStoreRelated(Command cmd) {
diff --git a/jdk/src/share/classes/sun/security/tools/keytool/Resources.java b/jdk/src/share/classes/sun/security/tools/keytool/Resources.java
index 6199927..00922de 100644
--- a/jdk/src/share/classes/sun/security/tools/keytool/Resources.java
+++ b/jdk/src/share/classes/sun/security/tools/keytool/Resources.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -48,7 +48,8 @@
                  "Key and Certificate Management Tool"},
         {"Commands.", "Commands:"},
         {"Use.keytool.command.name.help.for.usage.of.command.name",
-                "Use \"keytool -command_name -help\" for usage of command_name"},
+                "Use \"keytool -command_name -help\" for usage of command_name.\n" +
+                "Use the -conf <url> option to specify a pre-configured options file."},
         // keytool: help: commands
         {"Generates.a.certificate.request",
                 "Generates a certificate request"}, //-certreq
diff --git a/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java b/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java
index 862b07c..bf2e951 100644
--- a/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java
+++ b/jdk/src/share/classes/sun/tools/attach/HotSpotVirtualMachine.java
@@ -33,7 +33,7 @@
 import java.io.InputStream;
 import java.io.IOException;
 import java.util.Properties;
-import java.util.Map;
+import java.util.stream.Collectors;
 
 /*
  * The HotSpot implementation of com.sun.tools.attach.VirtualMachine.
@@ -161,6 +161,50 @@
         return props;
     }
 
+    private static final String MANAGMENT_PREFIX = "com.sun.management.";
+
+    private static boolean checkedKeyName(Object key) {
+        if (!(key instanceof String)) {
+            throw new IllegalArgumentException("Invalid option (not a String): "+key);
+        }
+        if (!((String)key).startsWith(MANAGMENT_PREFIX)) {
+            throw new IllegalArgumentException("Invalid option: "+key);
+        }
+        return true;
+    }
+
+    private static String stripKeyName(Object key) {
+        return ((String)key).substring(MANAGMENT_PREFIX.length());
+    }
+
+    @Override
+    public void startManagementAgent(Properties agentProperties) throws IOException {
+        if (agentProperties == null) {
+            throw new NullPointerException("agentProperties cannot be null");
+        }
+        // Convert the arguments into arguments suitable for the Diagnostic Command:
+        // "ManagementAgent.start jmxremote.port=5555 jmxremote.authenticate=false"
+        String args = agentProperties.entrySet().stream()
+            .filter(entry -> checkedKeyName(entry.getKey()))
+            .map(entry -> stripKeyName(entry.getKey()) + "=" + escape(entry.getValue()))
+            .collect(Collectors.joining(" "));
+        executeJCmd("ManagementAgent.start " + args);
+    }
+
+    private String escape(Object arg) {
+        String value = arg.toString();
+        if (value.contains(" ")) {
+            return "'" + value + "'";
+        }
+        return value;
+    }
+
+    @Override
+    public String startLocalManagementAgent() throws IOException {
+        executeJCmd("ManagementAgent.start_local");
+        return getAgentProperties().getProperty("com.sun.management.jmxremote.localConnectorAddress");
+    }
+
     // --- HotSpot specific methods ---
 
     // same as SIGQUIT
diff --git a/jdk/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java b/jdk/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
index 65b03e0..e6c827b 100644
--- a/jdk/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
+++ b/jdk/src/share/classes/sun/tools/jconsole/LocalVirtualMachine.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,8 +32,6 @@
 // Sun specific
 import com.sun.tools.attach.VirtualMachine;
 import com.sun.tools.attach.VirtualMachineDescriptor;
-import com.sun.tools.attach.AgentInitializationException;
-import com.sun.tools.attach.AgentLoadException;
 import com.sun.tools.attach.AttachNotSupportedException;
 
 // Sun private
@@ -238,35 +236,7 @@
             throw ioe;
         }
 
-        String home = vm.getSystemProperties().getProperty("java.home");
-
-        // Normally in ${java.home}/jre/lib/management-agent.jar but might
-        // be in ${java.home}/lib in build environments.
-
-        String agent = home + File.separator + "jre" + File.separator +
-                           "lib" + File.separator + "management-agent.jar";
-        File f = new File(agent);
-        if (!f.exists()) {
-            agent = home + File.separator +  "lib" + File.separator +
-                        "management-agent.jar";
-            f = new File(agent);
-            if (!f.exists()) {
-                throw new IOException("Management agent not found");
-            }
-        }
-
-        agent = f.getCanonicalPath();
-        try {
-            vm.loadAgent(agent, "com.sun.management.jmxremote");
-        } catch (AgentLoadException x) {
-            IOException ioe = new IOException(x.getMessage());
-            ioe.initCause(x);
-            throw ioe;
-        } catch (AgentInitializationException x) {
-            IOException ioe = new IOException(x.getMessage());
-            ioe.initCause(x);
-            throw ioe;
-        }
+        vm.startLocalManagementAgent();
 
         // get the connector address
         Properties agentProps = vm.getAgentProperties();
diff --git a/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java b/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
index 05c8276..56aa0c1 100644
--- a/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
+++ b/jdk/src/share/classes/sun/tools/jconsole/ProxyClient.java
@@ -954,7 +954,7 @@
             final InvocationHandler ih = new SnapshotInvocationHandler(mbsc);
             return (SnapshotMBeanServerConnection) Proxy.newProxyInstance(
                     Snapshot.class.getClassLoader(),
-                    new Class[] {SnapshotMBeanServerConnection.class},
+                    new Class<?>[] {SnapshotMBeanServerConnection.class},
                     ih);
         }
     }
diff --git a/jdk/src/share/classes/sun/tools/jconsole/TimeComboBox.java b/jdk/src/share/classes/sun/tools/jconsole/TimeComboBox.java
index d45ac6d..55b5d39 100644
--- a/jdk/src/share/classes/sun/tools/jconsole/TimeComboBox.java
+++ b/jdk/src/share/classes/sun/tools/jconsole/TimeComboBox.java
@@ -37,7 +37,7 @@
  * them.
  */
 @SuppressWarnings("serial")
-public class TimeComboBox extends JComboBox implements ItemListener, PropertyChangeListener {
+public class TimeComboBox extends JComboBox<String> implements ItemListener, PropertyChangeListener {
     private ArrayList<Plotter> plotters = new ArrayList<Plotter>();
 
     public TimeComboBox(Plotter... plotterArray) {
diff --git a/jdk/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java b/jdk/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
index 7822c88..4f48bae 100644
--- a/jdk/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/OperationEntry.java
@@ -32,7 +32,6 @@
 @SuppressWarnings("serial")
 public class OperationEntry extends JPanel {
     private MBeanOperationInfo operation;
-    private JComboBox sigs;
     private XTextField inputs[];
 
     public OperationEntry (MBeanOperationInfo operation,
diff --git a/jdk/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java b/jdk/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
index 486243e..c25d9a2 100644
--- a/jdk/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
+++ b/jdk/src/share/classes/sun/tools/jconsole/inspector/TableSorter.java
@@ -146,7 +146,7 @@
         // update row heights in XMBeanAttributes (required by expandable cells)
         if (attrs != null) {
             for (int i = 0; i < getRowCount(); i++) {
-                Vector data = (Vector) dataVector.elementAt(i);
+                Vector<?> data = (Vector) dataVector.elementAt(i);
                 attrs.updateRowHeight(data.elementAt(1), i);
             }
         }
@@ -217,17 +217,17 @@
             }
     }
 
-    private Vector getRow(int row) {
+    private Vector<?> getRow(int row) {
         return (Vector) dataVector.elementAt(row);
     }
 
     @SuppressWarnings("unchecked")
-    private void setRow(Vector data, int row) {
+    private void setRow(Vector<?> data, int row) {
         dataVector.setElementAt(data,row);
     }
 
     private void swap(int i, int j, int column) {
-        Vector data = getRow(i);
+        Vector<?> data = getRow(i);
         setRow(getRow(j),i);
         setRow(data,j);
 
diff --git a/jdk/src/share/classes/sun/tools/jmap/JMap.java b/jdk/src/share/classes/sun/tools/jmap/JMap.java
index 5d349fc..f6dd404 100644
--- a/jdk/src/share/classes/sun/tools/jmap/JMap.java
+++ b/jdk/src/share/classes/sun/tools/jmap/JMap.java
@@ -194,7 +194,7 @@
         }
 
         // invoke the main method with the arguments
-        Class[] argTypes = { String[].class } ;
+        Class<?>[] argTypes = { String[].class } ;
         Method m = c.getDeclaredMethod("main", argTypes);
 
         Object[] invokeArgs = { args };
diff --git a/jdk/src/share/classes/sun/tools/jstack/JStack.java b/jdk/src/share/classes/sun/tools/jstack/JStack.java
index 6c96af2..2b0f59c 100644
--- a/jdk/src/share/classes/sun/tools/jstack/JStack.java
+++ b/jdk/src/share/classes/sun/tools/jstack/JStack.java
@@ -133,7 +133,7 @@
             args = prepend("-l", args);
         }
 
-        Class[] argTypes = { String[].class };
+        Class<?>[] argTypes = { String[].class };
         Method m = cl.getDeclaredMethod("main", argTypes);
 
         Object[] invokeArgs = { args };
diff --git a/jdk/src/share/classes/sun/tools/jstat/Alignment.java b/jdk/src/share/classes/sun/tools/jstat/Alignment.java
index a421bfe..8cd865d 100644
--- a/jdk/src/share/classes/sun/tools/jstat/Alignment.java
+++ b/jdk/src/share/classes/sun/tools/jstat/Alignment.java
@@ -110,7 +110,7 @@
      *
      * @return     Set of Key Words for this enumeration.
      */
-    public static Set keySet() {
+    public static Set<String> keySet() {
         return map.keySet();
     }
 
diff --git a/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java b/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java
index 97fb4a8..685b978 100644
--- a/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java
+++ b/jdk/src/share/classes/sun/tools/jstat/ColumnFormat.java
@@ -143,8 +143,8 @@
                 + ";format=" + format + ";width=" + width
                 + ";scale=" + scale.toString() + ";align=" + align.toString());
 
-        for (Iterator i = children.iterator();  i.hasNext(); /* empty */) {
-            OptionFormat of = (OptionFormat)i.next();
+        for (Iterator<OptionFormat> i = children.iterator();  i.hasNext(); /* empty */) {
+            OptionFormat of = i.next();
             of.printFormat(indentLevel+1);
         }
 
diff --git a/jdk/src/share/classes/sun/tools/jstat/Jstat.java b/jdk/src/share/classes/sun/tools/jstat/Jstat.java
index ad1e069..072b063 100644
--- a/jdk/src/share/classes/sun/tools/jstat/Jstat.java
+++ b/jdk/src/share/classes/sun/tools/jstat/Jstat.java
@@ -116,8 +116,8 @@
             Collections.sort(logged, arguments.comparator());
             List<Monitor> constants = new ArrayList<Monitor>();
 
-            for (Iterator i = logged.iterator(); i.hasNext(); /* empty */) {
-                Monitor m = (Monitor)i.next();
+            for (Iterator<Monitor> i = logged.iterator(); i.hasNext(); /* empty */) {
+                Monitor m = i.next();
                 if (!(m.isSupported() || arguments.showUnsupported())) {
                     i.remove();
                     continue;
diff --git a/jdk/src/share/classes/sun/tools/jstat/Operator.java b/jdk/src/share/classes/sun/tools/jstat/Operator.java
index 05fa53c..b7c3671 100644
--- a/jdk/src/share/classes/sun/tools/jstat/Operator.java
+++ b/jdk/src/share/classes/sun/tools/jstat/Operator.java
@@ -105,7 +105,7 @@
      * @param   s  an string to match against Operator objects.
      * @return     The Operator object matching the given string.
      */
-    protected static Set keySet() {
+    protected static Set<?> keySet() {
         return map.keySet();
     }
 }
diff --git a/jdk/src/share/classes/sun/tools/jstat/OptionFormat.java b/jdk/src/share/classes/sun/tools/jstat/OptionFormat.java
index fb27587..c5d9f79 100644
--- a/jdk/src/share/classes/sun/tools/jstat/OptionFormat.java
+++ b/jdk/src/share/classes/sun/tools/jstat/OptionFormat.java
@@ -77,13 +77,13 @@
 
     public void apply(Closure c) throws MonitorException {
 
-      for (Iterator i = children.iterator(); i.hasNext(); /* empty */) {
-          OptionFormat o = (OptionFormat)i.next();
+      for (Iterator<OptionFormat> i = children.iterator(); i.hasNext(); /* empty */) {
+          OptionFormat o = i.next();
           c.visit(o, i.hasNext());
       }
 
-      for (Iterator i = children.iterator(); i.hasNext(); /* empty */) {
-          OptionFormat o = (OptionFormat)i.next();
+      for (Iterator <OptionFormat>i = children.iterator(); i.hasNext(); /* empty */) {
+          OptionFormat o = i.next();
           o.apply(c);
       }
     }
diff --git a/jdk/src/share/classes/sun/tools/jstat/Parser.java b/jdk/src/share/classes/sun/tools/jstat/Parser.java
index 9687371..33b17b9 100644
--- a/jdk/src/share/classes/sun/tools/jstat/Parser.java
+++ b/jdk/src/share/classes/sun/tools/jstat/Parser.java
@@ -63,8 +63,8 @@
 
     private static final String START = OPTION;
 
-    private static final Set scaleKeyWords = Scale.keySet();
-    private static final Set alignKeyWords = Alignment.keySet();
+    private static final Set<String> scaleKeyWords = Scale.keySet();
+    private static final Set<String> alignKeyWords = Alignment.keySet();
     private static String[] otherKeyWords = {
         OPTION, COLUMN, DATA, HEADER, WIDTH, FORMAT, ALIGN, SCALE
     };
@@ -141,7 +141,7 @@
      * token is assumed to be of type TT_WORD, and the set is assumed
      * to contain String objects.
      */
-    private Token matchOne(Set keyWords) throws ParserException, IOException {
+    private Token matchOne(Set<String> keyWords) throws ParserException, IOException {
         if ((lookahead.ttype == StreamTokenizer.TT_WORD)
                 && keyWords.contains(lookahead.sval)) {
             Token t = lookahead;
diff --git a/jdk/src/share/classes/sun/tools/jstat/RawOutputFormatter.java b/jdk/src/share/classes/sun/tools/jstat/RawOutputFormatter.java
index c980d5d..614af44 100644
--- a/jdk/src/share/classes/sun/tools/jstat/RawOutputFormatter.java
+++ b/jdk/src/share/classes/sun/tools/jstat/RawOutputFormatter.java
@@ -35,11 +35,11 @@
  * @since 1.5
  */
 public class RawOutputFormatter implements OutputFormatter {
-    private List logged;
+    private List<Monitor> logged;
     private String header;
     private boolean printStrings;
 
-    public RawOutputFormatter(List logged, boolean printStrings) {
+    public RawOutputFormatter(List<Monitor> logged, boolean printStrings) {
         this.logged = logged;
         this.printStrings = printStrings;
     }
@@ -48,8 +48,8 @@
         if (header == null) {
             // build the header string and prune out any unwanted monitors
             StringBuilder headerBuilder = new StringBuilder();
-            for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) {
-                Monitor m = (Monitor)i.next();
+            for (Iterator<Monitor> i = logged.iterator(); i.hasNext(); /* empty */ ) {
+                Monitor m = i.next();
                 headerBuilder.append(m.getName() + " ");
             }
             header = headerBuilder.toString();
@@ -60,8 +60,8 @@
     public String getRow() throws MonitorException {
         StringBuilder row = new StringBuilder();
         int count = 0;
-        for (Iterator i = logged.iterator(); i.hasNext(); /* empty */ ) {
-            Monitor m = (Monitor)i.next();
+        for (Iterator<Monitor> i = logged.iterator(); i.hasNext(); /* empty */ ) {
+            Monitor m = i.next();
             if (count++ > 0) {
                 row.append(" ");
             }
diff --git a/jdk/src/share/classes/sun/tools/jstat/Scale.java b/jdk/src/share/classes/sun/tools/jstat/Scale.java
index e08a031..9663ccc 100644
--- a/jdk/src/share/classes/sun/tools/jstat/Scale.java
+++ b/jdk/src/share/classes/sun/tools/jstat/Scale.java
@@ -175,7 +175,7 @@
      * @param   s  an string to match against Scale objects.
      * @return     The Scale object matching the given string.
      */
-    protected static Set keySet() {
+    protected static Set<String> keySet() {
         return map.keySet();
     }
 
diff --git a/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java b/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java
index 65a058c..1e1b2a1 100644
--- a/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java
+++ b/jdk/src/share/classes/sun/tools/jstat/SyntaxException.java
@@ -62,14 +62,14 @@
                   + ", Found " + found.toMessage();
     }
 
-    public SyntaxException(int lineno, Set expected, Token found) {
+    public SyntaxException(int lineno, Set<String> expected, Token found) {
         StringBuilder msg = new StringBuilder();
 
         msg.append("Syntax error at line " + lineno + ": Expected one of \'");
 
         boolean first = true;
-        for (Iterator i = expected.iterator(); i.hasNext(); /* empty */) {
-            String keyWord = (String)i.next();
+        for (Iterator<String> i = expected.iterator(); i.hasNext(); /* empty */) {
+            String keyWord = i.next();
             if (first) {
                 msg.append(keyWord);
                 first = false;
diff --git a/jdk/src/share/classes/sun/tools/serialver/resources/serialver_ja.properties b/jdk/src/share/classes/sun/tools/serialver/resources/serialver_ja.properties
index 0feef10..e468e9c 100644
--- a/jdk/src/share/classes/sun/tools/serialver/resources/serialver_ja.properties
+++ b/jdk/src/share/classes/sun/tools/serialver/resources/serialver_ja.properties
@@ -1,13 +1,6 @@
-SerialVersionInspector=\u30B7\u30EA\u30A2\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3\u30FB\u30A4\u30F3\u30B9\u30DA\u30AF\u30BF
-File=\u30D5\u30A1\u30A4\u30EB
-Exit=\u7D42\u4E86
-Show=\u8868\u793A
-FullClassName=\u5B8C\u5168\u30AF\u30E9\u30B9\u540D:
-SerialVersion=\u30B7\u30EA\u30A2\u30EB\u30FB\u30D0\u30FC\u30B8\u30E7\u30F3:
 NotSerializable=\u30AF\u30E9\u30B9{0}\u306F\u76F4\u5217\u5316\u3067\u304D\u307E\u305B\u3093\u3002
 ClassNotFound=\u30AF\u30E9\u30B9{0}\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002
 error.parsing.classpath=\u30AF\u30E9\u30B9\u30D1\u30B9{0}\u306E\u89E3\u6790\u30A8\u30E9\u30FC\u3067\u3059\u3002
 error.missing.classpath=-classpath\u30AA\u30D7\u30B7\u30E7\u30F3\u306E\u5F15\u6570\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093
 invalid.flag=\u7121\u52B9\u306A\u30D5\u30E9\u30B0{0}\u3002
-ignoring.classes=-show\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u6301\u3064\u30AF\u30E9\u30B9\u5F15\u6570\u3092\u6307\u5B9A\u3067\u304D\u307E\u305B\u3093
-usage=\u4F7F\u7528\u65B9\u6CD5: serialver [-classpath classpath] [-show] [classname...]
+usage=\u4F7F\u7528\u65B9\u6CD5: serialver [-classpath classpath] [classname...]
diff --git a/jdk/src/share/classes/sun/tools/serialver/resources/serialver_zh_CN.properties b/jdk/src/share/classes/sun/tools/serialver/resources/serialver_zh_CN.properties
index 526a1e3..87a6eb7 100644
--- a/jdk/src/share/classes/sun/tools/serialver/resources/serialver_zh_CN.properties
+++ b/jdk/src/share/classes/sun/tools/serialver/resources/serialver_zh_CN.properties
@@ -1,13 +1,6 @@
-SerialVersionInspector=\u5E8F\u5217\u7248\u672C\u68C0\u67E5\u5668
-File=\u6587\u4EF6
-Exit=\u9000\u51FA
-Show=\u663E\u793A
-FullClassName=\u5B8C\u6574\u7684\u7C7B\u540D:
-SerialVersion=\u5E8F\u5217\u7248\u672C:
 NotSerializable=\u7C7B{0}\u65E0\u6CD5\u5E8F\u5217\u5316\u3002
 ClassNotFound=\u627E\u4E0D\u5230\u7C7B{0}\u3002
 error.parsing.classpath=\u89E3\u6790\u7C7B\u8DEF\u5F84 {0} \u65F6\u51FA\u9519\u3002
 error.missing.classpath=\u7F3A\u5C11 -classpath \u9009\u9879\u7684\u53C2\u6570
 invalid.flag=\u65E0\u6548\u6807\u8BB0{0}\u3002
-ignoring.classes=\u65E0\u6CD5\u4F7F\u7528 -show \u9009\u9879\u6307\u5B9A\u7C7B\u53C2\u6570
-usage=\u7528\u6CD5: serialver [-classpath \u7C7B\u8DEF\u5F84] [-show] [\u7C7B\u540D\u79F0...]
+usage=\u7528\u6CD5: serialver [-classpath \u7C7B\u8DEF\u5F84] [\u7C7B\u540D\u79F0...]
diff --git a/jdk/src/share/native/sun/security/ec/impl/mpi.c b/jdk/src/share/native/sun/security/ec/impl/mpi.c
index 3149fa2..496916a 100644
--- a/jdk/src/share/native/sun/security/ec/impl/mpi.c
+++ b/jdk/src/share/native/sun/security/ec/impl/mpi.c
@@ -3376,7 +3376,7 @@
 #if !defined(MP_NO_MP_WORD) && !defined(MP_NO_DIV_WORD)
   mp_word   w = 0, q;
 #else
-  mp_digit  w, q;
+  mp_digit  w = 0, q;
 #endif
   int       ix;
   mp_err    res;
diff --git a/jdk/src/share/native/sun/security/krb5/nativeccache.c b/jdk/src/share/native/sun/security/krb5/nativeccache.c
index beb5bf0..667313d 100644
--- a/jdk/src/share/native/sun/security/krb5/nativeccache.c
+++ b/jdk/src/share/native/sun/security/krb5/nativeccache.c
@@ -82,9 +82,6 @@
         printf("Couldn't find %s\n", className);
         return NULL;
     }
-#ifdef DEBUG
-    printf("Found %s\n", className);
-#endif /* DEBUG */
 
     jobject returnValue = (*env)->NewWeakGlobalRef(env,cls);
     return returnValue;
@@ -136,85 +133,54 @@
         printf("Couldn't find DerValue constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found DerValue constructor\n");
-#endif /* DEBUG */
 
     ticketConstructor = (*env)->GetMethodID(env, ticketClass, "<init>", "(Lsun/security/util/DerValue;)V");
     if (ticketConstructor == 0) {
         printf("Couldn't find Ticket constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found Ticket constructor\n");
-#endif /* DEBUG */
 
     principalNameConstructor = (*env)->GetMethodID(env, principalNameClass, "<init>", "(Ljava/lang/String;I)V");
     if (principalNameConstructor == 0) {
         printf("Couldn't find PrincipalName constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found PrincipalName constructor\n");
-#endif /* DEBUG */
 
     encryptionKeyConstructor = (*env)->GetMethodID(env, encryptionKeyClass, "<init>", "(I[B)V");
     if (encryptionKeyConstructor == 0) {
         printf("Couldn't find EncryptionKey constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found EncryptionKey constructor\n");
-#endif /* DEBUG */
 
     ticketFlagsConstructor = (*env)->GetMethodID(env, ticketFlagsClass, "<init>", "(I[B)V");
     if (ticketFlagsConstructor == 0) {
         printf("Couldn't find TicketFlags constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found TicketFlags constructor\n");
-#endif /* DEBUG */
 
     kerberosTimeConstructor = (*env)->GetMethodID(env, kerberosTimeClass, "<init>", "(J)V");
     if (kerberosTimeConstructor == 0) {
         printf("Couldn't find KerberosTime constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found KerberosTime constructor\n");
-#endif /* DEBUG */
 
     integerConstructor = (*env)->GetMethodID(env, javaLangIntegerClass, "<init>", "(I)V");
     if (integerConstructor == 0) {
         printf("Couldn't find Integer constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found Integer constructor\n");
-#endif /* DEBUG */
 
     hostAddressConstructor = (*env)->GetMethodID(env, hostAddressClass, "<init>", "(I[B)V");
     if (hostAddressConstructor == 0) {
         printf("Couldn't find HostAddress constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found HostAddress constructor\n");
-#endif /* DEBUG */
 
     hostAddressesConstructor = (*env)->GetMethodID(env, hostAddressesClass, "<init>", "([Lsun/security/krb5/internal/HostAddress;)V");
     if (hostAddressesConstructor == 0) {
         printf("Couldn't find HostAddresses constructor\n");
         return JNI_ERR;
     }
-#ifdef DEBUG
-    printf("Found HostAddresses constructor\n");
-#endif /* DEBUG */
-
-#ifdef DEBUG
-    printf("Finished OnLoad processing\n");
-#endif /* DEBUG */
 
     return JNI_VERSION_1_2;
 }
diff --git a/jdk/src/solaris/classes/java/io/FileDescriptor.java b/jdk/src/solaris/classes/java/io/FileDescriptor.java
index 1f0d086..4017b3a 100644
--- a/jdk/src/solaris/classes/java/io/FileDescriptor.java
+++ b/jdk/src/solaris/classes/java/io/FileDescriptor.java
@@ -41,7 +41,7 @@
  * @author  Pavani Diwanji
  * @see     java.io.FileInputStream
  * @see     java.io.FileOutputStream
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class FileDescriptor {
 
@@ -126,7 +126,7 @@
      *        Thrown when the buffers cannot be flushed,
      *        or because the system cannot guarantee that all the
      *        buffers have been synchronized with physical media.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public native void sync() throws SyncFailedException;
 
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XAtom.java b/jdk/src/solaris/classes/sun/awt/X11/XAtom.java
index 2d37879..4b31c9a 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XAtom.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XAtom.java
@@ -52,7 +52,7 @@
  * XAtom xa = new XAtom(display,XAtom.XA_CUT_BUFFER0);<p>
  * String selection = xa.getProperty(root_window);<p></code>
  * @author  Bino George
- * @since       JDK1.5
+ * @since       1.5
  */
 
 import sun.misc.Unsafe;
diff --git a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
index 6cc7062..450a375 100644
--- a/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
+++ b/jdk/src/solaris/classes/sun/awt/X11/XComponentPeer.java
@@ -677,7 +677,7 @@
      * @see       #getPeer
      * @see       java.awt.peer.ComponentPeer#getFontMetrics(Font)
      * @see       Toolkit#getFontMetrics(Font)
-     * @since     JDK1.0
+     * @since     1.0
      */
     public FontMetrics getFontMetrics(Font font) {
         if (fontLog.isLoggable(PlatformLogger.Level.FINE)) {
diff --git a/jdk/src/solaris/classes/sun/awt/X11InputMethodDescriptor.java b/jdk/src/solaris/classes/sun/awt/X11InputMethodDescriptor.java
index e654510..d050250 100644
--- a/jdk/src/solaris/classes/sun/awt/X11InputMethodDescriptor.java
+++ b/jdk/src/solaris/classes/sun/awt/X11InputMethodDescriptor.java
@@ -40,7 +40,7 @@
  * to enable selection and loading of that input method.
  * The input method itself is only loaded when it is actually used.
  *
- * @since JDK1.3
+ * @since 1.3
  */
 
 public abstract class X11InputMethodDescriptor implements InputMethodDescriptor {
diff --git a/jdk/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java b/jdk/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java
index edd99ff..559fda4 100644
--- a/jdk/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java
+++ b/jdk/src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java
@@ -38,7 +38,7 @@
  * and cache Jar files.
  *
  * @author Benjamin Renaud
- * @since JDK1.2
+ * @since 1.2
  */
 class JarFileFactory implements URLJarFile.URLJarFileCloseController {
 
diff --git a/jdk/src/solaris/demo/jni/Poller/Poller.java b/jdk/src/solaris/demo/jni/Poller/Poller.java
index 745fd99..a144dfb 100644
--- a/jdk/src/solaris/demo/jni/Poller/Poller.java
+++ b/jdk/src/solaris/demo/jni/Poller/Poller.java
@@ -58,7 +58,7 @@
  * @see     java.io.FileDescriptor
  * @see     java.net.Socket
  * @see     attached README.txt
- * @since   JDK1.2
+ * @since   1.2
  */
 
 public class Poller {
diff --git a/jdk/src/windows/classes/java/io/FileDescriptor.java b/jdk/src/windows/classes/java/io/FileDescriptor.java
index bfcda5b..c8cbc21 100644
--- a/jdk/src/windows/classes/java/io/FileDescriptor.java
+++ b/jdk/src/windows/classes/java/io/FileDescriptor.java
@@ -38,7 +38,7 @@
  * <p>Applications should not create their own file descriptors.
  *
  * @author  Pavani Diwanji
- * @since   JDK1.0
+ * @since   1.0
  */
 public final class FileDescriptor {
 
@@ -149,7 +149,7 @@
      *        Thrown when the buffers cannot be flushed,
      *        or because the system cannot guarantee that all the
      *        buffers have been synchronized with physical media.
-     * @since     JDK1.1
+     * @since     1.1
      */
     public native void sync() throws SyncFailedException;
 
diff --git a/jdk/src/windows/classes/sun/awt/windows/WClipboard.java b/jdk/src/windows/classes/sun/awt/windows/WClipboard.java
index d51ed94..3e82560 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WClipboard.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WClipboard.java
@@ -45,7 +45,7 @@
  * @author Danila Sinopalnikov
  * @author Alexander Gerasimov
  *
- * @since JDK1.1
+ * @since 1.1
  */
 final class WClipboard extends SunClipboard {
 
diff --git a/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java b/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java
index 36280f2..c674542 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WDragSourceContextPeer.java
@@ -48,7 +48,7 @@
  * TBC
  * </p>
  *
- * @since JDK1.2
+ * @since 1.2
  *
  */
 
diff --git a/jdk/src/windows/classes/sun/awt/windows/WInputMethodDescriptor.java b/jdk/src/windows/classes/sun/awt/windows/WInputMethodDescriptor.java
index 1885b0a..6295407 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WInputMethodDescriptor.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WInputMethodDescriptor.java
@@ -37,7 +37,7 @@
  * to enable selection and loading of that input method.
  * The input method itself is only loaded when it is actually used.
  *
- * @since JDK1.3
+ * @since 1.3
  */
 
 final class WInputMethodDescriptor implements InputMethodDescriptor {
diff --git a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
index 8e44064..8366598 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
@@ -120,7 +120,7 @@
      * a copy of this <code>Graphics</code> object.
      * @return     a new graphics context that is a copy of
      *                       this graphics context.
-     * @since      JDK1.0
+     * @since      1.0
      */
     @Override
     public Graphics create() {
@@ -253,7 +253,7 @@
      * @param       y        the <i>y</i> coordinate.
      * @see         java.awt.Graphics#drawBytes
      * @see         java.awt.Graphics#drawChars
-     * @since       JDK1.0
+     * @since       1.0
      */
     @Override
     public void drawString(String str, int x, int y) {
diff --git a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java
index 5adc648..23a71fe 100644
--- a/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java
+++ b/jdk/src/windows/classes/sun/awt/windows/WPrinterJob.java
@@ -419,7 +419,7 @@
      * @exception HeadlessException if GraphicsEnvironment.isHeadless()
      * returns true.
      * @see java.awt.GraphicsEnvironment#isHeadless
-     * @since     JDK1.2
+     * @since     1.2
      */
     @Override
     public PageFormat pageDialog(PageFormat page) throws HeadlessException {
diff --git a/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java b/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java
index 4de9396..07db32f 100644
--- a/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java
+++ b/jdk/src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java
@@ -38,7 +38,7 @@
  * and cache Jar files.
  *
  * @author Benjamin Renaud
- * @since JDK1.2
+ * @since 1.2
  */
 class JarFileFactory implements URLJarFile.URLJarFileCloseController {
 
diff --git a/jdk/test/com/sun/tools/attach/SimpleProvider.java b/jdk/test/com/sun/tools/attach/SimpleProvider.java
index 2a380f5..54f3dad 100644
--- a/jdk/test/com/sun/tools/attach/SimpleProvider.java
+++ b/jdk/test/com/sun/tools/attach/SimpleProvider.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -100,4 +100,12 @@
 
     public void dataDumpRequest() throws IOException {
     }
+
+    public String startLocalManagementAgent() {
+        return null;
+    }
+
+    public void startManagementAgent(Properties agentProperties) {
+    }
+
 }
diff --git a/jdk/test/com/sun/tools/attach/StartManagementAgent.java b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
new file mode 100644
index 0000000..c7a3946
--- /dev/null
+++ b/jdk/test/com/sun/tools/attach/StartManagementAgent.java
@@ -0,0 +1,211 @@
+/*
+ * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.tools.attach.AttachOperationFailedException;
+import com.sun.tools.attach.VirtualMachine;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.util.Properties;
+import java.util.HashMap;
+
+import javax.management.remote.JMXServiceURL;
+import javax.management.remote.JMXConnector;
+import javax.management.remote.JMXConnectorFactory;
+
+import jdk.testlibrary.ProcessThread;
+import jdk.testlibrary.Utils;
+
+/*
+ * @test
+ * @summary Test for VirtualMachine.startManagementAgent and VirtualMachine.startLocalManagementAgent
+ * @library /lib/testlibrary
+ * @run build Application Shutdown
+ * @run main StartManagementAgent
+ */
+
+/*
+ * This test is not meant to test all possible configuration parameters to
+ * the JMX agent, there are other tests for that. This test makes sure it is
+ * possible to start the agent via attach.
+ */
+public class StartManagementAgent {
+    public static void main(String[] args) throws Throwable {
+        final String pidFile = "StartManagementAgent.Application.pid";
+        ProcessThread processThread = null;
+        RunnerUtil.ProcessInfo info = null;
+        try {
+            processThread = RunnerUtil.startApplication(pidFile);
+            info = RunnerUtil.readProcessInfo(pidFile);
+            runTests(info.pid);
+        } catch (Throwable t) {
+            System.out.println("StartManagementAgent got unexpected exception: " + t);
+            t.printStackTrace();
+            throw t;
+        } finally {
+            // Make sure the Application process is stopped.
+            RunnerUtil.stopApplication(info.shutdownPort, processThread);
+        }
+    }
+
+    private static void basicTests(VirtualMachine vm) throws Exception {
+
+        // Try calling with null argument
+        boolean exception = false;
+        try {
+            vm.startManagementAgent(null);
+        } catch (NullPointerException e) {
+            exception = true;
+        }
+        if (!exception) {
+            throw new Exception("startManagementAgent(null) should throw NPE");
+        }
+
+        // Try calling with a property value with a space in it
+        Properties p = new Properties();
+        File f = new File("file with space");
+        try (FileWriter fw = new FileWriter(f)) {
+            fw.write("com.sun.management.jmxremote.port=apa");
+        }
+        p.put("com.sun.management.config.file", f.getAbsolutePath());
+        try {
+            vm.startManagementAgent(p);
+        } catch(AttachOperationFailedException ex) {
+            // We expect parsing of "apa" above to fail, but if the file path
+            // can't be read we get a different exception message
+            if (!ex.getMessage().contains("java.lang.NumberFormatException")) {
+                throw ex;
+            }
+        }
+    }
+
+    private static final String LOCAL_CONNECTOR_ADDRESS_PROP =
+        "com.sun.management.jmxremote.localConnectorAddress";
+
+    private static final int MAX_RETRIES = 10;
+
+    public static void runTests(int pid) throws Exception {
+        VirtualMachine vm = VirtualMachine.attach(""+pid);
+        try {
+
+            basicTests(vm);
+
+            testLocalAgent(vm);
+
+            // we retry the remote case several times in case the error
+            // was caused by a port conflict
+            int i = 0;
+            boolean success = false;
+            do {
+                try {
+                    System.err.println("Trying remote agent. Try #" + i);
+                    testRemoteAgent(vm);
+                    success = true;
+                } catch(Exception ex) {
+                    System.err.println("testRemoteAgent failed with exception:");
+                    ex.printStackTrace();
+                    System.err.println("Retrying.");
+                }
+                i++;
+            } while(!success && i < MAX_RETRIES);
+            if (!success) {
+                throw new Exception("testRemoteAgent failed after " + MAX_RETRIES + " tries");
+            }
+        } finally {
+            vm.detach();
+        }
+    }
+
+    public static void testLocalAgent(VirtualMachine vm) throws Exception {
+        Properties agentProps = vm.getAgentProperties();
+        String address = (String) agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP);
+        if (address != null) {
+            throw new Exception("Local management agent already started");
+        }
+
+        String result = vm.startLocalManagementAgent();
+
+        // try to parse the return value as a JMXServiceURL
+        new JMXServiceURL(result);
+
+        agentProps = vm.getAgentProperties();
+        address = (String) agentProps.get(LOCAL_CONNECTOR_ADDRESS_PROP);
+        if (address == null) {
+            throw new Exception("Local management agent could not be started");
+        }
+    }
+
+    public static void testRemoteAgent(VirtualMachine vm) throws Exception {
+        int port = Utils.getFreePort();
+
+        // try to connect - should fail
+        tryConnect(port, false);
+
+        // start agent
+        System.out.println("Starting agent on port: " + port);
+        Properties mgmtProps = new Properties();
+        mgmtProps.put("com.sun.management.jmxremote.port", port);
+        mgmtProps.put("com.sun.management.jmxremote.authenticate", "false");
+        mgmtProps.put("com.sun.management.jmxremote.ssl", "false");
+        vm.startManagementAgent(mgmtProps);
+
+        // try to connect - should work
+        tryConnect(port, true);
+
+        // try to start again - should fail
+        boolean exception = false;
+        try {
+            vm.startManagementAgent(mgmtProps);
+        } catch(AttachOperationFailedException ex) {
+            // expected
+            exception = true;
+        }
+        if (!exception) {
+            throw new Exception("Expected the second call to vm.startManagementAgent() to fail");
+        }
+    }
+
+    private static void tryConnect(int port, boolean shouldSucceed) throws Exception {
+        String jmxUrlStr =
+            String.format(
+                "service:jmx:rmi:///jndi/rmi://localhost:%d/jmxrmi",
+                port);
+        JMXServiceURL url = new JMXServiceURL(jmxUrlStr);
+        HashMap<String, ?> env = new HashMap<>();
+
+        boolean succeeded;
+        try {
+            JMXConnector c = JMXConnectorFactory.connect(url, env);
+            c.getMBeanServerConnection();
+            succeeded = true;
+        } catch(Exception ex) {
+            succeeded = false;
+        }
+        if (succeeded && !shouldSucceed) {
+            throw new Exception("Could connect to agent, but should not have been possible");
+        }
+        if (!succeeded && shouldSucceed) {
+            throw new Exception("Could not connect to agent");
+        }
+    }
+}
diff --git a/jdk/test/java/lang/invoke/lookup/SpecialStatic.java b/jdk/test/java/lang/invoke/lookup/SpecialStatic.java
new file mode 100644
index 0000000..57f5557
--- /dev/null
+++ b/jdk/test/java/lang/invoke/lookup/SpecialStatic.java
@@ -0,0 +1,194 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/* @test
+ * @bug 8032400
+ * @summary JSR292: invokeSpecial: InternalError attempting to lookup a method
+ * @compile -XDignore.symbol.file SpecialStatic.java
+ * @run junit test.java.lang.invoke.lookup.SpecialStatic
+ */
+package test.java.lang.invoke.lookup;
+
+import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
+import java.lang.invoke.MethodType;
+import jdk.internal.org.objectweb.asm.*;
+import org.junit.Test;
+import static jdk.internal.org.objectweb.asm.Opcodes.*;
+import static org.junit.Assert.*;
+
+/**
+ * Test case:
+ *   class T1            {        int m() { return 1; }}
+ *   class T2 extends T1 { static int m() { return 2; }}
+ *   class T3 extends T2 {        int m() { return 3; }}
+ *
+ *   T3::test { invokespecial T1.m() T3 } ==> T1::m
+ */
+public class SpecialStatic {
+    static class CustomClassLoader extends ClassLoader {
+        public Class<?> loadClass(String name) throws ClassNotFoundException {
+            if (findLoadedClass(name) != null) {
+                return findLoadedClass(name);
+            }
+
+            if ("T1".equals(name)) {
+                byte[] classFile = dumpT1();
+                return defineClass("T1", classFile, 0, classFile.length);
+            }
+            if ("T2".equals(name)) {
+                byte[] classFile = dumpT2();
+                return defineClass("T2", classFile, 0, classFile.length);
+            }
+            if ("T3".equals(name)) {
+                byte[] classFile = dumpT3();
+                return defineClass("T3", classFile, 0, classFile.length);
+            }
+
+            return super.loadClass(name);
+        }
+    }
+
+    private static ClassLoader cl = new CustomClassLoader();
+    private static Class t1, t3;
+    static {
+        try {
+            t1 = cl.loadClass("T1");
+            t3 = cl.loadClass("T3");
+        } catch (ClassNotFoundException e) {
+            throw new Error(e);
+        }
+    }
+
+    public static void main(String[] args) throws Throwable {
+        SpecialStatic test = new SpecialStatic();
+        test.testConstant();
+        test.testFindSpecial();
+    }
+
+    @Test
+    public void testConstant() throws Throwable {
+        MethodHandle mh = (MethodHandle)t3.getDeclaredMethod("getMethodHandle").invoke(null);
+        int result = (int)mh.invoke(t3.newInstance());
+        assertEquals(result, 1); // T1.m should be invoked.
+    }
+
+    @Test
+    public void testFindSpecial() throws Throwable {
+        MethodHandles.Lookup lookup = (MethodHandles.Lookup)t3.getDeclaredMethod("getLookup").invoke(null);
+        MethodHandle mh = lookup.findSpecial(t1, "m", MethodType.methodType(int.class), t3);
+        int result = (int)mh.invoke(t3.newInstance());
+        assertEquals(result, 1); // T1.m should be invoked.
+    }
+
+    public static byte[] dumpT1() {
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(52, ACC_PUBLIC + ACC_SUPER, "T1", null, "java/lang/Object", null);
+
+        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
+        mv.visitCode();
+        mv.visitIntInsn(BIPUSH, 1);
+        mv.visitInsn(IRETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    public static byte[] dumpT2() {
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(52, ACC_PUBLIC + ACC_SUPER, "T2", null, "T1", null);
+
+        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "T1", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "m", "()I", null, null);
+        mv.visitCode();
+        mv.visitIntInsn(BIPUSH, 2);
+        mv.visitInsn(IRETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+
+    public static byte[] dumpT3() {
+        ClassWriter cw = new ClassWriter(0);
+        MethodVisitor mv;
+
+        cw.visit(52, ACC_PUBLIC + ACC_SUPER, "T3", null, "T2", null);
+
+        mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);
+        mv.visitCode();
+        mv.visitVarInsn(ALOAD, 0);
+        mv.visitMethodInsn(INVOKESPECIAL, "T2", "<init>", "()V", false);
+        mv.visitInsn(RETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        mv = cw.visitMethod(ACC_PUBLIC, "m", "()I", null, null);
+        mv.visitCode();
+        mv.visitIntInsn(BIPUSH, 3);
+        mv.visitInsn(IRETURN);
+        mv.visitMaxs(1, 1);
+        mv.visitEnd();
+
+        // getMethodHandle
+        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "getMethodHandle", "()Ljava/lang/invoke/MethodHandle;", null, null);
+        mv.visitCode();
+        mv.visitLdcInsn(new Handle(H_INVOKESPECIAL, "T1", "m", "()I"));
+        mv.visitInsn(ARETURN);
+        mv.visitMaxs(1, 0);
+        mv.visitEnd();
+
+        // getLookup
+        mv = cw.visitMethod(ACC_PUBLIC + ACC_STATIC, "getLookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", null, null);
+        mv.visitCode();
+        mv.visitMethodInsn(INVOKESTATIC, "java/lang/invoke/MethodHandles", "lookup", "()Ljava/lang/invoke/MethodHandles$Lookup;", false);
+        mv.visitInsn(ARETURN);
+        mv.visitMaxs(1, 0);
+        mv.visitEnd();
+
+        cw.visitEnd();
+        return cw.toByteArray();
+    }
+}
diff --git a/jdk/test/java/lang/reflect/DefaultMethodMembers/FilterNotMostSpecific.java b/jdk/test/java/lang/reflect/DefaultMethodMembers/FilterNotMostSpecific.java
new file mode 100644
index 0000000..4a3d898
--- /dev/null
+++ b/jdk/test/java/lang/reflect/DefaultMethodMembers/FilterNotMostSpecific.java
@@ -0,0 +1,691 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8029674
+ * @summary Verify that the right interface methods are returned by
+ *          Class.getMethod() and Class.getMethods()
+ * @run testng FilterNotMostSpecific
+ */
+
+import java.lang.reflect.*;
+import java.lang.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+import org.testng.annotations.DataProvider;
+import org.testng.annotations.Test;
+
+import static org.testng.Assert.*;
+
+public class FilterNotMostSpecific {
+
+    @Test(dataProvider="getCases")
+    public void testGetMethod(Class<?> iface) {
+        boolean match = false;
+        MethodDesc[] expectedMethods = iface.getAnnotationsByType(MethodDesc.class);
+
+        for (MethodDesc expected : expectedMethods) {
+            if (expected.isGetMethodReturn()) {
+                try {
+                    Method m = iface.getMethod(expected.name());
+                    if (!assertMatch(expected, m))
+                        fail(failMsg(expected, m, iface));
+                    else
+                        match = true;
+                } catch (NoSuchMethodException e) {
+                    fail("expected: " + toMethodString(expected), e);
+                }
+            }
+        }
+        assert(match);
+    }
+
+    @Test(dataProvider="getCases")
+    public void testGetMethods(Class<?> iface) {
+        List<Method> foundMethods = filterObjectMethods(iface.getMethods());
+        MethodDesc[] expectedMethods = iface.getAnnotationsByType(MethodDesc.class);
+        Set<Method> used = new HashSet<>();
+
+        for (MethodDesc expected : expectedMethods) {
+            boolean found = false;
+
+            for (Method m : foundMethods) {
+                if (used.contains(m))
+                    continue;
+
+                if(expected.name().equals(m.getName()) &&
+                    expected.declaringClass() ==m.getDeclaringClass()) {
+
+                    found = true;
+                    assertMatch(expected, m);
+                    used.add(m);
+                    break;
+                }
+            }
+            if (! found)
+                fail("On: "+ iface +"\nDid not find " + toMethodString(expected) + " among " + foundMethods);
+        }
+        assertEquals(foundMethods.size(), expectedMethods.length,
+                "\non: " + iface +
+                "\nexpected: " + toMethodStrings(expectedMethods) +
+                "\nfound: " + foundMethods + "\n");
+    }
+
+    private boolean assertMatch(MethodDesc expected, Method m) {
+        if (!expected.name().equals(m.getName()))
+            return false;
+        if (expected.declaringClass() != m.getDeclaringClass())
+            return false;
+
+        if (expected.kind() == MethodKind.ABSTRACT)
+            assertTrue(Modifier.isAbstract(m.getModifiers()), m + " should be ABSTRACT");
+        else if (expected.kind() == MethodKind.CONCRETE)
+            assertTrue(!Modifier.isAbstract(m.getModifiers()) && !m.isDefault(), m + " should be CONCRETE");
+        else if (expected.kind() == MethodKind.DEFAULT)
+            assertTrue(m.isDefault(), m + " should be DEFAULT");
+
+        return true;
+    }
+
+    private String failMsg(MethodDesc expected, Method m, Class<?> iface) {
+        return "\nOn interface: " + iface +
+            "\nexpected: " + toMethodString(expected) +
+            "\nfound: " + m;
+    }
+
+    private static List<Method> filterObjectMethods(Method[] in) {
+        return Arrays.stream(in).
+            filter(m -> (m.getDeclaringClass() != java.lang.Object.class)).
+            collect(Collectors.toList());
+    }
+
+    private String toMethodString(MethodDesc m) {
+        return m.declaringClass().getSimpleName().toString() + "." +
+            m.name() + "()";
+    }
+
+    private List<String> toMethodStrings(MethodDesc[] m) {
+        return Arrays.stream(m).
+            map(this::toMethodString)
+            .collect(Collectors.toList());
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    @Repeatable(MethodDescs.class)
+    public @interface MethodDesc {
+        String name();
+        Class<?> declaringClass();
+        MethodKind kind() default MethodKind.ABSTRACT;
+        boolean isGetMethodReturn() default false;
+    }
+
+    @Retention(RetentionPolicy.RUNTIME)
+    public @interface MethodDescs {
+        MethodDesc[] value();
+    }
+
+    public static enum MethodKind {
+        ABSTRACT,
+        CONCRETE,
+        DEFAULT,
+    }
+    // base interfaces
+    interface I { void nonDefault(); }
+    interface J extends I { void nonDefault(); }
+
+    interface Jprim extends I {}
+    interface Jbis extends Jprim { void nonDefault(); }
+
+    // interesting cases
+
+    @MethodDesc(name="nonDefault", declaringClass=Jbis.class,
+            isGetMethodReturn=true)
+    interface P1 extends Jbis {}
+
+    @MethodDesc(name="nonDefault", declaringClass=Jbis.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=I.class)
+    interface P2 extends Jbis, Jprim {}
+
+    @MethodDesc(name="nonDefault", declaringClass=Jbis.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=I.class)
+    interface P3 extends Jbis, Jprim, I {}
+
+    @MethodDesc(name="nonDefault", declaringClass=I.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=J.class)
+    interface P4 extends I, J {}
+
+    @MethodDesc(name="nonDefault", declaringClass=J.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=I.class)
+    interface P5 extends J, I {}
+
+    @MethodDesc(name="nonDefault", declaringClass=J.class,
+            isGetMethodReturn=true)
+    interface K1 extends J {}
+
+    @MethodDesc(name="nonDefault", declaringClass=K1M.class,
+            isGetMethodReturn=true)
+    interface K1M extends J { void nonDefault(); }
+
+    @MethodDesc(name="nonDefault", declaringClass=I.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=J.class)
+    interface K2 extends I, J {}
+
+    @MethodDesc(name="nonDefault", declaringClass=J.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=I.class)
+    interface K2O extends J, I {}
+
+    @MethodDesc(name="nonDefault", declaringClass=K2M.class,
+            isGetMethodReturn=true)
+    interface K2M extends J, I { void nonDefault(); }
+
+    // base interfaces default methods
+    interface L { default void isDefault() {} void nonDefault(); }
+    interface M extends L { default void isDefault() {} void nonDefault(); }
+
+    // test cases default methods
+
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=M.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface N1 extends M {}
+
+    @MethodDesc(name="isDefault", declaringClass=N1D.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    interface N1D extends M { default void isDefault() {}}
+
+    @MethodDesc(name="nonDefault", declaringClass=N1N.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=M.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface N1N extends M { void nonDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=N1DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N1DN.class,
+            isGetMethodReturn=true)
+    interface N1DN extends M { default void isDefault() {} void nonDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=M.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    interface N2 extends M, L {}
+
+    @MethodDesc(name="isDefault", declaringClass=M.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    interface N22 extends L, M {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2D.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    interface N2D extends M, L { default void isDefault() {}}
+
+    @MethodDesc(name="isDefault", declaringClass=M.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2N.class,
+            isGetMethodReturn=true)
+    interface N2N extends M, L { void nonDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    interface N2DN extends M, L { default void isDefault() {} void nonDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface O1 extends L, M, N2DN {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface O2 extends M, N2DN, L {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    interface O3 extends N2DN, L, M {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    abstract class C1 implements L, M, N2DN {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    abstract class C2 implements M, N2DN, L {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    abstract class C3 implements N2DN, L, M {}
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=C4.class,
+            kind=MethodKind.CONCRETE, isGetMethodReturn=true)
+    class C4 implements L, M, N2DN { public void nonDefault() {} }
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=C5.class,
+            kind=MethodKind.CONCRETE, isGetMethodReturn=true)
+    class C5 implements M, N2DN, L { public void nonDefault() {} }
+
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=C6.class,
+            kind=MethodKind.CONCRETE, isGetMethodReturn=true)
+    class C6 implements N2DN, L, M { public void nonDefault() {} }
+
+    // reabstraction
+
+    @MethodDesc(name="isDefault", declaringClass=R1.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R1 extends L, M, N2DN { void isDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=R2.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R2 extends M, N2DN, L { void isDefault(); }
+
+    @MethodDesc(name="isDefault", declaringClass=R3.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    interface R3 extends N2DN, L, M { void isDefault(); }
+
+    // this one is strange but logical, getMethod finds N2DN first, which is
+    // default but not the most specific
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=R1.class)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R4 extends L, M, N2DN, R1 {}
+
+    // this one is strange but logical, getMethod finds N2DN first, which is
+    // default but not the most specific
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=R2.class)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R5 extends M, N2DN, R2, L {}
+
+    // this one is strange but logical, getMethod finds N2DN first, which is
+    // default but not the most specific
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=R3.class)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    interface R6 extends N2DN, R3, L, M {}
+
+    // the following three finds the "right" one
+    @MethodDesc(name="isDefault", declaringClass=R1.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="nonDefault", declaringClass=L.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R7 extends L, M, R1, N2DN {}
+
+    @MethodDesc(name="isDefault", declaringClass=R2.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class)
+    interface R8 extends M, R2, N2DN, L {}
+
+    @MethodDesc(name="isDefault", declaringClass=R3.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="isDefault", declaringClass=N2DN.class,
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="nonDefault", declaringClass=L.class)
+    @MethodDesc(name="nonDefault", declaringClass=M.class)
+    @MethodDesc(name="nonDefault", declaringClass=N2DN.class,
+            isGetMethodReturn=true)
+    interface R9 extends R3, N2DN, L, M {}
+
+    // More reabstraction
+    interface Z1 { void z(); }
+    interface Z2 extends Z1 { default void z() {} }
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            isGetMethodReturn=true, kind=MethodKind.DEFAULT)
+    interface Z31 extends Z1, Z2 {}
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface Z32 extends Z2, Z1 {}
+
+    interface Z3 extends Z2, Z1 { void z(); }
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z3.class)
+    interface Z41 extends Z1, Z2, Z3 { }
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z3.class)
+    interface Z42 extends Z2, Z3, Z1 { }
+
+    @MethodDesc(name="z", declaringClass=Z3.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT)
+    interface Z43 extends Z3, Z1, Z2 { }
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z3.class)
+    abstract class ZC41 implements Z1, Z2, Z3 { }
+
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z3.class)
+    abstract class ZC42 implements Z2, Z3, Z1 { }
+
+    @MethodDesc(name="z", declaringClass=Z3.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="z", declaringClass=Z2.class,
+            kind=MethodKind.DEFAULT)
+    abstract class ZC43 implements Z3, Z1, Z2 { }
+
+    // More reabstraction + concretization
+    interface X1 { default void x() {} }
+    interface X2 extends X1 { void x(); }
+
+    @MethodDesc(name="x", declaringClass=X1.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    @MethodDesc(name="x", declaringClass=X2.class)
+    interface X31 extends X1, X2 {}
+
+    @MethodDesc(name="x", declaringClass=X2.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="x", declaringClass=X1.class,
+            kind=MethodKind.DEFAULT)
+    interface X32 extends X2, X1 {}
+
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface X3 extends X2, X1 { default void x() {} }
+
+    // order shouldn't matter here
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface X41 extends X1, X2, X3 { }
+
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface X42 extends X2, X3, X1 { }
+
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    interface X43 extends X3, X1, X2 { }
+
+    // order shouldn't matter here
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    abstract class XC41 implements X1, X2, X3 { }
+
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    abstract class XC42 implements X2, X3, X1 { }
+
+    @MethodDesc(name="x", declaringClass=X3.class,
+            kind=MethodKind.DEFAULT, isGetMethodReturn=true)
+    abstract class XC43 implements X3, X1, X2 { }
+
+    interface K extends I, J { void nonDefault(); }
+
+    @MethodDesc(name="nonDefault", declaringClass=I.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=J.class)
+    @MethodDesc(name="nonDefault", declaringClass=K.class)
+    abstract class ZZ1 implements I, J, K {}
+
+    @MethodDesc(name="nonDefault", declaringClass=I.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=J.class)
+    @MethodDesc(name="nonDefault", declaringClass=K.class)
+    abstract class ZZ2 extends ZZ1 implements K, I, J {}
+
+    @MethodDesc(name="nonDefault", declaringClass=I.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="nonDefault", declaringClass=J.class)
+    @MethodDesc(name="nonDefault", declaringClass=K.class)
+    abstract class ZZ3 extends ZZ2 implements J, K, I {}
+
+    // bridges
+    interface B1A { Object m(); }
+    interface B1B extends B1A { Map m(); }
+
+    @MethodDesc(name="m", declaringClass=B1C.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=B1C.class,
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="m", declaringClass=B1C.class,
+            kind=MethodKind.DEFAULT)
+    interface B1C extends B1B { HashMap m(); }
+
+    @MethodDesc(name="m", declaringClass=B2.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=B2.class,
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="m", declaringClass=B2.class,
+            kind=MethodKind.DEFAULT)
+    interface B2 extends B1C { HashMap m(); }
+
+    @MethodDesc(name="m", declaringClass=B2.class, //HahsMap
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=B2.class, //Map
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="m", declaringClass=B2.class, //Object
+            kind=MethodKind.DEFAULT)
+    interface B3A extends B2, B1A {}
+
+    // this one is funny since HashMap isn't a bridge thus not a default
+    @MethodDesc(name="m", declaringClass=B2.class, //HashMap
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=B2.class, //Map
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="m", declaringClass=B2.class, //Object
+            kind=MethodKind.DEFAULT)
+    @MethodDesc(name="m", declaringClass=B1C.class) //HashMap
+    interface B3B extends B2, B1C {}
+
+    // same name different params type
+    interface A1 { void m(); void m(int i); void m(int i, int j); }
+    interface A2A extends A1 { void m(); void m(int i); void m(int i, int j); }
+    interface A2B extends A1 { void m(); void m(int i); default void m(int i, int j) {} }
+
+    @MethodDesc(name="m", declaringClass=A1.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=A1.class)
+    @MethodDesc(name="m", declaringClass=A1.class)
+    @MethodDesc(name="m", declaringClass=A2A.class)
+    @MethodDesc(name="m", declaringClass=A2A.class)
+    @MethodDesc(name="m", declaringClass=A2A.class)
+    interface A3A extends A1, A2A {}
+
+    @MethodDesc(name="m", declaringClass=A1.class,
+            isGetMethodReturn=true)
+    @MethodDesc(name="m", declaringClass=A1.class)
+    @MethodDesc(name="m", declaringClass=A2B.class)
+    @MethodDesc(name="m", declaringClass=A2B.class)
+    @MethodDesc(name="m", declaringClass=A2B.class,
+            kind=MethodKind.DEFAULT)
+    interface A3B extends A1, A2B {}
+
+    @DataProvider
+    public Object[][] getCases() { return CASES; }
+    public static final Class<?>[][] CASES =  {
+        { K1.class },
+        { K1M.class },
+        { K2.class },
+        { K2O.class },
+        { K2M.class },
+
+        { N1.class },
+        { N1D.class },
+        { N1N.class },
+        { N1DN.class },
+
+        { N2.class },
+        { N22.class },
+        { N2D.class },
+        { N2N.class },
+        { N2DN.class },
+
+        { P1.class },
+        { P2.class },
+        { P3.class },
+        { P4.class },
+        { P5.class },
+
+        { O1.class },
+        { O2.class },
+        { O3.class },
+
+        { C1.class },
+        { C2.class },
+        { C3.class },
+
+        { C4.class },
+        { C5.class },
+        { C6.class },
+
+        { R1.class },
+        { R2.class },
+        { R3.class },
+
+        { R4.class },
+        { R5.class },
+        { R6.class },
+
+        { R7.class },
+        { R8.class },
+        { R9.class },
+
+        { Z31.class },
+        { Z32.class },
+
+        { Z41.class },
+        { Z42.class },
+        { Z43.class },
+
+        { ZC41.class },
+        { ZC42.class },
+        { ZC43.class },
+
+        { ZZ1.class },
+        { ZZ2.class },
+        { ZZ3.class },
+
+        { X3.class },
+        { X31.class },
+        { X32.class },
+
+        { X41.class },
+        { X42.class },
+        { X43.class },
+
+        { XC41.class },
+        { XC42.class },
+        { XC43.class },
+
+        { B1C.class },
+        { B2.class },
+        { B3A.class },
+        { B3B.class },
+
+        { A3A.class },
+        { A3B.class },
+    };
+}
diff --git a/jdk/test/java/util/HashMap/PutNullKey.java b/jdk/test/java/util/HashMap/PutNullKey.java
new file mode 100644
index 0000000..72aade0
--- /dev/null
+++ b/jdk/test/java/util/HashMap/PutNullKey.java
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * @test
+ * @bug 8046085
+ * @summary Ensure that when trees are being used for collisions that null key
+ * insertion still works.
+ */
+
+import java.util.*;
+import java.util.stream.IntStream;
+
+public class PutNullKey {
+
+    // Initial capacity of map
+    // Should be >= the map capacity for treeifying, see HashMap/ConcurrentMap.MIN_TREEIFY_CAPACITY
+    static final int INITIAL_CAPACITY = 64;
+
+    // Maximum size of map
+    // Should be > the treeify threshold, see HashMap/ConcurrentMap.TREEIFY_THRESHOLD
+    static final int SIZE = 256;
+
+    // Load factor of map
+    // A value 1.0 will ensure that a new threshold == capacity
+    static final float LOAD_FACTOR = 1.0f;
+
+    public static class CollidingHash implements Comparable<CollidingHash> {
+
+        private final int value;
+
+        public CollidingHash(int value) {
+            this.value = value;
+        }
+
+        @Override
+        public int hashCode() {
+            // intentionally bad hashcode. Force into first bin.
+            return 0;
+        }
+
+        @Override
+        public boolean equals(Object o) {
+            if (null == o) {
+                return false;
+            }
+
+            if (o.getClass() != CollidingHash.class) {
+                return false;
+            }
+
+            return value == ((CollidingHash) o).value;
+        }
+
+        @Override
+        public int compareTo(CollidingHash o) {
+            return value - o.value;
+        }
+    }
+
+    public static void main(String[] args) throws Exception {
+        Map<Object,Object> m = new HashMap<>(INITIAL_CAPACITY, LOAD_FACTOR);
+        IntStream.range(0, SIZE)
+                .mapToObj(CollidingHash::new)
+                .forEach(e -> { m.put(e, e); });
+
+        // kaboom?
+        m.put(null, null);
+    }
+}
diff --git a/jdk/test/java/util/Timer/Args.java b/jdk/test/java/util/Timer/Args.java
index 3198a93..5dc9169 100644
--- a/jdk/test/java/util/Timer/Args.java
+++ b/jdk/test/java/util/Timer/Args.java
@@ -29,96 +29,137 @@
 
 import java.util.*;
 import java.util.concurrent.*;
+import static java.util.concurrent.TimeUnit.*;
 
 public class Args {
+    static final long DELAY_MS = 30 * 1000L;
+
     void schedule(final Timer t, final TimerTask task, final Date d) {
         t.schedule(task, d);
-        THROWS(IllegalStateException.class,
-               new F(){void f(){ t.schedule(task, d); }});
+        assertThrows
+            (IllegalStateException.class,
+             () -> t.schedule(task, d));
     }
 
-    void schedule(final Timer t, final TimerTask task, final Date d, final long period) {
+    void schedule(final Timer t, final TimerTask task, final Date d, final
+long period) {
         t.schedule(task, d, period);
-        THROWS(IllegalStateException.class,
-               new F(){void f(){ t.schedule(task, d, period); }});
+        assertThrows
+            (IllegalStateException.class,
+             () -> t.schedule(task, d, period));
     }
 
-    void scheduleAtFixedRate(final Timer t, final TimerTask task, final Date d, final long period) {
+    void scheduleAtFixedRate(final Timer t, final TimerTask task, final
+Date d, final long period) {
         t.scheduleAtFixedRate(task, d, period);
-        THROWS(IllegalStateException.class,
-               new F(){void f(){ t.scheduleAtFixedRate(task, d, period); }});
+        assertThrows
+            (IllegalStateException.class,
+             () -> t.scheduleAtFixedRate(task, d, period));
     }
 
     TimerTask counter(final CountDownLatch latch) {
         return new TimerTask() { public void run() {
-            check(latch.getCount() > 0);
+            if (latch.getCount() == 0)
+                fail(String.format("Latch counted down too many times: " +
+latch));
             latch.countDown();
         }};
     }
 
+    TimerTask nop() {
+        return new TimerTask() { public void run() { }};
+    }
+
     void test(String[] args) throws Throwable {
         final Timer t = new Timer();
+        try {
+            test(t);
+        } finally {
+            // Ensure this test doesn't interfere with subsequent
+            // tests even in case of failure.
+            t.cancel();
+        }
+
+        // Attempts to schedule tasks on a cancelled Timer result in ISE.
+
+        final Date past = new Date(System.currentTimeMillis() - DELAY_MS);
+        final Date future = new Date(System.currentTimeMillis() + DELAY_MS);
+        assertThrows
+            (IllegalStateException.class,
+             () -> t.schedule(nop(), 42),
+             () -> t.schedule(nop(), 42),
+             () -> t.schedule(nop(), past),
+             () -> t.schedule(nop(), 42, 42),
+             () -> t.schedule(nop(), past, 42),
+             () -> t.scheduleAtFixedRate(nop(), 42, 42),
+             () -> t.scheduleAtFixedRate(nop(), past, 42),
+             () -> t.scheduleAtFixedRate(nop(), future, 42));
+    }
+
+    void test(Timer t) throws Throwable {
         final TimerTask x = new TimerTask() { public void run() {}};
-        THROWS(IllegalArgumentException.class,
-               new F(){void f(){ t.schedule(x, -42); }},
-               new F(){void f(){ t.schedule(x, new Date(-42)); }},
+        assertThrows
+            (IllegalArgumentException.class,
+             () -> t.schedule(x, -42),
+             () -> t.schedule(x, new Date(-42)),
 
-               new F(){void f(){ t.schedule(x, Long.MAX_VALUE); }},
-               new F(){void f(){ t.schedule(x, -42, 42); }},
-               new F(){void f(){ t.schedule(x, new Date(-42), 42); }},
-               new F(){void f(){ t.schedule(x, Long.MAX_VALUE, 42); }},
-               new F(){void f(){ t.schedule(x, 42, 0); }},
-               new F(){void f(){ t.schedule(x, new Date(42), 0); }},
-               new F(){void f(){ t.schedule(x, 42, -42); }},
-               new F(){void f(){ t.schedule(x, new Date(42), -42); }},
+             () -> t.schedule(x, Long.MAX_VALUE),
+             () -> t.schedule(x, -42, 42),
+             () -> t.schedule(x, new Date(-42), 42),
+             () -> t.schedule(x, Long.MAX_VALUE, 42),
+             () -> t.schedule(x, 42, 0),
+             () -> t.schedule(x, new Date(42), 0),
+             () -> t.schedule(x, 42, -42),
+             () -> t.schedule(x, new Date(42), -42),
 
-               new F(){void f(){ t.scheduleAtFixedRate(x, -42, 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, new Date(-42), 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, Long.MAX_VALUE, 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, 42, 0); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, new Date(42), 0); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, 42, -42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, new Date(42), -42); }}
-               );
+             () -> t.scheduleAtFixedRate(x, -42, 42),
+             () -> t.scheduleAtFixedRate(x, new Date(-42), 42),
+             () -> t.scheduleAtFixedRate(x, Long.MAX_VALUE, 42),
+             () -> t.scheduleAtFixedRate(x, 42, 0),
+             () -> t.scheduleAtFixedRate(x, new Date(42), 0),
+             () -> t.scheduleAtFixedRate(x, 42, -42),
+             () -> t.scheduleAtFixedRate(x, new Date(42), -42));
 
-        THROWS(NullPointerException.class,
-               new F(){void f(){ t.schedule(null, 42); }},
-               new F(){void f(){ t.schedule(x, (Date)null); }},
+        assertThrows
+            (NullPointerException.class,
+             () -> t.schedule(null, 42),
+             () -> t.schedule(x, (Date)null),
 
-               new F(){void f(){ t.schedule(null, 42, 42); }},
-               new F(){void f(){ t.schedule(x, (Date)null, 42); }},
+             () -> t.schedule(null, 42, 42),
+             () -> t.schedule(x, (Date)null, 42),
 
-               new F(){void f(){ t.scheduleAtFixedRate(null, 42, 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, (Date)null, 42); }}
-               );
+             () -> t.scheduleAtFixedRate(null, 42, 42),
+             () -> t.scheduleAtFixedRate(x, (Date)null, 42));
 
-        final CountDownLatch y1 = new CountDownLatch(1);
-        final CountDownLatch y2 = new CountDownLatch(1);
-        final CountDownLatch y3 = new CountDownLatch(11);
+        // Create local classes for clearer diagnostics in case of failure
+        class OneShotLatch extends CountDownLatch {
+            OneShotLatch() { super(1); }
+        }
+        class FixedDelayLatch extends CountDownLatch {
+            FixedDelayLatch() { super(1); }
+        }
+        class FixedRateLatch extends CountDownLatch {
+            FixedRateLatch() { super(11); }
+        }
+        final CountDownLatch y1 = new OneShotLatch();
+        final CountDownLatch y2 = new FixedDelayLatch();
+        final CountDownLatch y3 = new FixedRateLatch();
+
         final long start = System.currentTimeMillis();
-        final Date past = new Date(start - 10500);
+        final Date past = new Date(start - (10 * DELAY_MS + DELAY_MS / 2));
 
         schedule(           t, counter(y1), past);
-        schedule(           t, counter(y2), past, 1000);
-        scheduleAtFixedRate(t, counter(y3), past, 1000);
-        y3.await();
-        y1.await();
-        y2.await();
+        schedule(           t, counter(y2), past, DELAY_MS);
+        scheduleAtFixedRate(t, counter(y3), past, DELAY_MS);
+
+        check(y1.await(DELAY_MS / 4, MILLISECONDS));
+        check(y2.await(DELAY_MS / 4, MILLISECONDS));
+        check(y3.await(DELAY_MS / 4, MILLISECONDS));
 
         final long elapsed = System.currentTimeMillis() - start;
-        System.out.printf("elapsed=%d%n", elapsed);
-        check(elapsed < 500);
-
-        t.cancel();
-
-        THROWS(IllegalStateException.class,
-               new F(){void f(){ t.schedule(x, 42); }},
-               new F(){void f(){ t.schedule(x, past); }},
-               new F(){void f(){ t.schedule(x, 42, 42); }},
-               new F(){void f(){ t.schedule(x, past, 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, 42, 42); }},
-               new F(){void f(){ t.scheduleAtFixedRate(x, past, 42); }});
-
+        if (elapsed >= DELAY_MS / 2)
+            fail(String.format("Test took too long: elapsed=%d%n",
+elapsed));
     }
 
     //--------------------- Infrastructure ---------------------------
@@ -137,11 +178,12 @@
         try {test(args);} catch (Throwable t) {unexpected(t);}
         System.out.printf("%nPassed = %d, failed = %d%n%n", passed, failed);
         if (failed > 0) throw new AssertionError("Some tests failed");}
-    abstract class F {abstract void f() throws Throwable;}
-    void THROWS(Class<? extends Throwable> k, F... fs) {
+    interface F { void f() throws Throwable; }
+    void assertThrows(Class<? extends Throwable> k, F... fs) {
         for (F f : fs)
             try {f.f(); fail("Expected " + k.getName() + " not thrown");}
             catch (Throwable t) {
                 if (k.isAssignableFrom(t.getClass())) pass();
                 else unexpected(t);}}
 }
+
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
index 2439765..558b2da 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/JvmstatCountersTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -143,9 +143,12 @@
                 String vmid = name.substring(0, name.indexOf("@"));
                 System.out.println("vmid = " + vmid);
                 VirtualMachine vm = VirtualMachine.attach(vmid);
-                String agent = vm.getSystemProperties().getProperty("java.home") +
-                        File.separator + "lib" + File.separator + "management-agent.jar";
-                vm.loadAgent(agent, "com.sun.management.jmxremote.port=0,com.sun.management.jmxremote.authenticate=false,com.sun.management.jmxremote.ssl=false");
+                Properties p = new Properties();
+                p.put("com.sun.management.jmxremote.port", "0");
+                p.put("com.sun.management.jmxremote.authenticate", "false");
+                p.put("com.sun.management.jmxremote.ssl", "false");
+                vm.startManagementAgent(p);
+                vm.startLocalManagementAgent();
                 vm.detach();
                 String localAddress2 = ConnectorAddressLink.importFrom(0);
                 if (localAddress2 == null) {
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
index 1828d86..b0d44c3 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/LocalManagementTest.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,13 +22,8 @@
  */
 
 import java.io.File;
-import java.io.IOException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.nio.file.FileSystem;
-import java.nio.file.FileSystems;
-import java.nio.file.Files;
-import java.nio.file.Path;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.TimeUnit;
@@ -47,19 +42,12 @@
  */
 
 import jdk.testlibrary.ProcessTools;
-import jdk.testlibrary.Utils;
 
 public class LocalManagementTest {
     private static final String TEST_CLASSPATH = System.getProperty("test.class.path");
     private static final String TEST_JDK = System.getProperty("test.jdk");
-    private static int MAX_GET_FREE_PORT_TRIES = 10;
 
     public static void main(String[] args) throws Exception {
-        try {
-            MAX_GET_FREE_PORT_TRIES = Integer.parseInt(System.getProperty("test.getfreeport.max.tries", "10"));
-        } catch (NumberFormatException ex) {
-        }
-
         int failures = 0;
         for(Method m : LocalManagementTest.class.getDeclaredMethods()) {
             if (Modifier.isStatic(m.getModifiers()) &&
@@ -84,110 +72,27 @@
         }
     }
 
+    @SuppressWarnings("unused")
     private static boolean test1() throws Exception {
         return doTest("1", "-Dcom.sun.management.jmxremote");
     }
 
-    private static boolean test2() throws Exception {
-        Path agentPath = findAgent();
-        if (agentPath != null) {
-            String agent = agentPath.toString();
-            return doTest("2", "-javaagent:" + agent);
-        } else {
-            return false;
-        }
-    }
-
     /**
      * no args (blank) - manager should attach and start agent
      */
+    @SuppressWarnings("unused")
     private static boolean test3() throws Exception {
         return doTest("3", null);
     }
 
     /**
-     * sanity check arguments to management-agent.jar
-     */
-    private static boolean test4() throws Exception {
-        Path agentPath = findAgent();
-        if (agentPath != null) {
-
-            for (int i = 0; i < MAX_GET_FREE_PORT_TRIES; ++i) {
-                ProcessBuilder builder = ProcessTools.createJavaProcessBuilder(
-                        "-javaagent:" + agentPath.toString() +
-                                "=com.sun.management.jmxremote.port=" + Utils.getFreePort() + "," +
-                                "com.sun.management.jmxremote.authenticate=false," +
-                                "com.sun.management.jmxremote.ssl=false",
-                        "-cp",
-                        TEST_CLASSPATH,
-                        "TestApplication",
-                        "-exit"
-                );
-
-                Process prc = null;
-                final AtomicReference<Boolean> isBindExceptionThrown = new AtomicReference<>();
-                isBindExceptionThrown.set(new Boolean(false));
-                try {
-                    prc = ProcessTools.startProcess(
-                            "TestApplication",
-                            builder,
-                            (String line) -> {
-                                if (line.contains("Exception thrown by the agent : " +
-                                        "java.rmi.server.ExportException: Port already in use")) {
-                                    isBindExceptionThrown.set(new Boolean(true));
-                                }
-                            });
-
-                    prc.waitFor();
-
-                    if (prc.exitValue() == 0) {
-                        return true;
-                    }
-
-                    if (isBindExceptionThrown.get().booleanValue()) {
-                        System.out.println("'Port already in use' error detected. Try again");
-                    } else {
-                        return false;
-                    }
-                } finally {
-                    if (prc != null) {
-                        prc.destroy();
-                        prc.waitFor();
-                    }
-                }
-            }
-        }
-        return false;
-    }
-
-    /**
      * use DNS-only name service
      */
+    @SuppressWarnings("unused")
     private static boolean test5() throws Exception {
         return doTest("5", "-Dsun.net.spi.namservice.provider.1=\"dns,sun\"");
     }
 
-    private static Path findAgent() {
-        FileSystem FS = FileSystems.getDefault();
-        Path agentPath = FS.getPath(
-            TEST_JDK, "jre", "lib", "management-agent.jar"
-        );
-        if (!isFileOk(agentPath)) {
-            agentPath = FS.getPath(
-                TEST_JDK, "lib", "management-agent.jar"
-            );
-        }
-        if (!isFileOk(agentPath)) {
-            System.err.println("Can not locate management-agent.jar");
-            return null;
-        }
-        return agentPath;
-    }
-
-    private static boolean isFileOk(Path path) {
-        return Files.isRegularFile(path) && Files.isReadable(path);
-    }
-
     private static boolean doTest(String testId, String arg) throws Exception {
         List<String> args = new ArrayList<>();
         args.add("-cp");
@@ -267,4 +172,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}
diff --git a/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java b/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java
index 4495c2d..76b4324 100644
--- a/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java
+++ b/jdk/test/sun/management/jmxremote/bootstrap/TestManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -40,7 +40,6 @@
 import static java.lang.management.ManagementFactory.*;
 import java.net.Socket;
 import java.net.InetSocketAddress;
-import java.io.File;
 import java.io.IOException;
 
 // Sun specific
@@ -55,28 +54,8 @@
      * Starts the management agent in the target VM
      */
     private static void startManagementAgent(String pid) throws IOException {
-        /*
-         * JAR file normally in ${java.home}/jre/lib but may be in ${java.home}/lib
-         * with development/non-images builds
-         */
-        String home = System.getProperty("java.home");
-        String agent = home + File.separator + "jre" + File.separator + "lib"
-                + File.separator + "management-agent.jar";
-        File f = new File(agent);
-        if (!f.exists()) {
-            agent = home + File.separator + "lib" + File.separator +
-                "management-agent.jar";
-            f = new File(agent);
-            if (!f.exists()) {
-                throw new RuntimeException("management-agent.jar missing");
-            }
-        }
-        agent = f.getCanonicalPath();
-
-        System.out.println("Loading " + agent + " into target VM ...");
-
         try {
-            VirtualMachine.attach(pid).loadAgent(agent);
+            VirtualMachine.attach(pid).startLocalManagementAgent();
         } catch (Exception x) {
             throw new IOException(x.getMessage());
         }
@@ -122,8 +101,7 @@
 
         if (agentPropLocalConnectorAddress == null &&
             jvmstatLocalConnectorAddress == null) {
-            // No JMX Connector address so attach to VM, and load
-            // management-agent.jar
+            // No JMX Connector address so attach to VM, and start local agent
             startManagementAgent(pid);
             agentPropLocalConnectorAddress = (String)
                 vm.getAgentProperties().get(LOCAL_CONNECTOR_ADDRESS_PROP);
diff --git a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
index a1518b9..09c1fa9 100644
--- a/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
+++ b/jdk/test/sun/management/jmxremote/startstop/JMXStartStopTest.java
@@ -31,16 +31,13 @@
 import java.rmi.registry.Registry;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.Map;
 import java.util.Objects;
 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.AtomicReference;
 import java.util.function.Consumer;
 
 import javax.management.*;
@@ -60,7 +57,6 @@
  *          JCMD achieves the desired results
  */
 public class JMXStartStopTest {
-    private static final String TEST_JDK = System.getProperty("test.jdk");
     private static final String TEST_SRC = System.getProperty("test.src");
 
     private static final boolean verbose = false;
@@ -117,8 +113,8 @@
                                   QueryExp query)
     throws Exception {
 
-        Set names = server.queryNames(pattern,query);
-        for (Iterator i=names.iterator(); i.hasNext(); ) {
+        Set<ObjectName> names = server.queryNames(pattern,query);
+        for (Iterator<ObjectName> i = names.iterator(); i.hasNext(); ) {
             ObjectName name = (ObjectName)i.next();
             MBeanInfo info = server.getMBeanInfo(name);
             dbg_print("Got MBean: " + name);
@@ -128,7 +124,7 @@
                 continue;
             for (MBeanAttributeInfo attr : attrs) {
                 if (attr.isReadable()) {
-                    Object o = server.getAttribute(name, attr.getName());
+                    server.getAttribute(name, attr.getName());
                 }
             }
         }
@@ -149,9 +145,8 @@
             }
 
             JMXServiceURL url = new JMXServiceURL(jmxUrlStr);
-            Map m = new HashMap();
 
-            JMXConnector c = JMXConnectorFactory.connect(url,m);
+            JMXConnector c = JMXConnectorFactory.connect(url, null);
 
             MBeanServerConnection conn = c.getMBeanServerConnection();
             ObjectName pattern = new ObjectName("java.lang:type=Memory,*");
@@ -221,9 +216,8 @@
                 port);
 
         JMXServiceURL url = new JMXServiceURL(jmxUrlStr);
-        Map m = new HashMap();
 
-        JMXConnector c = JMXConnectorFactory.connect(url,m);
+        JMXConnector c = JMXConnectorFactory.connect(url, null);
 
         MBeanServerConnection conn = c.getMBeanServerConnection();
         ObjectName pattern = new ObjectName("java.lang:type=Memory,*");
@@ -314,25 +308,6 @@
         }
     }
 
-    /**
-     * Retrieves the PID of the test application using JCMD
-     * @return The PID of the test application
-     * @throws InterruptedException
-     * @throws IOException
-     */
-    private static String getPID() throws InterruptedException, IOException {
-        final AtomicReference<String> pid = new AtomicReference<>();
-        jcmd(
-            null,
-            line -> {
-                if (line.endsWith("JMXStartStopDoSomething")) {
-                    pid.set(line.split(" ")[0]);
-                }
-            }
-        );
-        return pid.get();
-    }
-
     private static class Something {
         private Process p;
         private final ProcessBuilder pb;
@@ -473,7 +448,7 @@
     private static final String CMD_START= "ManagementAgent.start";
     private static final String CMD_START_LOCAL = "ManagementAgent.start_local";
 
-    private static void test_01() throws Exception {
+    static void test_01() throws Exception {
         // Run an app with JMX enabled stop it and
         // restart on other port
 
@@ -499,7 +474,7 @@
         }
     }
 
-    private static void test_02() throws Exception {
+    static void test_02() throws Exception {
         // Run an app without JMX enabled
         // start JMX by jcmd
 
@@ -520,7 +495,7 @@
         }
     }
 
-    private static void test_03() throws Exception {
+    static void test_03() throws Exception {
         // Run an app without JMX enabled
         // start JMX by jcmd on one port than on other one
 
@@ -550,7 +525,7 @@
         }
     }
 
-    private static void test_04() throws Exception {
+    static void test_04() throws Exception {
         // Run an app without JMX enabled
         // start JMX by jcmd on one port, specify rmi port explicitly
 
@@ -571,7 +546,7 @@
         }
     }
 
-    private static void test_05() throws Exception {
+    static void test_05() throws Exception {
         // Run an app without JMX enabled, it will enable local server
         // but should leave remote server disabled
 
@@ -589,7 +564,7 @@
         }
     }
 
-    private static void test_06() throws Exception {
+    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
@@ -636,38 +611,39 @@
             jcmd(CMD_STOP);
             jcmd(CMD_STOP);
 
-            ServerSocket ss = new ServerSocket(0);
+            try (ServerSocket ss = new ServerSocket(0))
+            {
+                jcmd(
+                    line -> {
+                        if (line.contains("Port already in use: " + ss.getLocalPort())) {
+                            checks[2] = true;
+                        }
+                    },
+                    CMD_START,
+                    "jmxremote.port=" + ss.getLocalPort(),
+                    "jmxremote.rmi.port=" + pa.getPort2(),
+                    "jmxremote.authenticate=false",
+                    "jmxremote.ssl=false");
 
-            jcmd(
-                line -> {
-                    if (line.contains("Port already in use: " + ss.getLocalPort())) {
-                        checks[2] = true;
-                    }
-                },
-                CMD_START,
-                "jmxremote.port=" + ss.getLocalPort(),
-                "jmxremote.rmi.port=" + pa.getPort2(),
-                "jmxremote.authenticate=false",
-                "jmxremote.ssl=false");
-
-            if (!checks[0]) {
-                throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
-                                    "report an invalid agent state");
-            }
-            if (!checks[1]) {
-                throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
-                                    "report an invalid agent state");
-            }
-            if (!checks[2]) {
-                throw new Exception("Starting agent on port " + ss.getLocalPort() + " should " +
-                                    "report port in use");
+                if (!checks[0]) {
+                    throw new Exception("Starting agent on port " + pa.getPort1() + " should " +
+                                        "report an invalid agent state");
+                }
+                if (!checks[1]) {
+                    throw new Exception("Starting agent on poprt " + pa.getPort2() + " should " +
+                                        "report an invalid agent state");
+                }
+                if (!checks[2]) {
+                    throw new Exception("Starting agent on port " + ss.getLocalPort() + " should " +
+                                        "report port in use");
+                }
             }
         } finally {
             s.stop();
         }
     }
 
-    private static void test_07() throws Exception {
+    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
@@ -694,7 +670,7 @@
         }
     }
 
-    private static void test_08() throws Exception {
+    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
@@ -729,7 +705,7 @@
         }
     }
 
-    private static void test_09() throws Exception {
+    static void test_09() 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
@@ -766,7 +742,7 @@
         }
     }
 
-    private static void test_10() throws Exception {
+    static void test_10() 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
@@ -803,7 +779,7 @@
         }
     }
 
-    private static void test_11() throws Exception {
+    static void test_11() throws Exception {
         // Run an app with JMX enabled
         // stop remote agent
         // make sure local agent is not affected
@@ -825,7 +801,7 @@
         }
     }
 
-    private static void test_12() throws Exception {
+    static void test_12() throws Exception {
         // Run an app with JMX disabled
         // start local agent only
 
@@ -845,28 +821,4 @@
         }
     }
 
-    private static void test_13() throws Exception {
-        // Run an app with -javaagent make sure it works as expected -
-        // system properties are ignored
-
-        System.out.println("**** Test thirteen ****");
-        PortAllocator pa = new PortAllocator();
-
-        String agent = TEST_JDK + "/jre/lib/management-agent.jar";
-        if (!new File(agent).exists()) {
-            agent = TEST_JDK + "/lib/management-agent.jar";
-        }
-
-        Something s = doSomething("test_14",
-            "-javaagent:" + agent + "=com.sun.management.jmxremote.port=" +
-                pa.getPort1() + ",com.sun.management.jmxremote.authenticate=false",
-            "-Dcom.sun.management.jmxremote.ssl=false"
-        );
-
-        try {
-            testNoConnect(pa.port1);
-        } finally {
-            s.stop();
-        }
-    }
 }
diff --git a/jdk/test/sun/net/www/protocol/http/ZoneId.java b/jdk/test/sun/net/www/protocol/http/ZoneId.java
new file mode 100644
index 0000000..5e08961
--- /dev/null
+++ b/jdk/test/sun/net/www/protocol/http/ZoneId.java
@@ -0,0 +1,127 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8027308
+ * @summary  verifies that HttpURLConnection does not send the zone id in the
+ *           'Host' field of the header:
+ *              Host: [fe80::a00:27ff:aaaa:aaaa] instead of
+ *              Host: [fe80::a00:27ff:aaaa:aaaa%eth0]"
+ */
+
+import com.sun.net.httpserver.Headers;
+import com.sun.net.httpserver.HttpExchange;
+import com.sun.net.httpserver.HttpHandler;
+import com.sun.net.httpserver.HttpServer;
+
+import java.io.IOException;
+import java.net.*;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.concurrent.CompletableFuture;
+import java.util.concurrent.ExecutionException;
+
+public class ZoneId {
+
+    public static void main(String[] args) throws Exception {
+
+        InetAddress address = getAppropriateIPv6Address();
+
+        if (address == null) {
+            System.out.println(
+                    "The test will be skipped as not a single " +
+                    "appropriate IPv6 address was found on this machine");
+            return;
+        }
+        String ip6_literal = address.getHostAddress();
+
+        System.out.println("Found an appropriate IPv6 address: " + address);
+
+        System.out.println("Starting http server...");
+        HttpServer server =
+                HttpServer.create(new InetSocketAddress(address, 0), 0);
+        CompletableFuture<Headers> headers = new CompletableFuture<>();
+        server.createContext("/", createCapturingHandler(headers));
+        server.start();
+        System.out.println("Started at " + server.getAddress());
+        try {
+            String spec = "http://[" + address.getHostAddress() + "]:" + server.getAddress().getPort();
+            System.out.println("Client is connecting to: " + spec);
+            URLConnection urlConnection = new URL(spec).openConnection();
+            ((sun.net.www.protocol.http.HttpURLConnection) urlConnection)
+                    .getResponseCode();
+        } finally {
+            System.out.println("Shutting down the server...");
+            server.stop(0);
+        }
+
+        int idx = ip6_literal.lastIndexOf('%');
+        String ip6_address = ip6_literal.substring(0, idx);
+        List<String> hosts = headers.get().get("Host");
+
+        System.out.println("Host: " + hosts);
+
+        if (hosts.size() != 1 || hosts.get(0).contains("%") ||
+                                !hosts.get(0).contains(ip6_address)) {
+            throw new RuntimeException("FAIL");
+        }
+    }
+
+    private static InetAddress getAppropriateIPv6Address() throws SocketException {
+        System.out.println("Searching through the network interfaces...");
+        Enumeration<NetworkInterface> is = NetworkInterface.getNetworkInterfaces();
+        while (is.hasMoreElements()) {
+            NetworkInterface i = is.nextElement();
+            System.out.println("\tinterface: " + i);
+
+            // just a "good enough" marker that the interface
+            // does not support a loopback and therefore should not be used
+            if ( i.getHardwareAddress() == null) continue;
+            if (!i.isUp()) continue;
+
+            Enumeration<InetAddress> as = i.getInetAddresses();
+            while (as.hasMoreElements()) {
+                InetAddress a = as.nextElement();
+                System.out.println("\t\taddress: " + a.getHostAddress());
+                if ( !(a instanceof Inet6Address &&
+                       a.toString().contains("%")) ) {
+                    continue;
+                }
+                return a;
+            }
+        }
+        return null;
+    }
+
+    private static HttpHandler createCapturingHandler(CompletableFuture<Headers> headers) {
+        return new HttpHandler() {
+            @Override
+            public void handle(HttpExchange exchange) throws IOException {
+                headers.complete(exchange.getRequestHeaders());
+                exchange.sendResponseHeaders(HttpURLConnection.HTTP_OK, -1);
+                exchange.close();
+            }
+        };
+    }
+}
diff --git a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java
index 42d4655..4f80a59 100644
--- a/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java
+++ b/jdk/test/sun/security/pkcs11/KeyStore/SecretKeysBasic.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -139,6 +139,13 @@
     }
 
     private static void doTest() throws Exception {
+        // Make sure both NSS libraries are the same version.
+        if (isNSS(provider) &&
+                (getLibsoftokn3Version() != getLibnss3Version())) {
+            System.out.println("libsoftokn3 and libnss3 versions do not match.  Aborting test...");
+            return;
+        }
+
         if (ks == null) {
             ks = KeyStore.getInstance(KS_TYPE, provider);
             ks.load(null, tokenPwd);
diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java
index f1b179b..ca836f0 100644
--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java
+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java
@@ -66,6 +66,11 @@
     // The other is "libnss3.so", listed as "nss3".
     static String nss_library = "softokn3";
 
+    // NSS versions of each library.  It is simplier to keep nss_version
+    // for quick checking for generic testing than many if-else statements.
+    static double softoken3_version = -1;
+    static double nss3_version = -1;
+
     static Provider getSunPKCS11(String config) throws Exception {
         Class clazz = Class.forName("sun.security.pkcs11.SunPKCS11");
         Constructor cons = clazz.getConstructor(new Class[] {String.class});
@@ -175,6 +180,10 @@
     }
 
     public static String getNSSLibDir() throws Exception {
+        return getNSSLibDir(nss_library);
+    }
+
+    static String getNSSLibDir(String library) throws Exception {
         Properties props = System.getProperties();
         String osName = props.getProperty("os.name");
         if (osName.startsWith("Win")) {
@@ -195,7 +204,7 @@
         String nssLibDir = null;
         for (String dir : nssLibDirs) {
             if (new File(dir).exists() &&
-                new File(dir + System.mapLibraryName(nss_library)).exists()) {
+                new File(dir + System.mapLibraryName(library)).exists()) {
                 nssLibDir = dir;
                 System.setProperty("pkcs11test.nss.libdir", nssLibDir);
                 break;
@@ -241,16 +250,37 @@
         return nss_ecc_status;
     }
 
+    public static double getLibsoftokn3Version() {
+        if (softoken3_version == -1)
+            return getNSSInfo("softokn3");
+        return softoken3_version;
+    }
+
+    public static double getLibnss3Version() {
+        if (nss3_version == -1)
+            return getNSSInfo("nss3");
+        return nss3_version;
+    }
+
     /* Read the library to find out the verison */
     static void getNSSInfo() {
+        getNSSInfo(nss_library);
+    }
+
+    static double getNSSInfo(String library) {
         String nssHeader = "$Header: NSS";
         boolean found = false;
         String s = null;
         int i = 0;
         String libfile = "";
 
+        if (library.compareTo("softokn3") == 0 && softoken3_version > -1)
+            return softoken3_version;
+        if (library.compareTo("nss3") == 0 && nss3_version > -1)
+            return nss3_version;
+
         try {
-            libfile = getNSSLibDir() + System.mapLibraryName(nss_library);
+            libfile = getNSSLibDir() + System.mapLibraryName(library);
             FileInputStream is = new FileInputStream(libfile);
             byte[] data = new byte[1000];
             int read = 0;
@@ -284,9 +314,10 @@
         }
 
         if (!found) {
-            System.out.println("NSS version not found, set to 0.0: "+libfile);
+            System.out.println("lib" + library +
+                    " version not found, set to 0.0: " + libfile);
             nss_version = 0.0;
-            return;
+            return nss_version;
         }
 
         // the index after whitespace after nssHeader
@@ -306,11 +337,12 @@
         try {
             nss_version = Double.parseDouble(version);
         } catch (NumberFormatException e) {
-            System.out.println("Failed to parse NSS version. Set to 0.0");
+            System.out.println("Failed to parse lib" + library +
+                    " version. Set to 0.0");
             e.printStackTrace();
         }
 
-        System.out.print("NSS version = "+version+".  ");
+        System.out.print("lib" + library + " version = "+version+".  ");
 
         // Check for ECC
         if (s.indexOf("Basic") > 0) {
@@ -319,7 +351,17 @@
         } else if (s.indexOf("Extended") > 0) {
             nss_ecc_status = ECCState.Extended;
             System.out.println("ECC Extended.");
+        } else {
+            System.out.println("ECC None.");
         }
+
+        if (library.compareTo("softokn3") == 0) {
+            softoken3_version = nss_version;
+        } else if (library.compareTo("nss3") == 0) {
+            nss3_version = nss_version;
+        }
+
+        return nss_version;
     }
 
     // Used to set the nss_library file to search for libsoftokn3.so
diff --git a/jdk/test/sun/security/tools/keytool/default_options.sh b/jdk/test/sun/security/tools/keytool/default_options.sh
new file mode 100644
index 0000000..5dc9894
--- /dev/null
+++ b/jdk/test/sun/security/tools/keytool/default_options.sh
@@ -0,0 +1,118 @@
+#
+# Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+# @test
+# @bug 8023197
+# @summary Pre-configured command line options for keytool and jarsigner
+#
+
+if [ "${TESTJAVA}" = "" ] ; then
+  JAVAC_CMD=`which javac`
+  TESTJAVA=`dirname $JAVAC_CMD`/..
+fi
+
+KS=ks
+KEYTOOL="$TESTJAVA/bin/keytool ${TESTTOOLVMOPTS}"
+JAR="$TESTJAVA/bin/jar ${TESTTOOLVMOPTS}"
+JARSIGNER="$TESTJAVA/bin/jarsigner ${TESTTOOLVMOPTS}"
+
+rm $KS 2> /dev/null
+
+PASS=changeit
+export PASS
+
+# keytool
+
+cat <<EOF > kt.conf
+# A Pre-configured options file
+keytool.all = -storepass:env PASS -keypass:env PASS -keystore \${user.dir}/$KS -debug
+keytool.genkey = -keyalg ec -ext bc
+keytool.delete = -keystore nothing
+EOF
+
+# kt.conf is read
+$KEYTOOL -conf kt.conf -genkeypair -dname CN=A -alias a || exit 1
+$KEYTOOL -conf kt.conf -list -alias a -v > a_certinfo || exit 2
+grep "Signature algorithm name" a_certinfo | grep ECDSA || exit 3
+grep "BasicConstraints" a_certinfo || exit 4
+
+# kt.conf is read, and dup multi-valued options processed as expected
+$KEYTOOL -conf kt.conf -genkeypair -dname CN=B -alias b -ext ku=ds \
+        || exit 11
+$KEYTOOL -conf kt.conf -list -alias b -v > b_certinfo || exit 12
+grep "BasicConstraints" b_certinfo || exit 14
+grep "DigitalSignature" b_certinfo || exit 15
+
+# Single-valued option in command section override all
+$KEYTOOL -conf kt.conf -delete -alias a && exit 16
+
+# Single-valued option on command line overrides again
+$KEYTOOL -conf kt.conf -delete -alias b -keystore $KS || exit 17
+
+# jarsigner
+
+cat <<EOF > js.conf
+jarsigner.all = -keystore \${user.dir}/$KS -storepass:env PASS -debug -strict
+jarsigner.sign = -digestalg SHA1
+jarsigner.verify = -verbose:summary
+
+EOF
+
+$JAR cvf a.jar ks js.conf kt.conf
+
+$JARSIGNER -conf js.conf a.jar a || exit 21
+$JARSIGNER -conf js.conf -verify a.jar > jarsigner.out || exit 22
+grep "and 2 more" jarsigner.out || exit 23
+$JAR xvf a.jar META-INF/MANIFEST.MF
+grep "SHA1-Digest" META-INF/MANIFEST.MF || exit 24
+
+# Error cases
+
+# File does not exist
+$KEYTOOL -conf no-such-file -help -list && exit 31
+
+# Cannot have both standard name (-genkeypair) and legacy name (-genkey)
+cat <<EOF > bad.conf
+keytool.all = -storepass:env PASS -keypass:env PASS -keystore ks
+keytool.genkeypair = -keyalg rsa
+keytool.genkey = -keyalg ec
+EOF
+
+$KEYTOOL -conf bad.conf -genkeypair -alias me -dname "cn=me" && exit 32
+
+# Unknown options are rejected by tool
+cat <<EOF > bad.conf
+keytool.all=-unknown
+EOF
+
+$KEYTOOL -conf bad.conf -help -list && exit 33
+
+# System property must be present
+cat <<EOF > bad.conf
+keytool.all = -keystore \${no.such.prop}
+EOF
+
+$KEYTOOL -conf bad.conf -help -list && exit 34
+
+echo Done
+exit 0
diff --git a/jdk/test/sun/security/tools/policytool/i18n.sh b/jdk/test/sun/security/tools/policytool/i18n.sh
index cefa93e..536080b 100644
--- a/jdk/test/sun/security/tools/policytool/i18n.sh
+++ b/jdk/test/sun/security/tools/policytool/i18n.sh
@@ -77,7 +77,7 @@
 echo "Checking for $HOME/.java.policy"
 
 # 8015274
-if [ -e $HOME/.java.policy ]; then
+if [ -f $HOME/.java.policy ]; then
     echo "You have a .java.policy file in your HOME directory"
     echo "The file must be removed before running this test"
     exit 1
diff --git a/langtools/.hgtags b/langtools/.hgtags
index 8f92581..e701f6f 100644
--- a/langtools/.hgtags
+++ b/langtools/.hgtags
@@ -260,3 +260,4 @@
 8666a9611eb8ba711b001bf8d942282e3e2d8e3d jdk9-b15
 7d67ebd3e35c3c36ad2caee482a84f8310d2f838 jdk9-b16
 b64f8d5b97faa29e4d629bf4e56ebe0e26c40ecc jdk9-b17
+fd8da51c5df4546995c360fc49f0b985cbf8fbd3 jdk9-b18
diff --git a/langtools/src/share/classes/com/sun/source/util/TaskEvent.java b/langtools/src/share/classes/com/sun/source/util/TaskEvent.java
index eefabcb..5ecde4d 100644
--- a/langtools/src/share/classes/com/sun/source/util/TaskEvent.java
+++ b/langtools/src/share/classes/com/sun/source/util/TaskEvent.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -68,7 +68,15 @@
         /**
          * For events relating to an individual annotation processing round.
          **/
-        ANNOTATION_PROCESSING_ROUND
+        ANNOTATION_PROCESSING_ROUND,
+        /**
+         * Sent before parsing first source file, and after writing the last output file.
+         * This event is not sent when using {@link JavacTask#parse()},
+         * {@link JavacTask#analyze()} or {@link JavacTask#generate()}.
+         *
+         * @since 1.9
+         */
+        COMPILATION,
     }
 
     public TaskEvent(Kind kind) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java b/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
index 0467c2c..6fd5b52 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/ClientCodeWrapper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -202,9 +202,6 @@
 
     // <editor-fold defaultstate="collapsed" desc="Wrapper classes">
 
-    // FIXME: all these classes should be converted to use multi-catch when
-    // that is available in the bootstrap compiler.
-
     protected class WrappedJavaFileManager implements JavaFileManager {
         protected JavaFileManager clientJavaFileManager;
         WrappedJavaFileManager(JavaFileManager clientJavaFileManager) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
index 9dba0ba..9d9ad45 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java
@@ -161,6 +161,15 @@
             compilerMain.log = Log.instance(context);
             compilerMain.setOptions(Options.instance(context));
             compilerMain.filenames = new LinkedHashSet<>();
+            compilerMain.deferredFileManagerOptions = new LinkedHashMap<>();
+            // The following line is conceptually wrong. It should not refer to args
+            // which may include inappropriate file manager options.
+            // (Ideally, args should not even be passed into JavacTaskImpl at all.)
+            // The "no filenames in args" check should have been handled by the use of
+            // the GrumpyHelper in JavacTool.getTask, but processArgs also has some
+            // additional checking, which should be factored out and called separately.
+            // If we fix this, then filenames and deferredFileManagerOptions in Main
+            // can revert to being protected or private, not public.
             Collection<File> filenames = compilerMain.processArgs(CommandLine.parse(args), classNames);
             if (filenames != null && !filenames.isEmpty())
                 throw new IllegalArgumentException("Malformed arguments " + toString(filenames, " "));
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java
index f2cff56..e789314 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java
@@ -142,7 +142,7 @@
          *  access this attribute.
          */
         public final List<Pair<MethodSymbol,Attribute>> values;
-        public TypeAnnotationPosition position;
+        public final TypeAnnotationPosition position;
 
         private boolean synthesized = false;
 
@@ -170,53 +170,9 @@
 
         @Override
         public TypeAnnotationPosition getPosition() {
-            if (hasUnknownPosition()) {
-                if (values.size() != 0) {
-                    Name valueName = values.head.fst.name.table.names.value;
-                    Pair<MethodSymbol, Attribute> res = getElemPair(valueName);
-                    position = res == null ? null : res.snd.getPosition();
-                }
-            }
             return position;
         }
 
-        public boolean isContainerTypeCompound() {
-            if (isSynthesized() && values.size() == 1)
-                return getFirstEmbeddedTC() != null;
-            return false;
-        }
-
-        private Compound getFirstEmbeddedTC() {
-            if (values.size() == 1) {
-                Pair<MethodSymbol, Attribute> val = values.get(0);
-                if (val.fst.getSimpleName().contentEquals("value")
-                        && val.snd instanceof Array) {
-                    Array arr = (Array) val.snd;
-                    if (arr.values.length != 0
-                            && arr.values[0] instanceof Attribute.TypeCompound)
-                        return (Attribute.TypeCompound) arr.values[0];
-                }
-            }
-            return null;
-        }
-
-        public boolean tryFixPosition() {
-            if (!isContainerTypeCompound())
-                return false;
-
-            Compound from = getFirstEmbeddedTC();
-            if (from != null && from.position != null &&
-                    from.position.type != TargetType.UNKNOWN) {
-                position = from.position;
-                return true;
-            }
-            return false;
-        }
-
-        public boolean hasUnknownPosition() {
-            return position.type == TargetType.UNKNOWN;
-        }
-
         public void accept(Visitor v) { v.visitCompound(this); }
 
         /**
@@ -280,6 +236,12 @@
                 valmap.put(value.fst, value.snd);
             return valmap;
         }
+
+        public TypeCompound toTypeCompound() {
+            // It is safe to alias the position.
+            return new TypeCompound(this, this.position);
+        }
+
     }
 
     public static class TypeCompound extends Compound {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java
index 220c276..88f421c 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Flags.java
@@ -296,7 +296,8 @@
         ModifierFlags               = ((long)StandardFlags & ~INTERFACE) | DEFAULT,
         InterfaceMethodMask         = ABSTRACT | STATIC | PUBLIC | STRICTFP | DEFAULT,
         AnnotationTypeElementMask   = ABSTRACT | PUBLIC,
-        LocalVarFlags               = FINAL | PARAMETER;
+        LocalVarFlags               = FINAL | PARAMETER,
+        ReceiverParamFlags          = PARAMETER;
 
 
     public static Set<Modifier> asModifierSet(long flags) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java b/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java
index 0876749..2ac4ca8 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TargetType.java
@@ -107,10 +107,7 @@
     CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT(0x4A, true),
 
     /** For annotations on a type argument of a method reference. */
-    METHOD_REFERENCE_TYPE_ARGUMENT(0x4B, true),
-
-    /** For annotations with an unknown target. */
-    UNKNOWN(0xFF);
+    METHOD_REFERENCE_TYPE_ARGUMENT(0x4B, true);
 
     private static final int MAXIMUM_TARGET_TYPE_VALUE = 0x4B;
 
@@ -150,26 +147,15 @@
         targets = new TargetType[MAXIMUM_TARGET_TYPE_VALUE + 1];
         TargetType[] alltargets = values();
         for (TargetType target : alltargets) {
-            if (target.targetTypeValue != UNKNOWN.targetTypeValue)
                 targets[target.targetTypeValue] = target;
         }
-        for (int i = 0; i <= MAXIMUM_TARGET_TYPE_VALUE; ++i) {
-            if (targets[i] == null)
-                targets[i] = UNKNOWN;
-        }
     }
 
     public static boolean isValidTargetTypeValue(int tag) {
-        if (tag == UNKNOWN.targetTypeValue)
-            return true;
-
         return (tag >= 0 && tag < targets.length);
     }
 
     public static TargetType fromTargetTypeValue(int tag) {
-        if (tag == UNKNOWN.targetTypeValue)
-            return UNKNOWN;
-
         if (tag < 0 || tag >= targets.length)
             Assert.error("Unknown TargetType: " + tag);
         return targets[tag];
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
index 55412a2..76a9fa9 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
@@ -259,9 +259,6 @@
         case METHOD_RETURN:
         case FIELD:
             break;
-        case UNKNOWN:
-            sb.append(", position UNKNOWN!");
-            break;
         default:
             Assert.error("Unknown target type: " + type);
         }
@@ -428,7 +425,7 @@
     }
 
     /**
-     * Create a {@code TypeAnnotationPosition} for a method receiver.
+     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
      *
      * @param location The type path.
      * @param onLambda The lambda for this parameter.
@@ -445,7 +442,7 @@
     }
 
     /**
-     * Create a {@code TypeAnnotationPosition} for a method receiver.
+     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
      *
      * @param location The type path.
      */
@@ -455,7 +452,7 @@
     }
 
     /**
-     * Create a {@code TypeAnnotationPosition} for a method receiver.
+     * Create a {@code TypeAnnotationPosition} for a method receiver parameter.
      *
      * @param pos The position from the associated tree node.
      */
@@ -664,10 +661,11 @@
     public static TypeAnnotationPosition
         exceptionParameter(final List<TypePathEntry> location,
                            final JCLambda onLambda,
+                           final int type_index,
                            final int pos) {
         return new TypeAnnotationPosition(TargetType.EXCEPTION_PARAMETER, pos,
                                           Integer.MIN_VALUE, onLambda,
-                                          Integer.MIN_VALUE, Integer.MIN_VALUE,
+                                          type_index, Integer.MIN_VALUE,
                                           location);
     }
 
@@ -680,7 +678,7 @@
     public static TypeAnnotationPosition
         exceptionParameter(final JCLambda onLambda,
                            final int pos) {
-        return exceptionParameter(emptyPath, onLambda, pos);
+        return exceptionParameter(emptyPath, onLambda, Integer.MIN_VALUE, pos);
     }
 
     /**
@@ -690,7 +688,7 @@
      */
     public static TypeAnnotationPosition
         exceptionParameter(final List<TypePathEntry> location) {
-        return exceptionParameter(location, null, -1);
+        return exceptionParameter(location, null, Integer.MIN_VALUE, -1);
     }
 
 
@@ -1204,12 +1202,4 @@
         return methodTypeParameterBound(location, null, parameter_index,
                                         bound_index, -1);
     }
-
-    // Consider this deprecated on arrival.  We eventually want to get
-    // rid of this value altogether.  Do not use it for anything new.
-    public static final TypeAnnotationPosition unknown =
-        new TypeAnnotationPosition(TargetType.UNKNOWN, -1,
-                                   Integer.MIN_VALUE, null,
-                                   Integer.MIN_VALUE, Integer.MIN_VALUE,
-                                   emptyPath);
 }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java b/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
deleted file mode 100644
index 1fa63c1..0000000
--- a/langtools/src/share/classes/com/sun/tools/javac/code/TypeAnnotations.java
+++ /dev/null
@@ -1,1397 +0,0 @@
-/*
- * Copyright (c) 2009, 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.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package com.sun.tools.javac.code;
-
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.type.TypeKind;
-
-import javax.tools.JavaFileObject;
-
-import com.sun.tools.javac.code.Attribute.TypeCompound;
-import com.sun.tools.javac.code.Type.ArrayType;
-import com.sun.tools.javac.code.Type.CapturedType;
-import com.sun.tools.javac.code.Type.ClassType;
-import com.sun.tools.javac.code.Type.ErrorType;
-import com.sun.tools.javac.code.Type.ForAll;
-import com.sun.tools.javac.code.Type.MethodType;
-import com.sun.tools.javac.code.Type.PackageType;
-import com.sun.tools.javac.code.Type.TypeVar;
-import com.sun.tools.javac.code.Type.UndetVar;
-import com.sun.tools.javac.code.Type.Visitor;
-import com.sun.tools.javac.code.Type.WildcardType;
-import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntry;
-import com.sun.tools.javac.code.TypeAnnotationPosition.TypePathEntryKind;
-import com.sun.tools.javac.code.Symbol.VarSymbol;
-import com.sun.tools.javac.code.Symbol.MethodSymbol;
-import com.sun.tools.javac.comp.Annotate;
-import com.sun.tools.javac.comp.Annotate.Worker;
-import com.sun.tools.javac.comp.Attr;
-import com.sun.tools.javac.comp.AttrContext;
-import com.sun.tools.javac.comp.Env;
-import com.sun.tools.javac.tree.JCTree;
-import com.sun.tools.javac.tree.TreeInfo;
-import com.sun.tools.javac.tree.JCTree.JCBlock;
-import com.sun.tools.javac.tree.JCTree.JCClassDecl;
-import com.sun.tools.javac.tree.JCTree.JCExpression;
-import com.sun.tools.javac.tree.JCTree.JCLambda;
-import com.sun.tools.javac.tree.JCTree.JCMethodDecl;
-import com.sun.tools.javac.tree.JCTree.JCMethodInvocation;
-import com.sun.tools.javac.tree.JCTree.JCNewClass;
-import com.sun.tools.javac.tree.JCTree.JCTypeApply;
-import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
-import com.sun.tools.javac.tree.TreeScanner;
-import com.sun.tools.javac.tree.JCTree.*;
-import com.sun.tools.javac.util.Assert;
-import com.sun.tools.javac.util.Context;
-import com.sun.tools.javac.util.List;
-import com.sun.tools.javac.util.ListBuffer;
-import com.sun.tools.javac.util.Log;
-import com.sun.tools.javac.util.Names;
-import com.sun.tools.javac.util.Options;
-
-/**
- * Contains operations specific to processing type annotations.
- * This class has two functions:
- * separate declaration from type annotations and insert the type
- * annotations to their types;
- * and determine the TypeAnnotationPositions for all type annotations.
- */
-public class TypeAnnotations {
-    protected static final Context.Key<TypeAnnotations> typeAnnosKey = new Context.Key<>();
-
-    public static TypeAnnotations instance(Context context) {
-        TypeAnnotations instance = context.get(typeAnnosKey);
-        if (instance == null)
-            instance = new TypeAnnotations(context);
-        return instance;
-    }
-
-    final Log log;
-    final Names names;
-    final Symtab syms;
-    final Annotate annotate;
-    final Attr attr;
-
-    protected TypeAnnotations(Context context) {
-        context.put(typeAnnosKey, this);
-        names = Names.instance(context);
-        log = Log.instance(context);
-        syms = Symtab.instance(context);
-        annotate = Annotate.instance(context);
-        attr = Attr.instance(context);
-        Options options = Options.instance(context);
-    }
-
-    /**
-     * Separate type annotations from declaration annotations and
-     * determine the correct positions for type annotations.
-     * This version only visits types in signatures and should be
-     * called from MemberEnter.
-     * The method takes the Annotate object as parameter and
-     * adds an Annotate.Worker to the correct Annotate queue for
-     * later processing.
-     */
-    public void organizeTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
-        annotate.afterRepeated( new Worker() {
-            @Override
-            public void run() {
-                JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
-
-                try {
-                    new TypeAnnotationPositions(true).scan(tree);
-                } finally {
-                    log.useSource(oldSource);
-                }
-            }
-        } );
-    }
-
-    public void validateTypeAnnotationsSignatures(final Env<AttrContext> env, final JCClassDecl tree) {
-        annotate.validate(new Worker() { //validate annotations
-            @Override
-            public void run() {
-                JavaFileObject oldSource = log.useSource(env.toplevel.sourcefile);
-
-                try {
-                    attr.validateTypeAnnotations(tree, true);
-                } finally {
-                    log.useSource(oldSource);
-                }
-            }
-        } );
-    }
-
-    /**
-     * This version only visits types in bodies, that is, field initializers,
-     * top-level blocks, and method bodies, and should be called from Attr.
-     */
-    public void organizeTypeAnnotationsBodies(JCClassDecl tree) {
-        new TypeAnnotationPositions(false).scan(tree);
-    }
-
-    public enum AnnotationType { DECLARATION, TYPE, BOTH }
-
-    /**
-     * Determine whether an annotation is a declaration annotation,
-     * a type annotation, or both.
-     */
-    public AnnotationType annotationType(Attribute.Compound a, Symbol s) {
-        Attribute.Compound atTarget =
-            a.type.tsym.attribute(syms.annotationTargetType.tsym);
-        if (atTarget == null) {
-            return inferTargetMetaInfo(a, s);
-        }
-        Attribute atValue = atTarget.member(names.value);
-        if (!(atValue instanceof Attribute.Array)) {
-            Assert.error("annotationType(): bad @Target argument " + atValue +
-                    " (" + atValue.getClass() + ")");
-            return AnnotationType.DECLARATION; // error recovery
-        }
-        Attribute.Array arr = (Attribute.Array) atValue;
-        boolean isDecl = false, isType = false;
-        for (Attribute app : arr.values) {
-            if (!(app instanceof Attribute.Enum)) {
-                Assert.error("annotationType(): unrecognized Attribute kind " + app +
-                        " (" + app.getClass() + ")");
-                isDecl = true;
-                continue;
-            }
-            Attribute.Enum e = (Attribute.Enum) app;
-            if (e.value.name == names.TYPE) {
-                if (s.kind == Kinds.TYP)
-                    isDecl = true;
-            } else if (e.value.name == names.FIELD) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind != Kinds.MTH)
-                    isDecl = true;
-            } else if (e.value.name == names.METHOD) {
-                if (s.kind == Kinds.MTH &&
-                        !s.isConstructor())
-                    isDecl = true;
-            } else if (e.value.name == names.PARAMETER) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind == Kinds.MTH &&
-                        (s.flags() & Flags.PARAMETER) != 0)
-                    isDecl = true;
-            } else if (e.value.name == names.CONSTRUCTOR) {
-                if (s.kind == Kinds.MTH &&
-                        s.isConstructor())
-                    isDecl = true;
-            } else if (e.value.name == names.LOCAL_VARIABLE) {
-                if (s.kind == Kinds.VAR &&
-                        s.owner.kind == Kinds.MTH &&
-                        (s.flags() & Flags.PARAMETER) == 0)
-                    isDecl = true;
-            } else if (e.value.name == names.ANNOTATION_TYPE) {
-                if (s.kind == Kinds.TYP &&
-                        (s.flags() & Flags.ANNOTATION) != 0)
-                    isDecl = true;
-            } else if (e.value.name == names.PACKAGE) {
-                if (s.kind == Kinds.PCK)
-                    isDecl = true;
-            } else if (e.value.name == names.TYPE_USE) {
-                if (s.kind == Kinds.TYP ||
-                        s.kind == Kinds.VAR ||
-                        (s.kind == Kinds.MTH && !s.isConstructor() &&
-                        !s.type.getReturnType().hasTag(TypeTag.VOID)) ||
-                        (s.kind == Kinds.MTH && s.isConstructor()))
-                    isType = true;
-            } else if (e.value.name == names.TYPE_PARAMETER) {
-                /* Irrelevant in this case */
-                // TYPE_PARAMETER doesn't aid in distinguishing between
-                // Type annotations and declaration annotations on an
-                // Element
-            } else {
-                Assert.error("annotationType(): unrecognized Attribute name " + e.value.name +
-                        " (" + e.value.name.getClass() + ")");
-                isDecl = true;
-            }
-        }
-        if (isDecl && isType) {
-            return AnnotationType.BOTH;
-        } else if (isType) {
-            return AnnotationType.TYPE;
-        } else {
-            return AnnotationType.DECLARATION;
-        }
-    }
-
-    /** Infer the target annotation kind, if none is give.
-     * We only infer declaration annotations.
-     */
-    private static AnnotationType inferTargetMetaInfo(Attribute.Compound a, Symbol s) {
-        return AnnotationType.DECLARATION;
-    }
-
-
-    private class TypeAnnotationPositions extends TreeScanner {
-
-        private final boolean sigOnly;
-
-        TypeAnnotationPositions(boolean sigOnly) {
-            this.sigOnly = sigOnly;
-        }
-
-        /*
-         * When traversing the AST we keep the "frames" of visited
-         * trees in order to determine the position of annotations.
-         */
-        private ListBuffer<JCTree> frames = new ListBuffer<>();
-
-        protected void push(JCTree t) { frames = frames.prepend(t); }
-        protected JCTree pop() { return frames.next(); }
-        // could this be frames.elems.tail.head?
-        private JCTree peek2() { return frames.toList().tail.head; }
-
-        @Override
-        public void scan(JCTree tree) {
-            push(tree);
-            super.scan(tree);
-            pop();
-        }
-
-        /**
-         * Separates type annotations from declaration annotations.
-         * This step is needed because in certain locations (where declaration
-         * and type annotations can be mixed, e.g. the type of a field)
-         * we never build an JCAnnotatedType. This step finds these
-         * annotations and marks them as if they were part of the type.
-         */
-        private void separateAnnotationsKinds(JCTree typetree, Type type, Symbol sym,
-                TypeAnnotationPosition pos) {
-            List<Attribute.Compound> annotations = sym.getRawAttributes();
-            ListBuffer<Attribute.Compound> declAnnos = new ListBuffer<>();
-            ListBuffer<Attribute.TypeCompound> typeAnnos = new ListBuffer<>();
-            ListBuffer<Attribute.TypeCompound> onlyTypeAnnos = new ListBuffer<>();
-
-            for (Attribute.Compound a : annotations) {
-                switch (annotationType(a, sym)) {
-                case DECLARATION:
-                    declAnnos.append(a);
-                    break;
-                case BOTH: {
-                    declAnnos.append(a);
-                    Attribute.TypeCompound ta = toTypeCompound(a, pos);
-                    typeAnnos.append(ta);
-                    break;
-                }
-                case TYPE: {
-                    Attribute.TypeCompound ta = toTypeCompound(a, pos);
-                    typeAnnos.append(ta);
-                    // Also keep track which annotations are only type annotations
-                    onlyTypeAnnos.append(ta);
-                    break;
-                }
-                }
-            }
-
-            sym.resetAnnotations();
-            sym.setDeclarationAttributes(declAnnos.toList());
-
-            if (typeAnnos.isEmpty()) {
-                return;
-            }
-
-            List<Attribute.TypeCompound> typeAnnotations = typeAnnos.toList();
-
-            if (type == null) {
-                // When type is null, put the type annotations to the symbol.
-                // This is used for constructor return annotations, for which
-                // we use the type of the enclosing class.
-                type = sym.getEnclosingElement().asType();
-
-                // Declaration annotations are always allowed on constructor returns.
-                // Therefore, use typeAnnotations instead of onlyTypeAnnos.
-                type = typeWithAnnotations(typetree, type, typeAnnotations, typeAnnotations);
-                // Note that we don't use the result, the call to
-                // typeWithAnnotations side-effects the type annotation positions.
-                // This is important for constructors of nested classes.
-                sym.appendUniqueTypeAttributes(typeAnnotations);
-                return;
-            }
-
-            // type is non-null and annotations are added to that type
-            type = typeWithAnnotations(typetree, type, typeAnnotations, onlyTypeAnnos.toList());
-
-            if (sym.getKind() == ElementKind.METHOD) {
-                sym.type.asMethodType().restype = type;
-            } else if (sym.getKind() == ElementKind.PARAMETER) {
-                sym.type = type;
-                if (sym.getQualifiedName().equals(names._this)) {
-                    sym.owner.type.asMethodType().recvtype = type;
-                    // note that the typeAnnotations will also be added to the owner below.
-                } else {
-                    MethodType methType = sym.owner.type.asMethodType();
-                    List<VarSymbol> params = ((MethodSymbol)sym.owner).params;
-                    List<Type> oldArgs = methType.argtypes;
-                    ListBuffer<Type> newArgs = new ListBuffer<>();
-                    while (params.nonEmpty()) {
-                        if (params.head == sym) {
-                            newArgs.add(type);
-                        } else {
-                            newArgs.add(oldArgs.head);
-                        }
-                        oldArgs = oldArgs.tail;
-                        params = params.tail;
-                    }
-                    methType.argtypes = newArgs.toList();
-                }
-            } else {
-                sym.type = type;
-            }
-
-            sym.appendUniqueTypeAttributes(typeAnnotations);
-
-            if (sym.getKind() == ElementKind.PARAMETER ||
-                sym.getKind() == ElementKind.LOCAL_VARIABLE ||
-                sym.getKind() == ElementKind.RESOURCE_VARIABLE ||
-                sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
-                // Make sure all type annotations from the symbol are also
-                // on the owner.
-                sym.owner.appendUniqueTypeAttributes(sym.getRawTypeAttributes());
-            }
-        }
-
-        // This method has a similar purpose as
-        // {@link com.sun.tools.javac.parser.JavacParser.insertAnnotationsToMostInner(JCExpression, List<JCTypeAnnotation>, boolean)}
-        // We found a type annotation in a declaration annotation position,
-        // for example, on the return type.
-        // Such an annotation is _not_ part of an JCAnnotatedType tree and we therefore
-        // need to set its position explicitly.
-        // The method returns a copy of type that contains these annotations.
-        //
-        // As a side effect the method sets the type annotation position of "annotations".
-        // Note that it is assumed that all annotations share the same position.
-        private Type typeWithAnnotations(final JCTree typetree, final Type type,
-                final List<Attribute.TypeCompound> annotations,
-                final List<Attribute.TypeCompound> onlyTypeAnnotations) {
-            //System.err.printf("typeWithAnnotations(typetree: %s, type: %s, annotations: %s, onlyTypeAnnotations: %s)%n",
-            //         typetree, type, annotations, onlyTypeAnnotations);
-            if (annotations.isEmpty()) {
-                return type;
-            }
-            if (type.hasTag(TypeTag.ARRAY)) {
-                Type.ArrayType arType = (Type.ArrayType) type;
-                Type.ArrayType tomodify = new Type.ArrayType(null, arType.tsym,
-                                                             Type.noAnnotations);
-                Type toreturn;
-                if (type.isAnnotated()) {
-                    toreturn = tomodify.annotatedType(type.getAnnotationMirrors());
-                } else {
-                    toreturn = tomodify;
-                }
-
-                JCArrayTypeTree arTree = arrayTypeTree(typetree);
-
-                ListBuffer<TypePathEntry> depth = new ListBuffer<>();
-                depth = depth.append(TypePathEntry.ARRAY);
-                while (arType.elemtype.hasTag(TypeTag.ARRAY)) {
-                    if (arType.elemtype.isAnnotated()) {
-                        Type aelemtype = arType.elemtype;
-                        arType = (Type.ArrayType) aelemtype;
-                        ArrayType prevToMod = tomodify;
-                        tomodify = new Type.ArrayType(null, arType.tsym,
-                                                      Type.noAnnotations);
-                        prevToMod.elemtype = tomodify.annotatedType(arType.elemtype.getAnnotationMirrors());
-                    } else {
-                        arType = (Type.ArrayType) arType.elemtype;
-                        tomodify.elemtype = new Type.ArrayType(null, arType.tsym,
-                                                               Type.noAnnotations);
-                        tomodify = (Type.ArrayType) tomodify.elemtype;
-                    }
-                    arTree = arrayTypeTree(arTree.elemtype);
-                    depth = depth.append(TypePathEntry.ARRAY);
-                }
-                Type arelemType = typeWithAnnotations(arTree.elemtype, arType.elemtype, annotations, onlyTypeAnnotations);
-                tomodify.elemtype = arelemType;
-                {
-                    // All annotations share the same position; modify the first one.
-                    Attribute.TypeCompound a = annotations.get(0);
-                    TypeAnnotationPosition p = a.position;
-                    p.location = p.location.prependList(depth.toList());
-                }
-                typetree.type = toreturn;
-                return toreturn;
-            } else if (type.hasTag(TypeTag.TYPEVAR)) {
-                // Nothing to do for type variables.
-                return type;
-            } else if (type.getKind() == TypeKind.UNION) {
-                // There is a TypeKind, but no TypeTag.
-                JCTypeUnion tutree = (JCTypeUnion) typetree;
-                JCExpression fst = tutree.alternatives.get(0);
-                Type res = typeWithAnnotations(fst, fst.type, annotations, onlyTypeAnnotations);
-                fst.type = res;
-                // TODO: do we want to set res as first element in uct.alternatives?
-                // UnionClassType uct = (com.sun.tools.javac.code.Type.UnionClassType)type;
-                // Return the un-annotated union-type.
-                return type;
-            } else {
-                Type enclTy = type;
-                Element enclEl = type.asElement();
-                JCTree enclTr = typetree;
-
-                while (enclEl != null &&
-                        enclEl.getKind() != ElementKind.PACKAGE &&
-                        enclTy != null &&
-                        enclTy.getKind() != TypeKind.NONE &&
-                        enclTy.getKind() != TypeKind.ERROR &&
-                        (enclTr.getKind() == JCTree.Kind.MEMBER_SELECT ||
-                         enclTr.getKind() == JCTree.Kind.PARAMETERIZED_TYPE ||
-                         enclTr.getKind() == JCTree.Kind.ANNOTATED_TYPE)) {
-                    // Iterate also over the type tree, not just the type: the type is already
-                    // completely resolved and we cannot distinguish where the annotation
-                    // belongs for a nested type.
-                    if (enclTr.getKind() == JCTree.Kind.MEMBER_SELECT) {
-                        // only change encl in this case.
-                        enclTy = enclTy.getEnclosingType();
-                        enclEl = enclEl.getEnclosingElement();
-                        enclTr = ((JCFieldAccess)enclTr).getExpression();
-                    } else if (enclTr.getKind() == JCTree.Kind.PARAMETERIZED_TYPE) {
-                        enclTr = ((JCTypeApply)enclTr).getType();
-                    } else {
-                        // only other option because of while condition
-                        enclTr = ((JCAnnotatedType)enclTr).getUnderlyingType();
-                    }
-                }
-
-                /** We are trying to annotate some enclosing type,
-                 * but nothing more exists.
-                 */
-                if (enclTy != null &&
-                        enclTy.hasTag(TypeTag.NONE)) {
-                    switch (onlyTypeAnnotations.size()) {
-                    case 0:
-                        // Don't issue an error if all type annotations are
-                        // also declaration annotations.
-                        // If the annotations are also declaration annotations, they are
-                        // illegal as type annotations but might be legal as declaration annotations.
-                        // The normal declaration annotation checks make sure that the use is valid.
-                        break;
-                    case 1:
-                        log.error(typetree.pos(), "cant.type.annotate.scoping.1",
-                                onlyTypeAnnotations);
-                        break;
-                    default:
-                        log.error(typetree.pos(), "cant.type.annotate.scoping",
-                                onlyTypeAnnotations);
-                    }
-                    return type;
-                }
-
-                // At this point we have visited the part of the nested
-                // type that is written in the source code.
-                // Now count from here to the actual top-level class to determine
-                // the correct nesting.
-
-                // The genericLocation for the annotation.
-                ListBuffer<TypePathEntry> depth = new ListBuffer<>();
-
-                Type topTy = enclTy;
-                while (enclEl != null &&
-                        enclEl.getKind() != ElementKind.PACKAGE &&
-                        topTy != null &&
-                        topTy.getKind() != TypeKind.NONE &&
-                        topTy.getKind() != TypeKind.ERROR) {
-                    topTy = topTy.getEnclosingType();
-                    enclEl = enclEl.getEnclosingElement();
-
-                    if (topTy != null && topTy.getKind() != TypeKind.NONE) {
-                        // Only count enclosing types.
-                        depth = depth.append(TypePathEntry.INNER_TYPE);
-                    }
-                }
-
-                if (depth.nonEmpty()) {
-                    // Only need to change the annotation positions
-                    // if they are on an enclosed type.
-                    // All annotations share the same position; modify the first one.
-                    Attribute.TypeCompound a = annotations.get(0);
-                    TypeAnnotationPosition p = a.position;
-                    p.location = p.location.appendList(depth.toList());
-                }
-
-                Type ret = typeWithAnnotations(type, enclTy, annotations);
-                typetree.type = ret;
-                return ret;
-            }
-        }
-
-        private JCArrayTypeTree arrayTypeTree(JCTree typetree) {
-            if (typetree.getKind() == JCTree.Kind.ARRAY_TYPE) {
-                return (JCArrayTypeTree) typetree;
-            } else if (typetree.getKind() == JCTree.Kind.ANNOTATED_TYPE) {
-                return (JCArrayTypeTree) ((JCAnnotatedType)typetree).underlyingType;
-            } else {
-                Assert.error("Could not determine array type from type tree: " + typetree);
-                return null;
-            }
-        }
-
-        /** Return a copy of the first type that only differs by
-         * inserting the annotations to the left-most/inner-most type
-         * or the type given by stopAt.
-         *
-         * We need the stopAt parameter to know where on a type to
-         * put the annotations.
-         * If we have nested classes Outer > Middle > Inner, and we
-         * have the source type "@A Middle.Inner", we will invoke
-         * this method with type = Outer.Middle.Inner,
-         * stopAt = Middle.Inner, and annotations = @A.
-         *
-         * @param type The type to copy.
-         * @param stopAt The type to stop at.
-         * @param annotations The annotations to insert.
-         * @return A copy of type that contains the annotations.
-         */
-        private Type typeWithAnnotations(final Type type,
-                final Type stopAt,
-                final List<Attribute.TypeCompound> annotations) {
-            //System.err.println("typeWithAnnotations " + type + " " + annotations + " stopAt " + stopAt);
-            Visitor<Type, List<TypeCompound>> visitor =
-                    new Type.Visitor<Type, List<Attribute.TypeCompound>>() {
-                @Override
-                public Type visitClassType(ClassType t, List<TypeCompound> s) {
-                    // assert that t.constValue() == null?
-                    if (t == stopAt ||
-                        t.getEnclosingType() == Type.noType) {
-                        return t.annotatedType(s);
-                    } else {
-                        ClassType ret = new ClassType(t.getEnclosingType().accept(this, s),
-                                                      t.typarams_field, t.tsym,
-                                                      t.getAnnotationMirrors());
-                        ret.all_interfaces_field = t.all_interfaces_field;
-                        ret.allparams_field = t.allparams_field;
-                        ret.interfaces_field = t.interfaces_field;
-                        ret.rank_field = t.rank_field;
-                        ret.supertype_field = t.supertype_field;
-                        return ret;
-                    }
-                }
-
-                @Override
-                public Type visitWildcardType(WildcardType t, List<TypeCompound> s) {
-                    return t.annotatedType(s);
-                }
-
-                @Override
-                public Type visitArrayType(ArrayType t, List<TypeCompound> s) {
-                    ArrayType ret = new ArrayType(t.elemtype.accept(this, s), t.tsym,
-                                                  t.getAnnotationMirrors());
-                    return ret;
-                }
-
-                @Override
-                public Type visitMethodType(MethodType t, List<TypeCompound> s) {
-                    // Impossible?
-                    return t;
-                }
-
-                @Override
-                public Type visitPackageType(PackageType t, List<TypeCompound> s) {
-                    // Impossible?
-                    return t;
-                }
-
-                @Override
-                public Type visitTypeVar(TypeVar t, List<TypeCompound> s) {
-                    return t.annotatedType(s);
-                }
-
-                @Override
-                public Type visitCapturedType(CapturedType t, List<TypeCompound> s) {
-                    return t.annotatedType(s);
-                }
-
-                @Override
-                public Type visitForAll(ForAll t, List<TypeCompound> s) {
-                    // Impossible?
-                    return t;
-                }
-
-                @Override
-                public Type visitUndetVar(UndetVar t, List<TypeCompound> s) {
-                    // Impossible?
-                    return t;
-                }
-
-                @Override
-                public Type visitErrorType(ErrorType t, List<TypeCompound> s) {
-                    return t.annotatedType(s);
-                }
-
-                @Override
-                public Type visitType(Type t, List<TypeCompound> s) {
-                    return t.annotatedType(s);
-                }
-            };
-
-            return type.accept(visitor, annotations);
-        }
-
-        private Attribute.TypeCompound toTypeCompound(Attribute.Compound a, TypeAnnotationPosition p) {
-            // It is safe to alias the position.
-            return new Attribute.TypeCompound(a, p);
-        }
-
-
-        /* This is the beginning of the second part of organizing
-         * type annotations: determine the type annotation positions.
-         */
-
-        // This method is considered deprecated, and will be removed
-        // in the near future.  Don't use it for anything new.
-        private TypeAnnotationPosition
-            resolveFrame(JCTree tree,
-                         JCTree frame,
-                         List<JCTree> path,
-                         JCLambda currentLambda,
-                         int outer_type_index,
-                         ListBuffer<TypePathEntry> location) {
-            /*
-            System.out.println("Resolving tree: " + tree + " kind: " + tree.getKind());
-            System.out.println("    Framing tree: " + frame + " kind: " + frame.getKind());
-            */
-
-            // Note that p.offset is set in
-            // com.sun.tools.javac.jvm.Gen.setTypeAnnotationPositions(int)
-
-            switch (frame.getKind()) {
-                case TYPE_CAST:
-                    return TypeAnnotationPosition.typeCast(location.toList(),
-                                                           currentLambda,
-                                                           outer_type_index,
-                                                           frame.pos);
-
-                case INSTANCE_OF:
-                    return TypeAnnotationPosition.instanceOf(location.toList(),
-                                                             currentLambda,
-                                                             frame.pos);
-
-                case NEW_CLASS:
-                    final JCNewClass frameNewClass = (JCNewClass) frame;
-                    if (frameNewClass.def != null) {
-                        // Special handling for anonymous class instantiations
-                        final JCClassDecl frameClassDecl = frameNewClass.def;
-                        if (frameClassDecl.extending == tree) {
-                            return TypeAnnotationPosition
-                                .classExtends(location.toList(), currentLambda,
-                                              frame.pos);
-                        } else if (frameClassDecl.implementing.contains(tree)) {
-                            final int type_index =
-                                frameClassDecl.implementing.indexOf(tree);
-                            return TypeAnnotationPosition
-                                .classExtends(location.toList(), currentLambda,
-                                              type_index, frame.pos);
-                        } else {
-                            // In contrast to CLASS below, typarams cannot occur here.
-                            throw new AssertionError("Could not determine position of tree " + tree +
-                                                     " within frame " + frame);
-                        }
-                    } else if (frameNewClass.typeargs.contains(tree)) {
-                        final int type_index =
-                            frameNewClass.typeargs.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .constructorInvocationTypeArg(location.toList(),
-                                                          currentLambda,
-                                                          type_index,
-                                                          frame.pos);
-                    } else {
-                        return TypeAnnotationPosition
-                            .newObj(location.toList(), currentLambda,
-                                    frame.pos);
-                    }
-
-                case NEW_ARRAY:
-                    return TypeAnnotationPosition
-                        .newObj(location.toList(), currentLambda, frame.pos);
-
-                case ANNOTATION_TYPE:
-                case CLASS:
-                case ENUM:
-                case INTERFACE:
-                    if (((JCClassDecl)frame).extending == tree) {
-                        return TypeAnnotationPosition
-                            .classExtends(location.toList(), currentLambda,
-                                          frame.pos);
-                    } else if (((JCClassDecl)frame).implementing.contains(tree)) {
-                        final int type_index =
-                            ((JCClassDecl)frame).implementing.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .classExtends(location.toList(), currentLambda,
-                                          type_index, frame.pos);
-                    } else if (((JCClassDecl)frame).typarams.contains(tree)) {
-                        final int parameter_index =
-                            ((JCClassDecl)frame).typarams.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .typeParameter(location.toList(), currentLambda,
-                                           parameter_index, frame.pos);
-                    } else {
-                        throw new AssertionError("Could not determine position of tree " +
-                                                 tree + " within frame " + frame);
-                    }
-
-                case METHOD: {
-                    final JCMethodDecl frameMethod = (JCMethodDecl) frame;
-                    if (frameMethod.thrown.contains(tree)) {
-                        final int type_index = frameMethod.thrown.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .methodThrows(location.toList(), currentLambda,
-                                          type_index, frame.pos);
-                    } else if (frameMethod.restype == tree) {
-                        return TypeAnnotationPosition
-                            .methodReturn(location.toList(), currentLambda,
-                                          frame.pos);
-                    } else if (frameMethod.typarams.contains(tree)) {
-                        final int parameter_index =
-                            frameMethod.typarams.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .methodTypeParameter(location.toList(),
-                                                 currentLambda,
-                                                 parameter_index, frame.pos);
-                    } else {
-                        throw new AssertionError("Could not determine position of tree " + tree +
-                                                 " within frame " + frame);
-                    }
-                }
-
-                case PARAMETERIZED_TYPE: {
-                    List<JCTree> newPath = path.tail;
-
-                    if (((JCTypeApply)frame).clazz == tree) {
-                        // generic: RAW; noop
-                    } else if (((JCTypeApply)frame).arguments.contains(tree)) {
-                        JCTypeApply taframe = (JCTypeApply) frame;
-                        int arg = taframe.arguments.indexOf(tree);
-                        location = location.prepend(
-                            new TypePathEntry(TypePathEntryKind.TYPE_ARGUMENT,
-                                              arg));
-
-                        Type typeToUse;
-                        if (newPath.tail != null &&
-                            newPath.tail.head.hasTag(Tag.NEWCLASS)) {
-                            // If we are within an anonymous class
-                            // instantiation, use its type, because it
-                            // contains a correctly nested type.
-                            typeToUse = newPath.tail.head.type;
-                        } else {
-                            typeToUse = taframe.type;
-                        }
-
-                        location = locateNestedTypes(typeToUse, location);
-                    } else {
-                        throw new AssertionError("Could not determine type argument position of tree " + tree +
-                                                 " within frame " + frame);
-                    }
-
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index, location);
-                }
-
-                case MEMBER_REFERENCE: {
-                    JCMemberReference mrframe = (JCMemberReference) frame;
-
-                    if (mrframe.expr == tree) {
-                        switch (mrframe.mode) {
-                        case INVOKE:
-                            return TypeAnnotationPosition
-                                .methodRef(location.toList(), currentLambda,
-                                           frame.pos);
-                        case NEW:
-                            return TypeAnnotationPosition
-                                .constructorRef(location.toList(),
-                                                currentLambda,
-                                                frame.pos);
-                        default:
-                            throw new AssertionError("Unknown method reference mode " + mrframe.mode +
-                                                     " for tree " + tree + " within frame " + frame);
-                        }
-                    } else if (mrframe.typeargs != null &&
-                            mrframe.typeargs.contains(tree)) {
-                        final int type_index = mrframe.typeargs.indexOf(tree);
-                        switch (mrframe.mode) {
-                        case INVOKE:
-                            return TypeAnnotationPosition
-                                .methodRefTypeArg(location.toList(),
-                                                  currentLambda,
-                                                  type_index, frame.pos);
-                        case NEW:
-                            return TypeAnnotationPosition
-                                .constructorRefTypeArg(location.toList(),
-                                                       currentLambda,
-                                                       type_index, frame.pos);
-                        default:
-                            throw new AssertionError("Unknown method reference mode " + mrframe.mode +
-                                                   " for tree " + tree + " within frame " + frame);
-                        }
-                    } else {
-                        throw new AssertionError("Could not determine type argument position of tree " + tree +
-                                               " within frame " + frame);
-                    }
-                }
-
-                case ARRAY_TYPE: {
-                    location = location.prepend(TypePathEntry.ARRAY);
-                    List<JCTree> newPath = path.tail;
-                    while (true) {
-                        JCTree npHead = newPath.tail.head;
-                        if (npHead.hasTag(JCTree.Tag.TYPEARRAY)) {
-                            newPath = newPath.tail;
-                            location = location.prepend(TypePathEntry.ARRAY);
-                        } else if (npHead.hasTag(JCTree.Tag.ANNOTATED_TYPE)) {
-                            newPath = newPath.tail;
-                        } else {
-                            break;
-                        }
-                    }
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index, location);
-                }
-
-                case TYPE_PARAMETER:
-                    if (path.tail.tail.head.hasTag(JCTree.Tag.CLASSDEF)) {
-                        final JCClassDecl clazz =
-                            (JCClassDecl)path.tail.tail.head;
-                        final int parameter_index =
-                            clazz.typarams.indexOf(path.tail.head);
-                        final int bound_index =
-                            ((JCTypeParameter)frame).bounds.get(0)
-                            .type.isInterface() ?
-                            ((JCTypeParameter)frame).bounds.indexOf(tree) + 1:
-                            ((JCTypeParameter)frame).bounds.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .typeParameterBound(location.toList(),
-                                                currentLambda,
-                                                parameter_index, bound_index,
-                                                frame.pos);
-                    } else if (path.tail.tail.head.hasTag(JCTree.Tag.METHODDEF)) {
-                        final JCMethodDecl method =
-                            (JCMethodDecl)path.tail.tail.head;
-                        final int parameter_index =
-                            method.typarams.indexOf(path.tail.head);
-                        final int bound_index =
-                            ((JCTypeParameter)frame).bounds.get(0)
-                            .type.isInterface() ?
-                            ((JCTypeParameter)frame).bounds.indexOf(tree) + 1:
-                            ((JCTypeParameter)frame).bounds.indexOf(tree);
-                        return TypeAnnotationPosition
-                            .methodTypeParameterBound(location.toList(),
-                                                      currentLambda,
-                                                      parameter_index,
-                                                      bound_index,
-                                                      frame.pos);
-                    } else {
-                        throw new AssertionError("Could not determine position of tree " + tree +
-                                                 " within frame " + frame);
-                    }
-
-                case VARIABLE:
-                    VarSymbol v = ((JCVariableDecl)frame).sym;
-                    if (v.getKind() != ElementKind.FIELD) {
-                        v.owner.appendUniqueTypeAttributes(v.getRawTypeAttributes());
-                    }
-                    switch (v.getKind()) {
-                        case LOCAL_VARIABLE:
-                            return TypeAnnotationPosition
-                                .localVariable(location.toList(), currentLambda,
-                                               frame.pos);
-                        case FIELD:
-                            return TypeAnnotationPosition.field(location.toList(),
-                                                                currentLambda,
-                                                                frame.pos);
-                        case PARAMETER:
-                            if (v.getQualifiedName().equals(names._this)) {
-                                return TypeAnnotationPosition
-                                    .methodReceiver(location.toList(),
-                                                    currentLambda,
-                                                    frame.pos);
-                            } else {
-                                final int parameter_index =
-                                    methodParamIndex(path, frame);
-                                return TypeAnnotationPosition
-                                    .methodParameter(location.toList(),
-                                                     currentLambda,
-                                                     parameter_index,
-                                                     frame.pos);
-                            }
-                        case EXCEPTION_PARAMETER:
-                            return TypeAnnotationPosition
-                                .exceptionParameter(location.toList(),
-                                                    currentLambda,
-                                                    frame.pos);
-                        case RESOURCE_VARIABLE:
-                            return TypeAnnotationPosition
-                                .resourceVariable(location.toList(),
-                                                  currentLambda,
-                                                  frame.pos);
-                        default:
-                            throw new AssertionError("Found unexpected type annotation for variable: " + v + " with kind: " + v.getKind());
-                    }
-
-                case ANNOTATED_TYPE: {
-                    if (frame == tree) {
-                        // This is only true for the first annotated type we see.
-                        // For any other annotated types along the path, we do
-                        // not care about inner types.
-                        JCAnnotatedType atypetree = (JCAnnotatedType) frame;
-                        final Type utype = atypetree.underlyingType.type;
-                        Assert.checkNonNull(utype);
-                        Symbol tsym = utype.tsym;
-                        if (tsym.getKind().equals(ElementKind.TYPE_PARAMETER) ||
-                                utype.getKind().equals(TypeKind.WILDCARD) ||
-                                utype.getKind().equals(TypeKind.ARRAY)) {
-                            // Type parameters, wildcards, and arrays have the declaring
-                            // class/method as enclosing elements.
-                            // There is actually nothing to do for them.
-                        } else {
-                            location = locateNestedTypes(utype, location);
-                        }
-                    }
-                    List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index, location);
-                }
-
-                case UNION_TYPE: {
-                    List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index, location);
-                }
-
-                case INTERSECTION_TYPE: {
-                    JCTypeIntersection isect = (JCTypeIntersection)frame;
-                    final List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        isect.bounds.indexOf(tree), location);
-                }
-
-                case METHOD_INVOCATION: {
-                    JCMethodInvocation invocation = (JCMethodInvocation)frame;
-                    if (!invocation.typeargs.contains(tree)) {
-                        throw new AssertionError("{" + tree + "} is not an argument in the invocation: " + invocation);
-                    }
-                    MethodSymbol exsym = (MethodSymbol) TreeInfo.symbol(invocation.getMethodSelect());
-                    final int type_index = invocation.typeargs.indexOf(tree);
-                    if (exsym == null) {
-                        throw new AssertionError("could not determine symbol for {" + invocation + "}");
-                    } else if (exsym.isConstructor()) {
-                        return TypeAnnotationPosition
-                            .constructorInvocationTypeArg(location.toList(),
-                                                          currentLambda,
-                                                          type_index,
-                                                          invocation.pos);
-                    } else {
-                        return TypeAnnotationPosition
-                            .methodInvocationTypeArg(location.toList(),
-                                                     currentLambda,
-                                                     type_index,
-                                                     invocation.pos);
-                    }
-                }
-
-                case EXTENDS_WILDCARD:
-                case SUPER_WILDCARD: {
-                    // Annotations in wildcard bounds
-                    final List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index,
-                                        location.prepend(TypePathEntry.WILDCARD));
-                }
-
-                case MEMBER_SELECT: {
-                    final List<JCTree> newPath = path.tail;
-                    return resolveFrame(newPath.head, newPath.tail.head,
-                                        newPath, currentLambda,
-                                        outer_type_index, location);
-                }
-
-                default:
-                    throw new AssertionError("Unresolved frame: " + frame +
-                                             " of kind: " + frame.getKind() +
-                                             "\n    Looking for tree: " + tree);
-            }
-        }
-
-        private ListBuffer<TypePathEntry>
-            locateNestedTypes(Type type,
-                              ListBuffer<TypePathEntry> depth) {
-            Type encl = type.getEnclosingType();
-            while (encl != null &&
-                    encl.getKind() != TypeKind.NONE &&
-                    encl.getKind() != TypeKind.ERROR) {
-                depth = depth.prepend(TypePathEntry.INNER_TYPE);
-                encl = encl.getEnclosingType();
-            }
-            return depth;
-        }
-
-        private int methodParamIndex(List<JCTree> path, JCTree param) {
-            List<JCTree> curr = path;
-            while (curr.head.getTag() != Tag.METHODDEF &&
-                    curr.head.getTag() != Tag.LAMBDA) {
-                curr = curr.tail;
-            }
-            if (curr.head.getTag() == Tag.METHODDEF) {
-                JCMethodDecl method = (JCMethodDecl)curr.head;
-                return method.params.indexOf(param);
-            } else if (curr.head.getTag() == Tag.LAMBDA) {
-                JCLambda lambda = (JCLambda)curr.head;
-                return lambda.params.indexOf(param);
-            } else {
-                Assert.error("methodParamIndex expected to find method or lambda for param: " + param);
-                return -1;
-            }
-        }
-
-        // Each class (including enclosed inner classes) is visited separately.
-        // This flag is used to prevent from visiting inner classes.
-        private boolean isInClass = false;
-
-        @Override
-        public void visitClassDef(JCClassDecl tree) {
-            if (isInClass)
-                return;
-            isInClass = true;
-
-            if (sigOnly) {
-                scan(tree.mods);
-                scan(tree.typarams);
-                scan(tree.extending);
-                scan(tree.implementing);
-            }
-            scan(tree.defs);
-        }
-
-        /**
-         * Resolve declaration vs. type annotations in methods and
-         * then determine the positions.
-         */
-        @Override
-        public void visitMethodDef(final JCMethodDecl tree) {
-            if (tree.sym == null) {
-                Assert.error("Visiting tree node before memberEnter");
-            }
-            if (sigOnly) {
-                if (!tree.mods.annotations.isEmpty()) {
-                    if (tree.sym.isConstructor()) {
-                        final TypeAnnotationPosition pos =
-                            TypeAnnotationPosition.methodReturn(tree.pos);
-                        // Use null to mark that the annotations go
-                        // with the symbol.
-                        separateAnnotationsKinds(tree, null, tree.sym, pos);
-                    } else {
-                        final TypeAnnotationPosition pos =
-                            TypeAnnotationPosition.methodReturn(tree.restype.pos);
-                        separateAnnotationsKinds(tree.restype,
-                                                 tree.sym.type.getReturnType(),
-                                                 tree.sym, pos);
-                    }
-                }
-                if (tree.recvparam != null && tree.recvparam.sym != null &&
-                        !tree.recvparam.mods.annotations.isEmpty()) {
-                    // Nothing to do for separateAnnotationsKinds if
-                    // there are no annotations of either kind.
-                    // TODO: make sure there are no declaration annotations.
-                    final TypeAnnotationPosition pos =
-                        TypeAnnotationPosition.methodReceiver(tree.recvparam.vartype.pos);
-                    separateAnnotationsKinds(tree.recvparam.vartype,
-                                             tree.recvparam.sym.type,
-                                             tree.recvparam.sym, pos);
-                }
-                int i = 0;
-                for (JCVariableDecl param : tree.params) {
-                    if (!param.mods.annotations.isEmpty()) {
-                        // Nothing to do for separateAnnotationsKinds if
-                        // there are no annotations of either kind.
-                        final TypeAnnotationPosition pos =
-                            TypeAnnotationPosition.methodParameter(i, param.vartype.pos);
-                        separateAnnotationsKinds(param.vartype,
-                                                 param.sym.type,
-                                                 param.sym, pos);
-                    }
-                    ++i;
-                }
-            }
-
-            push(tree);
-            // super.visitMethodDef(tree);
-            if (sigOnly) {
-                scan(tree.mods);
-                scan(tree.restype);
-                scan(tree.typarams);
-                scan(tree.recvparam);
-                scan(tree.params);
-                scan(tree.thrown);
-            } else {
-                scan(tree.defaultValue);
-                scan(tree.body);
-            }
-            pop();
-        }
-
-        /* Store a reference to the current lambda expression, to
-         * be used by all type annotations within this expression.
-         */
-        private JCLambda currentLambda = null;
-
-        public void visitLambda(JCLambda tree) {
-            JCLambda prevLambda = currentLambda;
-            try {
-                currentLambda = tree;
-
-                int i = 0;
-                for (JCVariableDecl param : tree.params) {
-                    if (!param.mods.annotations.isEmpty()) {
-                        // Nothing to do for separateAnnotationsKinds if
-                        // there are no annotations of either kind.
-                        final TypeAnnotationPosition pos =
-                            TypeAnnotationPosition.methodParameter(tree, i,
-                                                                   param.vartype.pos);
-                        separateAnnotationsKinds(param.vartype, param.sym.type, param.sym, pos);
-                    }
-                    ++i;
-                }
-
-                push(tree);
-                scan(tree.body);
-                scan(tree.params);
-                pop();
-            } finally {
-                currentLambda = prevLambda;
-            }
-        }
-
-        /**
-         * Resolve declaration vs. type annotations in variable declarations and
-         * then determine the positions.
-         */
-        @Override
-        public void visitVarDef(final JCVariableDecl tree) {
-            if (tree.mods.annotations.isEmpty()) {
-                // Nothing to do for separateAnnotationsKinds if
-                // there are no annotations of either kind.
-            } else if (tree.sym == null) {
-                Assert.error("Visiting tree node before memberEnter");
-            } else if (tree.sym.getKind() == ElementKind.PARAMETER) {
-                // Parameters are handled in visitMethodDef or visitLambda.
-            } else if (tree.sym.getKind() == ElementKind.FIELD) {
-                if (sigOnly) {
-                    TypeAnnotationPosition pos =
-                        TypeAnnotationPosition.field(tree.pos);
-                    separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);
-                }
-            } else if (tree.sym.getKind() == ElementKind.LOCAL_VARIABLE) {
-                final TypeAnnotationPosition pos =
-                    TypeAnnotationPosition.localVariable(currentLambda,
-                                                         tree.pos);
-                separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);
-            } else if (tree.sym.getKind() == ElementKind.EXCEPTION_PARAMETER) {
-                final TypeAnnotationPosition pos =
-                    TypeAnnotationPosition.exceptionParameter(currentLambda,
-                                                              tree.pos);
-                separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);
-            } else if (tree.sym.getKind() == ElementKind.RESOURCE_VARIABLE) {
-                final TypeAnnotationPosition pos =
-                    TypeAnnotationPosition.resourceVariable(currentLambda,
-                                                            tree.pos);
-                separateAnnotationsKinds(tree.vartype, tree.sym.type, tree.sym, pos);
-            } else if (tree.sym.getKind() == ElementKind.ENUM_CONSTANT) {
-                // No type annotations can occur here.
-            } else {
-                // There is nothing else in a variable declaration that needs separation.
-                Assert.error("Unhandled variable kind: " + tree + " of kind: " + tree.sym.getKind());
-            }
-
-            push(tree);
-            // super.visitVarDef(tree);
-            scan(tree.mods);
-            scan(tree.vartype);
-            if (!sigOnly) {
-                scan(tree.init);
-            }
-            pop();
-        }
-
-        @Override
-        public void visitBlock(JCBlock tree) {
-            // Do not descend into top-level blocks when only interested
-            // in the signature.
-            if (!sigOnly) {
-                scan(tree.stats);
-            }
-        }
-
-        @Override
-        public void visitAnnotatedType(JCAnnotatedType tree) {
-            push(tree);
-            findPosition(tree, tree, tree.annotations);
-            pop();
-            super.visitAnnotatedType(tree);
-        }
-
-        @Override
-        public void visitTypeParameter(JCTypeParameter tree) {
-            findPosition(tree, peek2(), tree.annotations);
-            super.visitTypeParameter(tree);
-        }
-
-        private void copyNewClassAnnotationsToOwner(JCNewClass tree) {
-            Symbol sym = tree.def.sym;
-            final TypeAnnotationPosition pos =
-                TypeAnnotationPosition.newObj(tree.pos);
-            ListBuffer<Attribute.TypeCompound> newattrs = new ListBuffer<>();
-
-            for (Attribute.TypeCompound old : sym.getRawTypeAttributes()) {
-                newattrs.append(new Attribute.TypeCompound(old.type, old.values,
-                                                           pos));
-            }
-
-            sym.owner.appendUniqueTypeAttributes(newattrs.toList());
-        }
-
-        @Override
-        public void visitNewClass(JCNewClass tree) {
-            if (tree.def != null &&
-                    !tree.def.mods.annotations.isEmpty()) {
-                JCClassDecl classdecl = tree.def;
-                TypeAnnotationPosition pos;
-
-                if (classdecl.extending == tree.clazz) {
-                    pos = TypeAnnotationPosition.classExtends(tree.pos);
-                } else if (classdecl.implementing.contains(tree.clazz)) {
-                    final int index = classdecl.implementing.indexOf(tree.clazz);
-                    pos = TypeAnnotationPosition.classExtends(index, tree.pos);
-                } else {
-                    // In contrast to CLASS elsewhere, typarams cannot occur here.
-                    throw new AssertionError("Could not determine position of tree " + tree);
-                }
-                Type before = classdecl.sym.type;
-                separateAnnotationsKinds(classdecl, tree.clazz.type, classdecl.sym, pos);
-                copyNewClassAnnotationsToOwner(tree);
-                // classdecl.sym.type now contains an annotated type, which
-                // is not what we want there.
-                // TODO: should we put this type somewhere in the superclass/interface?
-                classdecl.sym.type = before;
-            }
-
-            scan(tree.encl);
-            scan(tree.typeargs);
-            scan(tree.clazz);
-            scan(tree.args);
-
-            // The class body will already be scanned.
-            // scan(tree.def);
-        }
-
-        @Override
-        public void visitNewArray(JCNewArray tree) {
-            findPosition(tree, tree, tree.annotations);
-            int dimAnnosCount = tree.dimAnnotations.size();
-            ListBuffer<TypePathEntry> depth = new ListBuffer<>();
-
-            // handle annotations associated with dimensions
-            for (int i = 0; i < dimAnnosCount; ++i) {
-                ListBuffer<TypePathEntry> location =
-                    new ListBuffer<TypePathEntry>();
-                if (i != 0) {
-                    depth = depth.append(TypePathEntry.ARRAY);
-                    location = location.appendList(depth.toList());
-                }
-                final TypeAnnotationPosition p =
-                    TypeAnnotationPosition.newObj(location.toList(),
-                                                  currentLambda,
-                                                  tree.pos);
-
-                setTypeAnnotationPos(tree.dimAnnotations.get(i), p);
-            }
-
-            // handle "free" annotations
-            // int i = dimAnnosCount == 0 ? 0 : dimAnnosCount - 1;
-            // TODO: is depth.size == i here?
-            JCExpression elemType = tree.elemtype;
-            depth = depth.append(TypePathEntry.ARRAY);
-            while (elemType != null) {
-                if (elemType.hasTag(JCTree.Tag.ANNOTATED_TYPE)) {
-                    JCAnnotatedType at = (JCAnnotatedType)elemType;
-                    final ListBuffer<TypePathEntry> locationbuf =
-                        locateNestedTypes(elemType.type,
-                                          new ListBuffer<TypePathEntry>());
-                    final List<TypePathEntry> location =
-                        locationbuf.toList().prependList(depth.toList());
-                    final TypeAnnotationPosition p =
-                        TypeAnnotationPosition.newObj(location, currentLambda,
-                                                      tree.pos);
-                    setTypeAnnotationPos(at.annotations, p);
-                    elemType = at.underlyingType;
-                } else if (elemType.hasTag(JCTree.Tag.TYPEARRAY)) {
-                    depth = depth.append(TypePathEntry.ARRAY);
-                    elemType = ((JCArrayTypeTree)elemType).elemtype;
-                } else if (elemType.hasTag(JCTree.Tag.SELECT)) {
-                    elemType = ((JCFieldAccess)elemType).selected;
-                } else {
-                    break;
-                }
-            }
-            scan(tree.elems);
-        }
-
-        private void findPosition(JCTree tree, JCTree frame, List<JCAnnotation> annotations) {
-            if (!annotations.isEmpty()) {
-                /*
-                System.err.println("Finding pos for: " + annotations);
-                System.err.println("    tree: " + tree + " kind: " + tree.getKind());
-                System.err.println("    frame: " + frame + " kind: " + frame.getKind());
-                */
-                final TypeAnnotationPosition p =
-                    resolveFrame(tree, frame, frames.toList(), currentLambda, 0,
-                                 new ListBuffer<TypePathEntry>());
-                setTypeAnnotationPos(annotations, p);
-            }
-        }
-
-        private void setTypeAnnotationPos(List<JCAnnotation> annotations,
-                TypeAnnotationPosition position) {
-            for (JCAnnotation anno : annotations) {
-                // attribute might be null during DeferredAttr;
-                // we will be back later.
-                if (anno.attribute != null) {
-                    ((Attribute.TypeCompound) anno.attribute).position = position;
-                }
-            }
-        }
-
-        @Override
-        public String toString() {
-            return super.toString() + ": sigOnly: " + sigOnly;
-        }
-    }
-}
diff --git a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
index 783f628..ba65311 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/code/Types.java
@@ -1212,17 +1212,38 @@
         TypeRelation isSameTypeLoose = new LooseSameTypeVisitor();
 
         private class LooseSameTypeVisitor extends SameTypeVisitor {
+
+            /** cache of the type-variable pairs being (recursively) tested. */
+            private Set<TypePair> cache = new HashSet<>();
+
             @Override
             boolean sameTypeVars(TypeVar tv1, TypeVar tv2) {
-                return tv1.tsym == tv2.tsym && visit(tv1.getUpperBound(), tv2.getUpperBound());
+                return tv1.tsym == tv2.tsym && checkSameBounds(tv1, tv2);
             }
             @Override
             protected boolean containsTypes(List<Type> ts1, List<Type> ts2) {
                 return containsTypeEquivalent(ts1, ts2);
             }
-        }
 
-    /**
+            /**
+             * Since type-variable bounds can be recursive, we need to protect against
+             * infinite loops - where the same bounds are checked over and over recursively.
+             */
+            private boolean checkSameBounds(TypeVar tv1, TypeVar tv2) {
+                TypePair p = new TypePair(tv1, tv2, true);
+                if (cache.add(p)) {
+                    try {
+                        return visit(tv1.getUpperBound(), tv2.getUpperBound());
+                    } finally {
+                        cache.remove(p);
+                    }
+                } else {
+                    return false;
+                }
+            }
+        };
+
+        /**
          * Strict type-equality relation - type variables are considered
          * equals if they share the same object identity.
          */
@@ -3396,9 +3417,16 @@
         class TypePair {
             final Type t1;
             final Type t2;
+            boolean strict;
+
             TypePair(Type t1, Type t2) {
+                this(t1, t2, false);
+            }
+
+            TypePair(Type t1, Type t2, boolean strict) {
                 this.t1 = t1;
                 this.t2 = t2;
+                this.strict = strict;
             }
             @Override
             public int hashCode() {
@@ -3409,8 +3437,8 @@
                 if (!(obj instanceof TypePair))
                     return false;
                 TypePair typePair = (TypePair)obj;
-                return isSameType(t1, typePair.t1)
-                    && isSameType(t2, typePair.t2);
+                return isSameType(t1, typePair.t1, strict)
+                    && isSameType(t2, typePair.t2, strict);
             }
         }
         Set<TypePair> mergeCache = new HashSet<>();
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java
index 04e475e..296c98a 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java
@@ -29,12 +29,15 @@
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import javax.lang.model.element.ElementKind;
+import javax.lang.model.type.TypeKind;
 import javax.tools.JavaFileObject;
 
 import com.sun.tools.javac.util.*;
 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.TypeAnnotationPosition.*;
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.tree.JCTree.*;
 
@@ -259,36 +262,78 @@
  * Compute an attribute from its annotation.
  *********************************************************************/
 
-    /** Process a single compound annotation, returning its
-     *  Attribute. Used from MemberEnter for attaching the attributes
-     *  to the annotated symbol.
+    /**
+     * Enter (and attribute) a single regular annotation, returning
+     * its Attribute.  We give these annotations a position in case we
+     * end up creating a type annotation from using toTypeCompound.
+     *
+     * In some cases, namely on annotations that can never be type
+     * annotations (like package annotations), the position can be
+     * null; however, if this annotation is in a place where it might
+     * possibly denote a type annotation, it will have a non-null
+     * position.
+     *
+     * @param a Annotation to attribute.
+     * @param expected Expected annotation type.
+     * @param env The environment.
+     * @param position The type annotation position this will have if
+     *                 it's converted to a type annotation.
+     * @return The Attribute.Compound representing this annotation.
      */
     Attribute.Compound enterAnnotation(JCAnnotation a,
                                        Type expected,
-                                       Env<AttrContext> env) {
-        List<Pair<MethodSymbol,Attribute>> elems =
-            enterAttributeValues(a, expected, env);
-        Attribute.Compound ac = new Attribute.Compound(a.type, elems);
+                                       Env<AttrContext> env,
+                                       TypeAnnotationPosition position) {
+        List<Pair<MethodSymbol,Attribute>> buf =
+            enterAttributeValues(a, expected, env, position);
+        Attribute.Compound ac =
+            new Attribute.Compound(a.type, buf, position);
         a.attribute = ac;
 
         return ac;
     }
 
+    /**
+     * Enter (and attribute) a single type annotation, returning its
+     * Attribute.
+     *
+     * Things are a bit complicated, though, because a single source
+     * annotation (JCAnnotation) might give rise to several bytecode
+     * annotations (Attribute.TypeCompound), but we can only associate
+     * a source annotation with one bytecode annotation.  Thus, we
+     * have to distinguish between the "primary" (which will be stored
+     * to the JCAnnotation) and "secondary" (which won't) annotations.
+     * The primary place this gets used is for anonymous classes.
+     *
+     * The annotations we generate for the new instruction are the
+     * primary, and the ones we generate for the class are the
+     * secondaries.  (Note: this choice is arbitrary, and it does not
+     * appear to cause any problems if these roles are reversed)
+     *
+     * @param a The annotation to attribute.
+     * @param expected The expected annotation type.
+     * @param env The environment.
+     * @param position The type annotation position to give the type
+     *                 annotation.
+     * @param secondaryAttr Whether or not this is a secondary (ie
+     *                      will ignore the .attribute field on a).
+     * @return The Attribute.TypeCompound representing the annotation.
+     */
     Attribute.TypeCompound enterTypeAnnotation(JCAnnotation a,
                                                Type expected,
-                                               Env<AttrContext> env) {
-        List<Pair<MethodSymbol,Attribute>> elems =
-            enterAttributeValues(a, expected, env);
+                                               Env<AttrContext> env,
+                                               TypeAnnotationPosition position,
+                                               boolean secondaryAttr) {
+        List<Pair<MethodSymbol,Attribute>> buf =
+            enterAttributeValues(a, expected, env, position);
 
-        if (a.attribute == null || !(a.attribute instanceof Attribute.TypeCompound)) {
+        // Secondary attr means we do not set the .attribute field of
+        // the JCAnnotation, nor do we pay attention to it.
+        if (!secondaryAttr || a.attribute == null ||
+            !(a.attribute instanceof Attribute.TypeCompound)) {
             // Create a new TypeCompound
-
             Attribute.TypeCompound tc =
-                new Attribute.TypeCompound(a.type, elems,
-                // TODO: Eventually, we will get rid of this use of
-                // unknown, because we'll get a position from
-                // MemberEnter (task 8027262).
-                                           TypeAnnotationPosition.unknown);
+                new Attribute.TypeCompound(a.type, buf, position);
             a.attribute = tc;
             return tc;
         } else {
@@ -297,10 +342,12 @@
         }
     }
 
+    // Attribute all the annotation's values.
     private List<Pair<MethodSymbol,Attribute>>
             enterAttributeValues(JCAnnotation a,
                                  Type expected,
-                                 Env<AttrContext> env) {
+                                 Env<AttrContext> env,
+                                 TypeAnnotationPosition position) {
         // The annotation might have had its type attributed (but not
         // checked) by attr.attribAnnotationTypes during MemberEnter,
         // in which case we do not need to do it again.
@@ -325,13 +372,13 @@
             JCExpression t = tl.head;
             if (!t.hasTag(ASSIGN)) {
                 log.error(t.pos(), "annotation.value.must.be.name.value");
-                enterAttributeValue(t.type = syms.errType, t, env);
+                enterAttributeValue(t.type = syms.errType, t, env, position);
                 continue;
             }
             JCAssign assign = (JCAssign)t;
             if (!assign.lhs.hasTag(IDENT)) {
                 log.error(t.pos(), "annotation.value.must.be.name.value");
-                enterAttributeValue(t.type = syms.errType, t, env);
+                enterAttributeValue(t.type = syms.errType, t, env, position);
                 continue;
             }
             JCIdent left = (JCIdent)assign.lhs;
@@ -346,7 +393,7 @@
             if (method.owner != a.type.tsym && !isError)
                 log.error(left.pos(), "no.annotation.member", left.name, a.type);
             Type result = method.type.getReturnType();
-            Attribute value = enterAttributeValue(result, assign.rhs, env);
+            Attribute value = enterAttributeValue(result, assign.rhs, env, position);
             if (!method.type.isErroneous())
                 buf.append(new Pair<>((MethodSymbol)method, value));
             t.type = result;
@@ -357,6 +404,13 @@
     Attribute enterAttributeValue(Type expected,
                                   JCExpression tree,
                                   Env<AttrContext> env) {
+        return enterAttributeValue(expected, tree, env, null);
+    }
+
+    Attribute enterAttributeValue(Type expected,
+                                  JCExpression tree,
+                                  Env<AttrContext> env,
+                                  TypeAnnotationPosition position) {
         //first, try completing the attribution value sym - if a completion
         //error is thrown, we should recover gracefully, and display an
         //ordinary resolution diagnostic.
@@ -378,8 +432,7 @@
             ListBuffer<Attribute> buf = new ListBuffer<>();
             for (List<JCExpression> l = na.elems; l.nonEmpty(); l=l.tail) {
                 buf.append(enterAttributeValue(types.elemtype(expected),
-                                               l.head,
-                                               env));
+                                               l.head, env, position));
             }
             na.type = expected;
             return new Attribute.
@@ -393,15 +446,13 @@
                 log.error(na.elemtype.pos(), "new.not.allowed.in.annotation");
             }
             for (List<JCExpression> l = na.elems; l.nonEmpty(); l=l.tail) {
-                enterAttributeValue(syms.errType,
-                                    l.head,
-                                    env);
+                enterAttributeValue(syms.errType, l.head, env, position);
             }
             return new Attribute.Error(syms.errType);
         }
         if ((expected.tsym.flags() & Flags.ANNOTATION) != 0) {
             if (tree.hasTag(ANNOTATION)) {
-                return enterAnnotation((JCAnnotation)tree, expected, env);
+                return enterAnnotation((JCAnnotation)tree, expected, env, position);
             } else {
                 log.error(tree.pos(), "annotation.value.must.be.annotation");
                 expected = syms.errType;
@@ -410,7 +461,7 @@
         if (tree.hasTag(ANNOTATION)) { //error recovery
             if (!expected.isErroneous())
                 log.error(tree.pos(), "annotation.not.valid.for.type", expected);
-            enterAnnotation((JCAnnotation)tree, syms.errType, env);
+            enterAnnotation((JCAnnotation)tree, syms.errType, env, position);
             return new Attribute.Error(((JCAnnotation)tree).annotationType.type);
         }
         if (expected.isPrimitive() ||
@@ -477,9 +528,11 @@
      * synthesized container annotation or null IFF all repeating
      * annotation are invalid.  This method reports errors/warnings.
      */
-    private <T extends Attribute.Compound> T processRepeatedAnnotations(List<T> annotations,
+    private <T extends Attribute.Compound> T processRepeatedAnnotations(
+            List<T> annotations,
             AnnotationContext<T> ctx,
-            Symbol on) {
+            Symbol on,
+            TypeAnnotationPosition position) {
         T firstOccurrence = annotations.head;
         List<Attribute> repeated = List.nil();
         Type origAnnoType = null;
@@ -491,12 +544,8 @@
                      !annotations.tail.isEmpty()); // i.e. size() > 1
 
         int count = 0;
-        for (List<T> al = annotations;
-             !al.isEmpty();
-             al = al.tail)
-        {
+        for (List<T> al = annotations; !al.isEmpty(); al = al.tail) {
             count++;
-
             // There must be more than a single anno in the annotation list
             Assert.check(count > 1 || !al.tail.isEmpty());
 
@@ -536,26 +585,16 @@
                     new Pair<MethodSymbol, Attribute>(containerValueSymbol,
                                new Attribute.Array(arrayOfOrigAnnoType, repeated));
             if (ctx.isTypeCompound) {
-                /* TODO: the following code would be cleaner:
-                Attribute.TypeCompound at = new Attribute.TypeCompound(targetContainerType, List.of(p),
-                        ((Attribute.TypeCompound)annotations.head).position);
-                JCTypeAnnotation annoTree = m.TypeAnnotation(at);
-                at = enterTypeAnnotation(annoTree, targetContainerType, ctx.env);
-                */
-                // However, we directly construct the TypeCompound to keep the
-                // direct relation to the contained TypeCompounds.
-                Attribute.TypeCompound at = new Attribute.TypeCompound(targetContainerType, List.of(p),
-                        ((Attribute.TypeCompound)annotations.head).position);
-
-                // TODO: annotation applicability checks from below?
-
+                Attribute.TypeCompound at = new Attribute.TypeCompound(targetContainerType, List.of(p), position);
                 at.setSynthesized(true);
 
                 @SuppressWarnings("unchecked")
                 T x = (T) at;
                 return x;
             } else {
-                Attribute.Compound c = new Attribute.Compound(targetContainerType, List.of(p));
+                Attribute.Compound c = new Attribute.Compound(targetContainerType,
+                                                              List.of(p),
+                                                              position);
                 JCAnnotation annoTree = m.Annotation(c);
 
                 if (!chk.annotationApplicable(annoTree, on))
@@ -564,7 +603,7 @@
                 if (!chk.validateAnnotationDeferErrors(annoTree))
                     log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType);
 
-                c = enterAnnotation(annoTree, targetContainerType, ctx.env);
+                c = enterAnnotation(annoTree, targetContainerType, ctx.env, position);
                 c.setSynthesized(true);
 
                 @SuppressWarnings("unchecked")
@@ -576,6 +615,7 @@
         }
     }
 
+
     /** Fetches the actual Type that should be the containing annotation. */
     private Type getContainingType(Attribute.Compound currentAnno,
             DiagnosticPosition pos,
@@ -705,31 +745,53 @@
         return fatalError ? null : containerValueSymbol;
     }
 
+    /**
+     * First step of repeating annotations handling: go through a list
+     * of annotations, and gather up all the repeated ones into a map,
+     * which we use to build an AnnotationContext.
+     *
+     * Because we do this, we need to get all the annotations for a
+     * given AST node at once (ie. if we have "@A @B @A int foo;", we
+     * have to get "@A @B @A" at the same time).
+     *
+     * @param annotations The annotations being attached.
+     * @param env The environment.
+     * @param sym The symbol to which the annotations will be attached.
+     * @param creator The attribute creator used to enter the annotations.
+     * @param position The position for any type annotations.
+     * @return The AnnotaionContext for use in the next phase.
+     */
     private <T extends Attribute.Compound> AnnotationContext<T>
             prepareEnterAnnotations(List<JCAnnotation> annotations,
                                     Env<AttrContext> env,
                                     Symbol sym,
                                     AttributeCreator<T> creator,
-                                    boolean isTypeCompound) {
+                                    TypeAnnotationPosition position) {
         Map<TypeSymbol, ListBuffer<T>> annotated = new LinkedHashMap<>();
         Map<T, DiagnosticPosition> pos = new HashMap<>();
 
+        // Go through the annotation list, build up a map from
+        // annotation types to lists of annotations.
         for (List<JCAnnotation> al = annotations; !al.isEmpty(); al = al.tail) {
             JCAnnotation a = al.head;
-            T c = creator.create(a, syms.annotationType, env);
+            T c = creator.create(a, syms.annotationType, env, position);
 
             Assert.checkNonNull(c, "Failed to create annotation");
 
             if (annotated.containsKey(a.type.tsym)) {
+                // Make sure we even allow repeating annotations.
                 if (!allowRepeatedAnnos) {
                     log.error(a.pos(), "repeatable.annotations.not.supported.in.source");
                     allowRepeatedAnnos = true;
                 }
+                // Append the annotation to the list for this kind of
+                // annotation.
                 ListBuffer<T> l = annotated.get(a.type.tsym);
                 l = l.append(c);
                 annotated.put(a.type.tsym, l);
                 pos.put(c, a.pos());
             } else {
+                // We are seeing the first annotation of this kind.
                 annotated.put(a.type.tsym, ListBuffer.of(c));
                 pos.put(c, a.pos());
             }
@@ -743,25 +805,54 @@
         }
 
         return new AnnotationContext<>(env, annotated, pos,
-                                             isTypeCompound);
+                                       creator.createsTypeCompound());
     }
 
-    // Gather up annotations into a map from type symbols to lists of
-    // Compound attributes, then continue on with repeating
-    // annotations processing
+    /**
+     * Entry-point for repeating annotations handling.  At this point,
+     * we should know the type annotation position, and we should have
+     * all the annotations for a given source location.
+     *
+     * We first gather up all the repeated annotations and build an
+     * AnnotationContext.  Then create Placeholder's for any repeated
+     * annotations and send them further down the pipeline.
+     *
+     * Something to keep in mind here is that even if we are handling
+     * "declaration" annotations, it is still possible that those
+     * might turn into type annotations (consider "@A @B int foo;",
+     * for example).
+     *
+     * The pipeline uses a sort of continuation-passing like style,
+     * with creator and attacher.  This allows two things.  First, it
+     * allows for a single pipeline for repeating annotations,
+     * regardless of what eventually happens to the annotations.
+     * Second, it allows us to avoid some unsafe casts we would
+     * otherwise have to make.
+     *
+     * @param annotations The annotations to handle.
+     * @param env The environment.
+     * @param sym The symbol to which to attach annotations.
+     * @param position The position for type annotations.
+     * @param creator The creator to use to enter annotations.
+     * @param attacher The attacher to use to attach annotations.
+     */
     private <T extends Attribute.Compound>
             void attachAttributesLater(final List<JCAnnotation> annotations,
                                        final Env<AttrContext> env,
                                        final Symbol sym,
-                                       final boolean isTypeCompound,
+                                       final TypeAnnotationPosition position,
                                        final AttributeCreator<T> creator,
                                        final AttributeAttacher<T> attacher) {
+        // First, gather up all the repeated annotations.
         final AnnotationContext<T> ctx =
-            prepareEnterAnnotations(annotations, env, sym, creator, isTypeCompound);
+            prepareEnterAnnotations(annotations, env, sym, creator, position);
         final Map<Symbol.TypeSymbol, ListBuffer<T>> annotated =
             ctx.annotated;
         boolean hasRepeated = false;
 
+        // Now run through all the annotation types in the
+        // AnnotationContext.  If there are any that have more than
+        // one entry, then we set up a Placeholder for them.
         List<T> buf = List.<T>nil();
         for (ListBuffer<T> lb : annotated.values()) {
             if (lb.size() == 1) {
@@ -776,14 +867,62 @@
 
         final List<T> attrs = buf.reverse();
 
-        if (!isTypeCompound) {
+        if (!creator.createsTypeCompound()) {
             // Attach declaration attributes early, so
             // that @Repeatable and other annotations get attached.
             // Since the attacher uses setDeclarationAttributes, this
             // will be overwritten later.
-            attacher.attach(sym, attrs);
+            //
+            // The root cause of this is that annotations are
+            // themselves defined using annotations.  However, it is
+            // never the case that a type annotation affects the
+            // definition of an annotation, so we don't have to do
+            // this.
+            //
+            // We really should find a better way to do this.
+            @SuppressWarnings("unchecked")
+            List<Attribute.Compound> tempattrs = (List<Attribute.Compound>) attrs;
+            sym.setDeclarationAttributes(tempattrs);
         }
+
         if (hasRepeated) {
+            // If we have repeated annotations, then we go to the next
+            // pipeline step, which replaces all the placeholders.
+            replacePlaceholdersAndAttach(attrs, ctx, env, sym, attacher);
+        } else {
+            // If we don't have repeated annotations, then we still
+            // have to run the annotations through the rest of the
+            // pipeline.
+            //
+            // For type annotations, we might have error-reporting to
+            // do, and the attacher might end up attaching the
+            // annotation to the symbol's owner as well.
+            //
+            // For regular annotations, we might have a
+            // classifyingAttacher, in which case we have to pull the
+            // annotations off the symbol, classify them, and then put
+            // them in the right place.
+            attachAttributesAfterRepeated(attrs, env, attacher);
+        }
+    }
+
+    /**
+     * Next pipeline step for repeated annotations: replate all the
+     * placeholders, and then send the result further down the pipe.
+     *
+     * @param attrs The Attributes representing the annotations.
+     * @param ctx The AnnotationContext being used.
+     * @param env The environment.
+     * @param sym The symbol to which to attach annotations.
+     * @param attacher The attacher to use to attach annotations.
+     */
+    private <T extends Attribute.Compound>
+            void replacePlaceholdersAndAttach(final List<T> attrs,
+                                              final AnnotationContext<T> ctx,
+                                              final Env<AttrContext> env,
+                                              final Symbol sym,
+                                              final AttributeAttacher<T> attacher) {
+        // Set up a Worker.
             repeated(new Annotate.Worker() {
                     @Override
                     public String toString() {
@@ -795,38 +934,493 @@
                         JavaFileObject oldSource =
                             log.useSource(env.toplevel.sourcefile);
                         try {
-                            attacher.attach(sym, replacePlaceholders(attrs, ctx, sym));
+                        // Replace placeholders
+                        final List<T> replaced =
+                            replacePlaceholders(attrs, ctx, sym);
+                        // Then send the result to the final pipeline stage.
+                        attachAttributesAfterRepeated(replaced, env, attacher);
                         } finally {
                             log.useSource(oldSource);
                         }
                     }
                 });
+    }
+
+    /**
+     * Final pipeline stage.  Simply use the attacher to deal with the
+     * annotations however we want to deal with them.  Note that
+     * attachers may do a number of things, like attach annotations to
+     * other symbols (as is the case with some type annotations, which
+     * get attached to their symbol's owner as well), report errors,
+     * or even create copies (as is the case with classifyingAttacher)
+     *
+     * At this point, we have to be able to guarantee that we don't
+     * see any Placeholders.
+     *
+     * @param attrs The Attributes representing the annotations.
+     * @param env The environment.
+     * @param attacher The attacher we use to finish handling the
+     * annotations.
+     */
+    private <T extends Attribute.Compound>
+            void attachAttributesAfterRepeated(final List<T> attrs,
+                                               final Env<AttrContext> env,
+                                               final AttributeAttacher<T> attacher) {
+        // Set up a Worker that just calls the attacher.
+        afterRepeated(new Worker() {
+                @Override
+                public String toString() {
+                    return "attach pass for: " + attrs;
+    }
+
+            @Override
+                public void run() {
+                    JavaFileObject oldSource =
+                        log.useSource(env.toplevel.sourcefile);
+                    try {
+                        attacher.attach(attrs);
+                    } finally {
+                        log.useSource(oldSource);
+                    }
+                }
+            });
+    }
+
+    /**
+     * AttributeAttachers are similar to continuations.  That contains
+     * the behavior of the final stage of the annotation pipeline,
+     * when we've creted Attributes (which have a type annotation
+     * position), and we've dealt with repeating annotations.  Once we
+     * have done all that, we simply hand off the list of attributes
+     * to the attacher and let it do its work.
+     *
+     * If we didn't have the multiple deferred steps, we could
+     * implement this by returning a list of Attributes from a
+     * top-level method representing the entire repeating annotations
+     * pipeline.  Since we have to handle annotations in multiple
+     * steps, we can't do that.  Therefore, in this light, we can
+     * think of an attacher as being essentially a return
+     * continuation.
+     *
+     * We also have ways to "build" more complex attachers out of
+     * simple ones, such as classifyingAttacher.  This allows us
+     * considerable flexibility in how we deal with annotations at the
+     * end of the pipeline (which is necessary, because there are a
+     * lot of cases).
+     */
+    public interface AttributeAttacher<T extends Attribute.Compound> {
+        public void attach(List<T> attrs);
+    }
+
+    /**
+     * An interface for describing error reporting behaviors for
+     * type-only annotations.  Sometimes, we need to report errors if
+     * any annotations wind up being type-only annotations (the best
+     * example being for illegal scoping).  But at the point where we
+     * know this, we don't always know if a given annotation will be a
+     * type-only annotation, a regular annotation, or both.  So we
+     * have to defer the error-reporting until we do know.
+     */
+    public interface Reporter<T extends Attribute.Compound> {
+        public void report(List<T> attrs);
+    }
+
+    public enum AnnotationKind { DECLARATION, TYPE, BOTH }
+
+    public Attribute[] getTargetTypes(Attribute.Compound a) {
+        Attribute.Compound atTarget =
+            a.type.tsym.attribute(syms.annotationTargetType.tsym);
+        if (atTarget == null) {
+            return null;
+        }
+        Attribute atValue = atTarget.member(names.value);
+        Assert.check(atValue instanceof Attribute.Array);
+        return ((Attribute.Array) atValue).values;
+    }
+
+    public boolean hasTypeUseTarget(Attribute.Compound a,
+                                    boolean isTypeParameter) {
+        Attribute[] targets = getTargetTypes(a);
+        if (targets != null) {
+            for (Attribute app : targets) {
+                Assert.check(app instanceof Attribute.Enum);
+                Attribute.Enum e = (Attribute.Enum) app;
+                if (e.value.name == names.TYPE_USE ||
+                    (isTypeParameter && e.value.name == names.TYPE_PARAMETER)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    /**
+     * Determine whether an annotation is a declaration annotation,
+     * a type annotation, or both.
+     */
+    public AnnotationKind annotationKind(Attribute.Compound a, Symbol s) {
+        Attribute[] targets = getTargetTypes(a);
+        if (targets == null) {
+            return AnnotationKind.DECLARATION;
+        }
+        boolean isDecl = false, isType = false;
+        for (Attribute app : targets) {
+            Assert.check(app instanceof Attribute.Enum);
+            Attribute.Enum e = (Attribute.Enum) app;
+            if (e.value.name == names.TYPE) {
+                if (s.kind == Kinds.TYP) {
+                    ElementKind skind = s.getKind();
+                    // The only symbols we should see here correspond
+                    // to definitions.
+                    Assert.check(skind == ElementKind.ANNOTATION_TYPE ||
+                                 skind == ElementKind.INTERFACE ||
+                                 skind == ElementKind.ENUM ||
+                                 skind == ElementKind.CLASS);
+                    isDecl = true;
+                }
+            } else if (e.value.name == names.FIELD) {
+                if (s.kind == Kinds.VAR &&
+                        s.owner.kind != Kinds.MTH)
+                    isDecl = true;
+            } else if (e.value.name == names.METHOD) {
+                if (s.kind == Kinds.MTH &&
+                        !s.isConstructor())
+                    isDecl = true;
+            } else if (e.value.name == names.PARAMETER) {
+                if (s.kind == Kinds.VAR &&
+                        s.owner.kind == Kinds.MTH &&
+                        (s.flags() & Flags.PARAMETER) != 0)
+                    isDecl = true;
+            } else if (e.value.name == names.CONSTRUCTOR) {
+                if (s.kind == Kinds.MTH &&
+                        s.isConstructor())
+                    isDecl = true;
+            } else if (e.value.name == names.LOCAL_VARIABLE) {
+                if (s.kind == Kinds.VAR &&
+                        s.owner.kind == Kinds.MTH &&
+                        (s.flags() & Flags.PARAMETER) == 0)
+                    isDecl = true;
+            } else if (e.value.name == names.ANNOTATION_TYPE) {
+                if (s.kind == Kinds.TYP &&
+                        (s.flags() & Flags.ANNOTATION) != 0)
+                    isDecl = true;
+            } else if (e.value.name == names.PACKAGE) {
+                if (s.kind == Kinds.PCK)
+                    isDecl = true;
+            } else if (e.value.name == names.TYPE_USE) {
+                if (s.kind == Kinds.TYP ||
+                    s.kind == Kinds.VAR ||
+                    (s.kind == Kinds.MTH && !s.isConstructor() &&
+                     !s.type.getReturnType().hasTag(TypeTag.VOID)) ||
+                    (s.kind == Kinds.MTH && s.isConstructor()))
+                    isType = true;
+            } else if (e.value.name == names.TYPE_PARAMETER) {
+                /* Irrelevant in this case: we will never see symbols
+                 * that are type parameters, as we never attach
+                 * declaration annotations to them. */
+                Assert.check(s.getKind() != ElementKind.TYPE_PARAMETER);
+            } else {
+                Assert.error("annotationKind(): unrecognized Attribute name " + e.value.name +
+                        " (" + e.value.name.getClass() + ")");
+            }
+        }
+        if (isDecl && isType) {
+            return AnnotationKind.BOTH;
+        } else if (isType) {
+            return AnnotationKind.TYPE;
         } else {
-            attacher.attach(sym, attrs);
+            return AnnotationKind.DECLARATION;
         }
     }
 
-    private interface AttributeAttacher<T extends Attribute.Compound> {
-        public void attach(Symbol sym, List<T> attrs);
-    }
-
-    private final AttributeAttacher<Attribute.Compound> declAnnotationsAttacher =
-        new AttributeAttacher<Attribute.Compound>() {
+    /**
+     * An attacher that just attaches annotations as declaration
+     * annotations.  This is used in places where we know for a fact
+     * that type annotations cannot occur.
+     */
+    private AttributeAttacher<Attribute.Compound>
+            declAnnotationsAttacher(final Symbol sym) {
+        return new AttributeAttacher<Attribute.Compound>() {
             @Override
-            public void attach(Symbol sym, List<Attribute.Compound> attrs) {
+            public String toString() {
+                return "Attacher for strictly declaration annotations, for " +
+                    sym;
+            }
+
+            @Override
+            public void attach(List<Attribute.Compound> attrs) {
                 sym.resetAnnotations();
                 sym.setDeclarationAttributes(attrs);
             }
         };
+    }
 
-    private final AttributeAttacher<Attribute.TypeCompound> typeAnnotationsAttacher =
-        new AttributeAttacher<Attribute.TypeCompound>() {
+    /**
+     * An attacher that just attaches annotations as type annotations.
+     * We use this in places where only type annotations can occur.
+     * The most common use for this is any annotation where we have to
+     * "parse" a type (arrays, inner classes, type arguments, bounds,
+     * etc.).  We also use this for base types for non-declarations
+     * (ie. casts, instanceofs, etc).  A more subtle case is for
+     * anonymous classes and receiver parameters, both of which cannot
+     * have regular annotations.
+     */
+    private AttributeAttacher<Attribute.TypeCompound>
+            typeAnnotationsAttacher(final Symbol sym) {
+        return new AttributeAttacher<Attribute.TypeCompound>() {
             @Override
-            public void attach(Symbol sym, List<Attribute.TypeCompound> attrs) {
-                sym.appendUniqueTypeAttributes(attrs);
+            public String toString() {
+                return "Attacher for strictly type annotations, for " + sym;
+            }
+
+            @Override
+            public void attach(List<Attribute.TypeCompound> attrs) {
+                if (!attrs.isEmpty()) {
+                    attachTypeAnnotations(sym, attrs);
+                }
             }
         };
+    }
 
+    /**
+     * Attach type-only annotations using an attacher, and run a
+     * reporter.  Either the reporter or the attacher may be null, in
+     * which case we skip that step.
+     */
+    private AttributeAttacher<Attribute.TypeCompound>
+        reportingTypeAnnotationsAttacher(final AttributeAttacher<Attribute.TypeCompound> attacher,
+                                         final Reporter<Attribute.TypeCompound> reporter) {
+        return new AttributeAttacher<Attribute.TypeCompound>() {
+            @Override
+            public String toString() {
+                return "Error-reporting type annotation, attacher is: " + attacher +
+                    "\n reporter is: " + reporter;
+            }
+
+            @Override
+            public void attach(List<Attribute.TypeCompound> attrs) {
+                if (attacher != null)
+                    attacher.attach(attrs);
+
+                if (reporter != null)
+                    reporter.report(attrs);
+            }
+        };
+    }
+
+    /**
+     * Attach type-only annotations to a symbol and also update the
+     * .type field on a tree (unless it is a package type).  This is
+     * used to put annotations on to a type as well as a symbol.
+     */
+    private AttributeAttacher<Attribute.TypeCompound>
+        typeUpdatingTypeAnnotationsAttacher(final AttributeAttacher<Attribute.TypeCompound> attacher,
+                                            final JCTree tree) {
+        return new AttributeAttacher<Attribute.TypeCompound>() {
+            @Override
+            public String toString() {
+                return "Type-updating type annotation attacher, attacher is: " + attacher +
+                    "\n tree is: " + tree;
+            }
+
+            @Override
+            public void attach(List<Attribute.TypeCompound> attrs) {
+                if (null != attacher)
+                    attacher.attach(attrs);
+
+                if (!attrs.isEmpty() && !tree.type.hasTag(TypeTag.PACKAGE)) {
+                    tree.type = tree.type.annotatedType(attrs);
+                }
+            }
+        };
+    }
+
+    /**
+     * A Reporter for illegal scoping.  We set one of these up in
+     * TypeAnnotate whenever we are in a place that corresponds to a
+     * package or static class that cannot be annotated.
+     */
+    private void reportIllegalScoping(List<Attribute.TypeCompound> attrs,
+                                      int pos) {
+        switch (attrs.size()) {
+        case 0:
+            // Don't issue an error if all type annotations are
+            // also declaration annotations.
+            // If the annotations are also declaration annotations, they are
+            // illegal as type annotations but might be legal as declaration annotations.
+            // The normal declaration annotation checks make sure that the use is valid.
+            break;
+        case 1:
+            log.error(pos, "cant.type.annotate.scoping.1", attrs);
+            break;
+        default:
+            log.error(pos, "cant.type.annotate.scoping", attrs);
+        }
+    }
+
+    private Reporter<Attribute.TypeCompound>
+            illegalScopingReporter(final int pos) {
+        return new Reporter<Attribute.TypeCompound>() {
+            @Override
+            public String toString() {
+                return "Illegal scoping reporter at position " + pos;
+            }
+
+            @Override
+            public void report(List<Attribute.TypeCompound> attrs) {
+                reportIllegalScoping(attrs, pos);
+            }
+        };
+    }
+
+    // Create the "simple case": just attach type and regular
+    // annotations, no reporting.
+    private AttributeAttacher<Attribute.Compound>
+            classifyingAttacher(final Symbol sym) {
+        return classifyingAttacher(sym, declAnnotationsAttacher(sym),
+                                   typeAnnotationsAttacher(sym),
+                                   null);
+    }
+
+
+    /**
+     * Build an attacher for handling the case where we have
+     * annotations, but we don't know for sure whether they are
+     * declaration annotations, type annotations, or both.
+     *
+     * We do this by taking an attacher for declaration annotations,
+     * another one for type annotations, and (possibly) a reporter for
+     * type-only annotations.  We then use the logic from
+     * annotationKind to figure out what kind each annotation is and
+     * deal with it accordingly.
+     *
+     * Any of the declAttacher, the typeAttacher, or the Reporter can
+     * be null, in which case we skip it.
+     *
+     * We have to have the reporter *separate* from the type
+     * annotation attacher, because we might be attaching type
+     * annotations that are also declaration annotations.  But the
+     * semantics of reporters are that they get called for type-only
+     * annotations.  For an example of where this matters, consider
+     * "@A java.lang.Object foo;", where @A can annotate packages and
+     * type uses.  We would create the classifyingAttacher with null
+     * for the type attacher and an illegal scoping reporter.  Both
+     * attachers would end up getting called on @A (which, we'd skip
+     * the type attacher, because it's null), the result being that @A
+     * goes on foo as a declaration annotation.  The reporter would
+     * not get called, because there are no type-only annotations.
+     * However, if @A can only annotate type uses, then it's a
+     * type-only annotation, and we report an illegal scoping error.
+     *
+     * Note: there is a case where we want both attachers to be null:
+     * speculative attribution.
+     *
+     * @param sym The symbol to which to attach annotations.
+     * @param declAttacher The attacher to use for declaration (and
+     *                     both) annotations, or null.
+     * @param typeAttacher The attacher to use for type (and both)
+     *                     annotations, or null.
+     * @param reporter The reporter to use for type-only annotations, or null.
+     * @return The created attacher.
+     */
+    private AttributeAttacher<Attribute.Compound>
+            classifyingAttacher(final Symbol sym,
+                                final AttributeAttacher<Attribute.Compound> declAttacher,
+                                final AttributeAttacher<Attribute.TypeCompound> typeAttacher,
+                                final Reporter<Attribute.TypeCompound> reporter) {
+        return new AttributeAttacher<Attribute.Compound>() {
+            @Override
+            public String toString() {
+                return "Classifying attacher, attaching to " + sym +
+                    "\n declaration annotation attacher is: " + declAttacher +
+                    "\n type annotation attacher is: " + typeAttacher +
+                    "\n reporter for strictly type annotations is: " + reporter;
+            }
+
+            @Override
+            public void attach(List<Attribute.Compound> attrs) {
+                // We sort annotations into "buckets" based on what
+                // kind they are.
+                ListBuffer<Attribute.Compound> declAnnos = new ListBuffer<>();
+                ListBuffer<Attribute.TypeCompound> typeAnnos = new ListBuffer<>();
+                // We also need to keep track of the type-only
+                // annotations, in case we have a reporting action.
+                ListBuffer<Attribute.TypeCompound> onlyTypeAnnos = new ListBuffer<>();
+
+                for (Attribute.Compound a : attrs) {
+                    Assert.check(!(a instanceof Placeholder),
+                                 "Placeholders found in annotations being attached!");
+                    switch (annotationKind(a, sym)) {
+                    case DECLARATION:
+                        declAnnos.append(a);
+                        break;
+                    case BOTH: {
+                        declAnnos.append(a);
+                        Attribute.TypeCompound ta = a.toTypeCompound();
+                        Assert.checkNonNull(ta.position);
+                        typeAnnos.append(ta);
+                        break;
+                    }
+                    case TYPE: {
+                        Attribute.TypeCompound ta = a.toTypeCompound();
+                        Assert.checkNonNull(ta.position);
+                        typeAnnos.append(ta);
+                        // Also keep track which annotations are only type annotations
+                        onlyTypeAnnos.append(ta);
+                        break;
+                    }
+                    default:
+                        throw new AssertionError("Unknown annotation type");
+                    }
+                }
+
+                if (declAttacher != null)
+                    declAttacher.attach(declAnnos.toList());
+
+                if (typeAttacher != null)
+                    typeAttacher.attach(typeAnnos.toList());
+
+                if (reporter != null)
+                    reporter.report(onlyTypeAnnos.toList());
+            }
+        };
+    }
+
+    /**
+     * Actually attach a list of type annotations to a symbol.  For
+     * variables defined in methods, we need to attach to both the
+     * variable symbol, as well as the method symbol.  This takes care
+     * of that.
+     *
+     * @param sym The symbol to which to attach.
+     * @param attrs The annotations to attach.
+     */
+    public void attachTypeAnnotations(Symbol sym, List<Attribute.TypeCompound> attrs) {
+        sym.appendUniqueTypeAttributes(attrs);
+
+        // For type annotations on variables in methods, make
+        // sure they are attached to the owner too.
+        switch(sym.getKind()) {
+        case PARAMETER:
+        case LOCAL_VARIABLE:
+        case RESOURCE_VARIABLE:
+        case EXCEPTION_PARAMETER:
+            // Make sure all type annotations from the symbol are also
+            // on the owner.
+            sym.owner.appendUniqueTypeAttributes(attrs);
+            break;
+        }
+    }
+
+    /**
+     * Final task for repeating annotations: go through a list of
+     * Attributes and replace all the placeholders with containers.
+     *
+     * @param buf The list of Attributes.
+     * @param ctx The AnnotationContext.
+     * @param sym The symbol to which we are attaching.
+     * @return The list of attributes with all placeholders replaced.
+     */
     private <T extends Attribute.Compound> List<T>
             replacePlaceholders(List<T> buf,
                                 Annotate.AnnotationContext<T> ctx,
@@ -848,13 +1442,16 @@
         return result.reverse();
     }
 
+    /**
+     * Replace one placeholder with a container.
+     */
     private <T extends Attribute.Compound> T replaceOne(Placeholder<T> placeholder,
                                                         Annotate.AnnotationContext<T> ctx,
                                                         Symbol sym) {
         // Process repeated annotations
         T validRepeated =
             processRepeatedAnnotations(placeholder.getPlaceholderFor(),
-                                       ctx, sym);
+                                       ctx, sym, placeholder.position);
 
         if (validRepeated != null) {
             // Check that the container isn't manually
@@ -875,16 +1472,65 @@
  * Annotation processing
  *********************************************************************/
 
-    /** Queue annotations for later processing. */
+    /**
+     * Run a list of annotations through the repeating annotations
+     * pipeline, and attach them.  We don't have any diagnostic
+     * position.
+     */
+    void annotateLater(final List<JCAnnotation> annotations,
+                       final Env<AttrContext> localEnv,
+                       final Symbol s) {
+        annotateLater(annotations, localEnv, s, null);
+    }
+
+    /**
+     * Run a list of annotations through the repeating annotations
+     * pipeline and attach them.  This is for when we have annotations
+     * that cannot possibly be type annotations (thus, we have no type
+     * annotation position).
+     */
     void annotateLater(final List<JCAnnotation> annotations,
                        final Env<AttrContext> localEnv,
                        final Symbol s,
                        final DiagnosticPosition deferPos) {
+        // Only attach declaration annotations.
+        doAnnotateLater(annotations, localEnv, s, deferPos, null,
+                        declAnnotationsAttacher(s));
+    }
+
+    /**
+     * Run a list of annotations through the repeating annotation
+     * pipeline, and then classify and attach them.  This is used
+     * whenever we have annotations that might be regular annotations,
+     * type annotations, or both.
+     */
+    void annotateWithClassifyLater(final List<JCAnnotation> annotations,
+                                   final Env<AttrContext> localEnv,
+                                   final Symbol s,
+                                   final DiagnosticPosition deferPos,
+                                   final TypeAnnotationPosition tapos) {
+        // Set up just the basic classifying attacher.
+        doAnnotateLater(annotations, localEnv, s, deferPos, tapos,
+                        classifyingAttacher(s));
+    }
+
+    /**
+     * Set up a worker for handling annotations without parsing a type tree.
+     */
+    private void doAnnotateLater(final List<JCAnnotation> annotations,
+                                 final Env<AttrContext> localEnv,
+                                 final Symbol s,
+                                 final DiagnosticPosition deferPos,
+                                 final TypeAnnotationPosition tapos,
+                                 final AttributeAttacher<Attribute.Compound> attacher) {
         if (annotations.isEmpty()) {
             return;
         }
+        // Mark annotations as incomplete for now.
+        //
+        // This should probably get redesigned at some point.
         if (s.kind != PCK) {
-            s.resetAnnotations(); // mark Annotations as incomplete for now
+            s.resetAnnotations();
         }
         normal(new Annotate.Worker() {
                 @Override
@@ -894,12 +1540,44 @@
 
                 @Override
                 public void run() {
+                    annotateNow(annotations, localEnv, s, deferPos,
+                                tapos, attacher);
+                }
+            });
+
+        validate(annotationValidator(annotations, localEnv, s));
+    }
+
+    /**
+     * Run a list of declaration (meaning they are in a declaration
+     * position) annotations through the repeating annotations
+     * pipeline.
+     *
+     * Note that in some cases, these annotations might end up being
+     * type annotations, or both declaration and type annotations.
+     *
+     * @param annotations The annotations to handle.
+     * @param localEnv the environment.
+     * @param s The symbol to which to attach.
+     * @param deferPos The diagnostic position to use.
+     * @param position The type annotation position to use if some of
+     *                 the annotations end up being type annotations.
+     * @param attacher The attacher to use.
+     */
+    private void annotateNow(final List<JCAnnotation> annotations,
+                             final Env<AttrContext> localEnv,
+                             final Symbol s,
+                             final DiagnosticPosition deferPos,
+                             final TypeAnnotationPosition position,
+                             final AttributeAttacher<Attribute.Compound> attacher) {
+        if (annotations.isEmpty()) {
+            return;
+        }
                     Assert.check(s.kind == PCK || s.annotationsPendingCompletion());
                     JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
-                    DiagnosticPosition prevLintPos =
-                        deferPos != null
-                        ? deferredLintHandler.setPos(deferPos)
-                        : deferredLintHandler.immediate();
+        DiagnosticPosition prevLintPos = deferPos != null ?
+            deferredLintHandler.setPos(deferPos) :
+            deferredLintHandler.immediate();
                     Lint prevLint = deferPos != null ? null : chk.setLint(lint);
                     try {
                         if (s.hasAnnotations() &&
@@ -907,7 +1585,7 @@
                             log.error(annotations.head.pos,
                                       "already.annotated",
                                       kindName(s), s);
-                        actualEnterAnnotations(annotations, localEnv, s);
+            actualEnterAnnotations(annotations, localEnv, s, position, attacher);
                     } finally {
                         if (prevLint != null)
                             chk.setLint(prevLint);
@@ -915,9 +1593,12 @@
                         log.useSource(prev);
                     }
                 }
-            });
 
-        validate(new Annotate.Worker() { //validate annotations
+    // Set up a validator to enforce some rules on regular annotations.
+    private Annotate.Worker annotationValidator(final List<JCAnnotation> annotations,
+                                                final Env<AttrContext> localEnv,
+                                                final Symbol s) {
+        return new Annotate.Worker() { //validate annotations
             @Override
             public void run() {
                 JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
@@ -927,52 +1608,140 @@
                     log.useSource(prev);
                 }
             }
-        });
+        };
     }
 
+    private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations,
+                                                boolean isTypeParameter) {
+        // Ensure that no declaration annotations are present.
+        // Note that a tree type might be an AnnotatedType with
+        // empty annotations, if only declaration annotations were given.
+        // This method will raise an error for such a type.
+        for (JCAnnotation ai : annotations) {
+            Assert.checkNonNull(ai.type);
+            Assert.checkNonNull(ai.attribute);
+
+            if (!ai.type.isErroneous() &&
+                !hasTypeUseTarget(ai.attribute, isTypeParameter)) {
+                log.error(ai.pos(), "annotation.type.not.applicable");
+            }
+        }
+    }
+
+    // Set up a validator to enforce some rules on type annotations.
+    // In addition to those enforced by Check.validateTypeAnnotations,
+    // this enforces that declaration annotations cannot occur on type
+    // parameters.
+    private Annotate.Worker typeAnnotationValidator(final List<JCAnnotation> annotations,
+                                                    final Env<AttrContext> localEnv,
+                                                    final boolean isTypeParameter) {
+        return new Annotate.Worker() { //validate annotations
+            @Override
+            public void run() {
+                JavaFileObject prev = log.useSource(localEnv.toplevel.sourcefile);
+                try {
+                    checkForDeclarationAnnotations(annotations, isTypeParameter);
+                    chk.validateTypeAnnotations(annotations, isTypeParameter);
+                } finally {
+                    log.useSource(prev);
+                }
+            }
+        };
+    }
+
+    /**
+     * This is an interface that wraps up the functionality of
+     * enterAnnotations and enterTypeAnnotations.  This allows some
+     * code duplication to be removed from the original repeating
+     * annotations pipeline.  It also allows for some unsafe casts to
+     * be eliminated.
+     *
+     * Note: when Lambdas can be used in the compiler, we can just use
+     * method refs for enterAnnotations and enterTypeAnnotations.
+     */
     private interface AttributeCreator<T extends Attribute.Compound> {
-        public T create(JCAnnotation a, Type expected, Env<AttrContext> env);
+        public T create(JCAnnotation a,
+                        Type expected,
+                        Env<AttrContext> env,
+                        TypeAnnotationPosition position);
+        public abstract boolean createsTypeCompound();
     }
 
-    // TODO: When SE8 features can be used, these can go away and be
-    // replaced by method refs.
+    // Note: try to avoid doing anything that makes these any more
+    // than just the equivalent of method refs in a pre-lambda
+    // setting.  That way, they can go away when we are allowed to use
+    // lambda.
     private final AttributeCreator<Attribute.Compound> enterAnnotationsCreator =
         new AttributeCreator<Attribute.Compound>() {
         @Override
+            public String toString() {
+                return "Attribute creator for regular declaration annotations";
+            }
+
+            @Override
         public Attribute.Compound create(JCAnnotation a,
                                          Type expected,
-                                         Env<AttrContext> env) {
-            return enterAnnotation(a, syms.annotationType, env);
+                                             Env<AttrContext> env,
+                                             TypeAnnotationPosition position) {
+                return enterAnnotation(a, syms.annotationType, env, position);
         }
+
+            @Override
+            public boolean createsTypeCompound() { return false; }
     };
-    private final AttributeCreator<Attribute.TypeCompound> enterTypeAnnotationsCreator =
-        new AttributeCreator<Attribute.TypeCompound>() {
+
+    private AttributeCreator<Attribute.TypeCompound>
+            enterTypeAnnotationsCreator(final boolean secondaryAttr) {
+        return new AttributeCreator<Attribute.TypeCompound>() {
+            @Override
+            public String toString() {
+                if (!secondaryAttr) {
+                    return "Attribute creator for regular type annotations";
+                } else {
+                    return "Attribute creator for regular type annotations, ignores cached attributes";
+                }
+            }
+
         @Override
         public Attribute.TypeCompound create(JCAnnotation a,
                                              Type expected,
-                                             Env<AttrContext> env) {
-            return enterTypeAnnotation(a, syms.annotationType, env);
+                                                 Env<AttrContext> env,
+                                                 TypeAnnotationPosition position) {
+                return enterTypeAnnotation(a, syms.annotationType,
+                                           env, position, secondaryAttr);
         }
-    };
 
-    /** Enter a set of annotations. */
-    private void actualEnterAnnotations(List<JCAnnotation> annotations,
-                                        Env<AttrContext> env,
-                                        Symbol s) {
-        Assert.checkNonNull(s, "Symbol argument to actualEnterAnnotations is null");
-        attachAttributesLater(annotations, env, s, false,
-                              enterAnnotationsCreator,
-                              declAnnotationsAttacher);
+            @Override
+            public boolean createsTypeCompound() { return true; }
+    };
     }
 
-    /*
-     * If the symbol is non-null, attach the type annotation to it.
+    /**
+     * Send a list of annotations (which occurred in a declaration
+     * position) into the repeating annotations pipeline.
+     */
+    private void actualEnterAnnotations(List<JCAnnotation> annotations,
+                                        Env<AttrContext> env,
+                                        Symbol s,
+                                        TypeAnnotationPosition position,
+                                        AttributeAttacher<Attribute.Compound> attacher) {
+        Assert.checkNonNull(s);
+        attachAttributesLater(annotations, env, s, position,
+                              enterAnnotationsCreator, attacher);
+    }
+
+    /**
+     * Send a list of annotations (which occurred in a type-use
+     * position) into the repeating annotations pipeline.
      */
     private void actualEnterTypeAnnotations(final List<JCAnnotation> annotations,
                                             final Env<AttrContext> env,
                                             final Symbol s,
-                                            final DiagnosticPosition deferPos) {
-        Assert.checkNonNull(s, "Symbol argument to actualEnterTypeAnnotations is nul/");
+                                            final DiagnosticPosition deferPos,
+                                            final boolean secondaryAttr,
+                                            final TypeAnnotationPosition position,
+                                            final AttributeAttacher<Attribute.TypeCompound> attacher) {
+        Assert.checkNonNull(s);
         JavaFileObject prev = log.useSource(env.toplevel.sourcefile);
         DiagnosticPosition prevLintPos = null;
 
@@ -980,9 +1749,9 @@
             prevLintPos = deferredLintHandler.setPos(deferPos);
         }
         try {
-            attachAttributesLater(annotations, env, s, true,
-                                  enterTypeAnnotationsCreator,
-                                  typeAnnotationsAttacher);
+            attachAttributesLater(annotations, env, s, position,
+                                  enterTypeAnnotationsCreator(secondaryAttr),
+                                  attacher);
         } finally {
             if (prevLintPos != null)
                 deferredLintHandler.setPos(prevLintPos);
@@ -990,11 +1759,114 @@
         }
     }
 
+    /**
+     * Given a type tree, walk down it and handle any annotations we
+     * find.
+     *
+     * @param tree The type tree to scan.
+     * @param env The environment.
+     * @param sym The symbol to which to attach any annotations we
+     * might find.
+     * @param deferPos The diagnostic position to use.
+     * @param creator The creator to use for making positions.
+     */
     public void annotateTypeLater(final JCTree tree,
                                   final Env<AttrContext> env,
                                   final Symbol sym,
-                                  final DiagnosticPosition deferPos) {
+                                  final DiagnosticPosition deferPos,
+                                  final PositionCreator creator) {
+        doAnnotateTypeLater(tree, List.<JCAnnotation>nil(), env,
+                            sym, deferPos, creator, false, false);
+    }
+
+    /**
+     * Given a type tree, walk down it and handle any annotations we
+     * find.  We also have a set of base-type annotations (which
+     * occurred in a declaration position in source), which may either
+     * be declaration annotations or annotations on the base type.
+     * For an example, in "@A int @B []", we would have the type tree
+     * "int @B []" with base-type annotations "@A".
+     *
+     * @param tree The type tree to scan.
+     * @param baseTypeAnnos The base-type annotations.
+     * @param env The environment.
+     * @param sym The symbol to which to attach any annotations we
+     * might find.
+     * @param deferPos The diagnostic position to use.
+     * @param creator The creator to use for making positions.
+     */
+    public void annotateTypeLater(final JCTree tree,
+                                  final List<JCAnnotation> baseTypeAnnos,
+                                  final Env<AttrContext> env,
+                                  final Symbol sym,
+                                  final DiagnosticPosition deferPos,
+                                  final PositionCreator creator) {
+        doAnnotateTypeLater(tree, baseTypeAnnos, env, sym, deferPos,
+                            creator, false, false);
+    }
+
+    /**
+     * Given a type tree, walk down it and handle any annotations we
+     * find.  We also have a set of base-type annotations (which
+     * occurred in a declaration position in source), which must be
+     * type annotations on the base type.
+     *
+     * @param tree The type tree to scan.
+     * @param baseTypeAnnos The base-type annotations.
+     * @param env The environment.
+     * @param sym The symbol to which to attach any annotations we
+     * might find.
+     * @param deferPos The diagnostic position to use.
+     * @param creator The creator to use for making positions.
+     */
+    public void annotateStrictTypeLater(final JCTree tree,
+                                        final List<JCAnnotation> baseTypeAnnos,
+                                        final Env<AttrContext> env,
+                                        final Symbol sym,
+                                        final DiagnosticPosition deferPos,
+                                        final PositionCreator creator) {
+        doAnnotateTypeLater(tree, baseTypeAnnos, env, sym, deferPos,
+                            creator, true, false);
+    }
+
+    /**
+     * Given a type tree representing an anonymous class' supertype,
+     * walk down it and handle any annotations we find.  We also have
+     * a set of base-type annotations (which occurred in a declaration
+     * position in source), which must be type annotations on the base
+     * type.
+     *
+     * @param tree The type tree to scan.
+     * @param baseTypeAnnos The base-type annotations.
+     * @param env The environment.
+     * @param sym The symbol to which to attach any annotations we
+     * might find.
+     * @param deferPos The diagnostic position to use.
+     * @param creator The creator to use for making positions.
+     */
+    public void annotateAnonClassDefLater(final JCTree tree,
+                                          final List<JCAnnotation> baseTypeAnnos,
+                                          final Env<AttrContext> env,
+                                          final Symbol sym,
+                                          final DiagnosticPosition deferPos,
+                                          final PositionCreator creator) {
+        doAnnotateTypeLater(tree, baseTypeAnnos, env, sym, deferPos,
+                            creator, true, true);
+    }
+
+    // The combined worker function for the annotateTypeLater family.
+    public void doAnnotateTypeLater(final JCTree tree,
+                                    final List<JCAnnotation> baseTypeAnnos,
+                                    final Env<AttrContext> env,
+                                    final Symbol sym,
+                                    final DiagnosticPosition deferPos,
+                                    final PositionCreator creator,
+                                    final boolean onlyTypeAnnos,
+                                    final boolean secondaryAttr) {
         Assert.checkNonNull(sym);
+        Assert.checkNonNull(baseTypeAnnos);
+        Assert.checkNonNull(creator);
+
         normal(new Annotate.Worker() {
                 @Override
                 public String toString() {
@@ -1002,93 +1874,912 @@
                 }
                 @Override
                 public void run() {
-                    tree.accept(new TypeAnnotate(env, sym, deferPos));
+                    if (!baseTypeAnnos.isEmpty()) {
+                        sym.resetAnnotations(); // mark Annotations as incomplete for now
+                    }
+
+                    tree.accept(typeAnnotator(baseTypeAnnos, sym, env, deferPos,
+                                              creator, onlyTypeAnnos,
+                                              secondaryAttr));
                 }
             });
     }
 
     /**
-     * We need to use a TreeScanner, because it is not enough to visit the top-level
-     * annotations. We also need to visit type arguments, etc.
+     * A client passed into various visitors that takes a type path as
+     * an argument and performs an action (typically creating a
+     * TypeAnnotationPosition and then creating a {@code Worker} and
+     * adding it to a queue.
+     */
+    public abstract class PositionCreator {
+        public abstract TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                      JCLambda lambda,
+                                                      int typeIndex);
+    }
+
+    // For when we don't have a creator.  Throws an exception.
+    public final PositionCreator noCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Sentinel null position creator";
+        }
+
+        @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                throw new AssertionError("No annotation position creator registered");
+            }
+        };
+
+    // For when we are creating annotations that will inevitably
+    // trigger errors.  Creates null.
+    public final PositionCreator errorCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for annotations that represent errors";
+        }
+
+        @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return null;
+            }
+        };
+
+    // Create class extension positions
+    public final PositionCreator extendsCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for extends";
+        }
+
+        @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.classExtends(path, lambda, -1);
+            }
+        };
+
+    // Create interface implementation positions
+    public PositionCreator implementsCreator(final int idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for implements, index " + idx;
+        }
+
+        @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.classExtends(path, lambda, idx, -1);
+            }
+        };
+    }
+
+    // Create method parameter positions
+    public final PositionCreator paramCreator(final int idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for parameter " + idx;
+        }
+
+        @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodParameter(path, lambda, idx, -1);
+            }
+        };
+    }
+
+    // Create class type parameter positions
+    public PositionCreator typeParamCreator(final int idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for class type parameter " + idx;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.typeParameter(path, lambda, idx, -1);
+            }
+        };
+    }
+
+    public PositionCreator typeParamBoundCreator(final JCTypeParameter typaram,
+                                                 final int param_idx,
+                                                 final int bound_idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for class type parameter " + param_idx +
+                    ", bound " + bound_idx;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                final int real_bound_idx =
+                    typaram.bounds.head.type.isInterface() ? bound_idx + 1 : bound_idx;
+                return TypeAnnotationPosition
+                    .typeParameterBound(path, lambda, param_idx, real_bound_idx, -1);
+            }
+        };
+    }
+
+    // Create field positions
+    public final PositionCreator fieldCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for field declaration";
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.field(path, lambda, -1);
+            }
+        };
+
+    // Create local variable positions
+    public PositionCreator localVarCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for local variable declaration at " +
+                    pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.localVariable(path, lambda, pos);
+            }
+        };
+    }
+
+    // Create resource variable positions.
+    public PositionCreator resourceVarCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for resource variable declaration at " +
+                    pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.resourceVariable(path, lambda, pos);
+            }
+        };
+    }
+
+    // Create exception parameter positions.
+    public PositionCreator exceptionParamCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for exception param declaration at " +
+                    pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.exceptionParameter(path, lambda,
+                                                                 typeIndex, pos);
+            }
+        };
+    }
+
+    // Create constructor reference type argument positions.
+    public PositionCreator constructorRefTypeArgCreator(final int idx,
+                                                        final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for constructor reference type argument " + idx +
+                    " at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition
+                    .constructorRefTypeArg(path, lambda, idx, pos);
+            }
+        };
+    }
+
+    public PositionCreator methodInvokeTypeArgCreator(final int idx,
+                                                      final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method invoke type argument " + idx +
+                    " at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodInvocationTypeArg(path, lambda, idx, pos);
+            }
+        };
+    }
+
+    public PositionCreator methodTypeParamCreator(final int idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method type parameter " + idx;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodTypeParameter(path, lambda, idx, -1);
+            }
+        };
+    }
+
+    public PositionCreator methodTypeParamBoundCreator(final JCTypeParameter typaram,
+                                                       final int param_idx,
+                                                       final int bound_idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method type parameter " + param_idx +
+                    " bound " + bound_idx;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                final int real_bound_idx =
+                    typaram.bounds.head.type.isInterface() ? bound_idx + 1 : bound_idx;
+                return TypeAnnotationPosition
+                    .methodTypeParameterBound(path, lambda, param_idx, real_bound_idx, -1);
+            }
+        };
+    }
+
+    public PositionCreator throwCreator(final int idx) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for throw, type index " + idx;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodThrows(path, lambda, idx, -1);
+            }
+        };
+    }
+
+    public final PositionCreator returnCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method return type";
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodReturn(path, lambda, -1);
+            }
+        };
+
+    public PositionCreator receiverCreator =
+        new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method receiver parameter type";
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodReceiver(path, lambda, -1);
+            }
+        };
+
+    public PositionCreator methodRefCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method reference at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodRef(path, lambda, pos);
+            }
+        };
+    }
+
+    public PositionCreator methodRefTypeArgCreator(final int idx,
+                                                   final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for method reference type argument " + idx +
+                    " at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.methodRefTypeArg(path, lambda, idx, pos);
+            }
+        };
+    }
+
+    public PositionCreator constructorRefCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for constructor reference at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.constructorRef(path, lambda, pos);
+            }
+        };
+    }
+
+    public PositionCreator constructorInvokeTypeArgCreator(final int idx,
+                                                           final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for constructor invoke type argument " + idx +
+                    " at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.constructorInvocationTypeArg(path, lambda, idx, pos);
+            }
+        };
+    }
+
+    public PositionCreator instanceOfCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for instanceof at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.instanceOf(path, lambda, pos);
+            }
+        };
+    }
+
+    public PositionCreator newObjCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for new at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.newObj(path, lambda, pos);
+            }
+        };
+    }
+
+    public PositionCreator castCreator(final int pos) {
+        return new PositionCreator() {
+            @Override
+            public String toString() {
+                return "Position creator for cast at " + pos;
+            }
+
+            @Override
+            public TypeAnnotationPosition create(List<TypePathEntry> path,
+                                                 JCLambda lambda,
+                                                 int typeIndex) {
+                return TypeAnnotationPosition.typeCast(path, lambda, typeIndex, pos);
+            }
+        };
+    }
+
+    public static List<TypePathEntry> makeInners(Type type) {
+        return addInners(type, List.<TypePathEntry>nil());
+    }
+
+    private static List<TypePathEntry> addInners(Type type,
+                                                 List<TypePathEntry> typepath) {
+        Type encl = type.getEnclosingType();
+        while (encl != null && encl.getKind() != TypeKind.NONE &&
+               encl.getKind() != TypeKind.ERROR) {
+            typepath = typepath.append(TypePathEntry.INNER_TYPE);
+            encl = encl.getEnclosingType();
+        }
+        return typepath;
+    }
+
+    /**
+     * Set up the visitor to scan the type tree and handle any
+     * annotations we find.  If we are in speculative attribution, we
+     * will not actually attach anything, we will just enter the
+     * annotations and run them through the pipeline to pick up any
+     * errors that might occur.
+     *
+     * @param baseTypeAnnos Annotations on the base type, which need
+     *                      to be classified if onlyTypeAnnos is false.
+     * @param sym The symbol to which to attach.
+     * @param env The environment.
+     * @param creator The position creator to use.
+     * @param onlyTypeAnnos Whether or not baseTypeAnnos can represent
+     *                      declaration annotations.
+     * @param secondaryAttr Whether or not we are creating secondary
+     *                      attributes (see enterTypeAnnotations).
+     */
+    public TypeAnnotate typeAnnotator(final List<JCAnnotation> baseTypeAnnos,
+                                      final Symbol sym,
+                                      final Env<AttrContext> env,
+                                      final DiagnosticPosition deferPos,
+                                      final PositionCreator creator,
+                                      final boolean onlyTypeAnnos,
+                                      final boolean secondaryAttr) {
+        if (!env.info.isSpeculative) {
+            return new TypeAnnotate(baseTypeAnnos, sym, env, deferPos, creator,
+                                    declAnnotationsAttacher(sym),
+                                    typeAnnotationsAttacher(sym),
+                                    onlyTypeAnnos, secondaryAttr);
+        } else {
+            return new TypeAnnotate(baseTypeAnnos, sym, env, deferPos, creator,
+                                    null, null, onlyTypeAnnos, secondaryAttr);
+        }
+    }
+
+    /**
+     * A visitor that scans a type tree and handles an annotations it finds.
+     *
      */
     private class TypeAnnotate extends TreeScanner {
-        private final Env<AttrContext> env;
+        // The creator we use to create positions.
+        protected PositionCreator creator;
+        // The current type path
+        private List<TypePathEntry> typepath = List.nil();
+        // The current innermost lambda
+        private JCLambda currentLambda;
+        // The current type index, if we are looking at an
+        // intersection type.
+        private int type_index = 0;
+        // Whether or not we are looking at the innermost type.  This
+        // gets used to figure out where to attach base type
+        // annotations.
+        private boolean innermost;
+        // The attachers and reporter we use.
+        private AttributeAttacher<Attribute.Compound> declAttacher;
+        private AttributeAttacher<Attribute.TypeCompound> typeAttacher;
+        private Reporter<Attribute.TypeCompound> reporter;
+        // The symbol to which we are attaching.
         private final Symbol sym;
-        private DiagnosticPosition deferPos;
+        // The diagnostic position we use.
+        private final DiagnosticPosition deferPos;
+        // The environment
+        private final Env<AttrContext> env;
+        private final List<JCAnnotation> baseTypeAnnos;
+        // Whether or not baseTypeAnnos can be declaration
+        // annotations, or just strictly type annotations.
+        private final boolean onlyTypeAnnos;
+        // Whether or not we are creating secondary attributes (see
+        // enterTypeAnnotations).
+        private final boolean secondaryAttr;
 
-        public TypeAnnotate(final Env<AttrContext> env,
+        public TypeAnnotate(final List<JCAnnotation> baseTypeAnnos,
                             final Symbol sym,
-                            final DiagnosticPosition deferPos) {
-
-            this.env = env;
+                            final Env<AttrContext> env,
+                            final DiagnosticPosition deferPos,
+                            final PositionCreator creator,
+                            final AttributeAttacher<Attribute.Compound> declAttacher,
+                            final AttributeAttacher<Attribute.TypeCompound> typeAttacher,
+                            final boolean onlyTypeAnnos,
+                            final boolean secondaryAttr) {
+            this.baseTypeAnnos = baseTypeAnnos;
             this.sym = sym;
+            this.env = env;
             this.deferPos = deferPos;
+            this.currentLambda = env.getLambda();
+            this.creator = creator;
+            this.innermost = true;
+            this.declAttacher = declAttacher;
+            this.typeAttacher = typeAttacher;
+            this.reporter = null;
+            this.onlyTypeAnnos = onlyTypeAnnos;
+            this.secondaryAttr = secondaryAttr;
+        }
+
+        // Deal with the base-type annotations.  This should only get
+        // called when we are at the inner-most type.
+        private void doBaseTypeAnnos() {
+            if (onlyTypeAnnos) {
+                // If the base type annotations can only be type
+                // annotations, then handle them as such.
+                doTypeAnnos(baseTypeAnnos, false);
+            } else if (!baseTypeAnnos.isEmpty()) {
+                // Otherwise, send them into the repeating annotations
+                // pipeline with a classifying attacher we build based
+                // on the current state.
+                final TypeAnnotationPosition tapos =
+                    creator.create(typepath, currentLambda, type_index);
+                annotateNow(baseTypeAnnos, env, sym, deferPos, tapos,
+                            classifyingAttacher(sym, declAttacher,
+                                                typeAttacher, reporter));
+                // Also set up a validator.
+                validate(annotationValidator(baseTypeAnnos, env, sym));
+            }
+        }
+
+        // Deal with type annotations we found while scanning the tree.
+        private void doTypeAnnos(List<JCAnnotation> annos,
+                                 boolean isTypeParameter) {
+            if (!annos.isEmpty()) {
+                // Grab the reporter and the type attacher (which,
+                // it's ok for either to be null), and combine them
+                // into a reporting attacher.
+                final AttributeAttacher<Attribute.TypeCompound> attacher =
+                    reportingTypeAnnotationsAttacher(typeAttacher, reporter);
+                // Create the position using the current type path and
+                // type index.
+                final TypeAnnotationPosition tapos =
+                    creator.create(typepath, currentLambda, type_index);
+                // Send the annotations into the repeating annotations
+                // pipeline, and set up a validator.
+                actualEnterTypeAnnotations(annos, env, sym, deferPos, secondaryAttr,
+                                           tapos, attacher);
+                validate(typeAnnotationValidator(annos, env, isTypeParameter));
+            }
         }
 
         @Override
-        public void visitAnnotatedType(final JCAnnotatedType tree) {
-            actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
-            super.visitAnnotatedType(tree);
+        public void visitTypeIdent(final JCPrimitiveTypeTree tree) {
+            // This is one place that can represent the base type.
+            // But we need to make sure we're actually in the
+            // innermost type (ie not a type argument or something).
+            if (innermost) {
+                final AttributeAttacher<Attribute.TypeCompound> oldTypeAttacher = typeAttacher;
+                // We want to update the Type to have annotations.
+                typeAttacher = typeUpdatingTypeAnnotationsAttacher(oldTypeAttacher,
+                                                                   tree);
+                // We can't possibly have any INNER_TYPE type path
+                // elements, because these are all primitives.
+                doBaseTypeAnnos();
+                typeAttacher = oldTypeAttacher;
+            }
         }
 
         @Override
-        public void visitTypeParameter(final JCTypeParameter tree) {
-            actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
-            super.visitTypeParameter(tree);
+        public void visitIdent(final JCIdent tree) {
+            // This is one place that can represent the base type.
+            // But we need to make sure we're actually in the
+            // innermost type (ie not a type argument or something).
+            if (innermost) {
+                final AttributeAttacher<Attribute.TypeCompound> oldTypeAttacher = typeAttacher;
+                // Set up an attacher that updates the Type, so we get
+                // the annotations.
+                typeAttacher = typeUpdatingTypeAnnotationsAttacher(oldTypeAttacher,
+                                                                   tree);
+                // Add any INNER_TYPE type path elements we might need.
+                if (tree.type != null) {
+                    final List<TypePathEntry> oldpath = typepath;
+                    typepath = addInners(tree.type, typepath);
+                    doBaseTypeAnnos();
+                    typepath = oldpath;
+                } else {
+                    doBaseTypeAnnos();
+                }
+                typeAttacher = oldTypeAttacher;
+            }
         }
 
         @Override
-        public void visitNewArray(final JCNewArray tree) {
-            actualEnterTypeAnnotations(tree.annotations, env, sym, deferPos);
-            for (List<JCAnnotation> dimAnnos : tree.dimAnnotations)
-                actualEnterTypeAnnotations(dimAnnos, env, sym, deferPos);
-            super.visitNewArray(tree);
+        public void visitAnnotatedType(JCAnnotatedType tree) {
+            // This is one place where we run into pure type
+            // annotations.
+            Assert.checkNonNull(tree.getUnderlyingType().type);
+            final boolean oldinnermost = innermost;
+            // Make sure we don't consider ourselves "innermost" when
+            // scanning the annotations.
+            innermost = false;
+            scan(tree.annotations);
+            innermost = oldinnermost;
+            scan(tree.underlyingType);
+            final List<TypePathEntry> oldpath = typepath;
+            typepath = addInners(tree.getUnderlyingType().type, typepath);
+            doTypeAnnos(tree.annotations, false);
+            typepath = oldpath;
         }
 
         @Override
-        public void visitMethodDef(final JCMethodDecl tree) {
-            scan(tree.mods);
-            scan(tree.restype);
-            scan(tree.typarams);
-            scan(tree.recvparam);
+        public void visitTypeArray(JCArrayTypeTree tree) {
+            // This case is simple: just add an ARRAY to the type path.
+            final List<TypePathEntry> oldpath = typepath;
+            typepath = typepath.append(TypePathEntry.ARRAY);
+            super.visitTypeArray(tree);
+            typepath = oldpath;
+        }
+
+        @Override
+        public void visitTypeApply(JCTypeApply tree) {
+            // Handle type arguments
+            Assert.checkNonNull(tree.getType().type);
+            final List<TypePathEntry> oldpath = typepath;
+            // First, look at the base type.
+            scan(tree.clazz);
+
+            // Add any INNER_TYPE path elements we need first
+            if (tree.getType() != null && tree.getType().type != null) {
+                typepath = addInners(tree.getType().type, typepath);
+            }
+            // Make sure we're not considering ourselves innermost
+            // when looking at type arguments.
+            final boolean oldinnermost = innermost;
+            innermost = false;
+            // For each type argument, add a TYPE_ARGUMENT path
+            // element for the right index.
+            int i = 0;
+            for (List<JCExpression> l = tree.arguments; l.nonEmpty();
+                 l = l.tail, i++) {
+                final JCExpression arg = l.head;
+                final List<TypePathEntry> noargpath = typepath;
+                typepath = typepath.append(new TypePathEntry(TypePathEntryKind.TYPE_ARGUMENT, i));
+                scan(arg);
+                typepath = noargpath;
+            }
+            typepath = oldpath;
+            innermost = oldinnermost;
+        }
+
+        @Override
+        public void visitNewArray(JCNewArray tree) {
+            // We can also run into type annotations here, on dimAnnos.
+            final List<TypePathEntry> oldpath = typepath;
+            final PositionCreator oldcreator = creator;
+            creator = newObjCreator(tree.pos);
+            doTypeAnnos(tree.annotations, false);
+
+            // Go through the dimensions, set up the type path, and
+            // handle any annetations we find.
+            for (int i = 0; i < tree.dimAnnotations.size(); i++) {
+                final List<JCAnnotation> dimAnnos = tree.dimAnnotations.get(i);
+                doTypeAnnos(dimAnnos, false);
+                // This is right.  As per the type annotations spec,
+                // the first array dimension has no arrays in the type
+                // path, the second has one, and so on, and the
+                // element type has n for n dimensions.
+                typepath = typepath.append(TypePathEntry.ARRAY);
+            }
+
+            // The element type is sometimes null, in the case of
+            // array literals.
+            scan(tree.elemtype);
+            typepath = oldpath;
+            creator = oldcreator;
+        }
+
+        @Override
+        public void visitWildcard(JCWildcard tree) {
+            // Simple: add a WILDCARD type path element and continue.
+            final List<TypePathEntry> oldpath = typepath;
+            typepath = typepath.append(TypePathEntry.WILDCARD);
+            super.visitWildcard(tree);
+            typepath = oldpath;
+        }
+
+        @Override
+        public void visitTypeParameter(JCTypeParameter tree) {
+            // This is another place where we can run into pure type
+            // annotations.
+            scan(tree.annotations);
+            Assert.checkNonNull(tree.type);
+            doTypeAnnos(tree.annotations, true);
+        }
+
+        @Override
+        public void visitLambda(JCLambda tree) {
+            // If we run into a lambda, set the current lambda to it.
+            final JCLambda oldLambda = currentLambda;
+            currentLambda = tree;
+            scan(tree.body);
             scan(tree.params);
-            scan(tree.thrown);
-            scan(tree.defaultValue);
-            // Do not annotate the body, just the signature.
-            // scan(tree.body);
+            currentLambda = oldLambda;
         }
 
         @Override
+        public void visitTypeIntersection(JCTypeIntersection tree) {
+            final boolean oldinnermost = innermost;
+            // Run through the options, and update the type_index
+            // accordingly.
+            for (List<JCExpression> l = tree.bounds; l.nonEmpty();
+                 l = l.tail, type_index++) {
+                scan(l.head);
+                // Set innermost to false after the first element
+                innermost = false;
+            }
+            innermost = oldinnermost;
+        }
+
+        @Override
+        public void visitTypeUnion(JCTypeUnion tree) {
+            final boolean oldinnermost = innermost;
+            // Run through the options, and update the type_index
+            // accordingly.
+            for (List<JCExpression> l = tree.alternatives; l.nonEmpty();
+                 l = l.tail, type_index++) {
+                scan(l.head);
+                // Set innermost to false after the first element
+                innermost = false;
+            }
+            innermost = oldinnermost;
+        }
+
+        @Override
+        public void visitSelect(JCFieldAccess tree) {
+            // In this case, we need to possibly set up an
+            // illegalScopingReporter, if the selected type cannot be
+            // annotated.
+            Symbol sym = tree.sym;
+            final AttributeAttacher<Attribute.TypeCompound> oldTypeAttacher = typeAttacher;
+            final Reporter<Attribute.TypeCompound> oldReporter = reporter;
+            // If we're selecting from an interface or a static class,
+            // set up attachers that will only attach declaration
+            // annotations and will report type annotations as errors.
+            Type selectedTy = tree.selected.type;
+            if ((sym != null && (sym.isStatic() || sym.isInterface() ||
+                                selectedTy.hasTag(TypeTag.PACKAGE))) ||
+                tree.name == names._class) {
+                typeAttacher = null;
+                reporter = illegalScopingReporter(tree.pos);
+            }
+            super.visitSelect(tree);
+            typeAttacher = oldTypeAttacher;
+            reporter = oldReporter;
+        }
+
+        // These methods stop the visitor from continuing on when it
+        // sees a definition.
+        @Override
         public void visitVarDef(final JCVariableDecl tree) {
-            DiagnosticPosition prevPos = deferPos;
-            deferPos = tree.pos();
-            try {
-                if (sym != null && sym.kind == Kinds.VAR) {
-                    // Don't visit a parameter once when the sym is the method
-                    // and once when the sym is the parameter.
-                    scan(tree.mods);
-                    scan(tree.vartype);
-                }
-                scan(tree.init);
-            } finally {
-                deferPos = prevPos;
-            }
         }
 
         @Override
         public void visitClassDef(JCClassDecl tree) {
-            // We can only hit a classdef if it is declared within
-            // a method. Ignore it - the class will be visited
-            // separately later.
         }
 
         @Override
         public void visitNewClass(JCNewClass tree) {
-            if (tree.def == null) {
-                // For an anonymous class instantiation the class
-                // will be visited separately.
-                super.visitNewClass(tree);
+
             }
         }
+
+    // A derived TypeAnnotate visitor that also scans expressions
+    // within Deferred attribution.
+    private class TypeAnnotateExpr extends TypeAnnotate {
+        // This constructor creates an instance suitable for deferred
+        // attribution.
+        public TypeAnnotateExpr(final Symbol sym,
+                                final Env<AttrContext> env,
+                                final DiagnosticPosition deferPos,
+                                final PositionCreator creator) {
+            super(List.<JCAnnotation>nil(), sym, env, deferPos,
+                  creator, null, null, false, false);
+        }
+
+        @Override
+        public void visitTypeCast(final JCTypeCast tree) {
+            final PositionCreator oldcreator = creator;
+            creator = castCreator(tree.pos);
+            super.visitTypeCast(tree);
+            creator = oldcreator;
+        }
+
+        @Override
+        public void visitTypeTest(JCInstanceOf tree) {
+            final PositionCreator oldcreator = creator;
+            creator = instanceOfCreator(tree.pos);
+            super.visitTypeTest(tree);
+            creator = oldcreator;
+        }
+
+        @Override
+        public void visitReference(JCMemberReference that) {
+            final boolean isConstructor = that.getName() == names.init;
+            final PositionCreator oldcreator = creator;
+            creator = isConstructor ? constructorRefCreator(that.pos) :
+                                      methodRefCreator(that.pos);
+            scan(that.expr);
+
+            if (null != that.typeargs) {
+                int i = 0;
+                for (List<JCExpression> l = that.typeargs;
+                     l.nonEmpty(); l = l.tail, i++) {
+                    final Annotate.PositionCreator typeArgCreator =
+                        isConstructor ? constructorRefTypeArgCreator(i, that.pos) :
+                                        methodRefTypeArgCreator(i, that.pos);
+                    final JCExpression arg = l.head;
+                    scan(that.expr);
+                }
+            }
+
+            creator = oldcreator;
+        }
+
+        @Override
+        public void visitNewClass(JCNewClass tree) {
+            // This will be visited by Attr later, so don't do
+            // anything.
+        }
+    }
+
+    /**
+     * Set up a visitor to scan an expression and handle any type
+     * annotations it finds, within a deferred attribution context.
+     */
+    public void typeAnnotateExprLater(final JCTree tree,
+                                      final Env<AttrContext> env,
+                                      final Symbol sym,
+                                      final DiagnosticPosition deferPos,
+                                      final PositionCreator creator) {
+        Assert.checkNonNull(sym);
+        Assert.checkNonNull(creator);
+
+        normal(new Annotate.Worker() {
+                @Override
+                public String toString() {
+                    return "type annotate " + tree + " onto " + sym + " in " + sym.owner;
+                }
+                @Override
+                public void run() {
+                    tree.accept(new TypeAnnotateExpr(sym, env, deferPos, creator));
+                }
+            });
     }
 }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
index ba72525..8762d12 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java
@@ -91,7 +91,6 @@
     final Types types;
     final JCDiagnostic.Factory diags;
     final Annotate annotate;
-    final TypeAnnotations typeAnnotations;
     final DeferredLintHandler deferredLintHandler;
 
     public static Attr instance(Context context) {
@@ -120,7 +119,6 @@
         types = Types.instance(context);
         diags = JCDiagnostic.Factory.instance(context);
         annotate = Annotate.instance(context);
-        typeAnnotations = TypeAnnotations.instance(context);
         deferredLintHandler = DeferredLintHandler.instance(context);
 
         Options options = Options.instance(context);
@@ -137,6 +135,7 @@
         allowTypeAnnos = source.allowTypeAnnotations();
         allowLambda = source.allowLambda();
         allowDefaultMethods = source.allowDefaultMethods();
+        allowStaticInterfaceMethods = source.allowStaticInterfaceMethods();
         sourceName = source.name;
         relax = (options.isSet("-retrofit") ||
                  options.isSet("-relax"));
@@ -194,6 +193,10 @@
      */
     boolean allowDefaultMethods;
 
+    /** Switch: static interface methods enabled?
+     */
+    boolean allowStaticInterfaceMethods;
+
     /** Switch: allow references to surrounding object from anonymous
      * objects during constructor call?
      */
@@ -434,8 +437,7 @@
     public Type attribImportQualifier(JCImport tree, Env<AttrContext> env) {
         // Attribute qualifying package or class.
         JCFieldAccess s = (JCFieldAccess)tree.qualid;
-        return attribTree(s.selected,
-                       env,
+        return attribTree(s.selected, env,
                        new ResultInfo(tree.staticImport ? TYP : (TYP | PCK),
                        Type.noType));
     }
@@ -638,7 +640,8 @@
     /** Derived visitor method: attribute an expression tree.
      */
     public Type attribExpr(JCTree tree, Env<AttrContext> env, Type pt) {
-        return attribTree(tree, env, new ResultInfo(VAL, !pt.hasTag(ERROR) ? pt : Type.noType));
+        return attribTree(tree, env,
+                          new ResultInfo(VAL, !pt.hasTag(ERROR) ? pt : Type.noType));
     }
 
     /** Derived visitor method: attribute an expression tree with
@@ -650,6 +653,7 @@
 
     /** Derived visitor method: attribute a type tree.
      */
+
     public Type attribType(JCTree tree, Env<AttrContext> env) {
         Type result = attribType(tree, env, Type.noType);
         return result;
@@ -664,6 +668,7 @@
 
     /** Derived visitor method: attribute a statement or definition tree.
      */
+
     public Type attribStat(JCTree tree, Env<AttrContext> env) {
         return attribTree(tree, env, statInfo);
     }
@@ -731,7 +736,8 @@
             a.tsym.flags_field |= UNATTRIBUTED;
             a.bound = Type.noType;
             if (!tvar.bounds.isEmpty()) {
-                List<Type> bounds = List.of(attribType(tvar.bounds.head, env));
+                List<Type> bounds =
+                    List.of(attribType(tvar.bounds.head, env));
                 for (JCExpression bound : tvar.bounds.tail)
                     bounds = bounds.prepend(attribType(bound, env));
                 types.setBounds(a, bounds.reverse());
@@ -765,7 +771,7 @@
      *  @param type        The expected type, or null
      *  @see VarSymbol#setLazyConstValue
      */
-    public Object attribLazyConstantValue(Env<AttrContext> env,
+    public Object attribLazyConstantValue(final Env<AttrContext> env,
                                       JCVariableDecl variable,
                                       Type type) {
 
@@ -884,6 +890,7 @@
                 c.flags_field |= NOOUTERTHIS;
             }
             attribClass(tree.pos(), c);
+
             result = tree.type = c.type;
         }
     }
@@ -1021,10 +1028,6 @@
                     }
                 }
 
-                // Attribute all type annotations in the body
-                annotate.annotateTypeLater(tree.body, localEnv, m, null);
-                annotate.flush();
-
                 // Attribute method body.
                 attribStat(tree.body, localEnv);
             }
@@ -1038,21 +1041,59 @@
         }
     }
 
-    public void visitVarDef(JCVariableDecl tree) {
+    public Annotate.PositionCreator getVarCreator(final JCVariableDecl tree) {
+        // Form the enclosing tree node, figure out what kind
+        // of definition we are looking at.
+        switch(env.tree.getTag()) {
+        case TRY:
+            // If it's a try, then we have a resource variable
+            return annotate.resourceVarCreator(tree.pos);
+        case CATCH:
+            // If it's a catch, then we have an exception parameter
+            return annotate.exceptionParamCreator(tree.pos);
+        case LAMBDA: {
+            // If it's a lambda, then we could have a local
+            // variable or a parameter.
+            final JCLambda lambda = (JCLambda) env.tree;
+            // We have to figure out what the index of the
+            // parameter is, and unfortunately, the visitor
+            // and tree APIs don't help us much here.  If we
+            // don't find the declaration in the parameter
+            // list, then it must be a local variable.
+            //
+            // This could easily be replaced by an index
+            // parameter, which is -1 for non-indexed
+            // definitions.
+            int index = -1;
+            int i = 0;
+            for (List<JCVariableDecl> l = lambda.params;
+                 l.nonEmpty(); l = l.tail, i++) {
+                if (l.head == tree) {
+                    index = i;
+                    break;
+                }
+            }
+            if (index == -1) {
+                return annotate.localVarCreator(tree.pos);
+            } else {
+                return annotate.paramCreator(index);
+            }
+        }
+        default:
+            // The default case is to treat any declaration as a local
+            // variable.
+            return annotate.localVarCreator(tree.pos);
+        }
+    }
+
+    public void visitVarDef(final JCVariableDecl tree) {
         // Local variables have not been entered yet, so we need to do it now:
         if (env.info.scope.owner.kind == MTH) {
             if (tree.sym != null) {
                 // parameters have already been entered
                 env.info.scope.enter(tree.sym);
             } else {
-                memberEnter.memberEnter(tree, env);
-                annotate.flush();
-            }
-        } else {
-            if (tree.init != null) {
-                // Field initializer expression need to be entered.
-                annotate.annotateTypeLater(tree.init, env, tree.sym, tree.pos());
-                annotate.flush();
+                memberEnter.memberEnter(tree, env, getVarCreator(tree));
             }
         }
 
@@ -1103,17 +1144,15 @@
             // Block is a static or instance initializer;
             // let the owner of the environment be a freshly
             // created BLOCK-method.
-            Env<AttrContext> localEnv =
+            final Env<AttrContext> localEnv =
                 env.dup(tree, env.info.dup(env.info.scope.dupUnshared()));
             localEnv.info.scope.owner =
                 new MethodSymbol(tree.flags | BLOCK |
                     env.info.scope.owner.flags() & STRICTFP, names.empty, null,
                     env.info.scope.owner);
-            if ((tree.flags & STATIC) != 0) localEnv.info.staticLevel++;
 
-            // Attribute all type annotations in the block
-            annotate.annotateTypeLater(tree, localEnv, localEnv.info.scope.owner, null);
-            annotate.flush();
+            if ((tree.flags & STATIC) != 0) localEnv.info.staticLevel++;
+            attribStats(tree.stats, localEnv);
 
             {
                 // Store init and clinit type annotations with the ClassSymbol
@@ -1126,8 +1165,6 @@
                     cs.appendInitTypeAttributes(tas);
                 }
             }
-
-            attribStats(tree.stats, localEnv);
         } else {
             // Create a new local environment with a local scope.
             Env<AttrContext> localEnv =
@@ -1481,17 +1518,21 @@
                             isBooleanOrNumeric(env, condTree.falsepart);
                 case APPLY:
                     JCMethodInvocation speculativeMethodTree =
-                            (JCMethodInvocation)deferredAttr.attribSpeculative(tree, env, unknownExprInfo);
+                        (JCMethodInvocation)deferredAttr.attribSpeculative(tree, env, unknownExprInfo,
+                                                                           annotate.noCreator);
                     Type owntype = TreeInfo.symbol(speculativeMethodTree.meth).type.getReturnType();
                     return types.unboxedTypeOrType(owntype).isPrimitive();
                 case NEWCLASS:
                     JCExpression className =
                             removeClassParams.translate(((JCNewClass)tree).clazz);
                     JCExpression speculativeNewClassTree =
-                            (JCExpression)deferredAttr.attribSpeculative(className, env, unknownTypeInfo);
+                        (JCExpression)deferredAttr.attribSpeculative(className,
+                                                                     env,
+                                                                     unknownTypeInfo,
+                                                                     annotate.newObjCreator(tree.pos));
                     return types.unboxedTypeOrType(speculativeNewClassTree.type).isPrimitive();
                 default:
-                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo).type;
+                    Type speculativeType = deferredAttr.attribSpeculative(tree, env, unknownExprInfo, annotate.noCreator).type;
                     speculativeType = types.unboxedTypeOrType(speculativeType);
                     return speculativeType.isPrimitive();
             }
@@ -1754,7 +1795,28 @@
                 // Attribute arguments, yielding list of argument types.
                 attribArgs(tree.args, localEnv, argtypesBuf);
                 argtypes = argtypesBuf.toList();
-                typeargtypes = attribTypes(tree.typeargs, localEnv);
+
+                // Attribute and annotate the type arguments
+                ListBuffer<Type> typeargtypesbuf = new ListBuffer<>();
+                int i = 0;
+
+                for (List<JCExpression> l = tree.typeargs;
+                     l.nonEmpty(); l = l.tail, i++) {
+                    final JCExpression arg = l.head;
+                    try {
+                        annotate.enterStart();
+                        typeargtypesbuf.append(attribType(arg, localEnv));
+                        annotate.annotateTypeLater(arg, localEnv,
+                                                   localEnv.info.scope.owner,
+                                                   tree.pos(),
+                                                   annotate.constructorInvokeTypeArgCreator(i, tree.pos));
+                    } finally {
+                        annotate.enterDone();
+                    }
+                }
+
+                typeargtypes =
+                    chk.checkRefTypes(tree.typeargs, typeargtypesbuf.toList());
 
                 // Variable `site' points to the class in which the called
                 // constructor is defined.
@@ -1827,7 +1889,27 @@
             // Attribute the arguments, yielding list of argument types, ...
             int kind = attribArgs(tree.args, localEnv, argtypesBuf);
             argtypes = argtypesBuf.toList();
-            typeargtypes = attribAnyTypes(tree.typeargs, localEnv);
+
+            // Attribute and annotate the type arguments
+            ListBuffer<Type> typeargtypesbuf = new ListBuffer<>();
+            int i = 0;
+
+            for (List<JCExpression> l = tree.typeargs;
+                 l.nonEmpty(); l = l.tail, i++) {
+                final JCExpression arg = l.head;
+                try {
+                    annotate.enterStart();
+                    typeargtypesbuf.append(attribType(arg, localEnv));
+                    annotate.annotateTypeLater(arg, localEnv,
+                                               localEnv.info.scope.owner,
+                                               tree.pos(),
+                                               annotate.methodInvokeTypeArgCreator(i, tree.pos));
+                } finally {
+                    annotate.enterDone();
+                }
+            }
+
+            typeargtypes = typeargtypesbuf.toList();
 
             // ... and attribute the method using as a prototype a methodtype
             // whose formal argument types is exactly the list of actual
@@ -1852,6 +1934,7 @@
             // current context.  Also, capture the return type
             result = check(tree, capture(restype), VAL, resultInfo);
         }
+
         chk.validate(tree.typeargs, localEnv);
     }
     //where
@@ -1927,14 +2010,12 @@
                 annoclazzid = (JCAnnotatedType) clazzid;
                 clazzid = annoclazzid.underlyingType;
             }
-        } else {
-            if (clazz.hasTag(ANNOTATED_TYPE)) {
+        } else if (clazz.hasTag(ANNOTATED_TYPE)) {
                 annoclazzid = (JCAnnotatedType) clazz;
                 clazzid = annoclazzid.underlyingType;
             } else {
                 clazzid = clazz;
             }
-        }
 
         JCExpression clazzid1 = clazzid; // The same in fully qualified form
 
@@ -1956,11 +2037,12 @@
 
             EndPosTable endPosTable = this.env.toplevel.endPositions;
             endPosTable.storeEnd(clazzid1, tree.getEndPosition(endPosTable));
-            if (clazz.hasTag(ANNOTATED_TYPE)) {
-                JCAnnotatedType annoType = (JCAnnotatedType) clazz;
-                List<JCAnnotation> annos = annoType.annotations;
+            if (annoclazzid != null) {
+                JCAnnotatedType annoType = annoclazzid;
+                List<JCAnnotation> annos = annoclazzid.annotations;
 
-                if (annoType.underlyingType.hasTag(TYPEAPPLY)) {
+                if (clazz.hasTag(TYPEAPPLY)) {
+
                     clazzid1 = make.at(tree.pos).
                         TypeApply(clazzid1,
                                   ((JCTypeApply) clazz).arguments);
@@ -1977,12 +2059,32 @@
             clazz = clazzid1;
         }
 
+        Type clazztype;
+
+        try {
+            annotate.enterStart();
         // Attribute clazz expression and store
         // symbol + type back into the attributed tree.
-        Type clazztype = TreeInfo.isEnumInit(env.tree) ?
+            clazztype = TreeInfo.isEnumInit(env.tree) ?
             attribIdentAsEnumType(env, (JCIdent)clazz) :
             attribType(clazz, env);
 
+            if (cdef != null) {
+                // If we are looking at an anonymous class creation, then
+                // we are not allowed to have declaration annotations on
+                // the base type.
+                annotate.annotateStrictTypeLater(clazz, cdef.mods.annotations, localEnv,
+                                                 env.info.scope.owner, tree.pos(),
+                                                 annotate.newObjCreator(tree.pos));
+            } else {
+                // Otherwise, we are.
+                annotate.annotateTypeLater(clazz, localEnv, env.info.scope.owner,
+                                           tree.pos(), annotate.newObjCreator(tree.pos));
+            }
+        } finally {
+            annotate.enterDone();
+        }
+
         clazztype = chk.checkDiamond(tree, clazztype);
         chk.validate(clazz, localEnv);
         if (tree.encl != null) {
@@ -2011,7 +2113,29 @@
         ListBuffer<Type> argtypesBuf = new ListBuffer<>();
         int pkind = attribArgs(tree.args, localEnv, argtypesBuf);
         List<Type> argtypes = argtypesBuf.toList();
-        List<Type> typeargtypes = attribTypes(tree.typeargs, localEnv);
+        List<Type> typeargtypes;
+
+        // Attribute and annotate the type arguments
+        ListBuffer<Type> typeargtypesbuf = new ListBuffer<>();
+        int i = 0;
+
+        for (List<JCExpression> l = tree.typeargs;
+             l.nonEmpty(); l = l.tail, i++) {
+            final JCExpression arg = l.head;
+            try {
+                annotate.enterStart();
+                typeargtypesbuf.append(attribType(arg, localEnv));
+                annotate.annotateTypeLater(arg, localEnv,
+                                           localEnv.info.scope.owner,
+                                           tree.pos(),
+                                           annotate.constructorInvokeTypeArgCreator(i, tree.pos));
+            } finally {
+                annotate.enterDone();
+            }
+        }
+
+        typeargtypes =
+            chk.checkRefTypes(tree.typeargs, typeargtypesbuf.toList());
 
         // If we have made no mistakes in the class type...
         if (clazztype.hasTag(CLASS)) {
@@ -2194,7 +2318,9 @@
                 ta.arguments = List.nil();
                 ResultInfo findDiamondResult = new ResultInfo(VAL,
                         resultInfo.checkContext.inferenceContext().free(resultInfo.pt) ? Type.noType : pt());
-                Type inferred = deferredAttr.attribSpeculative(tree, env, findDiamondResult).type;
+                Type inferred = deferredAttr.attribSpeculative(tree, env,
+                                                               findDiamondResult,
+                                                               annotate.newObjCreator(tree.pos)).type;
                 Type polyPt = allowPoly ?
                         syms.objectType :
                         clazztype;
@@ -2256,8 +2382,20 @@
         Type owntype = types.createErrorType(tree.type);
         Env<AttrContext> localEnv = env.dup(tree);
         Type elemtype;
+
+        for(List<JCAnnotation> dim : tree.dimAnnotations) {
+            this.attribAnnotationTypes(dim, localEnv);
+        }
+
         if (tree.elemtype != null) {
+            try {
+                annotate.enterStart();
             elemtype = attribType(tree.elemtype, localEnv);
+                annotate.annotateTypeLater(tree, env, env.info.scope.owner, tree.pos(),
+                                           annotate.newObjCreator(tree.pos));
+            } finally {
+                annotate.enterDone();
+            }
             chk.validate(tree.elemtype, localEnv);
             owntype = elemtype;
             for (List<JCExpression> l = tree.dims; l.nonEmpty(); l = l.tail) {
@@ -2278,6 +2416,7 @@
                 elemtype = types.createErrorType(pt());
             }
         }
+
         if (tree.elems != null) {
             attribExprs(tree.elems, localEnv, elemtype);
             owntype = new ArrayType(elemtype, syms.arrayClass,
@@ -2672,6 +2811,8 @@
 
     @Override
     public void visitReference(final JCMemberReference that) {
+        final boolean isConstructor = that.getName() == names.init;
+
         if (pt().isErroneous() || (pt().hasTag(NONE) && pt() != Type.recoveryType)) {
             if (pt().hasTag(NONE)) {
                 //method reference only allowed in assignment or method invocation/cast context
@@ -2682,9 +2823,20 @@
         }
         final Env<AttrContext> localEnv = env.dup(that);
         try {
+            Type exprType;
+            try {
+                annotate.enterStart();
             //attribute member reference qualifier - if this is a constructor
             //reference, the expected kind must be a type
-            Type exprType = attribTree(that.expr, env, memberReferenceQualifierResult(that));
+                exprType = attribTree(that.expr, env, memberReferenceQualifierResult(that));
+                final Annotate.PositionCreator creator =
+                    isConstructor ? annotate.constructorRefCreator(that.pos) :
+                    annotate.methodRefCreator(that.pos);
+                annotate.annotateTypeLater(that.expr, localEnv, env.info.scope.owner,
+                                           that.pos(), creator);
+            } finally {
+                annotate.enterDone();
+            }
 
             if (that.getMode() == JCMemberReference.ReferenceMode.NEW) {
                 exprType = chk.checkConstructorRefType(that.expr, exprType);
@@ -2714,7 +2866,24 @@
             //attrib type-arguments
             List<Type> typeargtypes = List.nil();
             if (that.typeargs != null) {
+                try {
+                    annotate.enterStart();
                 typeargtypes = attribTypes(that.typeargs, localEnv);
+
+                    // Annotate type arguments
+                    int i = 0;
+                    for (List<JCExpression> l = that.typeargs;
+                         l.nonEmpty(); l = l.tail, i++) {
+                        final Annotate.PositionCreator typeArgCreator =
+                            isConstructor ? annotate.constructorRefTypeArgCreator(i, that.pos) :
+                            annotate.methodRefTypeArgCreator(i, that.pos);
+                        final JCExpression arg = l.head;
+                        annotate.annotateTypeLater(arg, env, env.info.scope.owner,
+                                                   that.pos(), typeArgCreator);
+                    }
+                } finally {
+                    annotate.enterDone();
+                }
             }
 
             Type desc;
@@ -3088,7 +3257,15 @@
     }
 
     public void visitTypeCast(final JCTypeCast tree) {
-        Type clazztype = attribType(tree.clazz, env);
+        Type clazztype;
+        try {
+            annotate.enterStart();
+            clazztype = attribType(tree.clazz, env);
+            annotate.annotateTypeLater(tree.clazz, env, env.info.scope.owner,
+                                       tree.pos(), annotate.castCreator(tree.pos));
+        } finally {
+            annotate.enterDone();
+        }
         chk.validate(tree.clazz, env, false);
         //a fresh environment is required for 292 inference to work properly ---
         //see Infer.instantiatePolymorphicSignatureInstance()
@@ -3121,7 +3298,16 @@
     public void visitTypeTest(JCInstanceOf tree) {
         Type exprtype = chk.checkNullOrRefType(
             tree.expr.pos(), attribExpr(tree.expr, env));
-        Type clazztype = attribType(tree.clazz, env);
+        Type clazztype;
+        try {
+            annotate.enterStart();
+            clazztype = attribType(tree.clazz, env);
+            annotate.annotateTypeLater(tree.clazz, env, env.info.scope.owner, tree.pos(),
+                                       annotate.instanceOfCreator(tree.pos));
+        } finally {
+            annotate.enterDone();
+        }
+
         if (!clazztype.hasTag(TYPEVAR)) {
             clazztype = chk.checkClassOrArrayType(tree.clazz.pos(), clazztype);
         }
@@ -3250,9 +3436,12 @@
         if ((pkind() & (PCK | TYP)) == 0)
             site = capture(site); // Capture field access
 
-        // don't allow T.class T[].class, etc
         if (skind == TYP) {
+            // If the qualifier is a type, annotate it
+            annotate.annotateTypeLater(tree, env, env.info.scope.owner,
+                                       tree.pos(), annotate.errorCreator);
             Type elt = site;
+        // don't allow T.class T[].class, etc
             while (elt.hasTag(ARRAY))
                 elt = ((ArrayType)elt).elemtype;
             if (elt.hasTag(TYPEVAR)) {
@@ -3334,6 +3523,10 @@
                               tree.pos(), site, sym.name, true);
                 }
             }
+            if (!allowStaticInterfaceMethods && sitesym.isInterface() &&
+                    sym.isStatic() && sym.kind == MTH) {
+                log.error(tree.pos(), "static.intf.method.invoke.not.supported.in.source", sourceName);
+            }
         } else if (sym.kind != ERR && (sym.flags() & STATIC) != 0 && sym.name != names._class) {
             // If the qualified item is not a type and the selected item is static, report
             // a warning. Make allowance for the class of an array type e.g. Object[].class)
@@ -4081,8 +4274,13 @@
         Assert.error("should be handled in Annotate");
     }
 
+    /* This needs to be removed or otherwise changed, as it implicitly
+     * relies on the annotated types having previously been visited by
+     * Annotate.TypeAnnotate.
+     */
     public void visitAnnotatedType(JCAnnotatedType tree) {
-        Type underlyingType = attribType(tree.getUnderlyingType(), env);
+        Type underlyingType = attribTree(tree.getUnderlyingType(), env,
+                                         resultInfo);
         this.attribAnnotationTypes(tree.annotations, env);
         annotateType(tree, tree.annotations);
         result = tree.type = underlyingType;
@@ -4101,8 +4299,10 @@
             public void run() {
                 List<Attribute.TypeCompound> compounds = fromAnnotations(annotations);
                 Assert.check(annotations.size() == compounds.size());
+                if (!tree.type.hasTag(TypeTag.PACKAGE)) {
                 tree.type = tree.type.annotatedType(compounds);
                 }
+            }
         });
     }
 
@@ -4353,13 +4553,6 @@
             checkForSerial(c)) {
             checkSerialVersionUID(tree, c);
         }
-        if (allowTypeAnnos) {
-            // Correctly organize the postions of the type annotations
-            typeAnnotations.organizeTypeAnnotationsBodies(tree);
-
-            // Check type annotations applicability rules
-            validateTypeAnnotations(tree, false);
-        }
     }
         // where
         boolean checkForSerial(ClassSymbol c) {
@@ -4433,233 +4626,6 @@
         return types.capture(type);
     }
 
-    public void validateTypeAnnotations(JCTree tree, boolean sigOnly) {
-        tree.accept(new TypeAnnotationsValidator(sigOnly));
-    }
-    //where
-    private final class TypeAnnotationsValidator extends TreeScanner {
-
-        private final boolean sigOnly;
-        public TypeAnnotationsValidator(boolean sigOnly) {
-            this.sigOnly = sigOnly;
-        }
-
-        public void visitAnnotation(JCAnnotation tree) {
-            chk.validateTypeAnnotation(tree, false);
-            super.visitAnnotation(tree);
-        }
-        public void visitAnnotatedType(JCAnnotatedType tree) {
-            if (!tree.underlyingType.type.isErroneous()) {
-                super.visitAnnotatedType(tree);
-            }
-        }
-        public void visitTypeParameter(JCTypeParameter tree) {
-            chk.validateTypeAnnotations(tree.annotations, true);
-            scan(tree.bounds);
-            // Don't call super.
-            // This is needed because above we call validateTypeAnnotation with
-            // false, which would forbid annotations on type parameters.
-            // super.visitTypeParameter(tree);
-        }
-        public void visitMethodDef(JCMethodDecl tree) {
-            if (tree.recvparam != null &&
-                    !tree.recvparam.vartype.type.isErroneous()) {
-                checkForDeclarationAnnotations(tree.recvparam.mods.annotations,
-                        tree.recvparam.vartype.type.tsym);
-            }
-            if (tree.restype != null && tree.restype.type != null) {
-                validateAnnotatedType(tree.restype, tree.restype.type);
-            }
-            if (sigOnly) {
-                scan(tree.mods);
-                scan(tree.restype);
-                scan(tree.typarams);
-                scan(tree.recvparam);
-                scan(tree.params);
-                scan(tree.thrown);
-            } else {
-                scan(tree.defaultValue);
-                scan(tree.body);
-            }
-        }
-        public void visitVarDef(final JCVariableDecl tree) {
-            //System.err.println("validateTypeAnnotations.visitVarDef " + tree);
-            if (tree.sym != null && tree.sym.type != null)
-                validateAnnotatedType(tree.vartype, tree.sym.type);
-            scan(tree.mods);
-            scan(tree.vartype);
-            if (!sigOnly) {
-                scan(tree.init);
-            }
-        }
-        public void visitTypeCast(JCTypeCast tree) {
-            if (tree.clazz != null && tree.clazz.type != null)
-                validateAnnotatedType(tree.clazz, tree.clazz.type);
-            super.visitTypeCast(tree);
-        }
-        public void visitTypeTest(JCInstanceOf tree) {
-            if (tree.clazz != null && tree.clazz.type != null)
-                validateAnnotatedType(tree.clazz, tree.clazz.type);
-            super.visitTypeTest(tree);
-        }
-        public void visitNewClass(JCNewClass tree) {
-            if (tree.clazz.hasTag(ANNOTATED_TYPE)) {
-                checkForDeclarationAnnotations(((JCAnnotatedType) tree.clazz).annotations,
-                        tree.clazz.type.tsym);
-            }
-            if (tree.def != null) {
-                checkForDeclarationAnnotations(tree.def.mods.annotations, tree.clazz.type.tsym);
-            }
-            if (tree.clazz.type != null) {
-                validateAnnotatedType(tree.clazz, tree.clazz.type);
-            }
-            super.visitNewClass(tree);
-        }
-        public void visitNewArray(JCNewArray tree) {
-            if (tree.elemtype != null && tree.elemtype.type != null) {
-                if (tree.elemtype.hasTag(ANNOTATED_TYPE)) {
-                    checkForDeclarationAnnotations(((JCAnnotatedType) tree.elemtype).annotations,
-                            tree.elemtype.type.tsym);
-                }
-                validateAnnotatedType(tree.elemtype, tree.elemtype.type);
-            }
-            super.visitNewArray(tree);
-        }
-        public void visitClassDef(JCClassDecl tree) {
-            //System.err.println("validateTypeAnnotations.visitClassDef " + tree);
-            if (sigOnly) {
-                scan(tree.mods);
-                scan(tree.typarams);
-                scan(tree.extending);
-                scan(tree.implementing);
-            }
-            for (JCTree member : tree.defs) {
-                if (member.hasTag(Tag.CLASSDEF)) {
-                    continue;
-                }
-                scan(member);
-            }
-        }
-        public void visitBlock(JCBlock tree) {
-            if (!sigOnly) {
-                scan(tree.stats);
-            }
-        }
-
-        /* I would want to model this after
-         * com.sun.tools.javac.comp.Check.Validator.visitSelectInternal(JCFieldAccess)
-         * and override visitSelect and visitTypeApply.
-         * However, we only set the annotated type in the top-level type
-         * of the symbol.
-         * Therefore, we need to override each individual location where a type
-         * can occur.
-         */
-        private void validateAnnotatedType(final JCTree errtree, final Type type) {
-            //System.err.println("Attr.validateAnnotatedType: " + errtree + " type: " + type);
-
-            if (type.isPrimitiveOrVoid()) {
-                return;
-            }
-
-            JCTree enclTr = errtree;
-            Type enclTy = type;
-
-            boolean repeat = true;
-            while (repeat) {
-                if (enclTr.hasTag(TYPEAPPLY)) {
-                    List<Type> tyargs = enclTy.getTypeArguments();
-                    List<JCExpression> trargs = ((JCTypeApply)enclTr).getTypeArguments();
-                    if (trargs.length() > 0) {
-                        // Nothing to do for diamonds
-                        if (tyargs.length() == trargs.length()) {
-                            for (int i = 0; i < tyargs.length(); ++i) {
-                                validateAnnotatedType(trargs.get(i), tyargs.get(i));
-                            }
-                        }
-                        // If the lengths don't match, it's either a diamond
-                        // or some nested type that redundantly provides
-                        // type arguments in the tree.
-                    }
-
-                    // Look at the clazz part of a generic type
-                    enclTr = ((JCTree.JCTypeApply)enclTr).clazz;
-                }
-
-                if (enclTr.hasTag(SELECT)) {
-                    enclTr = ((JCTree.JCFieldAccess)enclTr).getExpression();
-                    if (enclTy != null &&
-                            !enclTy.hasTag(NONE)) {
-                        enclTy = enclTy.getEnclosingType();
-                    }
-                } else if (enclTr.hasTag(ANNOTATED_TYPE)) {
-                    JCAnnotatedType at = (JCTree.JCAnnotatedType) enclTr;
-                    if (enclTy == null || enclTy.hasTag(NONE)) {
-                        if (at.getAnnotations().size() == 1) {
-                            log.error(at.underlyingType.pos(), "cant.type.annotate.scoping.1", at.getAnnotations().head.attribute);
-                        } else {
-                            ListBuffer<Attribute.Compound> comps = new ListBuffer<>();
-                            for (JCAnnotation an : at.getAnnotations()) {
-                                comps.add(an.attribute);
-                            }
-                            log.error(at.underlyingType.pos(), "cant.type.annotate.scoping", comps.toList());
-                        }
-                        repeat = false;
-                    }
-                    enclTr = at.underlyingType;
-                    // enclTy doesn't need to be changed
-                } else if (enclTr.hasTag(IDENT)) {
-                    repeat = false;
-                } else if (enclTr.hasTag(JCTree.Tag.WILDCARD)) {
-                    JCWildcard wc = (JCWildcard) enclTr;
-                    if (wc.getKind() == JCTree.Kind.EXTENDS_WILDCARD) {
-                        validateAnnotatedType(wc.getBound(), ((WildcardType)enclTy).getExtendsBound());
-                    } else if (wc.getKind() == JCTree.Kind.SUPER_WILDCARD) {
-                        validateAnnotatedType(wc.getBound(), ((WildcardType)enclTy).getSuperBound());
-                    } else {
-                        // Nothing to do for UNBOUND
-                    }
-                    repeat = false;
-                } else if (enclTr.hasTag(TYPEARRAY)) {
-                    JCArrayTypeTree art = (JCArrayTypeTree) enclTr;
-                    validateAnnotatedType(art.getType(), ((ArrayType)enclTy).getComponentType());
-                    repeat = false;
-                } else if (enclTr.hasTag(TYPEUNION)) {
-                    JCTypeUnion ut = (JCTypeUnion) enclTr;
-                    for (JCTree t : ut.getTypeAlternatives()) {
-                        validateAnnotatedType(t, t.type);
-                    }
-                    repeat = false;
-                } else if (enclTr.hasTag(TYPEINTERSECTION)) {
-                    JCTypeIntersection it = (JCTypeIntersection) enclTr;
-                    for (JCTree t : it.getBounds()) {
-                        validateAnnotatedType(t, t.type);
-                    }
-                    repeat = false;
-                } else if (enclTr.getKind() == JCTree.Kind.PRIMITIVE_TYPE ||
-                           enclTr.getKind() == JCTree.Kind.ERRONEOUS) {
-                    repeat = false;
-                } else {
-                    Assert.error("Unexpected tree: " + enclTr + " with kind: " + enclTr.getKind() +
-                            " within: "+ errtree + " with kind: " + errtree.getKind());
-                }
-            }
-        }
-
-        private void checkForDeclarationAnnotations(List<? extends JCAnnotation> annotations,
-                Symbol sym) {
-            // Ensure that no declaration annotations are present.
-            // Note that a tree type might be an AnnotatedType with
-            // empty annotations, if only declaration annotations were given.
-            // This method will raise an error for such a type.
-            for (JCAnnotation ai : annotations) {
-                if (!ai.type.isErroneous() &&
-                        typeAnnotations.annotationType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
-                    log.error(ai.pos(), "annotation.type.not.applicable");
-                }
-            }
-        }
-    }
-
     // <editor-fold desc="post-attribution visitor">
 
     /**
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java b/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java
index e9e6224..3ffda24 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java
@@ -58,6 +58,11 @@
      */
     boolean isSerializable = false;
 
+    /**
+     * Are we doing speculative attribution?
+     */
+    boolean isSpeculative = false;
+
     /** Are arguments to current function applications boxed into an array for varargs?
      */
     Resolve.MethodResolutionPhase pendingResolutionPhase = null;
@@ -94,6 +99,7 @@
         info.returnResult = returnResult;
         info.defaultSuperCallSite = defaultSuperCallSite;
         info.isSerializable = isSerializable;
+        info.isSpeculative = isSpeculative;
         return info;
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
index 7cfb78e..2857b4d 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Check.java
@@ -1041,7 +1041,9 @@
 
         switch (sym.kind) {
         case VAR:
-            if (sym.owner.kind != TYP)
+            if (TreeInfo.isReceiverParam(tree))
+                mask = ReceiverParamFlags;
+            else if (sym.owner.kind != TYP)
                 mask = LocalVarFlags;
             else if ((sym.owner.flags_field & INTERFACE) != 0)
                 mask = implicit = InterfaceVarFlags;
@@ -1818,6 +1820,11 @@
                                             Type t1,
                                             Type t2,
                                             Type site) {
+        if ((site.tsym.flags() & COMPOUND) != 0) {
+            // special case for intersections: need to eliminate wildcards in supertypes
+            t1 = types.capture(t1);
+            t2 = types.capture(t2);
+        }
         return firstIncompatibility(pos, t1, t2, site) == null;
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
index 1517948..3f2157c 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/DeferredAttr.java
@@ -25,6 +25,7 @@
 
 package com.sun.tools.javac.comp;
 
+import com.sun.source.tree.*;
 import com.sun.source.tree.LambdaExpressionTree.BodyKind;
 import com.sun.tools.javac.code.*;
 import com.sun.tools.javac.tree.*;
@@ -76,6 +77,7 @@
     final Types types;
     final Flow flow;
     final Names names;
+    final Annotate annotate;
 
     public static DeferredAttr instance(Context context) {
         DeferredAttr instance = context.get(deferredAttrKey);
@@ -99,6 +101,7 @@
         flow = Flow.instance(context);
         names = Names.instance(context);
         stuckTree = make.Ident(names.empty).setType(Type.stuckType);
+        annotate = Annotate.instance(context);
         emptyDeferredAttrContext =
             new DeferredAttrContext(AttrMode.CHECK, null, MethodResolutionPhase.BOX, infer.emptyContext, null, null) {
                 @Override
@@ -133,7 +136,8 @@
         AttrMode mode;
         SpeculativeCache speculativeCache;
 
-        DeferredType(JCExpression tree, Env<AttrContext> env) {
+        DeferredType(JCExpression tree,
+                     Env<AttrContext> env) {
             super(null, noAnnotations);
             this.tree = tree;
             this.env = attr.copyEnv(env);
@@ -277,12 +281,18 @@
                     //Note: if a symbol is imported twice we might do two identical
                     //speculative rounds...
                     Assert.check(dt.mode == null || dt.mode == AttrMode.SPECULATIVE);
-                    JCTree speculativeTree = attribSpeculative(dt.tree, dt.env, resultInfo);
+                    JCTree speculativeTree = attribSpeculative(dt.tree, dt.env,
+                                                               resultInfo,
+                                                               annotate.noCreator);
                     dt.speculativeCache.put(speculativeTree, resultInfo);
                     return speculativeTree.type;
                 case CHECK:
                     Assert.check(dt.mode != null);
-                    return attr.attribTree(dt.tree, dt.env, resultInfo);
+                    final boolean oldSpeculative = dt.env.info.isSpeculative;
+                    dt.env.info.isSpeculative = false;
+                    Type out = attr.attribTree(dt.tree, dt.env, resultInfo);
+                    dt.env.info.isSpeculative = oldSpeculative;
+                    return out;
             }
             Assert.error();
             return null;
@@ -359,9 +369,13 @@
      * restored after type-checking. All diagnostics (but critical ones) are
      * disabled during speculative type-checking.
      */
-    JCTree attribSpeculative(JCTree tree, Env<AttrContext> env, ResultInfo resultInfo) {
+    JCTree attribSpeculative(JCTree tree,
+                             Env<AttrContext> env,
+                             ResultInfo resultInfo,
+                             Annotate.PositionCreator creator) {
         final JCTree newTree = new TreeCopier<>(make).copy(tree);
         Env<AttrContext> speculativeEnv = env.dup(newTree, env.info.dup(env.info.scope.dupUnshared()));
+        speculativeEnv.info.isSpeculative = true;
         speculativeEnv.info.scope.owner = env.info.scope.owner;
         Log.DeferredDiagnosticHandler deferredDiagnosticHandler =
                 new Log.DeferredDiagnosticHandler(log, new Filter<JCDiagnostic>() {
@@ -385,6 +399,9 @@
         });
         try {
             attr.attribTree(newTree, speculativeEnv, resultInfo);
+            annotate.typeAnnotateExprLater(newTree, speculativeEnv,
+                                           speculativeEnv.info.scope.owner,
+                                           newTree.pos(), creator);
             unenterScanner.scan(newTree);
             return newTree;
         } finally {
@@ -741,8 +758,11 @@
                         checkContext.report(null, ex.getDiagnostic());
                     }
                     Env<AttrContext> localEnv = env.dup(tree);
-                    JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
-                            attr.memberReferenceQualifierResult(tree));
+                    JCExpression exprTree =
+                        (JCExpression)attribSpeculative(tree.getQualifierExpression(),
+                                                        localEnv,
+                                                        attr.memberReferenceQualifierResult(tree),
+                                                        annotate.methodRefCreator(tree.pos));
                     ListBuffer<Type> argtypes = new ListBuffer<>();
                     for (Type t : types.findDescriptorType(pt).getParameterTypes()) {
                         argtypes.append(Type.noType);
@@ -1164,8 +1184,11 @@
         public void visitReference(JCMemberReference tree) {
             //perform arity-based check
             Env<AttrContext> localEnv = env.dup(tree);
-            JCExpression exprTree = (JCExpression)attribSpeculative(tree.getQualifierExpression(), localEnv,
-                    attr.memberReferenceQualifierResult(tree));
+            JCExpression exprTree =
+                (JCExpression)attribSpeculative(tree.getQualifierExpression(),
+                                                localEnv,
+                                                attr.memberReferenceQualifierResult(tree),
+                                                annotate.methodRefCreator(tree.pos));
             JCMemberReference mref2 = new TreeCopier<Void>(make).copy(tree);
             mref2.expr = exprTree;
             Symbol res =
@@ -1309,7 +1332,7 @@
                         return null;
                     site = resolvedReturnType.type;
                 } else {
-                    site = attribSpeculative(rec, env, attr.unknownTypeExprInfo).type;
+                    site = attribSpeculative(rec, env, attr.unknownTypeExprInfo, annotate.noCreator).type;
                 }
             } else {
                 site = env.enclClass.sym.type;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java b/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java
index e189d99..e354991 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/Env.java
@@ -26,6 +26,7 @@
 package com.sun.tools.javac.comp;
 
 import com.sun.tools.javac.tree.*;
+import com.sun.tools.javac.tree.JCTree.JCLambda;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
 
@@ -156,4 +157,10 @@
             }
         };
     }
+
+    public JCLambda getLambda() {
+        Env<A> out = enclosing(JCTree.Tag.LAMBDA);
+
+        return out != null ? (JCLambda) out.tree : null;
+    }
 }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
index 4fddfb1..a1b51f6 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java
@@ -35,8 +35,9 @@
 import com.sun.tools.javac.tree.*;
 import com.sun.tools.javac.util.*;
 
-import com.sun.tools.javac.code.Type.*;
 import com.sun.tools.javac.code.Symbol.*;
+import com.sun.tools.javac.code.Type.*;
+import com.sun.tools.javac.code.TypeAnnotationPosition.*;
 import com.sun.tools.javac.tree.JCTree.*;
 
 import static com.sun.tools.javac.code.Flags.*;
@@ -75,7 +76,6 @@
     private final TreeMaker make;
     private final Todo todo;
     private final Annotate annotate;
-    private final TypeAnnotations typeAnnotations;
     private final Types types;
     private final JCDiagnostic.Factory diags;
     private final Source source;
@@ -101,7 +101,6 @@
         make = TreeMaker.instance(context);
         todo = Todo.instance(context);
         annotate = Annotate.instance(context);
-        typeAnnotations = TypeAnnotations.instance(context);
         types = Types.instance(context);
         diags = JCDiagnostic.Factory.instance(context);
         source = Source.instance(context);
@@ -131,6 +130,13 @@
      */
     boolean completionEnabled = true;
 
+    /** The creator that will be used for any varDef's we visit.  This
+     * is used to create the position for any type annotations (or
+     * annotations that potentially are type annotations) that we
+     * encounter.
+     */
+    Annotate.PositionCreator creator;
+
     /* ---------- Processing import clauses ----------------
      */
 
@@ -348,6 +354,7 @@
     }
 
     /** Construct method type from method signature.
+     *  @param msym        The MethodSymbol for the method.
      *  @param typarams    The method's type parameters.
      *  @param params      The method's value parameters.
      *  @param res             The method's result type,
@@ -356,33 +363,89 @@
      *                 null if none given; TODO: or already set here?
      *  @param thrown      The method's thrown exceptions.
      *  @param env             The method's (local) environment.
+     *  @param declAnnos   The annotations on the method declaration,
+     *                     some of which may be type annotations on
+     *                     the return type.
+     *  @param deferPos    The deferred diagnostic position for error
+     *                     reporting.
      */
-    Type signature(MethodSymbol msym,
-                   List<JCTypeParameter> typarams,
-                   List<JCVariableDecl> params,
-                   JCTree res,
-                   JCVariableDecl recvparam,
-                   List<JCExpression> thrown,
-                   Env<AttrContext> env) {
+    Type signature(final MethodSymbol msym,
+                   final List<JCTypeParameter> typarams,
+                   final List<JCVariableDecl> params,
+                   final JCTree res,
+                   final JCVariableDecl recvparam,
+                   final List<JCExpression> thrown,
+                   final Env<AttrContext> env,
+                   final List<JCAnnotation> declAnnos,
+                   final DiagnosticPosition deferPos) {
+        int i;
 
         // Enter and attribute type parameters.
         List<Type> tvars = enter.classEnter(typarams, env);
         attr.attribTypeVariables(typarams, env);
 
-        // Enter and attribute value parameters.
+        // Handle type annotations on type parameters.
+        i = 0;
+        for (List<JCTypeParameter> l = typarams; l.nonEmpty();
+             l = l.tail, i++) {
+            final JCTypeParameter param = l.head;
+            annotate.annotateTypeLater(param, env, msym, deferPos,
+                                       annotate.methodTypeParamCreator(i));
+            // ...and bounds on type parameters.
+            int j = 0;
+            for (List<JCExpression> bounds = param.bounds;
+                 bounds.nonEmpty(); bounds = bounds.tail, j++) {
+                annotate.annotateTypeLater(bounds.head, env, msym, deferPos,
+                                           annotate.methodTypeParamBoundCreator(param, i, j));
+            }
+        }
+
+        // Enter and attribute value parameters.  Type annotations get
+        // METHOD_FORMAL_PARAMETER positions.
         ListBuffer<Type> argbuf = new ListBuffer<>();
-        for (List<JCVariableDecl> l = params; l.nonEmpty(); l = l.tail) {
-            memberEnter(l.head, env);
+        i = 0;
+        for (List<JCVariableDecl> l = params; l.nonEmpty(); l = l.tail, i++) {
+            // The types will get annotated by visitVarDef
+            memberEnter(l.head, env, annotate.paramCreator(i));
             argbuf.append(l.head.vartype.type);
         }
 
         // Attribute result type, if one is given.
-        Type restype = res == null ? syms.voidType : attr.attribType(res, env);
+        Type restype;
+
+        if (res != null) {
+            // If we have any declaration annotations, they might
+            // be/also be type annotations on the return type.  We
+            // pass them in, so they get classified and then attached
+            // to the method, or the return type, or both.
+            restype = attr.attribType(res, env);
+            annotate.annotateTypeLater(res, declAnnos, env, msym, deferPos,
+                                       annotate.returnCreator);
+        } else {
+            // For constructors, we don't actually have a type, so we
+            // can't have a type path (except for INNER_TYPE), and we
+            // don't have annotations on arrays, type arguments, and
+            // the like.
+
+            // The only type path we have is if we are in an inner type.
+            List<TypePathEntry> typepath = Annotate.makeInners(msym.owner.type);
+            TypeAnnotationPosition tapos =
+                TypeAnnotationPosition.methodReturn(typepath, env.getLambda(), -1);
+
+            // We don't have to walk down a type.  We just have to do
+            // repeating annotation handling, then classify and attach
+            // the annotations.
+            annotate.annotateWithClassifyLater(declAnnos, env, msym,
+                                               deferPos, tapos);
+            restype = syms.voidType;
+        }
+
 
         // Attribute receiver type, if one is given.
         Type recvtype;
         if (recvparam!=null) {
-            memberEnter(recvparam, env);
+            // The type will get annotated by visitVarDef
+            memberEnter(recvparam, env, annotate.receiverCreator);
             recvtype = recvparam.vartype.type;
         } else {
             recvtype = null;
@@ -390,8 +453,12 @@
 
         // Attribute thrown exceptions.
         ListBuffer<Type> thrownbuf = new ListBuffer<>();
-        for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail) {
+        i = 0;
+        for (List<JCExpression> l = thrown; l.nonEmpty(); l = l.tail, i++) {
             Type exc = attr.attribType(l.head, env);
+            // Annotate each exception type.
+            annotate.annotateTypeLater(l.head, env, msym, deferPos,
+                                       annotate.throwCreator(i));
             if (!exc.hasTag(TYPEVAR)) {
                 exc = chk.checkClassType(l.head.pos(), exc);
             } else if (exc.tsym.owner == msym) {
@@ -420,33 +487,49 @@
     /** Enter field and method definitions and process import
      *  clauses, catching any completion failure exceptions.
      */
-    protected void memberEnter(JCTree tree, Env<AttrContext> env) {
+    protected void memberEnter(JCTree tree, Env<AttrContext> env,
+                               Annotate.PositionCreator creator) {
         Env<AttrContext> prevEnv = this.env;
+        Annotate.PositionCreator prevCreator = this.creator;
         try {
             this.env = env;
+            this.creator = creator;
             tree.accept(this);
         }  catch (CompletionFailure ex) {
             chk.completionError(tree.pos(), ex);
         } finally {
+            this.creator = prevCreator;
             this.env = prevEnv;
         }
     }
 
+
+    protected void memberEnter(JCTree tree, Env<AttrContext> env) {
+        memberEnter(tree, env, annotate.noCreator);
+    }
+
     /** Enter members from a list of trees.
      */
-    void memberEnter(List<? extends JCTree> trees, Env<AttrContext> env) {
+    void memberEnter(List<? extends JCTree> trees,
+                     Env<AttrContext> env,
+                     Annotate.PositionCreator creator) {
         for (List<? extends JCTree> l = trees; l.nonEmpty(); l = l.tail)
-            memberEnter(l.head, env);
+            memberEnter(l.head, env, creator);
+    }
+
+    void memberEnter(List<? extends JCTree> trees,
+                     Env<AttrContext> env) {
+        memberEnter(trees, env, annotate.noCreator);
     }
 
     /** Enter members for a class.
      */
-    void finishClass(JCClassDecl tree, Env<AttrContext> env) {
+    void finishClass(final JCClassDecl tree, final Env<AttrContext> env) {
         if ((tree.mods.flags & Flags.ENUM) != 0 &&
             (types.supertype(tree.sym.type).tsym.flags() & Flags.ENUM) == 0) {
             addEnumMembers(tree, env);
         }
-        memberEnter(tree.defs, env);
+        memberEnter(tree.defs, env, annotate.fieldCreator);
     }
 
     /** Add the implicit members for an enum type
@@ -521,7 +604,7 @@
             }
         }
         // process package annotations
-        annotate.annotateLater(tree.annotations, env, env.toplevel.packge, null);
+        annotate.annotateLater(tree.annotations, env, env.toplevel.packge);
     }
 
     // process the non-static imports and the static imports of types.
@@ -567,15 +650,13 @@
 
         Env<AttrContext> localEnv = methodEnv(tree, env);
 
-        annotate.enterStart();
-        try {
             DiagnosticPosition prevLintPos = deferredLintHandler.setPos(tree.pos());
             try {
                 // Compute the method type
                 m.type = signature(m, tree.typarams, tree.params,
                                    tree.restype, tree.recvparam,
-                                   tree.thrown,
-                                   localEnv);
+                               tree.thrown, localEnv,
+                               tree.mods.annotations, tree.pos());
             } finally {
                 deferredLintHandler.setPos(prevLintPos);
             }
@@ -602,16 +683,9 @@
             enclScope.enter(m);
             }
 
-            annotate.annotateLater(tree.mods.annotations, localEnv, m, tree.pos());
-            // Visit the signature of the method. Note that
-            // TypeAnnotate doesn't descend into the body.
-            annotate.annotateTypeLater(tree, localEnv, m, tree.pos());
-
             if (tree.defaultValue != null)
-                annotateDefaultValueLater(tree.defaultValue, localEnv, m);
-        } finally {
-            annotate.enterDone();
-        }
+            annotateDefaultValueLater(tree.defaultValue, localEnv,
+                                      m, annotate.noCreator);
     }
 
     /** Create a fresh environment for method bodies.
@@ -646,22 +720,8 @@
                     attr.attribIdentAsEnumType(localEnv, (JCIdent)tree.vartype);
                 } else {
                     attr.attribType(tree.vartype, localEnv);
-                    if (tree.nameexpr != null) {
-                        attr.attribExpr(tree.nameexpr, localEnv);
-                        MethodSymbol m = localEnv.enclMethod.sym;
-                        if (m.isConstructor()) {
-                            Type outertype = m.owner.owner.type;
-                            if (outertype.hasTag(TypeTag.CLASS)) {
-                                checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
-                                checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
-                            } else {
-                                log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
-                            }
-                        } else {
-                            checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
-                            checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
-                        }
-                    }
+                    if (TreeInfo.isReceiverParam(tree))
+                        checkReceiver(tree, localEnv);
                 }
             } finally {
                 deferredLintHandler.setPos(prevLintPos);
@@ -695,8 +755,18 @@
                 chk.checkTransparentVar(tree.pos(), v, enclScope);
                 enclScope.enter(v);
             }
-            annotate.annotateLater(tree.mods.annotations, localEnv, v, tree.pos());
-            annotate.annotateTypeLater(tree.vartype, env, v, tree.pos());
+            if (TreeInfo.isReceiverParam(tree)) {
+                // If we are dealing with a receiver parameter, then
+                // we only allow base type annotations to be type
+                // annotations.  Receivers are not allowed to have
+                // declaration annotations.
+                annotate.annotateStrictTypeLater(tree.vartype, tree.mods.annotations,
+                                                 localEnv, v, tree.pos(), creator);
+            } else {
+                // Otherwise, we annotate the type.
+                annotate.annotateTypeLater(tree.vartype, tree.mods.annotations,
+                                           localEnv, v, tree.pos(), creator);
+            }
             v.pos = tree.pos;
         } finally {
             annotate.enterDone();
@@ -708,6 +778,26 @@
             log.error(tree, diag, type, tree.type);
         }
     }
+    void checkReceiver(JCVariableDecl tree, Env<AttrContext> localEnv) {
+        attr.attribExpr(tree.nameexpr, localEnv);
+        MethodSymbol m = localEnv.enclMethod.sym;
+        if (m.isConstructor()) {
+            Type outertype = m.owner.owner.type;
+            if (outertype.hasTag(TypeTag.METHOD)) {
+                // we have a local inner class
+                outertype = m.owner.owner.owner.type;
+            }
+            if (outertype.hasTag(TypeTag.CLASS)) {
+                checkType(tree.vartype, outertype, "incorrect.constructor.receiver.type");
+                checkType(tree.nameexpr, outertype, "incorrect.constructor.receiver.name");
+            } else {
+                log.error(tree, "receiver.parameter.not.applicable.constructor.toplevel.class");
+            }
+        } else {
+            checkType(tree.vartype, m.owner.type, "incorrect.receiver.type");
+            checkType(tree.nameexpr, m.owner.type, "incorrect.receiver.name");
+        }
+    }
 
     public boolean needsLazyConstValue(JCTree tree) {
         InitTreeVisitor initTreeVisitor = new InitTreeVisitor();
@@ -849,7 +939,8 @@
     /** Queue processing of an attribute default value. */
     void annotateDefaultValueLater(final JCExpression defaultValue,
                                    final Env<AttrContext> localEnv,
-                                   final MethodSymbol m) {
+                                   final MethodSymbol m,
+                                   final Annotate.PositionCreator creator) {
         annotate.normal(new Annotate.Worker() {
                 @Override
                 public String toString() {
@@ -936,22 +1027,44 @@
             // create an environment for evaluating the base clauses
             Env<AttrContext> baseEnv = baseEnv(tree, env);
 
-            if (tree.extending != null)
-                annotate.annotateTypeLater(tree.extending, baseEnv, sym, tree.pos());
-            for (JCExpression impl : tree.implementing)
-                annotate.annotateTypeLater(impl, baseEnv, sym, tree.pos());
-            annotate.flush();
+            // Annotations.
+            // In general, we cannot fully process annotations yet,  but we
+            // can attribute the annotation types and then check to see if the
+            // @Deprecated annotation is present.
+            attr.attribAnnotationTypes(tree.mods.annotations, baseEnv);
+            if (hasDeprecatedAnnotation(tree.mods.annotations))
+                c.flags_field |= DEPRECATED;
+
+            // Don't attach declaration annotations to anonymous
+            // classes, they get handled specially below.
+            if (!sym.isAnonymous()) {
+                annotate.annotateLater(tree.mods.annotations, baseEnv,
+                                       c, tree.pos());
+            }
 
             // Determine supertype.
-            Type supertype =
-                (tree.extending != null)
-                ? attr.attribBase(tree.extending, baseEnv, true, false, true)
-                : ((tree.mods.flags & Flags.ENUM) != 0)
+            Type supertype;
+
+            if (tree.extending != null) {
+                supertype = attr.attribBase(tree.extending, baseEnv,
+                                            true, false, true);
+                if (sym.isAnonymous()) {
+                    annotate.annotateAnonClassDefLater(tree.extending,
+                                                       tree.mods.annotations,
+                                                       baseEnv, sym, tree.pos(),
+                                                       annotate.extendsCreator);
+                } else {
+                    annotate.annotateTypeLater(tree.extending, baseEnv, sym,
+                                               tree.pos(), annotate.extendsCreator);
+                }
+            } else {
+                supertype = ((tree.mods.flags & Flags.ENUM) != 0)
                 ? attr.attribBase(enumBase(tree.pos, c), baseEnv,
                                   true, false, false)
                 : (c.fullname == names.java_lang_Object)
                 ? Type.noType
                 : syms.objectType;
+            }
             ct.supertype_field = modelMissingTypes(supertype, tree.extending, false);
 
             // Determine interfaces.
@@ -959,18 +1072,33 @@
             ListBuffer<Type> all_interfaces = null; // lazy init
             Set<Type> interfaceSet = new HashSet<>();
             List<JCExpression> interfaceTrees = tree.implementing;
+            int i = 0;
             for (JCExpression iface : interfaceTrees) {
-                Type i = attr.attribBase(iface, baseEnv, false, true, true);
-                if (i.hasTag(CLASS)) {
-                    interfaces.append(i);
-                    if (all_interfaces != null) all_interfaces.append(i);
-                    chk.checkNotRepeated(iface.pos(), types.erasure(i), interfaceSet);
+                Type it = attr.attribBase(iface, baseEnv, false, true, true);
+                if (it.hasTag(CLASS)) {
+                    interfaces.append(it);
+                    if (all_interfaces != null) all_interfaces.append(it);
+                    chk.checkNotRepeated(iface.pos(), types.erasure(it), interfaceSet);
                 } else {
                     if (all_interfaces == null)
                         all_interfaces = new ListBuffer<Type>().appendList(interfaces);
-                    all_interfaces.append(modelMissingTypes(i, iface, true));
+                    all_interfaces.append(modelMissingTypes(it, iface, true));
+
                 }
+                if (sym.isAnonymous()) {
+                    // Note: if an anonymous class ever has more than
+                    // one supertype for some reason, this will
+                    // incorrectly attach tree.mods.annotations to ALL
+                    // supertypes, not just the first.
+                    annotate.annotateAnonClassDefLater(iface, tree.mods.annotations,
+                                                       baseEnv, sym, tree.pos(),
+                                                       annotate.implementsCreator(i++));
+                } else {
+                    annotate.annotateTypeLater(iface, baseEnv, sym, tree.pos(),
+                                               annotate.implementsCreator(i++));
             }
+            }
+
             if ((c.flags_field & ANNOTATION) != 0) {
                 ct.interfaces_field = List.of(syms.annotationType);
                 ct.all_interfaces_field = ct.interfaces_field;
@@ -993,22 +1121,28 @@
                 }
             }
 
-            // Annotations.
-            // In general, we cannot fully process annotations yet,  but we
-            // can attribute the annotation types and then check to see if the
-            // @Deprecated annotation is present.
-            attr.attribAnnotationTypes(tree.mods.annotations, baseEnv);
-            if (hasDeprecatedAnnotation(tree.mods.annotations))
-                c.flags_field |= DEPRECATED;
-            annotate.annotateLater(tree.mods.annotations, baseEnv, c, tree.pos());
             // class type parameters use baseEnv but everything uses env
 
             chk.checkNonCyclicDecl(tree);
 
             attr.attribTypeVariables(tree.typarams, baseEnv);
             // Do this here, where we have the symbol.
-            for (JCTypeParameter tp : tree.typarams)
-                annotate.annotateTypeLater(tp, baseEnv, sym, tree.pos());
+            int j = 0;
+            for (List<JCTypeParameter> l = tree.typarams; l.nonEmpty();
+                 l = l.tail, j++) {
+                final JCTypeParameter typaram = l.head;
+                annotate.annotateTypeLater(typaram, baseEnv, sym, tree.pos(),
+                                           annotate.typeParamCreator(j));
+
+                int k = 0;
+                for(List<JCExpression> b = typaram.bounds; b.nonEmpty();
+                    b = b.tail, k++) {
+                    final JCExpression bound = b.head;
+                    annotate.annotateTypeLater(bound, baseEnv, sym, tree.pos(),
+                                               annotate.typeParamBoundCreator(typaram, j, k));
+                }
+
+            }
 
             // Add default constructor if needed.
             if ((c.flags() & INTERFACE) == 0 &&
@@ -1088,10 +1222,6 @@
                 while (halfcompleted.nonEmpty()) {
                     Env<AttrContext> toFinish = halfcompleted.next();
                     finish(toFinish);
-                    if (allowTypeAnnos) {
-                        typeAnnotations.organizeTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
-                        typeAnnotations.validateTypeAnnotationsSignatures(toFinish, (JCClassDecl)toFinish.tree);
-                    }
                 }
             } finally {
                 isFirst = true;
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
index f57ce74..25f062b 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -158,11 +158,6 @@
         symbolFileEnabled = b;
     }
 
-    @Override
-    public boolean isDefaultBootClassPath() {
-        return locations.isDefaultBootClassPath();
-    }
-
     public JavaFileObject getFileForInput(String name) {
         return getRegularFile(new File(name));
     }
@@ -579,15 +574,6 @@
         }
     }
 
-    private String defaultEncodingName;
-    private String getDefaultEncodingName() {
-        if (defaultEncodingName == null) {
-            defaultEncodingName =
-                new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();
-        }
-        return defaultEncodingName;
-    }
-
     public ClassLoader getClassLoader(Location location) {
         nullCheck(location);
         Iterable<? extends File> path = getLocation(location);
diff --git a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java
index 3ba1d11..4106849 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/file/Locations.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -22,12 +22,10 @@
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
-
 package com.sun.tools.javac.file;
 
-import java.io.FileNotFoundException;
-import java.util.Iterator;
 import java.io.File;
+import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -38,64 +36,72 @@
 import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.zip.ZipFile;
+
+import javax.tools.JavaFileManager;
 import javax.tools.JavaFileManager.Location;
+import javax.tools.StandardJavaFileManager;
 import javax.tools.StandardLocation;
 
 import com.sun.tools.javac.code.Lint;
 import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Log;
-import com.sun.tools.javac.util.Options;
 import com.sun.tools.javac.util.StringUtils;
 
-import javax.tools.JavaFileManager;
-import javax.tools.StandardJavaFileManager;
-import static javax.tools.StandardLocation.*;
-import static com.sun.tools.javac.main.Option.*;
+import static javax.tools.StandardLocation.CLASS_PATH;
+import static javax.tools.StandardLocation.PLATFORM_CLASS_PATH;
+import static javax.tools.StandardLocation.SOURCE_PATH;
 
-/** This class converts command line arguments, environment variables
- *  and system properties (in File.pathSeparator-separated String form)
- *  into a boot class path, user class path, and source path (in
- *  {@code Collection<String>} form).
+import static com.sun.tools.javac.main.Option.BOOTCLASSPATH;
+import static com.sun.tools.javac.main.Option.DJAVA_ENDORSED_DIRS;
+import static com.sun.tools.javac.main.Option.DJAVA_EXT_DIRS;
+import static com.sun.tools.javac.main.Option.ENDORSEDDIRS;
+import static com.sun.tools.javac.main.Option.EXTDIRS;
+import static com.sun.tools.javac.main.Option.XBOOTCLASSPATH;
+import static com.sun.tools.javac.main.Option.XBOOTCLASSPATH_APPEND;
+import static com.sun.tools.javac.main.Option.XBOOTCLASSPATH_PREPEND;
+
+/**
+ * This class converts command line arguments, environment variables and system properties (in
+ * File.pathSeparator-separated String form) into a boot class path, user class path, and source
+ * path (in {@code Collection<String>} form).
  *
- *  <p><b>This is NOT part of any supported API.
- *  If you write code that depends on this, you do so at your own risk.
- *  This code and its internal interfaces are subject to change or
- *  deletion without notice.</b>
+ * <p>
+ * <b>This is NOT part of any supported API. If you write code that depends on this, you do so at
+ * your own risk. This code and its internal interfaces are subject to change or deletion without
+ * notice.</b>
  */
 public class Locations {
 
-    /** The log to use for warning output */
+    /**
+     * The log to use for warning output
+     */
     private Log log;
 
-    /** Collection of command-line options */
-    private Options options;
-
-    /** Handler for -Xlint options */
-    private Lint lint;
-
-    /** Access to (possibly cached) file info */
+    /**
+     * Access to (possibly cached) file info
+     */
     private FSInfo fsInfo;
 
-    /** Whether to warn about non-existent path elements */
+    /**
+     * Whether to warn about non-existent path elements
+     */
     private boolean warn;
 
-    // TODO: remove need for this
-    private boolean inited = false; // TODO? caching bad?
-
     public Locations() {
         initHandlers();
     }
 
-    public void update(Log log, Options options, Lint lint, FSInfo fsInfo) {
+    // could replace Lint by "boolean warn"
+    public void update(Log log, Lint lint, FSInfo fsInfo) {
         this.log = log;
-        this.options = options;
-        this.lint = lint;
+        warn = lint.isEnabled(Lint.LintCategory.PATH);
         this.fsInfo = fsInfo;
     }
 
@@ -104,14 +110,14 @@
     }
 
     public boolean isDefaultBootClassPath() {
-        BootClassPathLocationHandler h =
-                (BootClassPathLocationHandler) getHandler(PLATFORM_CLASS_PATH);
+        BootClassPathLocationHandler h
+                = (BootClassPathLocationHandler) getHandler(PLATFORM_CLASS_PATH);
         return h.isDefault();
     }
 
     boolean isDefaultBootClassPathRtJar(File file) {
-        BootClassPathLocationHandler h =
-                (BootClassPathLocationHandler) getHandler(PLATFORM_CLASS_PATH);
+        BootClassPathLocationHandler h
+                = (BootClassPathLocationHandler) getHandler(PLATFORM_CLASS_PATH);
         return h.isDefaultRtJar(file);
     }
 
@@ -127,6 +133,7 @@
 
     /**
      * Split a path into its elements. Empty path elements will be ignored.
+     *
      * @param path The path to be split
      * @return The elements of the path
      */
@@ -135,12 +142,13 @@
     }
 
     /**
-     * Split a path into its elements. If emptyPathDefault is not null, all
-     * empty elements in the path, including empty elements at either end of
-     * the path, will be replaced with the value of emptyPathDefault.
+     * Split a path into its elements. If emptyPathDefault is not null, all empty elements in the
+     * path, including empty elements at either end of the path, will be replaced with the value of
+     * emptyPathDefault.
+     *
      * @param path The path to be split
-     * @param emptyPathDefault The value to substitute for empty path elements,
-     *  or null, to ignore empty path elements
+     * @param emptyPathDefault The value to substitute for empty path elements, or null, to ignore
+     * empty path elements
      * @return The elements of the path
      */
     private static Iterable<File> getPathEntries(String path, File emptyPathDefault) {
@@ -148,33 +156,38 @@
         int start = 0;
         while (start <= path.length()) {
             int sep = path.indexOf(File.pathSeparatorChar, start);
-            if (sep == -1)
+            if (sep == -1) {
                 sep = path.length();
-            if (start < sep)
+            }
+            if (start < sep) {
                 entries.add(new File(path.substring(start, sep)));
-            else if (emptyPathDefault != null)
+            } else if (emptyPathDefault != null) {
                 entries.add(emptyPathDefault);
+            }
             start = sep + 1;
         }
         return entries;
     }
 
     /**
-     * Utility class to help evaluate a path option.
-     * Duplicate entries are ignored, jar class paths can be expanded.
+     * Utility class to help evaluate a path option. Duplicate entries are ignored, jar class paths
+     * can be expanded.
      */
     private class Path extends LinkedHashSet<File> {
+
         private static final long serialVersionUID = 0;
 
         private boolean expandJarClassPaths = false;
-        private Set<File> canonicalValues = new HashSet<>();
+        private final Set<File> canonicalValues = new HashSet<>();
 
         public Path expandJarClassPaths(boolean x) {
             expandJarClassPaths = x;
             return this;
         }
 
-        /** What to use when path element is the empty string */
+        /**
+         * What to use when path element is the empty string
+         */
         private File emptyPathDefault = null;
 
         public Path emptyPathDefault(File x) {
@@ -182,15 +195,15 @@
             return this;
         }
 
-        public Path() { super(); }
-
         public Path addDirectories(String dirs, boolean warn) {
             boolean prev = expandJarClassPaths;
             expandJarClassPaths = true;
             try {
-                if (dirs != null)
-                    for (File dir : getPathEntries(dirs))
+                if (dirs != null) {
+                    for (File dir : getPathEntries(dirs)) {
                         addDirectory(dir, warn);
+                    }
+                }
                 return this;
             } finally {
                 expandJarClassPaths = prev;
@@ -203,19 +216,22 @@
 
         private void addDirectory(File dir, boolean warn) {
             if (!dir.isDirectory()) {
-                if (warn)
+                if (warn) {
                     log.warning(Lint.LintCategory.PATH,
                             "dir.path.element.not.found", dir);
+                }
                 return;
             }
 
             File[] files = dir.listFiles();
-            if (files == null)
+            if (files == null) {
                 return;
+            }
 
             for (File direntry : files) {
-                if (isArchive(direntry))
+                if (isArchive(direntry)) {
                     addFile(direntry, warn);
+                }
             }
         }
 
@@ -232,8 +248,9 @@
 
         public Path addFiles(Iterable<? extends File> files, boolean warn) {
             if (files != null) {
-                for (File file: files)
+                for (File file : files) {
                     addFile(file, warn);
+                }
             }
             return this;
         }
@@ -248,7 +265,7 @@
                 return;
             }
 
-            if (! fsInfo.exists(file)) {
+            if (!fsInfo.exists(file)) {
                 /* No such file or directory exists */
                 if (warn) {
                     log.warning(Lint.LintCategory.PATH,
@@ -288,12 +305,13 @@
             }
 
             /* Now what we have left is either a directory or a file name
-               conforming to archive naming convention */
+             conforming to archive naming convention */
             super.add(file);
             canonicalValues.add(canonFile);
 
-            if (expandJarClassPaths && fsInfo.isFile(file))
+            if (expandJarClassPaths && fsInfo.isFile(file)) {
                 addJarClassPath(file, warn);
+            }
         }
 
         // Adds referenced classpath elements from a jar's Class-Path
@@ -302,7 +320,7 @@
         // filenames, but if we do, we should redo all path-related code.
         private void addJarClassPath(File jarFile, boolean warn) {
             try {
-                for (File f: fsInfo.getJarClassPath(jarFile)) {
+                for (File f : fsInfo.getJarClassPath(jarFile)) {
                     addFile(f, warn);
                 }
             } catch (IOException e) {
@@ -312,53 +330,56 @@
     }
 
     /**
-     * Base class for handling support for the representation of Locations.
-     * Implementations are responsible for handling the interactions between
-     * the command line options for a location, and API access via setLocation.
+     * Base class for handling support for the representation of Locations. Implementations are
+     * responsible for handling the interactions between the command line options for a location,
+     * and API access via setLocation.
+     *
      * @see #initHandlers
      * @see #getHandler
      */
     protected abstract class LocationHandler {
+
         final Location location;
         final Set<Option> options;
 
         /**
-         * Create a handler. The location and options provide a way to map
-         * from a location or an option to the corresponding handler.
+         * Create a handler. The location and options provide a way to map from a location or an
+         * option to the corresponding handler.
+         *
+         * @param location the location for which this is the handler
+         * @param options the options affecting this location
          * @see #initHandlers
          */
         protected LocationHandler(Location location, Option... options) {
             this.location = location;
-            this.options = options.length == 0 ?
-                EnumSet.noneOf(Option.class):
-                EnumSet.copyOf(Arrays.asList(options));
+            this.options = options.length == 0
+                    ? EnumSet.noneOf(Option.class)
+                    : EnumSet.copyOf(Arrays.asList(options));
         }
 
-        // TODO: TEMPORARY, while Options still used for command line options
-        void update(Options optionTable) {
-            for (Option o: options) {
-                String v = optionTable.get(o);
-                if (v != null) {
-                    handleOption(o, v);
-                }
-            }
-        }
-
-        /** @see JavaFileManager#handleOption */
+        /**
+         * @see JavaFileManager#handleOption
+         */
         abstract boolean handleOption(Option option, String value);
-        /** @see StandardJavaFileManager#getLocation */
+
+        /**
+         * @see StandardJavaFileManager#getLocation
+         */
         abstract Collection<File> getLocation();
-        /** @see StandardJavaFileManager#setLocation */
+
+        /**
+         * @see StandardJavaFileManager#setLocation
+         */
         abstract void setLocation(Iterable<? extends File> files) throws IOException;
     }
 
     /**
-     * General purpose implementation for output locations,
-     * such as -d/CLASS_OUTPUT and -s/SOURCE_OUTPUT.
-     * All options are treated as equivalent (i.e. aliases.)
-     * The value is a single file, possibly null.
+     * General purpose implementation for output locations, such as -d/CLASS_OUTPUT and
+     * -s/SOURCE_OUTPUT. All options are treated as equivalent (i.e. aliases.) The value is a single
+     * file, possibly null.
      */
     private class OutputLocationHandler extends LocationHandler {
+
         private File outputDir;
 
         OutputLocationHandler(Location location, Option... options) {
@@ -367,14 +388,15 @@
 
         @Override
         boolean handleOption(Option option, String value) {
-            if (!options.contains(option))
+            if (!options.contains(option)) {
                 return false;
+            }
 
             // TODO: could/should validate outputDir exists and is a directory
             // need to decide how best to report issue for benefit of
             // direct API call on JavaFileManager.handleOption(specifies IAE)
             // vs. command line decoding.
-            outputDir = new File(value);
+            outputDir = (value == null) ? null : new File(value);
             return true;
         }
 
@@ -389,27 +411,30 @@
                 outputDir = null;
             } else {
                 Iterator<? extends File> pathIter = files.iterator();
-                if (!pathIter.hasNext())
+                if (!pathIter.hasNext()) {
                     throw new IllegalArgumentException("empty path for directory");
+                }
                 File dir = pathIter.next();
-                if (pathIter.hasNext())
+                if (pathIter.hasNext()) {
                     throw new IllegalArgumentException("path too long for directory");
-                if (!dir.exists())
+                }
+                if (!dir.exists()) {
                     throw new FileNotFoundException(dir + ": does not exist");
-                else if (!dir.isDirectory())
+                } else if (!dir.isDirectory()) {
                     throw new IOException(dir + ": not a directory");
+                }
                 outputDir = dir;
             }
         }
     }
 
     /**
-     * General purpose implementation for search path locations,
-     * such as -sourcepath/SOURCE_PATH and -processorPath/ANNOTATION_PROCESS_PATH.
-     * All options are treated as equivalent (i.e. aliases.)
+     * General purpose implementation for search path locations, such as -sourcepath/SOURCE_PATH and
+     * -processorPath/ANNOTATION_PROCESS_PATH. All options are treated as equivalent (i.e. aliases.)
      * The value is an ordered set of files and/or directories.
      */
     private class SimpleLocationHandler extends LocationHandler {
+
         protected Collection<File> searchPath;
 
         SimpleLocationHandler(Location location, Option... options) {
@@ -418,10 +443,11 @@
 
         @Override
         boolean handleOption(Option option, String value) {
-            if (!options.contains(option))
+            if (!options.contains(option)) {
                 return false;
-            searchPath = value == null ? null :
-                    Collections.unmodifiableCollection(createPath().addFiles(value));
+            }
+            searchPath = value == null ? null
+                    : Collections.unmodifiableCollection(createPath().addFiles(value));
             return true;
         }
 
@@ -451,11 +477,11 @@
     }
 
     /**
-     * Subtype of SimpleLocationHandler for -classpath/CLASS_PATH.
-     * If no value is given, a default is provided, based on system properties
-     * and other values.
+     * Subtype of SimpleLocationHandler for -classpath/CLASS_PATH. If no value is given, a default
+     * is provided, based on system properties and other values.
      */
     private class ClassPathLocationHandler extends SimpleLocationHandler {
+
         ClassPathLocationHandler() {
             super(StandardLocation.CLASS_PATH,
                     Option.CLASSPATH, Option.CP);
@@ -472,15 +498,20 @@
             String cp = value;
 
             // CLASSPATH environment variable when run from `javac'.
-            if (cp == null) cp = System.getProperty("env.class.path");
+            if (cp == null) {
+                cp = System.getProperty("env.class.path");
+            }
 
             // If invoked via a java VM (not the javac launcher), use the
             // platform class path
-            if (cp == null && System.getProperty("application.home") == null)
+            if (cp == null && System.getProperty("application.home") == null) {
                 cp = System.getProperty("java.class.path");
+            }
 
             // Default to current working directory.
-            if (cp == null) cp = ".";
+            if (cp == null) {
+                cp = ".";
+            }
 
             return createPath().addFiles(cp);
         }
@@ -488,38 +519,37 @@
         @Override
         protected Path createPath() {
             return new Path()
-                .expandJarClassPaths(true)         // Only search user jars for Class-Paths
-                .emptyPathDefault(new File("."));  // Empty path elt ==> current directory
+                    .expandJarClassPaths(true) // Only search user jars for Class-Paths
+                    .emptyPathDefault(new File("."));  // Empty path elt ==> current directory
         }
 
         private void lazy() {
-            if (searchPath == null)
+            if (searchPath == null) {
                 setLocation(null);
+            }
         }
     }
 
     /**
-     * Custom subtype of LocationHandler for PLATFORM_CLASS_PATH.
-     * Various options are supported for different components of the
-     * platform class path.
-     * Setting a value with setLocation overrides all existing option values.
-     * Setting any option overrides any value set with setLocation, and reverts
-     * to using default values for options that have not been set.
-     * Setting -bootclasspath or -Xbootclasspath overrides any existing
-     * value for -Xbootclasspath/p: and -Xbootclasspath/a:.
+     * Custom subtype of LocationHandler for PLATFORM_CLASS_PATH. Various options are supported for
+     * different components of the platform class path. Setting a value with setLocation overrides
+     * all existing option values. Setting any option overrides any value set with setLocation, and
+     * reverts to using default values for options that have not been set. Setting -bootclasspath or
+     * -Xbootclasspath overrides any existing value for -Xbootclasspath/p: and -Xbootclasspath/a:.
      */
     private class BootClassPathLocationHandler extends LocationHandler {
+
         private Collection<File> searchPath;
         final Map<Option, String> optionValues = new EnumMap<>(Option.class);
 
         /**
-         * rt.jar as found on the default bootclasspath.
-         * If the user specified a bootclasspath, null is used.
+         * rt.jar as found on the default bootclasspath. If the user specified a bootclasspath, null
+         * is used.
          */
         private File defaultBootClassPathRtJar = null;
 
         /**
-         *  Is bootclasspath the default?
+         * Is bootclasspath the default?
          */
         private boolean isDefaultBootClassPath;
 
@@ -544,8 +574,9 @@
 
         @Override
         boolean handleOption(Option option, String value) {
-            if (!options.contains(option))
+            if (!options.contains(option)) {
                 return false;
+            }
 
             option = canonicalize(option);
             optionValues.put(option, value);
@@ -557,20 +588,20 @@
             return true;
         }
         // where
-            // TODO: would be better if option aliasing was handled at a higher
-            // level
-            private Option canonicalize(Option option) {
-                switch (option) {
-                    case XBOOTCLASSPATH:
-                        return Option.BOOTCLASSPATH;
-                    case DJAVA_ENDORSED_DIRS:
-                        return Option.ENDORSEDDIRS;
-                    case DJAVA_EXT_DIRS:
-                        return Option.EXTDIRS;
-                    default:
-                        return option;
-                }
+        // TODO: would be better if option aliasing was handled at a higher
+        // level
+        private Option canonicalize(Option option) {
+            switch (option) {
+                case XBOOTCLASSPATH:
+                    return Option.BOOTCLASSPATH;
+                case DJAVA_ENDORSED_DIRS:
+                    return Option.ENDORSEDDIRS;
+                case DJAVA_EXT_DIRS:
+                    return Option.EXTDIRS;
+                default:
+                    return option;
             }
+        }
 
         @Override
         Collection<File> getLocation() {
@@ -602,10 +633,11 @@
             String xbootclasspathAppendOpt = optionValues.get(XBOOTCLASSPATH_APPEND);
             path.addFiles(xbootclasspathPrependOpt);
 
-            if (endorseddirsOpt != null)
+            if (endorseddirsOpt != null) {
                 path.addDirectories(endorseddirsOpt);
-            else
+            } else {
                 path.addDirectories(System.getProperty("java.endorsed.dirs"), false);
+            }
 
             if (bootclasspathOpt != null) {
                 path.addFiles(bootclasspathOpt);
@@ -615,8 +647,9 @@
                 path.addFiles(files, false);
                 File rt_jar = new File("rt.jar");
                 for (File file : getPathEntries(files)) {
-                    if (new File(file.getName()).equals(rt_jar))
+                    if (new File(file.getName()).equals(rt_jar)) {
                         defaultBootClassPathRtJar = file;
+                    }
                 }
             }
 
@@ -625,22 +658,24 @@
             // Strictly speaking, standard extensions are not bootstrap
             // classes, but we treat them identically, so we'll pretend
             // that they are.
-            if (extdirsOpt != null)
+            if (extdirsOpt != null) {
                 path.addDirectories(extdirsOpt);
-            else
+            } else {
                 path.addDirectories(System.getProperty("java.ext.dirs"), false);
+            }
 
-            isDefaultBootClassPath =
-                    (xbootclasspathPrependOpt == null) &&
-                    (bootclasspathOpt == null) &&
-                    (xbootclasspathAppendOpt == null);
+            isDefaultBootClassPath
+                    = (xbootclasspathPrependOpt == null)
+                    && (bootclasspathOpt == null)
+                    && (xbootclasspathAppendOpt == null);
 
             return path;
         }
 
         private void lazy() {
-            if (searchPath == null)
+            if (searchPath == null) {
                 searchPath = Collections.unmodifiableCollection(computePath());
+            }
         }
     }
 
@@ -661,14 +696,15 @@
             new OutputLocationHandler((StandardLocation.NATIVE_HEADER_OUTPUT), Option.H)
         };
 
-        for (LocationHandler h: handlers) {
+        for (LocationHandler h : handlers) {
             handlersForLocation.put(h.location, h);
-            for (Option o: h.options)
+            for (Option o : h.options) {
                 handlersForOption.put(o, h);
+            }
         }
     }
 
-    boolean handleOption(Option option, String value) {
+    public boolean handleOption(Option option, String value) {
         LocationHandler h = handlersForOption.get(option);
         return (h == null ? false : h.handleOption(option, value));
     }
@@ -679,8 +715,9 @@
     }
 
     File getOutputLocation(Location location) {
-        if (!location.isOutputLocation())
+        if (!location.isOutputLocation()) {
             throw new IllegalArgumentException();
+        }
         LocationHandler h = getHandler(location);
         return ((OutputLocationHandler) h).outputDir;
     }
@@ -688,10 +725,11 @@
     void setLocation(Location location, Iterable<? extends File> files) throws IOException {
         LocationHandler h = getHandler(location);
         if (h == null) {
-            if (location.isOutputLocation())
+            if (location.isOutputLocation()) {
                 h = new OutputLocationHandler(location);
-            else
+            } else {
                 h = new SimpleLocationHandler(location);
+            }
             handlersForLocation.put(location, h);
         }
         h.setLocation(files);
@@ -699,33 +737,21 @@
 
     protected LocationHandler getHandler(Location location) {
         location.getClass(); // null check
-        lazy();
         return handlersForLocation.get(location);
     }
 
-// TOGO
-    protected void lazy() {
-        if (!inited) {
-            warn = lint.isEnabled(Lint.LintCategory.PATH);
-
-            for (LocationHandler h: handlersForLocation.values()) {
-                h.update(options);
-            }
-
-            inited = true;
-        }
-    }
-
-    /** Is this the name of an archive file? */
+    /**
+     * Is this the name of an archive file?
+     */
     private boolean isArchive(File file) {
         String n = StringUtils.toLowerCase(file.getName());
         return fsInfo.isFile(file)
-            && (n.endsWith(".jar") || n.endsWith(".zip"));
+                && (n.endsWith(".jar") || n.endsWith(".zip"));
     }
 
     /**
-     * Utility method for converting a search path string to an array
-     * of directory and JAR file URLs.
+     * Utility method for converting a search path string to an array of directory and JAR file
+     * URLs.
      *
      * Note that this method is called by apt and the DocletInvoker.
      *
@@ -747,8 +773,7 @@
     }
 
     /**
-     * Returns the directory or JAR file URL corresponding to the specified
-     * local file name.
+     * Returns the directory or JAR file URL corresponding to the specified local file name.
      *
      * @param file the File object
      * @return the resulting directory or JAR file URL, or null if unknown
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
index 0a58573..bc610a2 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java
@@ -1611,8 +1611,6 @@
             return TypeAnnotationPosition.methodReturn(readTypePath());
         case FIELD:
             return TypeAnnotationPosition.field(readTypePath());
-        case UNKNOWN:
-            throw new AssertionError("jvm.ClassReader: UNKNOWN target type should never occur!");
         default:
             throw new AssertionError("jvm.ClassReader: Unknown target type for position: " + type);
         }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
index d86644d..5eebcc2 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java
@@ -768,25 +768,13 @@
         ListBuffer<Attribute.TypeCompound> invisibles = new ListBuffer<>();
 
         for (Attribute.TypeCompound tc : typeAnnos) {
-            if (tc.hasUnknownPosition()) {
-                boolean fixed = tc.tryFixPosition();
-
-                // Could we fix it?
-                if (!fixed) {
-                    // This happens for nested types like @A Outer. @B Inner.
-                    // For method parameters we get the annotation twice! Once with
-                    // a valid position, once unknown.
-                    // TODO: find a cleaner solution.
-                    PrintWriter pw = log.getWriter(Log.WriterKind.ERROR);
-                    pw.println("ClassWriter: Position UNKNOWN in type annotation: " + tc);
+            Assert.checkNonNull(tc.position);
+            if (tc.position.type.isLocal() != inCode) {
                     continue;
                 }
+            if (!tc.position.emitToClassfile()) {
+                continue;
             }
-
-            if (tc.position.type.isLocal() != inCode)
-                continue;
-            if (!tc.position.emitToClassfile())
-                continue;
             switch (types.getRetention(tc)) {
             case SOURCE: break;
             case CLASS: invisibles.append(tc); break;
@@ -967,8 +955,6 @@
         case METHOD_RETURN:
         case FIELD:
             break;
-        case UNKNOWN:
-            throw new AssertionError("jvm.ClassWriter: UNKNOWN target type should never occur!");
         default:
             throw new AssertionError("jvm.ClassWriter: Unknown target type for position: " + p);
         }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
index 3705077..2ee1489 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java
@@ -557,7 +557,6 @@
         ListBuffer<Attribute.TypeCompound> fieldTAs = new ListBuffer<>();
         ListBuffer<Attribute.TypeCompound> nonfieldTAs = new ListBuffer<>();
         for (TypeCompound ta : tas) {
-            Assert.check(ta.getPosition().type != TargetType.UNKNOWN);
             if (ta.getPosition().type == TargetType.FIELD) {
                 fieldTAs.add(ta);
             } else {
@@ -1931,10 +1930,7 @@
                 || code.meth.getKind() == javax.lang.model.element.ElementKind.STATIC_INIT;
 
         for (Attribute.TypeCompound ta : meth.getRawTypeAttributes()) {
-            if (ta.hasUnknownPosition())
-                ta.tryFixPosition();
-
-            if (ta.position.matchesPos(treePos))
+            if (ta.position != null && ta.position.matchesPos(treePos))
                 ta.position.updatePosOffset(code.cp);
         }
 
@@ -1942,10 +1938,7 @@
             return;
 
         for (Attribute.TypeCompound ta : meth.owner.getRawTypeAttributes()) {
-            if (ta.hasUnknownPosition())
-                ta.tryFixPosition();
-
-            if (ta.position.matchesPos(treePos))
+            if (ta.position != null && ta.position.matchesPos(treePos))
                 ta.position.updatePosOffset(code.cp);
         }
 
@@ -1955,10 +1948,7 @@
                 continue;
 
             for (Attribute.TypeCompound ta : s.getRawTypeAttributes()) {
-                if (ta.hasUnknownPosition())
-                    ta.tryFixPosition();
-
-                if (ta.position.matchesPos(treePos))
+                if (ta.position != null && ta.position.matchesPos(treePos))
                     ta.position.updatePosOffset(code.cp);
             }
         }
@@ -2330,8 +2320,8 @@
     }
 
     public void visitTypeTest(JCInstanceOf tree) {
-        setTypeAnnotationPositions(tree.pos);
         genExpr(tree.expr, tree.expr.type).load();
+        setTypeAnnotationPositions(tree.pos);
         code.emitop2(instanceof_, makeRef(tree.pos(), tree.clazz.type));
         result = items.makeStackItem(syms.booleanType);
     }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
index ff8ff35..97dfb97 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java
@@ -394,6 +394,7 @@
         processPcks   = options.isSet("process.packages");
         werror        = options.isSet(WERROR);
 
+        // Should this be with other option checking, in Main
         if (source.compareTo(Source.DEFAULT) < 0) {
             if (options.isUnset(XLINT_CUSTOM, "-" + LintCategory.OPTIONS.option)) {
                 if (fileManager instanceof BaseFileManager) {
@@ -403,6 +404,7 @@
             }
         }
 
+        // Should this be with other option checking, in Main
         checkForObsoleteOptions(target);
 
         verboseCompilePolicy = options.isSet("verboseCompilePolicy");
@@ -434,6 +436,7 @@
             log.setDiagnosticFormatter(RichDiagnosticFormatter.instance(context));
     }
 
+    // Should this be with other option checking, in Main
     private void checkForObsoleteOptions(Target target) {
         // Unless lint checking on options is disabled, check for
         // obsolete source and target options.
@@ -829,6 +832,10 @@
                         List<String> classnames,
                         Iterable<? extends Processor> processors)
     {
+        if (!taskListener.isEmpty()) {
+            taskListener.started(new TaskEvent(TaskEvent.Kind.COMPILATION));
+        }
+
         if (processors != null && processors.iterator().hasNext())
             explicitAnnotationProcessingRequested = true;
         // as a JavaCompiler can only be used once, throw an exception if
@@ -902,6 +909,9 @@
                 printCount("error", errorCount());
                 printCount("warn", warningCount());
             }
+            if (!taskListener.isEmpty()) {
+                taskListener.finished(new TaskEvent(TaskEvent.Kind.COMPILATION));
+            }
             close();
             if (procEnvImpl != null)
                 procEnvImpl.close();
diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java
index 2c7f2f5..3cb2662 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Main.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Main.java
@@ -33,8 +33,9 @@
 import java.security.MessageDigest;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
+import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
+import java.util.Map;
 import java.util.Set;
 
 import javax.annotation.processing.Processor;
@@ -56,6 +57,7 @@
 import com.sun.tools.javac.util.Log.PrefixKind;
 import com.sun.tools.javac.util.Log.WriterKind;
 import com.sun.tools.javac.util.ServiceLoader;
+
 import static com.sun.tools.javac.main.Option.*;
 
 /** This class provides a command line interface to the javac compiler.
@@ -121,6 +123,13 @@
         }
 
         @Override
+        public boolean handleFileManagerOption(Option option, String value) {
+            options.put(option.getText(), value);
+            deferredFileManagerOptions.put(option, value);
+            return true;
+        }
+
+        @Override
         public void remove(String name) {
             options.remove(name);
         }
@@ -172,11 +181,13 @@
 
     /** The list of source files to process
      */
-    public Set<File> filenames = null; // XXX sb protected
+    public Set<File> filenames = null; // XXX should be protected or private
 
     /** List of class files names passed on the command line
      */
-    public ListBuffer<String> classnames = null; // XXX sb protected
+    protected ListBuffer<String> classnames = null;
+
+    public Map<Option, String> deferredFileManagerOptions; // XXX should be protected or private
 
     /** Report a usage error.
      */
@@ -395,6 +406,7 @@
 
         filenames = new LinkedHashSet<>();
         classnames = new ListBuffer<>();
+        deferredFileManagerOptions = new LinkedHashMap<>();
         JavaCompiler comp = null;
         /*
          * TODO: Logic below about what is an acceptable command line
@@ -446,6 +458,11 @@
             if (batchMode)
                 CacheFSInfo.preRegister(context);
 
+            fileManager = context.get(JavaFileManager.class);
+            if (fileManager instanceof BaseFileManager) {
+                ((BaseFileManager) fileManager).handleOptions(deferredFileManagerOptions);
+            }
+
             // FIXME: this code will not be invoked if using JavacTask.parse/analyze/generate
             // invoke any available plugins
             String plugins = options.get(PLUGIN);
@@ -511,8 +528,6 @@
                 comp.closeables = comp.closeables.prepend(log.getWriter(WriterKind.NOTICE));
             }
 
-            fileManager = context.get(JavaFileManager.class);
-
             if (!files.isEmpty()) {
                 // add filenames to fileObjects
                 comp = JavaCompiler.instance(context);
diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java
index 360d894..a00bb43 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/main/Option.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/Option.java
@@ -83,6 +83,7 @@
 
     XLINT_CUSTOM("-Xlint:", EXTENDED, BASIC, ANYOF, getXLintChoices()) {
         private static final String LINT_KEY_FORMAT = "         %-19s %s";
+        @Override
         void help(Log log, OptionKind kind) {
             if (this.kind != kind)
                 return;
@@ -667,6 +668,8 @@
             }
         }
         helper.put(option, arg);
+        if (group == OptionGroup.FILEMANAGER)
+            helper.handleFileManagerOption(this, arg);
         return false;
     }
 
diff --git a/langtools/src/share/classes/com/sun/tools/javac/main/OptionHelper.java b/langtools/src/share/classes/com/sun/tools/javac/main/OptionHelper.java
index 4e65230..cf64792 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/main/OptionHelper.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/main/OptionHelper.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -50,6 +50,9 @@
     /** Remove any prior value for an option. */
     public abstract void remove(String name);
 
+    /** Handle a file manager option. */
+    public abstract boolean handleFileManagerOption(Option option, String value);
+
     /** Get access to the Log for the compilation. */
     public abstract Log getLog();
 
@@ -99,6 +102,11 @@
         }
 
         @Override
+        public boolean handleFileManagerOption(Option option, String value) {
+            throw new IllegalArgumentException();
+        }
+
+        @Override
         void error(String key, Object... args) {
             throw new IllegalArgumentException(log.localize(PrefixKind.JAVAC, key, args));
         }
diff --git a/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java
index 1ced030..4ca110d 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/nio/JavacPathFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -167,11 +167,6 @@
         return getClassLoader(lb.toArray(new URL[lb.size()]));
     }
 
-    @Override
-    public boolean isDefaultBootClassPath() {
-        return locations.isDefaultBootClassPath();
-    }
-
     // <editor-fold defaultstate="collapsed" desc="Location handling">
 
     public boolean hasLocation(Location location) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
index 9bf9f60..658a97d 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
+++ b/langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties
@@ -2404,6 +2404,11 @@
     static interface methods are not supported in -source {0}\n\
     (use -source 8 or higher to enable static interface methods)
 
+# 0: string
+compiler.err.static.intf.method.invoke.not.supported.in.source=\
+    static interface method invocations are not supported in -source {0}\n\
+    (use -source 8 or higher to enable static interface method invocations)
+
 ########################################
 # Diagnostics for verbose resolution
 # used by Resolve (debug only)
diff --git a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
index 201df78..463d7b8 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
@@ -135,6 +135,14 @@
         }
     }
 
+    public static boolean isReceiverParam(JCTree tree) {
+        if (tree.hasTag(VARDEF)) {
+            return ((JCVariableDecl)tree).nameexpr != null;
+        } else {
+            return false;
+        }
+    }
+
     /** Is there a constructor declaration in the given list of trees?
      */
     public static boolean hasConstructors(List<JCTree> trees) {
diff --git a/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java
index ed21e97..691b9c6 100644
--- a/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java
+++ b/langtools/src/share/classes/com/sun/tools/javac/util/BaseFileManager.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,6 @@
 package com.sun.tools.javac.util;
 
 import java.io.ByteArrayOutputStream;
-import java.io.Closeable;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStreamWriter;
@@ -47,6 +46,8 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+
+import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
 import javax.tools.JavaFileObject.Kind;
 
@@ -64,7 +65,7 @@
  * There are no references here to file-system specific objects such as
  * java.io.File or java.nio.file.Path.
  */
-public abstract class BaseFileManager {
+public abstract class BaseFileManager implements JavaFileManager {
     protected BaseFileManager(Charset charset) {
         this.charset = charset;
         byteBufferCache = new ByteBufferCache();
@@ -73,12 +74,13 @@
 
     /**
      * Set the context for JavacPathFileManager.
+     * @param context the context containing items to be associated with the file manager
      */
     public void setContext(Context context) {
         log = Log.instance(context);
         options = Options.instance(context);
         classLoaderClass = options.get("procloader");
-        locations.update(log, options, Lint.instance(context), FSInfo.instance(context));
+        locations.update(log, Lint.instance(context), FSInfo.instance(context));
     }
 
     protected Locations createLocations() {
@@ -123,14 +125,19 @@
                 Class<?>[] constrArgTypes = { URL[].class, ClassLoader.class };
                 Constructor<? extends ClassLoader> constr = loader.getConstructor(constrArgTypes);
                 return constr.newInstance(urls, thisClassLoader);
-            } catch (Throwable t) {
+            } catch (ReflectiveOperationException t) {
                 // ignore errors loading user-provided class loader, fall through
             }
         }
         return new URLClassLoader(urls, thisClassLoader);
     }
 
+    public boolean isDefaultBootClassPath() {
+        return locations.isDefaultBootClassPath();
+    }
+
     // <editor-fold defaultstate="collapsed" desc="Option handling">
+    @Override
     public boolean handleOption(String current, Iterator<String> remaining) {
         OptionHelper helper = new GrumpyHelper(log) {
             @Override
@@ -147,7 +154,13 @@
             public void remove(String name) {
                 options.remove(name);
             }
+
+            @Override
+            public boolean handleFileManagerOption(Option option, String value) {
+                return handleOption(option, value);
+            }
         };
+
         for (Option o: javacFileManagerOptions) {
             if (o.matches(current))  {
                 if (o.hasArg()) {
@@ -159,7 +172,7 @@
                     if (!o.process(helper, current))
                         return true;
                 }
-                // operand missing, or process returned false
+                // operand missing, or process returned true
                 throw new IllegalArgumentException(current);
             }
         }
@@ -170,6 +183,7 @@
         private static final Set<Option> javacFileManagerOptions =
             Option.getJavacFileManagerOptions();
 
+    @Override
     public int isSupportedOption(String option) {
         for (Option o : javacFileManagerOptions) {
             if (o.matches(option))
@@ -178,7 +192,27 @@
         return -1;
     }
 
-    public abstract boolean isDefaultBootClassPath();
+    /**
+     * Common back end for OptionHelper handleFileManagerOption.
+     * @param option the option whose value to be set
+     * @param value the value for the option
+     * @return true if successful, and false otherwise
+     */
+    public boolean handleOption(Option option, String value) {
+        return locations.handleOption(option, value);
+    }
+
+    /**
+     * Call handleOption for collection of options and corresponding values.
+     * @param map a collection of options and corresponding values
+     * @return true if all the calls are successful
+     */
+    public boolean handleOptions(Map<Option, String> map) {
+        boolean ok = true;
+        for (Map.Entry<Option, String> e: map.entrySet())
+            ok = ok & handleOption(e.getKey(), e.getValue());
+        return ok;
+    }
 
     // </editor-fold>
 
@@ -205,10 +239,7 @@
         CharsetDecoder decoder;
         try {
             decoder = getDecoder(encodingName, ignoreEncodingErrors);
-        } catch (IllegalCharsetNameException e) {
-            log.error("unsupported.encoding", encodingName);
-            return (CharBuffer)CharBuffer.allocate(1).flip();
-        } catch (UnsupportedCharsetException e) {
+        } catch (IllegalCharsetNameException | UnsupportedCharsetException e) {
             log.error("unsupported.encoding", encodingName);
             return (CharBuffer)CharBuffer.allocate(1).flip();
         }
@@ -286,6 +317,9 @@
     // <editor-fold defaultstate="collapsed" desc="ByteBuffers">
     /**
      * Make a byte buffer from an input stream.
+     * @param in the stream
+     * @return a byte buffer containing the contents of the stream
+     * @throws IOException if an error occurred while reading the stream
      */
     public ByteBuffer makeByteBuffer(InputStream in)
         throws IOException {
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
index d5cba00..de8f96c 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/Start.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -32,18 +32,23 @@
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.Map;
 
 import javax.tools.JavaFileManager;
 import javax.tools.JavaFileObject;
 
 import com.sun.javadoc.*;
+import com.sun.tools.javac.file.JavacFileManager;
 import com.sun.tools.javac.main.CommandLine;
+import com.sun.tools.javac.main.Option;
+import com.sun.tools.javac.util.BaseFileManager;
 import com.sun.tools.javac.util.ClientCodeException;
 import com.sun.tools.javac.util.Context;
 import com.sun.tools.javac.util.List;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Log;
 import com.sun.tools.javac.util.Options;
+
 import static com.sun.tools.javac.code.Flags.*;
 
 /**
@@ -71,7 +76,7 @@
     private static final String standardDocletClassName =
         "com.sun.tools.doclets.standard.Standard";
 
-    private long defaultFilter = PUBLIC | PROTECTED;
+    private final long defaultFilter = PUBLIC | PROTECTED;
 
     private final Messager messager;
 
@@ -324,6 +329,15 @@
                 javaNames.append(arg);
             }
         }
+
+        if (fileManager == null) {
+            JavacFileManager.preRegister(context);
+            fileManager = context.get(JavaFileManager.class);
+        }
+        if (fileManager instanceof BaseFileManager) {
+            ((BaseFileManager) fileManager).handleOptions(fileManagerOpts);
+        }
+
         compOpts.notifyListeners();
 
         if (javaNames.isEmpty() && subPackages.isEmpty() && isEmpty(fileObjects)) {
diff --git a/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java b/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java
index 9473324..d24aa33 100644
--- a/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java
+++ b/langtools/src/share/classes/com/sun/tools/javadoc/ToolOption.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -25,10 +25,14 @@
 
 package com.sun.tools.javadoc;
 
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.StringTokenizer;
+
 import com.sun.tools.javac.code.Flags;
+import com.sun.tools.javac.main.Option;
 import com.sun.tools.javac.util.ListBuffer;
 import com.sun.tools.javac.util.Options;
-import java.util.StringTokenizer;
 
 
 /**
@@ -45,42 +49,42 @@
     BOOTCLASSPATH("-bootclasspath", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt(opt, arg);
+            helper.setFileManagerOpt(Option.BOOTCLASSPATH, arg);
         }
     },
 
     CLASSPATH("-classpath", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt(opt, arg);
+            helper.setFileManagerOpt(Option.CLASSPATH, arg);
         }
     },
 
     CP("-cp", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt(opt, arg);
+            helper.setFileManagerOpt(Option.CP, arg);
         }
     },
 
     EXTDIRS("-extdirs", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt(opt, arg);
+            helper.setFileManagerOpt(Option.EXTDIRS, arg);
         }
     },
 
     SOURCEPATH("-sourcepath", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt(opt, arg);
+            helper.setFileManagerOpt(Option.SOURCEPATH, arg);
         }
     },
 
     SYSCLASSPATH("-sysclasspath", true) {
         @Override
         public void process(Helper helper, String arg) {
-            helper.setCompilerOpt("-bootclasspath", arg);
+            helper.setFileManagerOpt(Option.BOOTCLASSPATH, arg);
         }
     },
 
@@ -274,6 +278,9 @@
         /** Excluded packages, from -exclude. */
         final ListBuffer<String> excludedPackages = new ListBuffer<>();
 
+        // File manager options
+        final Map<Option, String> fileManagerOpts = new LinkedHashMap<>();
+
         /** javac options, set by various options. */
         Options compOpts; // = Options.instance(context)
 
@@ -306,7 +313,7 @@
 
         abstract void usageError(String msg, Object... args);
 
-        protected void addToList(ListBuffer<String> list, String str){
+        void addToList(ListBuffer<String> list, String str){
             StringTokenizer st = new StringTokenizer(str, ":");
             String current;
             while(st.hasMoreTokens()){
@@ -315,18 +322,22 @@
             }
         }
 
-        protected void setFilter(long filterBits) {
+        void setFilter(long filterBits) {
             if (showAccess != null) {
                 usageError("main.incompatible.access.flags");
             }
             showAccess = new ModifierFilter(filterBits);
         }
 
-        private void setCompilerOpt(String opt, String arg) {
+        void setCompilerOpt(String opt, String arg) {
             if (compOpts.get(opt) != null) {
                 usageError("main.option.already.seen", opt);
             }
             compOpts.put(opt, arg);
         }
+
+        void setFileManagerOpt(Option opt, String arg) {
+            fileManagerOpts.put(opt, arg);
+        }
     }
 }
diff --git a/langtools/test/tools/javac/T6358024.java b/langtools/test/tools/javac/T6358024.java
index 1aa5115..d0dd3aa 100644
--- a/langtools/test/tools/javac/T6358024.java
+++ b/langtools/test/tools/javac/T6358024.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -54,13 +54,13 @@
 
         test(fm, f,
              new Option[] { new Option("-d", ".")},
-             7);
+             8);
 
         test(fm, f,
              new Option[] { new XOption("-XprintRounds"),
                             new Option("-processorpath", "."),
                             new Option("-processor", self) },
-             12);
+             13);
     }
 
     static void test(JavacFileManager fm, JavaFileObject f, Option[] opts, int expect) throws Throwable {
diff --git a/langtools/test/tools/javac/T6358166.java b/langtools/test/tools/javac/T6358166.java
index fe887c6..8e669a2 100644
--- a/langtools/test/tools/javac/T6358166.java
+++ b/langtools/test/tools/javac/T6358166.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -57,12 +57,8 @@
 
     static void test(JavacFileManager fm, JavaFileObject f, String... args) throws Throwable {
         Context context = new Context();
-        fm.setContext(context);
 
-        Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
-        compilerMain.setOptions(Options.instance(context));
-        compilerMain.filenames = new LinkedHashSet<File>();
-        compilerMain.processArgs(args);
+        Main compilerMain = initCompilerMain(context, fm, args);
 
         JavaCompiler c = JavaCompiler.instance(context);
 
@@ -76,6 +72,19 @@
             throw new AssertionError("elapsed time is suspect: " + msec);
     }
 
+    static Main initCompilerMain(Context context, JavacFileManager fm, String... args) {
+        fm.setContext(context);
+        context.put(JavaFileManager.class, fm);
+
+        Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
+        compilerMain.setOptions(Options.instance(context));
+        compilerMain.filenames = new LinkedHashSet<File>();
+        compilerMain.deferredFileManagerOptions = new LinkedHashMap<>();
+        compilerMain.processArgs(args);
+        fm.handleOptions(compilerMain.deferredFileManagerOptions);
+        return compilerMain;
+    }
+
     public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
         return true;
     }
diff --git a/langtools/test/tools/javac/T6358168.java b/langtools/test/tools/javac/T6358168.java
index 9023e9d..be33620 100644
--- a/langtools/test/tools/javac/T6358168.java
+++ b/langtools/test/tools/javac/T6358168.java
@@ -68,12 +68,9 @@
 
     static void testNoAnnotationProcessing(JavacFileManager fm, JavaFileObject f) throws Throwable {
         Context context = new Context();
-        fm.setContext(context);
 
-        Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
-        compilerMain.setOptions(Options.instance(context));
-        compilerMain.filenames = new LinkedHashSet<File>();
-        compilerMain.processArgs(new String[] { "-d", "." });
+        String[] args = { "-d", "." };
+        Main compilerMain = initCompilerMain(context, fm, args);
 
         JavaCompiler compiler = JavaCompiler.instance(context);
         compiler.compile(List.of(f));
@@ -87,16 +84,14 @@
 
     static void testAnnotationProcessing(JavacFileManager fm, JavaFileObject f) throws Throwable {
         Context context = new Context();
-        fm.setContext(context);
 
-        Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
-        compilerMain.setOptions(Options.instance(context));
-        compilerMain.filenames = new LinkedHashSet<File>();
-        compilerMain.processArgs(new String[] {
-                                     "-XprintRounds",
-                                     "-processorpath", testClasses,
-                                     "-processor", self,
-                                     "-d", "."});
+        String[] args = {
+                "-XprintRounds",
+                "-processorpath", testClasses,
+                "-processor", self,
+                "-d", "."
+        };
+        Main compilerMain = initCompilerMain(context, fm, args);
 
         JavaCompiler compiler = JavaCompiler.instance(context);
         compiler.compile(List.of(f));
@@ -108,6 +103,19 @@
         }
     }
 
+    static Main initCompilerMain(Context context, JavacFileManager fm, String... args) {
+        fm.setContext(context);
+        context.put(JavaFileManager.class, fm);
+
+        Main compilerMain = new Main("javac", new PrintWriter(System.err, true));
+        compilerMain.setOptions(Options.instance(context));
+        compilerMain.filenames = new LinkedHashSet<File>();
+        compilerMain.deferredFileManagerOptions = new LinkedHashMap<>();
+        compilerMain.processArgs(args);
+        fm.handleOptions(compilerMain.deferredFileManagerOptions);
+        return compilerMain;
+    }
+
     public boolean process(Set<? extends TypeElement> tes, RoundEnvironment renv) {
         return true;
     }
diff --git a/langtools/test/tools/javac/T6395974.java b/langtools/test/tools/javac/T6395974.java
index f08cf7d..98d5d65 100644
--- a/langtools/test/tools/javac/T6395974.java
+++ b/langtools/test/tools/javac/T6395974.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -29,8 +29,11 @@
 
 import java.io.*;
 import java.util.*;
+
 import javax.tools.*;
+
 import com.sun.source.util.*;
+import com.sun.source.util.TaskEvent.Kind;
 import com.sun.tools.javac.api.*;
 
 
@@ -59,16 +62,13 @@
         task.setTaskListener(tl);
 
         task.call();
-
-        if (tl.event != null)
-            throw new AssertionError("Unexpected TaskListener event: " + tl.event);
     }
 
     static class MyTaskListener implements TaskListener {
         public void started(TaskEvent e) {
-            System.err.println("Started: " + e);
-            if (event == null)
-                event = e;
+            if (e.getKind() != Kind.COMPILATION) {
+                throw new AssertionError("Unexpected TaskListener event: " + e);
+            }
         }
         public void finished(TaskEvent e) {
         }
diff --git a/langtools/test/tools/javac/T6403466.out b/langtools/test/tools/javac/T6403466.out
index dbbdb54..6a4316e 100644
--- a/langtools/test/tools/javac/T6403466.out
+++ b/langtools/test/tools/javac/T6403466.out
@@ -1,3 +1,4 @@
+Started TaskEvent[COMPILATION,null,null]
 Started TaskEvent[ANNOTATION_PROCESSING,null,null]
 Started TaskEvent[PARSE,T6403466.java,null]
 Finished TaskEvent[PARSE,T6403466.java,null]
@@ -40,3 +41,4 @@
 Finished TaskEvent[ANALYZE,T6403466Wrapper.java,T6403466Wrapper]
 Started TaskEvent[GENERATE,T6403466Wrapper.java,T6403466Wrapper]
 Finished TaskEvent[GENERATE,T6403466Wrapper.java,T6403466Wrapper]
+Finished TaskEvent[COMPILATION,null,null]
diff --git a/langtools/test/tools/javac/annotations/FinalReceiverTest.java b/langtools/test/tools/javac/annotations/FinalReceiverTest.java
new file mode 100644
index 0000000..96ef9d9
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/FinalReceiverTest.java
@@ -0,0 +1,14 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8027886
+ * @summary Receiver parameters must not be final
+ * @compile/fail/ref=FinalReceiverTest.out  -XDrawDiagnostics FinalReceiverTest.java
+ */
+
+class FinalReceiverTest {
+    void m() {
+        class Inner {
+            Inner(final FinalReceiverTest FinalReceiverTest.this) {}
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/annotations/FinalReceiverTest.out b/langtools/test/tools/javac/annotations/FinalReceiverTest.out
new file mode 100644
index 0000000..0aaa964
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/FinalReceiverTest.out
@@ -0,0 +1,2 @@
+FinalReceiverTest.java:11:43: compiler.err.mod.not.allowed.here: final
+1 error
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/langtools/test/tools/javac/annotations/LocalInnerReceiverTest.java
similarity index 76%
rename from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
rename to langtools/test/tools/javac/annotations/LocalInnerReceiverTest.java
index ba34289..c32ec40 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/langtools/test/tools/javac/annotations/LocalInnerReceiverTest.java
@@ -22,15 +22,16 @@
  */
 
 /*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
- * @library /testlibrary
+ * @test
+ * @bug 8029042
+ * @summary Receiver parameter not supported on local class constructor
+ * @compile LocalInnerReceiverTest.java
  */
 
-public class TestStringDeduplicationMemoryUsage {
-    public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
+class LocalInnerReceiverTest {
+    void m() {
+        class Inner {
+            Inner(LocalInnerReceiverTest LocalInnerReceiverTest.this) {}
+        }
     }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/TargetTypes.java b/langtools/test/tools/javac/annotations/typeAnnotations/TargetTypes.java
index 053f4e4..2d42a64 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/TargetTypes.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/TargetTypes.java
@@ -35,9 +35,41 @@
  * @compile TargetTypes.java
  */
 
-@Target({TYPE_USE, TYPE_PARAMETER, TYPE})
-@Retention(RetentionPolicy.RUNTIME)
-@interface A {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface A {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface B {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface C {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface D {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface E {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface F {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface G {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface H {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface I {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface J {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface K {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface L {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface M {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface N {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface O {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface P {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface Q {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface R {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface S {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface U {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface V {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface W {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface X {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface Y {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface Z {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AA {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AB {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AC {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AD {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AE {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AF {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AG {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AH {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AI {}
+@Target({TYPE_USE, TYPE_PARAMETER, TYPE}) @Retention(RetentionPolicy.RUNTIME) @interface AJ {}
 
 /** wildcard bound */
 class T0x1C {
@@ -46,75 +78,75 @@
 
 /** wildcard bound generic/array */
 class T0x1D<T> {
-    void m0x1D(List<? extends @A List<int[]>> lst) {}
+    void m0x1D(List<? extends @B List<int[]>> lst) {}
 }
 
 /** typecast */
 class T0x00 {
     void m0x00(Long l1) {
-        Object l2 = (@A Long) l1;
+        Object l2 = (@C Long) l1;
     }
 }
 
 /** typecast generic/array */
 class T0x01<T> {
     void m0x01(List<T> list) {
-        List<T> l = (List<@A T>) list;
+        List<T> l = (List<@D T>) list;
     }
 }
 
 /** instanceof */
 class T0x02 {
     boolean m0x02(String s) {
-        return (s instanceof @A String);
+        return (s instanceof @E String);
     }
 }
 
 /** object creation (new) */
 class T0x04 {
     void m0x04() {
-        new @A ArrayList<String>();
+        new @F ArrayList<String>();
     }
 }
 
 /** local variable */
 class T0x08 {
     void m0x08() {
-      @A String s = null;
+      @G String s = null;
     }
 }
 
 /** method parameter generic/array */
 class T0x0D {
-    void m0x0D(HashMap<@A Object, List<@A List<@A Class>>> s1) {}
+    void m0x0D(HashMap<@H Object, List<@I List<@J Class>>> s1) {}
 }
 
 /** method receiver */
 class T0x06 {
-    void m0x06(@A T0x06 this) {}
+    void m0x06(@K T0x06 this) {}
 }
 
 /** method return type generic/array */
 class T0x0B {
-    Class<@A Object> m0x0B() { return null; }
+    Class<@L Object> m0x0B() { return null; }
 }
 
 /** field generic/array */
 class T0x0F {
-    HashMap<@A Object, @A Object> c1;
+    HashMap<@M Object, @N Object> c1;
 }
 
 /** method type parameter */
 class T0x20<T, U> {
-    <@A T, @A U> void m0x20() {}
+    <@O T, @P U> void m0x20() {}
 }
 
 /** class type parameter */
-class T0x22<@A T, @A U> {
+class T0x22<@Q T, @R U> {
 }
 
 /** class type parameter bound */
-class T0x10<T extends @A Object> {
+class T0x10<T extends @S Object> {
 }
 
 /** method type parameter bound */
@@ -123,43 +155,43 @@
 }
 
 /** class type parameter bound generic/array */
-class T0x11<T extends List<@A T>> {
+class T0x11<T extends List<@U T>> {
 }
 
 
 /** method type parameter bound generic/array */
 class T0x13 {
-    static <T extends Comparable<@A T>> T m0x13() {
+    static <T extends Comparable<@V T>> T m0x13() {
         return null;
     }
 }
 
 /** class extends/implements generic/array */
-class T0x15<T> extends ArrayList<@A T> {
+class T0x15<T> extends ArrayList<@W T> {
 }
 
 /** type test (instanceof) generic/array */
 class T0x03<T> {
     void m0x03(T typeObj, Object obj) {
-        boolean ok = obj instanceof String @A [];
+        boolean ok = obj instanceof String @X [];
     }
 }
 
 /** object creation (new) generic/array */
 class T0x05<T> {
     void m0x05() {
-        new ArrayList<@A T>();
+        new ArrayList<@Y T>();
     }
 }
 
 /** local variable generic/array */
 class T0x09<T> {
     void g() {
-        List<@A String> l = null;
+        List<@Z String> l = null;
     }
 
     void a() {
-        String @A [] as = null;
+        String @AA [] as = null;
     }
 }
 
@@ -168,14 +200,14 @@
     <T> T0x19() {}
 
     void g() {
-       new <List<@A String>> T0x19();
+       new <List<@AB String>> T0x19();
     }
 }
 
 /** type argument in method call generic/array */
 class T0x1B<T> {
     void m0x1B() {
-        Collections.<T @A []>emptyList();
+        Collections.<T @AC []>emptyList();
     }
 }
 
@@ -184,7 +216,7 @@
     <T> T0x18() {}
 
     void m() {
-        new <@A Integer> T0x18();
+        new <@AD Integer> T0x18();
     }
 }
 
@@ -192,15 +224,15 @@
 class T0x1A<T,U> {
     public static <T, U> T m() { return null; }
     static void m0x1A() {
-        T0x1A.<@A Integer, @A Short>m();
+        T0x1A.<@AE Integer, @AF Short>m();
     }
 }
 
 /** class extends/implements */
-class T0x14 extends @A Object implements @A Serializable, @A Cloneable {
+class T0x14 extends @AG Object implements @AH Serializable, @AI Cloneable {
 }
 
 /** exception type in throws */
 class T0x16 {
-    void m0x16() throws @A Exception {}
+    void m0x16() throws @AJ Exception {}
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/ClassfileTestHelper.java b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/ClassfileTestHelper.java
index 6beae3a..d6fa8e7 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/classfile/ClassfileTestHelper.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/classfile/ClassfileTestHelper.java
@@ -36,8 +36,8 @@
 
     //Makes debugging much easier. Set to 'false' for less output.
     public Boolean verbose = true;
-    void println(String msg) { if (verbose) System.out.println(msg); }
-    void print(String msg) { if (verbose) System.out.print(msg); }
+    void println(String msg) { if (verbose) System.err.println(msg); }
+    void print(String msg) { if (verbose) System.err.print(msg); }
 
     File writeTestFile(String fname, String source) throws IOException {
       File f = new File(fname);
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.java
new file mode 100644
index 0000000..d100659
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.java
@@ -0,0 +1,17 @@
+/*
+ * @test /nodynamiccopyright/
+ * @bug 8027262
+ * @summary A class expression cannot be annotated.
+ * @compile/fail/ref=AnnotatedClassExpr.out -XDrawDiagnostics AnnotatedClassExpr.java
+ */
+import java.lang.annotation.*;
+import java.util.List;
+
+class AnnotatedClassExpr {
+  static void main() {
+    Object o1 = @A int.class;
+  }
+}
+
+@Target(ElementType.TYPE_USE)
+@interface A { }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.out
new file mode 100644
index 0000000..d2d354c
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedClassExpr.out
@@ -0,0 +1,2 @@
+AnnotatedClassExpr.java:12:29: compiler.err.no.annotations.on.dot.class
+1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java
index c7b38cc..b5953d0 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.java
@@ -1,9 +1,8 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8006775
+ * @bug 8006775 8027262
  * @summary Import clauses cannot use annotations.
  * @author Werner Dietl
- * @ignore
  * @compile/fail/ref=AnnotatedImport.out -XDrawDiagnostics AnnotatedImport.java
  */
 
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out
index dbd0d42..91589d9 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedImport.out
@@ -1,7 +1,7 @@
-AnnotatedImport.java:9:13: compiler.err.expected: token.identifier
-AnnotatedImport.java:9:14: compiler.err.expected3: class, interface, enum
-AnnotatedImport.java:10:7: compiler.err.expected: token.identifier
-AnnotatedImport.java:10:10: compiler.err.expected: ';'
-AnnotatedImport.java:11:18: compiler.err.expected: token.identifier
-AnnotatedImport.java:11:19: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:10:13: compiler.err.expected: token.identifier
+AnnotatedImport.java:10:16: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:11:7: compiler.err.expected: token.identifier
+AnnotatedImport.java:11:11: compiler.err.expected3: class, interface, enum
+AnnotatedImport.java:12:18: compiler.err.expected: token.identifier
+AnnotatedImport.java:12:21: compiler.err.expected3: class, interface, enum
 6 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java
index 4122fa1..aed3e2c 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.java
@@ -1,9 +1,8 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8006775
+ * @bug 8006775 8027262
  * @summary Package declarations cannot use annotations.
  * @author Werner Dietl
- * @ignore
  * @compile/fail/ref=AnnotatedPackage1.out -XDrawDiagnostics AnnotatedPackage1.java
  */
 
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out
index 648af19..b2c1770 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/AnnotatedPackage1.out
@@ -1,3 +1,3 @@
 AnnotatedPackage1.java:9:14: compiler.err.expected: token.identifier
-AnnotatedPackage1.java:9:16: compiler.err.expected3: class, interface, enum
+AnnotatedPackage1.java:9:17: compiler.err.expected3: class, interface, enum
 2 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out
index 574ceb6..600d699 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotatePackages.out
@@ -1,5 +1,5 @@
-CantAnnotatePackages.java:19:14: compiler.err.cant.resolve.location: kindname.class, java, , , (compiler.misc.location: kindname.class, CantAnnotatePackages, null)
-CantAnnotatePackages.java:20:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
-CantAnnotatePackages.java:21:14: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
-CantAnnotatePackages.java:14:18: compiler.err.cant.type.annotate.scoping.1: @TA
-4 errors
\ No newline at end of file
+CantAnnotatePackages.java:14:13: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotatePackages.java:19:18: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotatePackages.java:20:19: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotatePackages.java:21:24: compiler.err.cant.type.annotate.scoping.1: @TA
+4 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.out
index 638b91d..85118d3 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateScoping.out
@@ -1,12 +1,14 @@
-CantAnnotateScoping.java:61:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
-CantAnnotateScoping.java:66:9: compiler.err.cant.resolve.location: kindname.class, XXX, , , (compiler.misc.location: kindname.package, java, null)
-CantAnnotateScoping.java:70:9: compiler.err.cant.resolve.location: kindname.class, lang, , , (compiler.misc.location: kindname.package, java, null)
+CantAnnotateScoping.java:66:18: compiler.err.doesnt.exist: java.XXX
 CantAnnotateScoping.java:38:14: compiler.err.cant.type.annotate.scoping.1: @TA
-CantAnnotateScoping.java:47:18: compiler.err.cant.type.annotate.scoping.1: @TA
-CantAnnotateScoping.java:56:37: compiler.err.cant.type.annotate.scoping: @TA,@TA2
-CantAnnotateScoping.java:40:14: compiler.err.cant.type.annotate.scoping.1: @TA
-CantAnnotateScoping.java:42:34: compiler.err.cant.type.annotate.scoping: @TA,@DA,@TA2
+CantAnnotateScoping.java:40:19: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotateScoping.java:47:13: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotateScoping.java:56:32: compiler.err.cant.type.annotate.scoping: @TA,@TA2
+CantAnnotateScoping.java:61:19: compiler.err.cant.type.annotate.scoping.1: @DA
+CantAnnotateScoping.java:70:19: compiler.err.cant.type.annotate.scoping.1: @TA
+CantAnnotateScoping.java:61:11: compiler.err.annotation.type.not.applicable
+CantAnnotateScoping.java:66:11: compiler.err.annotation.type.not.applicable
+CantAnnotateScoping.java:42:39: compiler.err.cant.type.annotate.scoping: @TA,@DA,@TA2
 CantAnnotateScoping.java:42:25: compiler.err.annotation.type.not.applicable
-CantAnnotateScoping.java:44:38: compiler.err.cant.type.annotate.scoping: @TA,@DA
+CantAnnotateScoping.java:44:43: compiler.err.cant.type.annotate.scoping: @TA,@DA
 CantAnnotateScoping.java:44:34: compiler.err.annotation.type.not.applicable
-11 errors
+13 errors
\ No newline at end of file
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java
index cf019b1..442c9d5 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass.java
@@ -12,14 +12,49 @@
 import java.lang.annotation.*;
 
 class Top {
-    @Target(ElementType.TYPE_USE)
-    @interface TA {}
-
-    @Target(ElementType.TYPE_USE)
-    @interface TB {}
-
-    @Target(ElementType.TYPE_USE)
-    @interface TC {}
+    @Target(ElementType.TYPE_USE) @interface TA {}
+    @Target(ElementType.TYPE_USE) @interface TB1 {}
+    @Target(ElementType.TYPE_USE) @interface TB2 {}
+    @Target(ElementType.TYPE_USE) @interface TB3 {}
+    @Target(ElementType.TYPE_USE) @interface TB4 {}
+    @Target(ElementType.TYPE_USE) @interface TB5 {}
+    @Target(ElementType.TYPE_USE) @interface TB6 {}
+    @Target(ElementType.TYPE_USE) @interface TB7 {}
+    @Target(ElementType.TYPE_USE) @interface TB8 {}
+    @Target(ElementType.TYPE_USE) @interface TB9 {}
+    @Target(ElementType.TYPE_USE) @interface TB10 {}
+    @Target(ElementType.TYPE_USE) @interface TB11 {}
+    @Target(ElementType.TYPE_USE) @interface TB12 {}
+    @Target(ElementType.TYPE_USE) @interface TB13 {}
+    @Target(ElementType.TYPE_USE) @interface TB14 {}
+    @Target(ElementType.TYPE_USE) @interface TB15 {}
+    @Target(ElementType.TYPE_USE) @interface TB16 {}
+    @Target(ElementType.TYPE_USE) @interface TB17 {}
+    @Target(ElementType.TYPE_USE) @interface TB18 {}
+    @Target(ElementType.TYPE_USE) @interface TB19 {}
+    @Target(ElementType.TYPE_USE) @interface TB20 {}
+    @Target(ElementType.TYPE_USE) @interface TB21 {}
+    @Target(ElementType.TYPE_USE) @interface TB22 {}
+    @Target(ElementType.TYPE_USE) @interface TB23 {}
+    @Target(ElementType.TYPE_USE) @interface TB24 {}
+    @Target(ElementType.TYPE_USE) @interface TB25 {}
+    @Target(ElementType.TYPE_USE) @interface TB26 {}
+    @Target(ElementType.TYPE_USE) @interface TB27 {}
+    @Target(ElementType.TYPE_USE) @interface TB28 {}
+    @Target(ElementType.TYPE_USE) @interface TB29 {}
+    @Target(ElementType.TYPE_USE) @interface TB30 {}
+    @Target(ElementType.TYPE_USE) @interface TB31 {}
+    @Target(ElementType.TYPE_USE) @interface TB32 {}
+    @Target(ElementType.TYPE_USE) @interface TB33 {}
+    @Target(ElementType.TYPE_USE) @interface TB34 {}
+    @Target(ElementType.TYPE_USE) @interface TB35 {}
+    @Target(ElementType.TYPE_USE) @interface TB36 {}
+    @Target(ElementType.TYPE_USE) @interface TB37 {}
+    @Target(ElementType.TYPE_USE) @interface TB38 {}
+    @Target(ElementType.TYPE_USE) @interface TB39 {}
+    @Target(ElementType.TYPE_USE) @interface TB40 {}
+    @Target(ElementType.TYPE_USE) @interface TB41 {}
+    @Target(ElementType.TYPE_USE) @interface TC {}
 
     class Outer {
         class Inner {
@@ -34,63 +69,63 @@
 
     // All combinations are OK
 
-    Top.@TB Outer f1;
-    @TB Outer.Inner f1a;
+    Top.@TB1 Outer f1;
+    @TB2 Outer.Inner f1a;
     Outer. @TC Inner f1b;
-    @TB Outer. @TC Inner f1c;
+    @TB3 Outer. @TC Inner f1c;
 
-    @TA Top. @TB Outer f2;
-    @TA Top. @TB Outer.Inner f2a;
+    @TA Top. @TB4 Outer f2;
+    @TA Top. @TB5 Outer.Inner f2a;
     @TA Top. Outer. @TC Inner f2b;
-    @TA Top. @TB Outer. @TC Inner f2c;
+    @TA Top. @TB6 Outer. @TC Inner f2c;
 
-    @TB Outer f1r() { return null; }
-    @TB Outer.Inner f1ra() { return null; }
+    @TB7 Outer f1r() { return null; }
+    @TB8 Outer.Inner f1ra() { return null; }
     Outer. @TC Inner f1rb() { return null; }
-    @TB Outer. @TC Inner f1rc() { return null; }
+    @TB9 Outer. @TC Inner f1rc() { return null; }
 
-    void f1param(@TB Outer p,
-            @TB Outer.Inner p1,
+    void f1param(@TB41 Outer p,
+            @TB10 Outer.Inner p1,
             Outer. @TC Inner p2,
-            @TB Outer. @TC Inner p3) { }
+            @TB11 Outer. @TC Inner p3) { }
 
     void f1cast(Object o) {
         Object l;
-        l = (@TB Outer) o;
-        l = (@TB Outer.Inner) o;
+        l = (@TB12 Outer) o;
+        l = (@TB13 Outer.Inner) o;
         l = (Outer. @TC Inner) o;
-        l = (@TB Outer. @TC Inner) o;
+        l = (@TB14 Outer. @TC Inner) o;
     }
 
-    List<@TB Outer> g1;
-    List<@TB Outer.Inner> g1a;
+    List<@TB15 Outer> g1;
+    List<@TB16 Outer.Inner> g1a;
     List<Outer. @TC Inner> g1b;
-    List<@TB Outer. @TC Inner> g1c;
+    List<@TB17 Outer. @TC Inner> g1c;
 
-    List<@TA Top. @TB Outer> g2;
-    List<@TA Top. @TB Outer.Inner> g2a;
+    List<@TA Top. @TB18 Outer> g2;
+    List<@TA Top. @TB19 Outer.Inner> g2a;
     List<@TA Top. Outer. @TC Inner> g2b;
-    List<@TA Top. @TB Outer. @TC Inner> g2c;
+    List<@TA Top. @TB20 Outer. @TC Inner> g2c;
 
-    List<@TB Outer> g1r() { return null; }
-    List<@TB Outer.Inner> g1ra() { return null; }
+    List<@TB21 Outer> g1r() { return null; }
+    List<@TB22 Outer.Inner> g1ra() { return null; }
     List<Outer. @TC Inner> g1rb() { return null; }
-    List<@TB Outer. @TC Inner> g1rc() { return null; }
+    List<@TB23 Outer. @TC Inner> g1rc() { return null; }
 
-    void g1param(List<@TB Outer> p,
-            List<@TB Outer.Inner> p1,
+    void g1param(List<@TB24 Outer> p,
+            List<@TB25 Outer.Inner> p1,
             List<Outer. @TC Inner> p2,
-            List<@TB Outer. @TC Inner> p3) { }
+            List<@TB26 Outer. @TC Inner> p3) { }
 
     void g1new(Object o) {
         Object l;
-        l = new @TB ArrayList<@TB Outer>();
-        l = new @TB ArrayList<@TB Outer.Inner>();
-        l = new @TB HashMap<String, Outer. @TC Inner>();
-        l = new @TB HashMap<String, @TB Outer. Inner>();
-        l = new @TB HashMap<String, @TB Outer. @TC Inner>();
-        l = new @TB HashMap<String, @TA Top. Outer. @TC Inner>();
-        l = new @TB HashMap<String, @TA Top. @TB Outer. Inner>();
-        l = new @TB HashMap<String, @TA Top. @TB Outer. @TC Inner>();
+        l = new @TB27 ArrayList<@TB28 Outer>();
+        l = new @TB29 ArrayList<@TB30 Outer.Inner>();
+        l = new @TB31 HashMap<String, Outer. @TC Inner>();
+        l = new @TB32 HashMap<String, @TB33 Outer. Inner>();
+        l = new @TB34 HashMap<String, @TB35 Outer. @TC Inner>();
+        l = new @TB36 HashMap<String, @TA Top. Outer. @TC Inner>();
+        l = new @TB37 HashMap<String, @TA Top. @TB38 Outer. Inner>();
+        l = new @TB39 HashMap<String, @TA Top. @TB40 Outer. @TC Inner>();
     }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out
index 869059c..b6e5d18 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass2.out
@@ -1,65 +1,72 @@
 CantAnnotateStaticClass2.java:44:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass2.java:45:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:52:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:53:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:55:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:56:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:60:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:61:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:62:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:64:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:65:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:66:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:52:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:53:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:55:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:56:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:60:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:61:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:62:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:64:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:65:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:66:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass2.java:71:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass2.java:72:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:79:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:80:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:79:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:80:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass2.java:87:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:89:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:89:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass2.java:91:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:93:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:120:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:121:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:128:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:129:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:131:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:133:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:137:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:138:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:139:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:141:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:149:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:150:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:157:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:158:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:165:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:167:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:169:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:171:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:105:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:107:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:112:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:114:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:184:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:186:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:187:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:192:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:194:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:195:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:199:35: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:200:38: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:201:41: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass2.java:202:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass2.java:204:49: compiler.err.cant.type.annotate.scoping: @Top.TA,@Top.TB,@Top.TC
-64 errors
+CantAnnotateStaticClass2.java:93:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:120:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:121:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:128:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:129:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:131:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:133:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:134:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:135:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:137:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:138:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:139:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:141:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:142:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:143:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:149:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:150:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:157:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:158:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:165:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:167:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:169:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:171:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:105:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:107:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:112:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:114:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:184:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:186:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:187:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:192:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:194:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:195:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:199:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:200:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:200:49: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:201:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:202:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:202:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass2.java:203:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass2.java:204:52: compiler.err.cant.type.annotate.scoping: @Top.TA,@Top.TB,@Top.TC
+71 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java
index f9d123e..4d94b6f 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.java
@@ -1,9 +1,8 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8006733 8006775
+ * @bug 8006733 8006775 8027262
  * @summary Ensure behavior for nested types is correct.
  * @author Werner Dietl
- * @ignore
  * @compile/fail/ref=CantAnnotateStaticClass3.out -XDrawDiagnostics CantAnnotateStaticClass3.java
  */
 
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out
index 1d3cba0..4f2f989 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/CantAnnotateStaticClass3.out
@@ -1,83 +1,92 @@
 CantAnnotateStaticClass3.java:44:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:45:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:46:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:52:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:53:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:54:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:56:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:59:23: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:61:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:62:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:63:21: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:65:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:66:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:67:25: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:52:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:53:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:54:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:56:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:57:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:58:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:59:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:59:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:61:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:62:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:63:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:65:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:66:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:67:12: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:67:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:71:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:72:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:73:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:79:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:80:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:81:16: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:79:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:80:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:81:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:84:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:86:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:86:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:88:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:90:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:90:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
 CantAnnotateStaticClass3.java:92:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:94:24: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:57:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:58:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:59:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:65:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:66:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:67:12: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:99:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:101:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:106:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:108:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:113:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:115:18: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:120:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:121:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:122:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:128:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:129:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:130:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:132:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:136:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:138:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:139:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:140:14: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:144:17: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:149:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:150:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:151:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:157:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:158:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:159:14: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:162:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:164:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:166:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:168:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:170:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:172:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:177:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:179:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:180:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:185:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:187:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:188:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:193:35: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:195:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:196:41: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:200:35: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:201:38: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:202:41: compiler.err.cant.type.annotate.scoping.1: @Top.TA
-CantAnnotateStaticClass3.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-CantAnnotateStaticClass3.java:204:44: compiler.err.cant.type.annotate.scoping.1: @Top.TB
-82 errors
\ No newline at end of file
+CantAnnotateStaticClass3.java:94:22: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:120:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:121:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:122:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:128:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:129:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:130:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:132:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:134:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:134:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:135:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:135:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:136:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:136:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:138:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:139:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:140:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:142:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:142:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:143:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:143:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:144:17: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:144:28: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:149:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:150:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:151:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:157:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:158:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:159:19: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:162:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:164:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:166:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:168:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:170:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:172:27: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:99:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:101:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:106:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:108:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:113:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:115:23: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:177:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:179:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:180:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:185:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:187:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:188:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:193:40: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:195:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:196:46: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:200:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:201:38: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:201:49: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:202:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:203:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:203:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+CantAnnotateStaticClass3.java:204:44: compiler.err.cant.type.annotate.scoping.1: @Top.TA
+CantAnnotateStaticClass3.java:204:55: compiler.err.cant.type.annotate.scoping.1: @Top.TB
+91 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java
index d33fd24..65029ce 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.java
@@ -10,7 +10,7 @@
     Object e1 = new @DA int[5];
     Object e2 = new @DA String[42];
     Object e3 = new @DA Object();
-    Object ok = new @DA Object() { };
+    Object e4 = new @DA Object() { };
 }
 
 @interface DA { }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out
index efb6557..325094a 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/DeclarationAnnotation.out
@@ -1,5 +1,5 @@
-DeclarationAnnotation.java:13:21: compiler.err.annotation.type.not.applicable
 DeclarationAnnotation.java:10:21: compiler.err.annotation.type.not.applicable
 DeclarationAnnotation.java:11:21: compiler.err.annotation.type.not.applicable
 DeclarationAnnotation.java:12:21: compiler.err.annotation.type.not.applicable
+DeclarationAnnotation.java:13:21: compiler.err.annotation.type.not.applicable
 4 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java
index 4f099e0..0ae45af 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.java
@@ -5,10 +5,13 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue {
   void test() {
     String @A [] s;
   }
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out
index 74a7ef7..c6deb98 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/arrays/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:10:12: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:12:12: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java
index 5a5c8b6..1acb2ec 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.java
@@ -5,10 +5,13 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue {
   void innermethod() {
     class Inner<@A K> { }
   }
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out
index 637ff4a..9c513dc 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/innertypeparams/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:10:17: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:12:17: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java
index 15cf6e9..784474b 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.java
@@ -5,10 +5,13 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue {
   void test() {
     String[] a = new String @A [5];
   }
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out
index 6865348..a8f60fb 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/newarray/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:10:29: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:12:29: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java
index 4043ed6..7851d21 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.java
@@ -5,8 +5,13 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+
 class MissingAnnotationValue {
   void test(@A MissingAnnotationValue this) { }
 }
 
+@Target({TYPE_USE})
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out
index c833910..3d0ae6b 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/receiver/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:9:13: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:13:13: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java
index a6e0030..8daca36 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.java
@@ -5,8 +5,11 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue<K> {
   MissingAnnotationValue<@A String> l;
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out
index 749442f..ec12c3d 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeArgs/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:9:26: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:11:26: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java
index 39f8bee..0b2b899 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.java
@@ -5,7 +5,10 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue<@A K> {
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out
index acac021..563bf87 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/typeparams/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:8:30: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:10:30: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java
index c111c89..4e9a113 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.java
@@ -5,8 +5,11 @@
  * @author Mahmood Ali
  * @compile/fail/ref=MissingAnnotationValue.out -XDrawDiagnostics MissingAnnotationValue.java
  */
+import java.lang.annotation.*;
+
 class MissingAnnotationValue<K> {
   MissingAnnotationValue<@A ?> l;
 }
 
+@Target(ElementType.TYPE_USE)
 @interface A { int field(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out
index 749442f..ec12c3d 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/failures/common/wildcards/MissingAnnotationValue.out
@@ -1,2 +1,2 @@
-MissingAnnotationValue.java:9:26: compiler.err.annotation.missing.default.value: A, field
+MissingAnnotationValue.java:11:26: compiler.err.annotation.missing.default.value: A, field
 1 error
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java
new file mode 100644
index 0000000..ed66750
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/AllLocations.java
@@ -0,0 +1,196 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8027262
+ * @summary Stress test for type annotatons
+ * @compile AllLocations.java
+ */
+
+import java.util.function.Function;
+import java.lang.annotation.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static java.lang.annotation.ElementType.*;
+import java.io.*;
+import java.lang.ref.WeakReference;
+
+public class AllLocations {
+
+    public class ParamStream<T> extends FileOutputStream {
+        public ParamStream(File f) throws FileNotFoundException { super(f); }
+    }
+
+    public class Inner<S> {
+        public Inner() {}
+        public <@A T> Inner(@B Object o) {}
+        public <@C T> Object g(Inner<@D S> this, Object @E [] o) {
+            return new @F int @G [5];
+        }
+    }
+
+    public <@H T extends @I Inner<@J ? extends @K String>> AllLocations(Object o) {}
+
+    public @L Object @M [] @N [] arr = new @O Object @P [5] @Q [5];
+
+    public Inner<@R ? extends @S Inner<@T ? extends @U Integer>> inner;
+
+    public Function func(@V AllLocations this) {
+        try (final ParamStream<@W Integer @X []> fs = new ParamStream<@Y Integer @Z []>(new File("testfile"))) {
+            return @AA AllLocations.Inner<@AB String>::<@AC Integer>new;
+        } catch(@AD Exception ex) {
+            return null;
+        }
+    }
+
+    public <@AE T extends @AF Inner<@AG Integer @AH []>> Function func2() {
+        arr[0][0] = new @AI Inner((@AJ Object) arr[0]);
+        return Ext.f((@AK Object) arr[0]) instanceof @AL Inner @AM [] @AN [] ?
+            @AO @AP Ext::<@AQ @AR Integer> f :
+            @AS @AT Ext::<@AU @AV Integer> f;
+    }
+
+    public Object func3(Object @AW [] arr) {
+        Inner<@AX ? extends @AY Inner<@AZ ? extends @BA Integer>> loc;
+        if (arr[0] instanceof @BB Inner @BC [] @BD [])
+            return this.<Inner<@BE Integer @BF []>> func4();
+        else
+            return new <@BG Inner<@BH Integer>> @BI Inner<@BJ Inner<@BK Integer>>(null);
+    }
+
+    public <@BL T extends @BO Inner<@BP Integer @BQ []>>
+    @BR Inner<@BS Inner<@BT String>> func4() {
+        return (@BU Inner<@BV Inner<@BW String>>)
+            new <@BX Inner<@BY Integer>> @BZ Inner<@CA Inner<@CB String>>(null) {};
+    }
+
+  { Inner<@CC ? extends @CD Inner<@CE ? extends @CF Integer>> loc =
+      new @CG Inner<@CH Inner<@CI Integer>>() {};
+      Ext.func(Ext.func(@CJ WeakReference::new));
+      Ext.func(Ext.func(@CK Ext::<@CL Integer>f));
+      Ext.func((@CM Object a) -> { @CN Object b = a; return b; });
+  }
+
+}
+
+class Ext {
+    public static <@CO T> Object f(Object o) {
+        return null;
+    }
+    public static Function func(Function f) { return f; }
+}
+
+
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface A { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface B { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface C { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface D { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface E { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface F { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface G { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface H { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface I { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface J { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface K { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface L { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface M { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface N { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface O { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface P { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface Q { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface R { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface S { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface T { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface U { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface V { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface W { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface X { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface Y { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface Z { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AA { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AB { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AC { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AD { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AE { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AF { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AG { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AH { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AI { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AJ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AK { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AL { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AM { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AN { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AO { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AP { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AQ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AR { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AS { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AT { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AU { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AV { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AW { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AX { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AY { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface AZ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BA { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BB { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BC { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BD { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BE { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BF { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BG { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BH { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BI { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BJ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BK { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BL { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BM { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BN { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BO { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BP { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BQ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BR { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BS { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BT { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BU { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BV { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BW { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BX { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BY { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface BZ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CA { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CB { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CC { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CD { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CE { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CF { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CG { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CH { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CI { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CJ { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CK { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CL { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CM { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CN { }
+@Retention(RUNTIME) @Target({TYPE_USE}) @interface CO { }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Expressions.java b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Expressions.java
index bd4acc9..77ab754 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Expressions.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Expressions.java
@@ -52,28 +52,40 @@
   }
 
   void objectCreationArray() {
-    Object a1 = new @A String [] [] { };
-    Object a2 = new @A String [1] [];
-    Object a3 = new @A String [1] [2];
+    Object a1 = new @C String [] [] { };
+    Object a2 = new @D String [1] [];
+    Object a3 = new @E String [1] [2];
 
-    Object b1 = new @A String @B(0) [] [] { };
-    Object b2 = new @A String @B(0) [1] [];
-    Object b3 = new @A String @B(0) [1] [2];
+    Object b1 = new @F String @B(1) [] [] { };
+    Object b2 = new @G String @B(2) [1] [];
+    Object b3 = new @H String @B(3) [1] [2];
 
-    Object c1 = new @A String []  @B(0) [] { };
-    Object c2 = new @A String [1] @B(0) [];
-    Object c3 = new @A String [1] @B(0) [2];
+    Object c1 = new @I String []  @B(4) [] { };
+    Object c2 = new @J String [1] @B(5) [];
+    Object c3 = new @K String [1] @B(6) [2];
 
-    Object d1 = new @A String @B(0) []  @B(0) [] { };
-    Object d2 = new @A String @B(0) [1] @B(0) [];
-    Object d3 = new @A String @B(0) [1] @B(0) [2];
+    Object d1 = new @L String @B(7) []  @B(8) [] { };
+    Object d2 = new @M String @B(9) [1] @B(10) [];
+    Object d3 = new @N String @B(11) [1] @B(12) [2];
 
-    Object rand = new @A String @B(value = 0) [1] @B(value = 0) [2];
+    Object rand = new @O String @B(value = 13) [1] @B(value = 14) [2];
 
   }
 }
 
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface A { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface C { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface D { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface E { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface F { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface G { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface H { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface I { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface J { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface K { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface L { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface M { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface N { }
+@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface O { }
 @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
-@interface A { }
-@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})
-@interface B { int value(); }
+  @interface B { int value(); }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/NestedTypes.java b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/NestedTypes.java
index 7572b4f..76c98fc 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/NestedTypes.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/NestedTypes.java
@@ -128,6 +128,7 @@
     MyList<Outer . @Cv("Data") Static> f9;
     // Illegal:
     // MyList<@A Outer . @Cv("Data") Static> f9;
+
 }
 
 class Test2 {
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Receivers.java b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Receivers.java
index 95103ff..c9d719c 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Receivers.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/Receivers.java
@@ -54,14 +54,6 @@
   <T extends Runnable> void accept(@B("m") WithValue this, T r) throws Exception { }
 }
 
-class WithFinal {
-  void plain(final @B("m") WithFinal this) { }
-  <T> void generic(final @B("m") WithFinal this) { }
-  void withException(final @B("m") WithFinal this) throws Exception { }
-  String nonVoid(final @B("m") WithFinal this) { return null; }
-  <T extends Runnable> void accept(final @B("m") WithFinal this, T r) throws Exception { }
-}
-
 class WithBody {
   Object f;
 
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.out b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.out
index 2e89277..d914d56 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.out
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/newlocations/RepeatingTypeAnnotations.out
@@ -17,12 +17,12 @@
 RepeatingTypeAnnotations.java:89:33: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 RepeatingTypeAnnotations.java:93:19: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 RepeatingTypeAnnotations.java:93:35: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
-RepeatingTypeAnnotations.java:97:34: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 RepeatingTypeAnnotations.java:97:19: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
-RepeatingTypeAnnotations.java:101:26: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
+RepeatingTypeAnnotations.java:97:34: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 RepeatingTypeAnnotations.java:101:37: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
-RepeatingTypeAnnotations.java:101:72: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
+RepeatingTypeAnnotations.java:101:26: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 RepeatingTypeAnnotations.java:101:56: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
+RepeatingTypeAnnotations.java:101:72: compiler.err.duplicate.annotation.missing.container: TA, java.lang.annotation.Repeatable
 - compiler.note.unchecked.filename: RepeatingTypeAnnotations.java
 - compiler.note.unchecked.recompile
 25 errors
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassExtends.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassExtends.java
index a38839e..8d39967 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassExtends.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassExtends.java
@@ -25,72 +25,110 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for class extends clauses
  * @compile -g Driver.java ReferenceInfoUtil.java ClassExtends.java
  * @run main Driver ClassExtends
  */
 public class ClassExtends {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1),
-        @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1)
+    @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
     public String regularClass() {
-        return "class Test extends @TA Object implements Cloneable, @TB Runnable {"
+        return "class %TEST_CLASS_NAME% extends @TA Object implements Cloneable, @TB Runnable {"
                + "  public void run() { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1,
-                genericLocation  = { 3, 1 })
-    })
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS, typeIndex = -1)
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1)
+    public String regularClassRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% extends @RTA @RTA Object implements Cloneable, @RTB @RTB Runnable {"
+                + "  public void run() { } }";
+    }
+
+    @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1,
+            genericLocation  = { 3, 1 })
     public String regularClassExtendsParametrized() {
-        return "class Test extends HashMap<@TA String, String> implements Cloneable, Map<String, @TB String>{ } ";
+        return "class %TEST_CLASS_NAME% extends HashMap<@TA String, String> implements Cloneable, Map<String, @TB String>{ } ";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1),
-        @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
-    })
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS, typeIndex = -1,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1,
+            genericLocation  = { 3, 1 })
+    public String regularClassExtendsParametrizedRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% extends HashMap<@RTA @RTA String, String> implements Cloneable, Map<String, @RTB @RTB String>{ } ";
+    }
+
+    @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1)
+    @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
     public String abstractClass() {
-        return "abstract class Test extends @TA Date implements Cloneable, @TB Runnable {"
+        return "abstract class %TEST_CLASS_NAME% extends @TA Date implements Cloneable, @TB Runnable {"
                + "  public void run() { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_EXTENDS, typeIndex = -1,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1,
-                genericLocation  = { 3, 1 })
-    })
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS, typeIndex = -1)
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1)
+    public String abstractClassRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% extends @RTA @RTA Date implements Cloneable, @RTB @RTB Runnable {"
+                + "  public void run() { } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS, typeIndex = -1,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1,
+            genericLocation  = { 3, 1 })
     public String abstractClassExtendsParametrized() {
-        return "abstract class Test extends HashMap<@TA String, String> implements Cloneable, Map<String, @TB String>{ } ";
+        return "abstract class %TEST_CLASS_NAME% extends HashMap<@RTA @RTA String, String> implements Cloneable, Map<String, @RTB @RTB String>{ } ";
     }
 
     @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
     public String regularInterface() {
-        return "interface Test extends Cloneable, @TB Runnable { }";
+        return "interface %TEST_CLASS_NAME% extends Cloneable, @TB Runnable { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS, typeIndex = 1)
+    public String regularInterfaceRepetableAnnotation() {
+        return "interface %TEST_CLASS_NAME% extends Cloneable, @RTA @RTA Runnable { }";
     }
 
     @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1,
             genericLocation  = { 3, 1 })
     public String regularInterfaceExtendsParametrized() {
-        return "interface Test extends Cloneable, Map<String, @TB String>{ } ";
+        return "interface %TEST_CLASS_NAME% extends Cloneable, Map<String, @TB String>{ } ";
+    }
+
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1,
+            genericLocation  = { 3, 1 })
+    public String regularInterfaceExtendsParametrizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% extends Cloneable, Map<String, @RTB @RTB String>{ } ";
     }
 
     @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1)
     public String regularEnum() {
-        return "enum Test implements Cloneable, @TB Runnable { TEST; public void run() { } }";
+        return "enum %TEST_CLASS_NAME% implements Cloneable, @TB Runnable { TEST; public void run() { } }";
+    }
+
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1)
+    public String regularEnumRepeatableAnnotation() {
+        return "enum %TEST_CLASS_NAME% implements Cloneable, @RTB @RTB Runnable { TEST; public void run() { } }";
     }
 
     @TADescription(annotation = "TB", type = CLASS_EXTENDS, typeIndex = 1,
             genericLocation  = { 3, 0 })
     public String regularEnumExtendsParametrized() {
         return
-            "enum Test implements Cloneable, Comparator<@TB String> { TEST;  "
+            "enum %TEST_CLASS_NAME% implements Cloneable, Comparator<@TB String> { TEST;  "
             + "public int compare(String a, String b) { return 0; }}";
     }
 
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS, typeIndex = 1,
+            genericLocation  = { 3, 0 })
+    public String regularEnumExtendsParametrizedRepeatableAnnotation() {
+        return
+                "enum %TEST_CLASS_NAME% implements Cloneable, Comparator<@RTB @RTB String> { TEST;  "
+                        + "public int compare(String a, String b) { return 0; }}";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassTypeParam.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassTypeParam.java
index 123cb05..20885db 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassTypeParam.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ClassTypeParam.java
@@ -25,134 +25,232 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for class type parameters
  * @compile -g Driver.java ReferenceInfoUtil.java ClassTypeParam.java
  * @run main Driver ClassTypeParam
  */
 public class ClassTypeParam {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
-    public String regularClass() {
-        return "class Test<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularClass1() {
+        return "class %TEST_CLASS_NAME%<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String regularClass2() {
-        return "class Test<@TA K extends @TB Date, @TC V extends @TE Cloneable> { }";
+        return "class %TEST_CLASS_NAME%<@TA K extends @TB Date, @TC V extends @TE Cloneable> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
     public String regularClassParameterized() {
-        return "class Test<K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> { }";
+        return "class %TEST_CLASS_NAME%<K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TG", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TG", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
     public String regularClassParameterized2() {
-        return "class Test<K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
+        return "class %TEST_CLASS_NAME%<K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String abstractClass() {
-        return "abstract class Test<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
+        return "abstract class %TEST_CLASS_NAME%<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
     public String abstractClassParameterized() {
-        return "abstract class Test<K extends @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
+        return "abstract class %TEST_CLASS_NAME%<K extends @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String regularInterface() {
-        return "interface Test<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
+        return "interface %TEST_CLASS_NAME%<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
     public String regularInterfaceParameterized() {
-        return "interface Test<K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> { }";
+        return "interface %TEST_CLASS_NAME%<K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TG", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TG", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
     public String regularInterfaceParameterized2() {
-        return "interface Test<K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
+        return "interface %TEST_CLASS_NAME%<K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> { }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RETURN)
     public String useInReturn1() {
-        return "class Test<T> { @TA T m() { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME%<T> { @TA T m() { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {3, 0})
     public String useInReturn2() {
-        return "class Test<T> { Class<@TA T> m() { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME%<T> { Class<@TA T> m() { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
             paramIndex = 0, genericLocation = {3, 0})
     public String useInParam1() {
-        return "class Test<T> { void m(Class<@TA T> p) { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME%<T> { void m(Class<@TA T> p) { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
             paramIndex = 0, genericLocation = {3, 0})
     public String useInParam2() {
-        return "class Test { void m(Class<@TA Object> p) { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME% { void m(Class<@TA Object> p) { throw new RuntimeException(); } }";
     }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularClassRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME%<@RTA @RTA K extends @RTB @RTB Date, @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularClassRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME%<@RTA @RTA K extends @RTB @RTB Date, @RTC @RTC V extends @RTE @RTE Cloneable> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    public String regularClassParameterizedRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME%<K extends @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTGs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    public String regularClassParameterizedRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME%<K extends @RTG @RTG Object & @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTF @RTF Object & @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String abstractClassRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME%<@RTA @RTA K extends @RTB @RTB Date," +
+                " @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    public String abstractClassParameterizedRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME%<K extends @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTF @RTF Object & @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularInterfaceRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME%<@RTA @RTA K extends @RTB @RTB Date," +
+                " @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    public String regularInterfaceParameterizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME%<K extends @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTGs", type = CLASS_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    public String regularInterfaceParameterizedRepeatableAnnotation2() {
+        return "interface %TEST_CLASS_NAME%<K extends @RTG @RTG Object & @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTF @RTF Object & @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String useInReturnRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME%<T> { @RTA @RTA T m() { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN, genericLocation = {3, 0})
+    public String useInReturnRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME%<T> { Class<@RTA @RTA T> m() { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0, genericLocation = {3, 0})
+    public String useInParamRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME%<T> { void m(Class<@RTA @RTA T> p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0, genericLocation = {3, 0})
+    public String useInParamRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { void m(Class<@RTA @RTA Object> p) { throw new RuntimeException(); } }";
+    }
+
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ConstructorInvocationTypeArgument.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ConstructorInvocationTypeArgument.java
new file mode 100644
index 0000000..d69a165
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ConstructorInvocationTypeArgument.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug 8042451
+ * @summary Test population of reference info for constructor invocation type argument
+ * @compile -g Driver.java ReferenceInfoUtil.java ConstructorInvocationTypeArgument.java
+ * @run main Driver ConstructorInvocationTypeArgument
+ */
+
+import static com.sun.tools.classfile.TypeAnnotation.TargetType.CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT;
+
+public class ConstructorInvocationTypeArgument {
+
+    @TADescription(annotation = "TA", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 4)
+    @TADescription(annotation = "TB", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    public String generic1() {
+        return "class %TEST_CLASS_NAME% { <T> %TEST_CLASS_NAME%(int i) { new <@TA T>%TEST_CLASS_NAME%(); }" +
+                " <T> %TEST_CLASS_NAME%() { <@TB String>this(0); } }";
+    }
+
+    @TADescription(annotation = "TA", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    public String generic2() {
+        return "class Super { <T> Super(int i) { } } " +
+                "class %TEST_CLASS_NAME% extends Super { <T> %TEST_CLASS_NAME%() { <@TA String>super(0); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 4)
+    @TADescription(annotation = "RTBs", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    public String genericRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { <T> %TEST_CLASS_NAME%(int i) { new <@RTA @RTA T>%TEST_CLASS_NAME%(); }" +
+                " <T> %TEST_CLASS_NAME%() { <@RTB @RTB String>this(0); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    public String genericRepeatableAnnotation2() {
+        return "class Super { <T> Super(int i) { } } " +
+                "class %TEST_CLASS_NAME% extends Super { <T> %TEST_CLASS_NAME%() { <@RTA @RTA String>super(0); } }";
+    }
+}
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java
index 3106341..78e9aca 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Constructors.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8026791
+ * @bug 8026791 8042451
  * @summary Test population of reference info for constructor results
  * @compile -g Driver.java ReferenceInfoUtil.java Constructors.java
  * @run main Driver Constructors
@@ -33,52 +33,44 @@
 
 public class Constructors {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN),
-        @TADescription(annotation = "TB", type = METHOD_RETURN),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN)
+    @TADescription(annotation = "TB", type = METHOD_RETURN)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     public String regularClass() {
-        return "class Test { @TA Test() {}" +
-                           " @TB Test(@TC int b) {} }";
+        return "class %TEST_CLASS_NAME% { @TA %TEST_CLASS_NAME%() {}" +
+                           " @TB %TEST_CLASS_NAME%(@TC int b) {} }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {1, 0}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    })
-    @TestClass("Test$Inner")
+    @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClass() {
-        return "class Test { class Inner {" +
+        return "class %TEST_CLASS_NAME% { class Inner {" +
                " @TA Inner() {}" +
                " @TB Inner(@TC int b) {}" +
                " } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RECEIVER),
-        @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_RECEIVER),
-        @TADescription(annotation = "TD", type = METHOD_RETURN, genericLocation = {1, 0}),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    })
-    @TestClass("Test$Inner")
+    @TADescription(annotation = "TA", type = METHOD_RECEIVER)
+    @TADescription(annotation = "TB", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = METHOD_RECEIVER)
+    @TADescription(annotation = "TD", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String innerClass2() {
-        return "class Test { class Inner {" +
-               " @TB Inner(@TA Test Test.this) {}" +
-               " @TD Inner(@TC Test Test.this, @TE int b) {}" +
+        return "class %TEST_CLASS_NAME% { class Inner {" +
+               " @TB Inner(@TA %TEST_CLASS_NAME% %TEST_CLASS_NAME%.this) {}" +
+               " @TD Inner(@TC %TEST_CLASS_NAME% %TEST_CLASS_NAME%.this, @TE int b) {}" +
                " } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RECEIVER),
-        @TADescription(annotation = "TB", type = METHOD_RECEIVER, genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0}),
-        @TADescription(annotation = "TD", type = METHOD_RECEIVER, genericLocation = {1, 0}),
-        @TADescription(annotation = "TE", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0}),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_RECEIVER)
+    @TADescription(annotation = "TB", type = METHOD_RECEIVER, genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "TD", type = METHOD_RECEIVER, genericLocation = {1, 0})
+    @TADescription(annotation = "TE", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     @TestClass("Outer$Middle$Inner")
     public String innerClass3() {
         return "class Outer { class Middle { class Inner {" +
@@ -87,24 +79,49 @@
                " } } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
-                typeIndex = 0, offset = 4),
-        @TADescription(annotation = "TB", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
-                typeIndex = 0, offset = 0)
-    })
-    public String generic1() {
-        return "class Test { <T> Test(int i) { new <@TA T>Test(); }" +
-                           " <T> Test() { <@TB String>this(0); } }";
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    public String regularClassRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% { @RTA  @RTA %TEST_CLASS_NAME%() {}" +
+                " @RTB @RTB %TEST_CLASS_NAME%(@RTC @RTC int b) {} }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CONSTRUCTOR_INVOCATION_TYPE_ARGUMENT,
-                typeIndex = 0, offset = 0)
-    })
-    public String generic2() {
-        return "class Super { <T> Super(int i) { } } " +
-                "class Test extends Super { <T> Test() { <@TA String>super(0); } }";
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String innerClassRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% { class Inner {" +
+                " @RTA @RTA Inner() {}" +
+                " @RTB @RTB Inner(@RTC @RTC int b) {}" +
+                " } }";
     }
 
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_RECEIVER)
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN, genericLocation = {1, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String innerClassRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { class Inner {" +
+                " @RTB @RTB Inner(@RTA @RTA %TEST_CLASS_NAME% %TEST_CLASS_NAME%.this) {}" +
+                " @RTD @RTD Inner(@RTC @RTC %TEST_CLASS_NAME% %TEST_CLASS_NAME%.this, @RTE @RTE int b) {}" +
+                " } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    @TADescription(annotation = "RTBs", type = METHOD_RECEIVER, genericLocation = {1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "RTDs", type = METHOD_RECEIVER, genericLocation = {1, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_RETURN, genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TestClass("Outer$Middle$Inner")
+    public String innerClassRepatableAnnotation3() {
+        return "class Outer { class Middle { class Inner {" +
+                " @RTC @RTC Inner(@RTA @RTA Outer. @RTB @RTB Middle Middle.this) {}" +
+                " @RTE @RTE Inner(@RTD @RTD Middle Outer.Middle.this, @RTF @RTF int b) {}" +
+                " } } }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Driver.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Driver.java
index 2493edf..b6c6aa4 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Driver.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Driver.java
@@ -40,51 +40,75 @@
 import com.sun.tools.classfile.TypeAnnotation;
 import com.sun.tools.classfile.TypeAnnotation.TargetType;
 
+import static java.lang.String.format;
+
 public class Driver {
 
     private static final PrintStream out = System.err;
 
+    private final Object testObject;
+
+    public Driver(Class<?> clazz) throws IllegalAccessException, InstantiationException {
+        testObject = clazz.newInstance();
+    }
+
     public static void main(String[] args) throws Exception {
         if (args.length == 0 || args.length > 1)
             throw new IllegalArgumentException("Usage: java Driver <test-name>");
         String name = args[0];
-        Class<?> clazz = Class.forName(name);
-        new Driver().runDriver(clazz.newInstance());
+        new Driver(Class.forName(name)).runDriver();
     }
 
-    String[][] extraParamsCombinations = new String[][] {
+    private final String[][] extraParamsCombinations = new String[][] {
         new String[] { },
         new String[] { "-g" },
     };
 
-    protected void runDriver(Object object) throws Exception {
+    private final String[] retentionPolicies = {RetentionPolicy.CLASS.toString(), RetentionPolicy.RUNTIME.toString()};
+
+    protected void runDriver() {
         int passed = 0, failed = 0;
-        Class<?> clazz = object.getClass();
+        Class<?> clazz = testObject.getClass();
         out.println("Tests for " + clazz.getName());
 
         // Find methods
         for (Method method : clazz.getMethods()) {
-            Map<String, TypeAnnotation.Position> expected = expectedOf(method);
-            if (expected == null)
-                continue;
-            if (method.getReturnType() != String.class)
-                throw new IllegalArgumentException("Test method needs to return a string: " + method);
-            String testClass = testClassOf(method);
+            try {
+                Map<String, TypeAnnotation.Position> expected = expectedOf(method);
+                if (expected == null)
+                    continue;
+                if (method.getReturnType() != String.class)
+                    throw new IllegalArgumentException("Test method needs to return a string: " + method);
 
-            for (String[] extraParams : extraParamsCombinations) {
-                try {
-                    String compact = (String)method.invoke(object);
-                    String fullFile = wrap(compact);
-                    ClassFile cf = compileAndReturn(fullFile, testClass, extraParams);
-                    List<TypeAnnotation> actual = ReferenceInfoUtil.extendedAnnotationsOf(cf);
-                    ReferenceInfoUtil.compare(expected, actual, cf);
-                    out.println("PASSED:  " + method.getName());
-                    ++passed;
-                } catch (Throwable e) {
-                    out.println("FAILED:  " + method.getName());
-                    out.println("    " + e.toString());
-                    ++failed;
+                String compact = (String) method.invoke(testObject);
+                for (String retentionPolicy : retentionPolicies) {
+                    String testClassName = getTestClassName(method, retentionPolicy);
+                    String testClass = testClassOf(method, testClassName);
+                    String fullFile = wrap(compact, new HashMap<String, String>() {{
+                        put("%RETENTION_POLICY%", retentionPolicy);
+                        put("%TEST_CLASS_NAME%", testClassName);
+                    }});
+                    for (String[] extraParams : extraParamsCombinations) {
+                        try {
+                            ClassFile cf = compileAndReturn(fullFile, testClass, extraParams);
+                            List<TypeAnnotation> actual = ReferenceInfoUtil.extendedAnnotationsOf(cf);
+                            ReferenceInfoUtil.compare(expected, actual, cf);
+                            out.format("PASSED:  %s %s%n", testClassName, Arrays.toString(extraParams));
+                            ++passed;
+                        } catch (Throwable e) {
+                            out.format("FAILED:  %s %s%n", testClassName, Arrays.toString(extraParams));
+                            out.println(fullFile);
+                            out.println("    " + e.toString());
+                            e.printStackTrace(out);
+                            ++failed;
+                        }
+                    }
                 }
+            } catch (IllegalAccessException | InvocationTargetException e) {
+                out.println("FAILED:  " + method.getName());
+                out.println("    " + e.toString());
+                e.printStackTrace(out);
+                ++failed;
             }
         }
 
@@ -106,7 +130,7 @@
             return null;
 
         Map<String, TypeAnnotation.Position> result =
-            new HashMap<String, TypeAnnotation.Position>();
+            new HashMap<>();
 
         if (ta != null)
             result.putAll(expectedOf(ta));
@@ -149,33 +173,42 @@
     }
 
     private List<Integer> wrapIntArray(int[] ints) {
-        List<Integer> list = new ArrayList<Integer>(ints.length);
+        List<Integer> list = new ArrayList<>(ints.length);
         for (int i : ints)
             list.add(i);
         return list;
     }
 
-    private String testClassOf(Method m) {
+    private String getTestClassName(Method m, String retentionPolicy) {
+        return format("%s_%s_%s", testObject.getClass().getSimpleName(),
+                m.getName(), retentionPolicy);
+    }
+
+    private String testClassOf(Method m, String testClassName) {
         TestClass tc = m.getAnnotation(TestClass.class);
         if (tc != null) {
-            return tc.value();
+            return tc.value().replace("%TEST_CLASS_NAME%", testClassName);
         } else {
-            return "Test";
+            return testClassName;
         }
     }
 
     private ClassFile compileAndReturn(String fullFile, String testClass, String... extraParams) throws Exception {
-        File source = writeTestFile(fullFile);
-        File clazzFile = compileTestFile(source, testClass);
+        File source = writeTestFile(fullFile, testClass);
+        File clazzFile = compileTestFile(source, testClass, extraParams);
         return ClassFile.read(clazzFile);
     }
 
-    protected File writeTestFile(String fullFile) throws IOException {
-        File f = new File("Test.java");
-        PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)));
-        out.println(fullFile);
-        out.close();
-        return f;
+    protected File writeTestFile(String fullFile, String testClass) throws IOException {
+        File f = new File(getClassDir(), format("%s.java", testClass));
+        try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
+            out.println(fullFile);
+            return f;
+        }
+    }
+
+    private String getClassDir() {
+        return System.getProperty("test.classes", Driver.class.getResource(".").getPath());
     }
 
     protected File compileTestFile(File f, String testClass, String... extraParams) {
@@ -185,20 +218,15 @@
         int rc = com.sun.tools.javac.Main.compile(options.toArray(new String[options.size()]));
         if (rc != 0)
             throw new Error("compilation failed. rc=" + rc);
-        String path;
-        if (f.getParent() != null) {
-            path = f.getParent();
-        } else {
-            path = "";
-        }
-
-        return new File(path + testClass + ".class");
+        String path = f.getParent() != null ? f.getParent() : "";
+        return new File(path, format("%s.class", testClass));
     }
 
-    private String wrap(String compact) {
+    private String wrap(String compact, Map<String, String> replacements) {
         StringBuilder sb = new StringBuilder();
 
         // Automatically import java.util
+        sb.append("\nimport java.io.*;");
         sb.append("\nimport java.util.*;");
         sb.append("\nimport java.lang.annotation.*;");
 
@@ -208,7 +236,7 @@
                             && !compact.contains("interface")
                             && !compact.contains("enum");
         if (isSnippet)
-            sb.append("class Test {\n");
+            sb.append("class %TEST_CLASS_NAME% {\n");
 
         sb.append(compact);
         sb.append("\n");
@@ -224,41 +252,102 @@
         }
 
         // create A ... F annotation declarations
-        sb.append("\n@interface A {}");
-        sb.append("\n@interface B {}");
-        sb.append("\n@interface C {}");
-        sb.append("\n@interface D {}");
-        sb.append("\n@interface E {}");
-        sb.append("\n@interface F {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface A {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface B {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface C {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface D {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface E {}");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface F {}");
 
         // create TA ... TF proper type annotations
         sb.append("\n");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TA {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TB {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TC {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TD {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TE {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TF {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TG {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TH {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TI {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TJ {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TK {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TL {}");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface TM {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                " @Retention(RetentionPolicy.%RETENTION_POLICY%)  @interface TA {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TB {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TC {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TD {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TE {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TF {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TG {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TH {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TI {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TJ {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TK {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TL {}");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface TM {}");
 
-        // create RTA, RTAs, RTB, RTBs for repeating type annotations
+        // create RT?, RT?s for repeating type annotations
         sb.append("\n");
-        sb.append("\n@Repeatable(RTAs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface RTA {}");
-        sb.append("\n@Repeatable(RTBs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface RTB {}");
+        sb.append("\n@Repeatable(RTAs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTA {}");
+        sb.append("\n@Repeatable(RTBs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTB {}");
+        sb.append("\n@Repeatable(RTCs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTC {}");
+        sb.append("\n@Repeatable(RTDs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTD {}");
+        sb.append("\n@Repeatable(RTEs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTE {}");
+        sb.append("\n@Repeatable(RTFs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTF {}");
+        sb.append("\n@Repeatable(RTGs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTG {}");
+        sb.append("\n@Repeatable(RTHs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTH {}");
+        sb.append("\n@Repeatable(RTIs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTI {}");
+        sb.append("\n@Repeatable(RTJs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTJ {}");
+        sb.append("\n@Repeatable(RTKs.class) @Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTK {}");
 
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface RTAs { RTA[] value(); }");
-        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER}) @interface RTBs { RTB[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTAs { RTA[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTBs { RTB[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTCs { RTC[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTDs { RTD[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTEs { RTE[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTFs { RTF[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTGs { RTG[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTHs { RTH[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTIs { RTI[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTJs { RTJ[] value(); }");
+        sb.append("\n@Target({ElementType.TYPE_USE, ElementType.TYPE_PARAMETER})" +
+                "@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface RTKs { RTK[] value(); }");
 
-        sb.append("\n@Target(value={ElementType.TYPE,ElementType.FIELD,ElementType.METHOD,ElementType.PARAMETER,ElementType.CONSTRUCTOR,ElementType.LOCAL_VARIABLE})");
-        sb.append("\n@interface Decl {}");
+        sb.append("\n@Target(value={ElementType.TYPE,ElementType.FIELD,ElementType.METHOD," +
+                "ElementType.PARAMETER,ElementType.CONSTRUCTOR,ElementType.LOCAL_VARIABLE})");
+        sb.append("\n@Retention(RetentionPolicy.%RETENTION_POLICY%) @interface Decl {}");
 
-        return sb.toString();
+        return replaceAll(sb.toString(), replacements);
+    }
+
+    private String replaceAll(String src, Map<String, String> replacements) {
+        for (Map.Entry<String, String> entry : replacements.entrySet()) {
+            src = src.replace(entry.getKey(), entry.getValue());
+        }
+        return src;
     }
 
     public static final int NOT_SET = -888;
@@ -267,6 +356,7 @@
 
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
+@Repeatable(TADescriptions.class)
 @interface TADescription {
     String annotation();
 
@@ -296,5 +386,5 @@
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.METHOD)
 @interface TestClass {
-    String value() default "Test";
+    String value();
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java
index f41cff9..d91e92d 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ExceptionParameters.java
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @bug 8028576
+ * @bug 8028576 8042451
  * @summary Test population of reference info for exception parameters
  * @author Werner Dietl
  * @compile -g Driver.java ReferenceInfoUtil.java ExceptionParameters.java
@@ -43,11 +43,9 @@
         return "void finalException() { try { new Object(); } catch(final @TA Exception e) { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions1() {
         return "void multipleExceptions() { " +
             "try { new Object(); } catch(@TA Exception e) { }" +
@@ -56,11 +54,9 @@
             " }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions2() {
         return "void multipleExceptions() { " +
             "  try { new Object(); " +
@@ -71,11 +67,9 @@
             "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multipleExceptions3() {
         return "void multipleExceptions() { " +
             "  try { new Object(); " +
@@ -87,4 +81,48 @@
             "  }" +
             "}";
     }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    public String exceptionRepeatableAnnoation() {
+        return "void exception() { try { new Object(); } catch(@RTA @RTA Exception e) { } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation1() {
+        return "void multipleExceptions() { " +
+                "try { new Object(); } catch(@RTA @RTA Exception e) { }" +
+                "try { new Object(); } catch(@RTB @RTB Exception e) { }" +
+                "try { new Object(); } catch(@RTC @RTC Exception e) { }" +
+                " }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation2() {
+        return "void multipleExceptions() { " +
+                "  try { new Object(); " +
+                "    try { new Object(); " +
+                "      try { new Object(); } catch(@RTA @RTA Exception e) { }" +
+                "    } catch(@RTB @RTB Exception e) { }" +
+                "  } catch(@RTC @RTC Exception e) { }" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multipleExceptionsRepeatableAnnotation3() {
+        return "void multipleExceptions() { " +
+                "  try { new Object(); " +
+                "  } catch(@RTA @RTA Exception e1) { "+
+                "    try { new Object(); " +
+                "    } catch(@RTB @RTB Exception e2) {" +
+                "      try { new Object(); } catch(@RTC @RTC Exception e3) { }" +
+                "    }" +
+                "  }" +
+                "}";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java
index 6502846..1a531c3 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Fields.java
@@ -25,12 +25,12 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for field
  * @compile -g Driver.java ReferenceInfoUtil.java Fields.java
  * @run main Driver Fields
  */
 public class Fields {
-
     // field types
     @TADescription(annotation = "TA", type = FIELD)
     public String fieldAsPrimitive() {
@@ -42,37 +42,31 @@
         return "@TA Object test;";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TD", type = FIELD,
-                genericLocation = { 3, 1, 3, 0 })
-    })
+    @TADescription(annotation = "TA", type = FIELD)
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "TD", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
     public String fieldAsParametrized() {
         return "@TA Map<@TB String, @TC List<@TD String>> test;";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = { 0, 0 }),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = { 0, 0, 0, 0 })
-    })
+    @TADescription(annotation = "TA", type = FIELD)
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = { 0, 0, 0, 0 })
     public String fieldAsArray() {
         return "@TC String @TA [] @TB [] test;";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = { 0, 0 }),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = { 0, 0, 0, 0 })
-    })
+    @TADescription(annotation = "TA", type = FIELD)
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = { 0, 0, 0, 0 })
     public String fieldAsArrayOld() {
         return "@TC String test @TA [] @TB [];";
     }
@@ -89,40 +83,108 @@
 
     // Smoke tests
     @TADescription(annotation = "TA", type = FIELD)
-    public String interfacefieldAsObject() {
-        return "interface Test { @TA String test = null; }";
+    public String interfaceFieldAsObject() {
+        return "interface %TEST_CLASS_NAME% { @TA String test = null; }";
     }
 
     @TADescription(annotation = "TA", type = FIELD)
-    public String abstractfieldAsObject() {
-        return "abstract class Test { @TA String test; }";
+    public String abstractFieldAsObject() {
+        return "abstract class %TEST_CLASS_NAME% { @TA String test; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TD", type = FIELD,
-                genericLocation = { 3, 1, 3, 0 })
-    })
-    public String interfacefieldAsParametrized() {
-        return "interface Test { @TA Map<@TB String, @TC List<@TD String>> test = null; }";
+    @TADescription(annotation = "TA", type = FIELD)
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "TD", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
+    public String interfaceFieldAsParametrized() {
+        return "interface %TEST_CLASS_NAME% { @TA Map<@TB String, @TC List<@TD String>> test = null; }";
     }
 
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TD", type = FIELD,
-                genericLocation = { 3, 1, 3, 0 })
-    })
+    @TADescription(annotation = "TA", type = FIELD)
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "TD", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
     public String staticFieldAsParametrized() {
         return "static @TA Map<@TB String, @TC List<@TD String>> test;";
     }
 
+    @TADescription(annotation = "RTAs", type = FIELD)
+    public String fieldAsPrimitiveRepeatableAnnotation() {
+        return "@RTA @RTA int test;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    public String fieldAsObjectRepeatableAnnotation() {
+        return "@RTA @RTA Object test;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
+    public String fieldAsParametrizedRepeatableAnnotation() {
+        return "@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> test;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = { 0, 0, 0, 0 })
+    public String fieldAsArrayRepeatableAnnotation() {
+        return "@RTC @RTC String @RTA @RTA [] @RTB @RTB [] test;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    @TADescription(annotation = "RTBs", type = FIELD,
+           genericLocation = { 0, 0 })
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = { 0, 0, 0, 0 })
+    public String fieldAsArrayOldRepeatableAnnotation() {
+        return "@RTC @RTC String test @RTA @RTA [] @RTB @RTB [];";
+    }
+
+    // Smoke tests
+    @TADescription(annotation = "RTAs", type = FIELD)
+    public String interfaceFieldAsObjectRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { @RTA @RTA String test = null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    public String abstractFieldAsObjectRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { @RTA @RTA String test; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
+    public String interfaceFieldAsParametrizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { @RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> test = null; }";
+    }
+
+
+    @TADescription(annotation = "RTAs", type = FIELD)
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = { 3, 1, 3, 0 })
+    public String staticFieldAsParametrizedRepeatableAnnotation() {
+        return "static @RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> test;";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/FromSpecification.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/FromSpecification.java
index 7f4c6fd..6d5bfd4 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/FromSpecification.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/FromSpecification.java
@@ -25,98 +25,89 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test that the examples from the manual are stored as expected
  * @compile -g Driver.java ReferenceInfoUtil.java FromSpecification.java
  * @run main Driver FromSpecification
  */
 public class FromSpecification {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 2, 0}, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0, 2, 0}, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {3, 1, 3, 0}, paramIndex = 0)
-    })
     public String testSpec1() {
         return "void test(@TA Map<@TB ? extends @TC String, @TD List<@TE Object>> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {0, 0, 0, 0, 0, 0}, paramIndex = 0)
-    })
     public String testSpec2() {
         return "void test(@TI String @TF [] @TG [] @TH [] a) { }";
     }
 
     // Note first "1, 0" for top-level class Test.
-    @TADescriptions({
-        @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TL", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TM", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TL", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TM", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {1, 0}, paramIndex = 0)
-    })
     public String testSpec3() {
-        return "class Test { class O1 { class O2 { class O3 { class NestedStatic {} } } }" +
+        return "class %TEST_CLASS_NAME% { class O1 { class O2 { class O3 { class NestedStatic {} } } }" +
                 "void test(@TM O1.@TL O2.@TK O3.@TJ NestedStatic a) { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 3, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 3, 0, 0, 0, 0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0, 3, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0, 3, 0, 0, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {3, 1, 3, 0}, paramIndex = 0)
-    })
     public String testSpec4() {
         return "void test(@TA Map<@TB Comparable<@TF Object @TC [] @TD [] @TE []>, @TG List<@TH String>> a) { }";
     }
 
     // Note first "1, 0" for top-level class Test.
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0, 1, 0, 3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {1, 0}, paramIndex = 0)
-    })
     public String testSpec5() {
-        return "class Test { class O1 { class O2<A, B> { class O3 { class Nested<X, Y> {} } } }" +
+        return "class %TEST_CLASS_NAME% { class O1 { class O2<A, B> { class O3 { class Nested<X, Y> {} } } }" +
                 "void test(@TH O1.@TE O2<@TF String, @TG String>.@TD O3.@TA Nested<@TB String, @TC String> a) { } }";
     }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Initializers.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Initializers.java
index d42c4f7..bab51f1 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Initializers.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Initializers.java
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @bug 8013852
+ * @bug 8013852 8042451
  * @summary Test population of reference info for instance and class initializers
  * @author Werner Dietl
  * @compile -g Driver.java ReferenceInfoUtil.java Initializers.java
@@ -33,63 +33,98 @@
  */
 public class Initializers {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
                 genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
-    public String instanceInit1() {
-        return "class Test { { Object o = new @TA ArrayList<@TB String>(); } }";
+        public String instanceInit1() {
+        return "class %TEST_CLASS_NAME% { { Object o = new @TA ArrayList<@TB String>(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TD", type = NEW,
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
                 genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
-    public String instanceInit2() {
-        return "class Test { Object f = new @TA ArrayList<@TB String>(); " +
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TD", type = NEW,
+                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+        public String instanceInit2() {
+        return "class %TEST_CLASS_NAME% { Object f = new @TA ArrayList<@TB String>(); " +
                 " { Object o = new @TC ArrayList<@TD String>(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
                 genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
-    public String staticInit1() {
-        return "class Test { static { Object o = new @TA ArrayList<@TB String>(); } }";
+        public String staticInit1() {
+        return "class %TEST_CLASS_NAME% { static { Object o = new @TA ArrayList<@TB String>(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TD", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TF", type = NEW,
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
                 genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
-    public String staticInit2() {
-        return "class Test { Object f = new @TA ArrayList<@TB String>(); " +
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TD", type = NEW,
+                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TF", type = NEW,
+                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+        public String staticInit2() {
+        return "class %TEST_CLASS_NAME% { Object f = new @TA ArrayList<@TB String>(); " +
                 " static Object g = new @TC ArrayList<@TD String>(); " +
                 " static { Object o = new @TE ArrayList<@TF String>(); } }";
     }
 
-    // TODO: test interaction with several constructors, especially non-initial constuctors.
-    // I don't think this kind of test is possible here.
-
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST,
-                typeIndex = 0, offset = ReferenceInfoUtil.IGNORE_VALUE),
-    })
-    public String lazyConstantCast1() {
-        return "class Test { public static final Object o = (@TA Object) null; }";
+    @TADescription(annotation = "TA", type = CAST,
+                typeIndex = 0, offset = ReferenceInfoUtil.IGNORE_VALUE)
+        public String lazyConstantCast1() {
+        return "class %TEST_CLASS_NAME% { public static final Object o = (@TA Object) null; }";
     }
 
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String instanceInitRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { { Object o = new @RTA @RTA ArrayList<@RTB @RTB String>(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTDs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String instanceInitRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { Object f = new @RTA @RTA ArrayList<@RTB @RTB String>(); " +
+                " { Object o = new @RTC @RTC ArrayList<@RTD @RTD String>(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String staticInitRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { static { Object o = new @RTA @RTA ArrayList<@RTB @RTB String>(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTDs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTEs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTFs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String staticInitRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { Object f = new @RTA @RTA ArrayList<@RTB @RTB String>(); " +
+                " static Object g = new @RTC @RTC ArrayList<@RTD @RTD String>(); " +
+                " static { Object o = new @RTE @RTE ArrayList<@RTF @RTF String>(); } }";
+    }
+
+    // TODO: test interaction with several constructors, especially non-initial constructors.
+    // I don't think this kind of test is possible here.
+
+    @TADescription(annotation = "RTAs", type = CAST,
+            typeIndex = 0, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String lazyConstantCastRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { public static final Object o = (@RTA @RTA Object) null; }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java
index ccf8f46..139f08b 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/Lambda.java
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8008077 8029721
+ * @bug 8008077 8029721 8042451 8043974
  * @summary Test population of reference info for lambda expressions
  * javac crash for annotated parameter type of lambda in a field
  * @compile -g Driver.java ReferenceInfoUtil.java Lambda.java
@@ -35,64 +35,58 @@
 
 public class Lambda {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = METHOD_REFERENCE,
+    @TADescription(annotation = "TA", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TB", type = METHOD_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnMethodRef1() {
         return
                 "class Lambda {" +
                 "  public String getName() { return \"Lambda!\"; }" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  java.util.function.Function<Lambda, String> lambda() {" +
                 "    return @TA @TB Lambda::getName;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = METHOD_REFERENCE,
+    @TADescription(annotation = "TA", type = METHOD_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TD", type = METHOD_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TE", type = METHOD_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "TD", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
                 genericLocation = { 3, 1 })
-    })
+    @TADescription(annotation = "TE", type = METHOD_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE,
+                genericLocation = { 3, 1})
     public String returnMethodRef2() {
         return
                 "class Lambda<S, T> {" +
                 "  public String getName() { return \"Lambda!\"; }" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" +
                 "    return @TA Lambda<@TB @TC Integer, @TD @TE Float>::getName;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "CTA", type = METHOD_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "CTB", type = METHOD_REFERENCE,
+    @TADescription(annotation = "CTA", type = METHOD_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "CTB", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "CTC", type = METHOD_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "CTC", type = METHOD_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 1 })
-    })
+                genericLocation = { 3, 1    })
     public String returnMethodRef3() {
         return
                 "class Lambda<S, T> {" +
@@ -114,7 +108,7 @@
                 "  String name();" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" +
                 "    return @CTA(\"x\") Lambda<@CTB(age = 5) Integer, @CTC(name = \"y\") Float>::getName;" +
                 "  }" +
@@ -122,64 +116,58 @@
     }
 
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE,
+    @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnConstructorRef1() {
         return
                 "class Lambda {" +
                 "  Lambda() { }" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  Runnable lambda() {" +
                 "    return @TA @TB Lambda::new;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE,
+    @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = CONSTRUCTOR_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TD", type = CONSTRUCTOR_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TE", type = CONSTRUCTOR_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "TD", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
                 genericLocation = { 3, 1 })
-    })
+    @TADescription(annotation = "TE", type = CONSTRUCTOR_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE,
+                genericLocation = { 3, 1    })
     public String returnConstructorRef2() {
         return
                 "class Lambda<S, T> {" +
                 "  Lambda() { }" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  Runnable lambda() {" +
                 "    return @TA Lambda<@TB @TC Integer, @TD @TE Float>::new;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "CTA", type = CONSTRUCTOR_REFERENCE,
-                offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "CTB", type = CONSTRUCTOR_REFERENCE,
+    @TADescription(annotation = "CTA", type = CONSTRUCTOR_REFERENCE,
+                offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "CTB", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "CTC", type = CONSTRUCTOR_REFERENCE,
+                genericLocation = { 3, 0 })
+    @TADescription(annotation = "CTC", type = CONSTRUCTOR_REFERENCE,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = { 3, 1 })
-    })
+                genericLocation = { 3, 1    })
     public String returnConstructorRef3() {
         return
                 "class Lambda<S, T> {" +
@@ -201,7 +189,7 @@
                 "  String name();" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  Runnable lambda() {" +
                 "    return @CTA(\"x\") Lambda<@CTB(age = 5) Integer, @CTC(name = \"y\") Float>::new;" +
                 "  }" +
@@ -209,14 +197,12 @@
     }
 
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_REFERENCE_TYPE_ARGUMENT,
+    @TADescription(annotation = "TA", type = METHOD_REFERENCE_TYPE_ARGUMENT,
                  offset = ReferenceInfoUtil.IGNORE_VALUE,
-                 typeIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_REFERENCE_TYPE_ARGUMENT,
+                 typeIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_REFERENCE_TYPE_ARGUMENT,
                  offset = ReferenceInfoUtil.IGNORE_VALUE,
                  typeIndex = 1)
-    })
     public String returnMethodRefTA1() {
         return
                 "interface Lambda {" +
@@ -227,21 +213,19 @@
                 "  public <S, T> void generic(S p1, T p2) {}" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  Lambda lambda(LambdaImpl r) {" +
                 "    return r::<@TA Object, @TB Object>generic;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
+    @TADescription(annotation = "TA", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
                  offset = ReferenceInfoUtil.IGNORE_VALUE,
-                 typeIndex = 0),
-        @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
+                 typeIndex = 0)
+    @TADescription(annotation = "TB", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
                  offset = ReferenceInfoUtil.IGNORE_VALUE,
                  typeIndex = 1)
-    })
     public String returnConstructorRefTA2() {
         return
                 "interface Lambda {" +
@@ -253,57 +237,222 @@
                 "  public <S, T> void generic(S p1, T p2) {}" +
                 "}" +
 
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  Lambda lambda() {" +
                 "    return LambdaImpl::<@TA Object, @TB Object>new;" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                paramIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                paramIndex = 1, genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+                paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                paramIndex = 1, genericLocation = { 3, 0 })
+    @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
                 lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
                 lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
-                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TE", type = CAST,
+                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TE", type = CAST,
                 offset = ReferenceInfoUtil.IGNORE_VALUE,
                 typeIndex = 0)
-    })
     public String returnLambdaExpr1() {
         return
                 "interface LambdaInt {" +
                 "  void lambda(Object p1, List<Object> p2);" +
                 "}" +
-                "class Test {" +
+                "class %TEST_CLASS_NAME% {" +
                 "  LambdaInt getLambda() {" +
                 "    return (@TA Object x, @TB List<@TC Object> y) -> { @TD Object l = null; System.out.println((@TE Object) l); };" +
                 "  }" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-            paramIndex = 0)})
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
     public String lambdaField1() {
         return
-            "class Test {" +
+            "class %TEST_CLASS_NAME% {" +
                 " java.util.function.IntUnaryOperator field = (@TA int y) -> 1;" +
             "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-            paramIndex = 0)})
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
     public String lambdaField2() {
         return
-            "class Test {" +
+            "class %TEST_CLASS_NAME% {" +
                 " static java.util.function.IntUnaryOperator field = (@TA int y) -> 1;" +
             "}";
     }
+
+    @TADescription(annotation = "RTAs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnMethodRefRepeatableAnnotation1() {
+        return
+                "class Lambda {" +
+                        "  public String getName() { return \"Lambda!\"; }" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  java.util.function.Function<Lambda, String> lambda() {" +
+                        "    return @RTA @RTA Lambda::getName;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTDs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTEs", type = METHOD_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 1})
+    public String returnMethodRefRepeatableAnnotation2() {
+        return
+                "class Lambda<S, T> {" +
+                        "  public String getName() { return \"Lambda!\"; }" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  java.util.function.Function<Lambda<Integer, Float>, String> lambda() {" +
+                        "    return @RTA @RTA Lambda<@RTB @RTB @RTC @RTC Integer, @RTD @RTD @RTE @RTE Float>::getName;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnConstructorRefRepeatable1() {
+        return
+                "class Lambda {" +
+                        "  Lambda() { }" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  Runnable lambda() {" +
+                        "    return @RTA @RTA Lambda::new;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = CONSTRUCTOR_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = CONSTRUCTOR_REFERENCE,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = { 3, 1    })
+    public String returnConstructorRefRepeatable2() {
+        return
+                "class Lambda<S, T> {" +
+                        "  Lambda() { }" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  Runnable lambda() {" +
+                        "    return @RTA @RTA Lambda<@RTB @RTB Integer, @RTC @RTC Float>::new;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_REFERENCE_TYPE_ARGUMENT,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_REFERENCE_TYPE_ARGUMENT,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 1)
+    public String returnMethodRefTARepeatableAnnotation1() {
+        return
+                "interface Lambda {" +
+                        "  <S, T> void generic(S p1, T p2);" +
+                        "}" +
+
+                        "class LambdaImpl implements Lambda {" +
+                        "  public <S, T> void generic(S p1, T p2) {}" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  Lambda lambda(LambdaImpl r) {" +
+                        "    return r::<@RTA @RTA Object, @RTB @RTB Object>generic;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CONSTRUCTOR_REFERENCE_TYPE_ARGUMENT,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 1)
+    public String returnConstructorRefTARepeatableAnnotation2() {
+        return
+                "interface Lambda {" +
+                        "  <S, T> void generic(S p1, T p2);" +
+                        "}" +
+
+                        "class LambdaImpl implements Lambda {" +
+                        "  <S, T> LambdaImpl(S p1, T p2) {}" +
+                        "  public <S, T> void generic(S p1, T p2) {}" +
+                        "}" +
+
+                        "class %TEST_CLASS_NAME% {" +
+                        "  Lambda lambda() {" +
+                        "    return LambdaImpl::<@RTA @RTA Object, @RTB @RTB Object>new;" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 1, genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTDs", type = LOCAL_VARIABLE,
+            lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTEs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnLambdaExprRepeatableAnnotation1() {
+        return
+                "interface LambdaInt {" +
+                        "  void lambda(Object p1, List<Object> p2);" +
+                        "}" +
+                        "class %TEST_CLASS_NAME% {" +
+                        "  LambdaInt getLambda() {" +
+                        "    return (@RTA @RTA Object x, @RTB @RTB List<@RTC @RTC Object> y) ->" +
+                        " { @RTD @RTD Object l = null; System.out.println((@RTE @RTE Object) l); };" +
+                        "  }" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
+    public String lambdaFieldRepeatableAnnotation1() {
+        return
+                "class %TEST_CLASS_NAME% {" +
+                        " java.util.function.IntUnaryOperator field = (@RTA @RTA int y) -> 1;" +
+                        "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
+    public String lambdaFieldRepeatableAnnotation2() {
+        return
+                "class %TEST_CLASS_NAME% {" +
+                        " static java.util.function.IntUnaryOperator field = (@RTA @RTA int y) -> 1;" +
+                        "}";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodInvocationTypeArgument.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodInvocationTypeArgument.java
new file mode 100644
index 0000000..30dd284
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodInvocationTypeArgument.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright (c) 2009, 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.
+ */
+
+/*
+ * @test
+ * @bug 8042451
+ * @summary Test population of reference info for method invocation type arguments
+ * @compile -g Driver.java ReferenceInfoUtil.java MethodInvocationTypeArgument.java
+ * @run main Driver MethodInvocationTypeArgument
+ */
+
+import static com.sun.tools.classfile.TypeAnnotation.TargetType.METHOD_INVOCATION_TYPE_ARGUMENT;
+import static java.lang.System.lineSeparator;
+
+public class MethodInvocationTypeArgument {
+
+    @TADescription(annotation = "TA", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 4)
+    @TADescription(annotation = "TB", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 4)
+    @TADescription(annotation = "TC", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 2, offset = 4)
+    @TADescription(annotation = "TD", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 24)
+    @TADescription(annotation = "TE", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 24)
+    @TADescription(annotation = "TF", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 2, offset = 24)
+    public String genericMethod() {
+        return
+                "public <T1, T2, T3> void function(T1 t1, T2 t2, T3 t3) {}" + lineSeparator() +
+                        "{ new %TEST_CLASS_NAME%().<@TA Integer, @TB String, @TC Double>function(0, \"\", 0.0); " + lineSeparator() +
+                        "  this.<@TD Integer, @TE String, @TF Double>function(0, \"\", 0.0); }";
+    }
+
+    @TADescription(annotation = "TA", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    @TADescription(annotation = "TB", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 0)
+    @TADescription(annotation = "TC", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 2, offset = 0)
+    public String genericStaticMethod() {
+        return
+                "public static <T1, T2, T3> void staticFunction(T1 t1, T2 t2, T3 t3) {}" + lineSeparator() +
+                        "static { %TEST_CLASS_NAME%.<@TA Integer, @TB String, @TC Double>staticFunction(0, \"\", 0.0); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 4)
+    @TADescription(annotation = "RTBs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 4)
+    @TADescription(annotation = "RTCs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 20)
+    @TADescription(annotation = "RTDs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 20)
+    public String genericMethodRepeatableAnnotation() {
+        return
+                "public <T1, T2> void function(T1 t1, T2 t2) {}" + lineSeparator() +
+                        "{ new %TEST_CLASS_NAME%().<@RTA @RTA Integer, @RTB @RTB String>" +
+                        "function(0, \"\"); " + lineSeparator() +
+                        "  this.<@RTC @RTC Integer, @RTD @RTD String>function(0, \"\"); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 0, offset = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 1, offset = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_INVOCATION_TYPE_ARGUMENT,
+            typeIndex = 2, offset = 0)
+    public String genericStaticMethodRepeatableAnnotation() {
+        return
+                "public static <T1, T2, T3> void staticFunction(T1 t1, T2 t2, T3 t3) {}" + lineSeparator() +
+                        "static { %TEST_CLASS_NAME%.<@RTA @RTA Integer, @RTB @RTB String, @RTC @RTC Double>staticFunction(0, \"\", 0.0); }";
+    }
+
+}
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java
index d4cc418..b72e9ce 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodParameters.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method parameters
  * @compile -g Driver.java ReferenceInfoUtil.java MethodParameters.java
  * @run main Driver MethodParameters
@@ -41,97 +42,83 @@
         return "void test(Object b, @TA Object a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1 }, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
-    })
     public String methodParamAsParametrized() {
         return "void test(@TA Map<@TB String, @TC List<@TD String>> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 0, 2, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1 }, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1, 3, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1, 3, 0, 2, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0, 2, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 1 }, paramIndex = 0),
-        @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 0, 2, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1, 3, 0, 2, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 0, 2, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1, 3, 0, 2, 0, 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 3, 1, 3, 0, 2, 0, 3, 1, 2, 0 }, paramIndex = 0)
-    })
     public String methodParamAsWildcard() {
         return "void test(@TA Map<@TB ? extends @TC String," +
                 "                 @TD List<@TE ? extends @TF Map<@TG ? super @TH String," +
                 "                                                @TI ? extends @TJ Object>>> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
-    })
     public String methodParamAsArray() {
         return "void test(Object b, @TC String @TA [] @TB [] a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 0, 0 }, paramIndex = 1)
-    })
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
     public String methodParamAsArray2() {
         return "void test(Object b, @TA @TB String [] a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 0, 0 }, paramIndex = 1)
-    })
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
     public String methodParamAsArray3() {
         return "void test(Object b, @TA @TB @TC String [] a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
-    })
     public String methodParamAsVararg() {
         return "void test(Object b, @TC String @TA [] @TB ... a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 0, 0 }, paramIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
-    })
     public String methodParamAsFQVararg() {
         return "void test(Object b, java.lang.@TC String @TA [] @TB ... a) { }";
     }
@@ -148,26 +135,125 @@
 
     // Smoke tests
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    public String interfacemethodParamAsObject() {
-        return "interface Test { void test(@TA Object a); }";
+    public String interfaceMethodParamAsObject() {
+        return "interface %TEST_CLASS_NAME% { void test(@TA Object a); }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 2)
-    public String abstractmethodParamAsObject() {
-        return "abstract class Test { abstract void test(Object b, Object c, @TA Object a); }";
+    public String abstractMethodParamAsObject() {
+        return "abstract class %TEST_CLASS_NAME% { abstract void test(Object b, Object c, @TA Object a); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 0 }, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = { 3, 1 }, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
-    })
-    public String interfacemethodParamAsParametrized() {
-        return "interface Test { void test(@TA Map<@TB String, @TC List<@TD String>> a); }";
+    public String interfaceMethodParamAsParametrized() {
+        return "interface %TEST_CLASS_NAME% { void test(@TA Map<@TB String, @TC List<@TD String>> a); }";
     }
 
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    public String methodParamAsPrimitiveRepeatableAnnotation() {
+        return "void test(@RTA @RTA int a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    public String methodParamAsObjectRepeatableAnnotation() {
+        return "void test(Object b, @RTA @RTA Object a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
+    public String methodParamAsParametrizedRepeatableAnnotation() {
+        return "void test(@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 0, 2, 0 }, paramIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1, 3, 0, 2, 0 }, paramIndex = 0)
+    public String methodParamAsWildcardRepeatableAnnotation() {
+        return "void test(@RTA @RTA Map<@RTB @RTB ? extends @RTC @RTC String," +
+                "                 @RTD @RTD List<@RTE @RTE ? super @RTF @RTF String>> a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
+    public String methodParamAsArrayRepeatableAnnotation() {
+        return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB [] a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    public String methodParamAsArrayRepeatableAnnotation2() {
+        return "void test(Object b, @RTA @RTA @RTB @RTB String [] a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    public String methodParamAsArrayRepeatableAnnotation3() {
+        return "void test(Object b, @RTA @RTA @RTB @RTB String [] a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
+    public String methodParamAsVarargRepeatableAnnoattion() {
+        return "void test(Object b, @RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0 }, paramIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 0, 0, 0, 0 }, paramIndex = 1)
+    public String methodParamAsFQVarargRepeatableAnnotation() {
+        return "void test(Object b, java.lang.@RTC @RTC String @RTA @RTA [] @RTB @RTB ... a) { }";
+    }
+
+    // Smoke tests
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    public String interfaceMethodParamAsObjectRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { void test(@RTA @RTA Object a); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 2)
+    public String abstractMethodParamAsObjectRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { abstract void test(Object b, Object c, @RTA @RTA Object a); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 0 }, paramIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1 }, paramIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = { 3, 1, 3, 0 }, paramIndex = 0)
+    public String interfaceMethodParamAsParametrizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { void test(@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> a); }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReceivers.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReceivers.java
index 8aefdd3..cab0de4 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReceivers.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReceivers.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method receivers
  * @compile -g Driver.java ReferenceInfoUtil.java MethodReceivers.java
  * @run main Driver MethodReceivers
@@ -33,47 +34,87 @@
 
     @TADescription(annotation = "TA", type = METHOD_RECEIVER)
     public String regularMethod() {
-        return "class Test { void test(@TA Test this) { } }";
+        return "class %TEST_CLASS_NAME% { void test(@TA %TEST_CLASS_NAME% this) { } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RECEIVER)
     public String abstractMethod() {
-        return "abstract class Test { abstract void test(@TA Test this); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract void test(@TA %TEST_CLASS_NAME% this); }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RECEIVER)
     public String interfaceMethod() {
-        return "interface Test { void test(@TA Test this); }";
+        return "interface %TEST_CLASS_NAME% { void test(@TA %TEST_CLASS_NAME% this); }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RECEIVER)
     public String regularWithThrows() {
-        return "class Test { void test(@TA Test this) throws Exception { } }";
-    }
-
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RECEIVER,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = METHOD_RECEIVER,
-                genericLocation = {1, 0})
-    })
-    @TestClass("TestOuter$TestInner")
-    public String nestedtypes1() {
-        return "class TestOuter { class TestInner { void test(@TA TestOuter. @TB TestInner this) { } } }";
+        return "class %TEST_CLASS_NAME% { void test(@TA %TEST_CLASS_NAME% this) throws Exception { } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RECEIVER,
             genericLocation = {})
-    @TestClass("TestOuter$TestInner")
+    @TADescription(annotation = "TB", type = METHOD_RECEIVER,
+            genericLocation = {1, 0})
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
+    public String nestedtypes1() {
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(@TA %TEST_CLASS_NAME%. @TB TestInner this) { } } }";
+    }
+
+    @TADescription(annotation = "TA", type = METHOD_RECEIVER,
+            genericLocation = {})
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
     public String nestedtypes2() {
-        return "class TestOuter { class TestInner { void test(@TA TestOuter.TestInner this) { } } }";
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(@TA %TEST_CLASS_NAME%.TestInner this) { } } }";
     }
 
     @TADescription(annotation = "TB", type = METHOD_RECEIVER,
             genericLocation = {1, 0})
-    @TestClass("TestOuter$TestInner")
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
     public String nestedtypes3() {
-        return "class TestOuter { class TestInner { void test(TestOuter. @TB TestInner this) { } } }";
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(%TEST_CLASS_NAME%. @TB TestInner this) { } } }";
     }
 
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    public String regularMethodRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% { void test(@RTA @RTA %TEST_CLASS_NAME% this) { } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    public String abstractMethodRepeatablaAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { abstract void test(@RTA @RTA %TEST_CLASS_NAME% this); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    public String interfaceMethodRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { void test(@RTA @RTA %TEST_CLASS_NAME% this); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER)
+    public String regularWithThrowsRepeatableAnnotation() {
+        return "class %TEST_CLASS_NAME% { void test(@RTA @RTA %TEST_CLASS_NAME% this) throws Exception { } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = METHOD_RECEIVER,
+            genericLocation = {1, 0})
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
+    public String nestedtypesRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(@RTA @RTA %TEST_CLASS_NAME%. @RTB @RTB TestInner this) { } } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RECEIVER,
+            genericLocation = {})
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
+    public String nestedtypesRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(@RTA @RTA %TEST_CLASS_NAME%.TestInner this) { } } }";
+    }
+
+    @TADescription(annotation = "RTBs", type = METHOD_RECEIVER,
+            genericLocation = {1, 0})
+    @TestClass("%TEST_CLASS_NAME%$TestInner")
+    public String nestedtypesRepeatableAnnotation3() {
+        return "class %TEST_CLASS_NAME% { class TestInner { void test(%TEST_CLASS_NAME%. @RTB @RTB TestInner this) { } } }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java
index e31c632..c3fcd77 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodReturns.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method return
  * @compile -g Driver.java ReferenceInfoUtil.java MethodReturns.java
  * @run main Driver MethodReturns
@@ -42,37 +43,31 @@
         return "@TA Object test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = { 3, 1, 3, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN)
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+            genericLocation = { 3, 1, 3, 0 })
     public String methodReturnAsParametrized() {
         return "@TA Map<@TB String, @TC List<@TD String>> test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 0, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 0, 0, 0, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN)
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 0, 0, 0, 0 })
     public String methodReturnAsArray() {
         return "@TC String @TA [] @TB [] test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 0, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 0, 0, 0, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN)
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 0, 0, 0, 0 })
     public String methodReturnAsArrayOld() {
         return "@TC String test() @TA [] @TB [] { return null; }";
     }
@@ -90,97 +85,206 @@
     // Smoke tests
     @TADescription(annotation = "TA", type = METHOD_RETURN)
     public String interfaceMethodReturnAsObject() {
-        return "interface Test { @TA Object test(); }";
+        return "interface %TEST_CLASS_NAME% { @TA Object test(); }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RETURN)
     public String abstractMethodReturnAsObject() {
-        return "abstract class Test { abstract @TA Object test(); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract @TA Object test(); }";
     }
 
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 1 }),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = { 3, 1, 3, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN)
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+            genericLocation = { 3, 1, 3, 0 })
     public String interfaceMethodReturnAsParametrized() {
-        return "interface Test { @TA Map<@TB String, @TC List<@TD String>> test(); }";
+        return "interface %TEST_CLASS_NAME% { @TA Map<@TB String, @TC List<@TD String>> test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = { 3, 0 }),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0 }),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 }),
-        @TADescription(annotation = "TE", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 }),
-        @TADescription(annotation = "TF", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1, 2, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "TE", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "TF", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1, 2, 0 })
     public String methodReturnAsNestedWildcard() {
         return "Set<@TA ? extends @TB GOuter<String, String>. @TC GInner<@TD String, @TE ? super @TF Object>> entrySet() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 1, 0, 3, 0 }),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 1, 0, 3, 1 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 1, 0, 3, 1, 2, 0 })
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 1, 2, 0 })
     public String methodReturnAsNestedWildcard2() {
         return "class GOuter<X, Y> { class GInner<X, Y> {} } " +
-                "class Test<K> { Set<GOuter<String, String>.GInner<@TA K, @TB ? extends @TC Object>> entrySet() { return null; } }";
+                "class %TEST_CLASS_NAME%<K> { Set<GOuter<String, String>.GInner<@TA K, @TB ? extends @TC Object>> entrySet() { return null; } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0 }),
-    })
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
     public String methodReturnAsNestedWildcard3() {
         return "Set<? extends @TB GOuter<String, String>. @TC GInner<String, Object>> entrySet() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0 }),
-    })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
     public String methodReturnAsNestedWildcard4() {
         return "Set<? extends GOuter<String, String>. @TC GInner<String, Object>> entrySet() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0 }),
-    })
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
     public String methodReturnAsNestedWildcard5() {
         return "Set<? extends @TB Outer. @TC Inner> entrySet() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 }),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 }),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = { 3, 0, 2, 0, 1, 0 }),
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
     public String methodReturnAsNestedWildcard6() {
         return "Set<? extends GOuter<String, String>. @TC GInner<@TA String, @TB Object>> entrySet() { return null; }";
     }
 
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String methodReturnAsPrimitiveRepeatableAnnotation() {
+        return "@RTA @RTA int test() { return 0; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String methodReturnAsObjectRepeatableAnnotation() {
+        return "@RTA @RTA Object test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = { 3, 1, 3, 0 })
+    public String methodReturnAsParametrizedRepeatableAnnotation() {
+        return "@RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 0, 0, 0, 0 })
+    public String methodReturnAsArrayRepeatableAnnotation() {
+        return "@RTC @RTC String @RTA @RTA [] @RTB @RTB [] test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 0, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 0, 0, 0, 0 })
+    public String methodReturnAsArrayOldRepeatableAnnotation() {
+        return "@RTC @RTC String test() @RTA @RTA [] @RTB @RTB [] { return null; }";
+    }
+
+    // Smoke tests
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String interfaceMethodReturnAsObjectRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { @RTA @RTA Object test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String abstractMethodReturnAsObjectRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { abstract @RTA @RTA Object test(); }";
+    }
+
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 1 })
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = { 3, 1, 3, 0 })
+    public String interfaceMethodReturnAsParametrizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { @RTA @RTA Map<@RTB @RTB String, @RTC @RTC List<@RTD @RTD String>> test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = { 3, 0 })
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "RTEs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "RTFs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1, 2, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation() {
+        return "Set<@RTA @RTA ? extends @RTB @RTB GOuter<String, String>. @RTC @RTC GInner<@RTD @RTD String," +
+                " @RTE @RTE ? super @RTF @RTF Object>> entrySet() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 1, 0, 3, 1, 2, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation2() {
+        return "class GOuter<X, Y> { class GInner<X, Y> {} } " +
+                "class %TEST_CLASS_NAME%<K> { Set<GOuter<String, String>.GInner<@RTA @RTA K," +
+                " @RTB @RTB ? extends @RTC @RTC Object>> entrySet() { return null; } }";
+    }
+
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation3() {
+        return "Set<? extends @RTB @RTB GOuter<String, String>. @RTC @RTC GInner<String, Object>> entrySet() { return null; }";
+    }
+
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation4() {
+        return "Set<? extends GOuter<String, String>. @RTC @RTC GInner<String, Object>> entrySet() { return null; }";
+    }
+
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation5() {
+        return "Set<? extends @RTB @RTB Outer. @RTC @RTC Inner> entrySet() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 0 })
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0, 3, 1 })
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = { 3, 0, 2, 0, 1, 0 })
+    public String methodReturnAsNestedWildcardRepeatableAnnotation6() {
+        return "Set<? extends GOuter<String, String>. @RTC @RTC GInner<@RTA @RTA String," +
+                " @RTB @RTB Object>> entrySet() { return null; }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java
index 2b73c6e..db0f610 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodThrows.java
@@ -25,53 +25,46 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method exception clauses
  * @compile -g Driver.java ReferenceInfoUtil.java MethodThrows.java
  * @run main Driver MethodThrows
  */
 public class MethodThrows {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String regularMethod() {
-        return "class Test { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception { } }";
+        return "class %TEST_CLASS_NAME% { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception { } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String abstractMethod() {
-        return "abstract class Test { abstract void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
+        return "abstract class %TEST_CLASS_NAME% { abstract void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0)
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 2)
     public String interfaceMethod() {
-        return "interface Test { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
+        return "interface %TEST_CLASS_NAME% { void test() throws @TA RuntimeException, IllegalArgumentException, @TB Exception; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = THROWS, typeIndex = 0,
-                       genericLocation = {}),
-        @TADescription(annotation = "TB", type = THROWS, typeIndex = 0,
-                       genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = THROWS, typeIndex = 0,
-                       genericLocation = {1, 0, 1, 0}),
-        @TADescription(annotation = "TD", type = THROWS, typeIndex = 1,
-                       genericLocation = {}),
-        @TADescription(annotation = "TE", type = THROWS, typeIndex = 1,
-                       genericLocation = {1, 0}),
-        @TADescription(annotation = "TF", type = THROWS, typeIndex = 1,
-                       genericLocation = {1, 0, 1, 0})
-    })
+    @TADescription(annotation = "TA", type = THROWS, typeIndex = 0,
+                   genericLocation = {})
+    @TADescription(annotation = "TB", type = THROWS, typeIndex = 0,
+                   genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = THROWS, typeIndex = 0,
+                   genericLocation = {1, 0, 1, 0})
+    @TADescription(annotation = "TD", type = THROWS, typeIndex = 1,
+                   genericLocation = {})
+    @TADescription(annotation = "TE", type = THROWS, typeIndex = 1,
+                   genericLocation = {1, 0})
+    @TADescription(annotation = "TF", type = THROWS, typeIndex = 1,
+                   genericLocation = {1, 0, 1, 0})
     public String NestedTypes() {
         return "class Outer { class Middle { class Inner1 extends Exception {}" +
                 "  class Inner2 extends Exception{} } }" +
-                "class Test { void test() throws @TA Outer.@TB Middle.@TC Inner1, @TD Outer.@TE Middle.@TF Inner2 { } }";
+                "class %TEST_CLASS_NAME% { void test() throws @TA Outer.@TB Middle.@TC Inner1, @TD Outer.@TE Middle.@TF Inner2 { } }";
     }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodTypeParam.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodTypeParam.java
index a48198c..c34f80e 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodTypeParam.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MethodTypeParam.java
@@ -22,230 +22,387 @@
  */
 
 import static com.sun.tools.classfile.TypeAnnotation.TargetType.*;
+import static java.lang.System.lineSeparator;
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for method type parameters
  * @compile -g Driver.java ReferenceInfoUtil.java MethodTypeParam.java
  * @run main Driver MethodTypeParam
  */
 public class MethodTypeParam {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String regularClass() {
         return "<@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> void test() { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String regularClass2() {
         return "<@TA K extends @TB Date, @TC V extends @TE Cloneable> void test() { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
     public String regularClassParameterized() {
         return "<K extends @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> void test() { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String abstractClass() {
-        return "abstract class Test { abstract <@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> void test(); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract <@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
     public String abstractClassParameterized() {
-        return "abstract class Test { abstract <K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> void test(); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @TG Object & @TA Map<String, @TB String>, V extends @TF Object & @TC List<@TD List<@TE Object>>> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
     public String abstractClassParameterized2() {
-        return "abstract class Test { abstract <K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> void test(); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @TA Map<String, @TB String>, V extends @TC List<@TD List<@TE Object>>> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String abstractClassParameterized3() {
-        return "abstract class Test { abstract <K extends @TA List<String>, V extends @TB List<Object>> void test(); }";
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @TA List<String>, V extends @TB List<Object>> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
     public String regularInterface() {
-        return "interface Test { <@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> void test(); }";
+        return "interface %TEST_CLASS_NAME% { <@TA K extends @TB Date, @TC V extends @TD Object & @TE Cloneable> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
     public String regularInterfaceParameterized() {
-        return "interface Test { <@TH K extends @TG Object & @TA Map<String, @TB String>, @TI V extends @TF Object & @TC List<@TD List<@TE Object>>> void test(); }";
+        return "interface %TEST_CLASS_NAME% { <@TH K extends @TG Object & @TA Map<String, @TB String>, @TI V extends @TF Object & @TC List<@TD List<@TE Object>>> void test(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
     public String regularInterfaceParameterized2() {
-        return "interface Test { <@TF K extends @TA Map<String, @TB String>, @TG V extends @TC List<@TD List<@TE Object>>> void test(); }";
+        return "interface %TEST_CLASS_NAME% { <@TF K extends @TA Map<String, @TB String>, @TG V extends @TC List<@TD List<@TE Object>>> void test(); }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RETURN)
     public String useInReturn1() {
-        return "class Test { <T> @TA T m() { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME% { <T> @TA T m() { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_RETURN, genericLocation = {3, 0})
     public String useInReturn2() {
-        return "class Test { <T> Class<@TA T> m() { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME% { <T> Class<@TA T> m() { throw new RuntimeException(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_RETURN)
-    })
-    public String useInReturn3() {
-        return "class Test { <T extends @TA Object> @TB T m() { throw new RuntimeException(); } }";
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_RETURN)
+        public String useInReturn3() {
+        return "class %TEST_CLASS_NAME% { <T extends @TA Object> @TB T m() { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
             paramIndex = 0, genericLocation = {3, 0})
     public String useInParam1() {
-        return "class Test { <T> void m(Class<@TA T> p) { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME% { <T> void m(Class<@TA T> p) { throw new RuntimeException(); } }";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
             paramIndex = 0, genericLocation = {3, 0})
     public String useInParam2() {
-        return "class Test { void m(Class<@TA Object> p) { throw new RuntimeException(); } }";
+        return "class %TEST_CLASS_NAME% { void m(Class<@TA Object> p) { throw new RuntimeException(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 2),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 2)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
     public String useInParam3() {
         return "interface IA {} " +
                "interface IB<XB> {} " +
                "interface IC<XC> {} " +
-               "class Test { <T extends @TA IB<IA> & @TB IC<IA>> void m(@TC T p) { throw new RuntimeException(); } }";
+               "class %TEST_CLASS_NAME% { <T extends @TA IB<IA> & @TB IC<IA>> void m(@TC T p) { throw new RuntimeException(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 1,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {})
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 2,
-                genericLocation = {}),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {})
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
                 paramIndex = 0)
-    })
     public String useInParam4() {
-        return "class Test {" +
+        return "class %TEST_CLASS_NAME% {" +
                "  interface IA {} " +
                "  interface IB<XB> {} " +
                "  interface IC<XC> {} " +
                "  <T extends @TA IB<IA> & @TB IC<IA>> void m(@TC T p) { throw new RuntimeException(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 0,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {})
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 0,
-                genericLocation = {1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {1, 0})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 0,
-                genericLocation = {1, 0, 3, 0}),
-    })
-    public String useInParam5() {
-        return "class Test {" +
+                genericLocation = {1, 0, 3, 0})
+        public String useInParam5() {
+    return "class %TEST_CLASS_NAME% {" +
                "  interface IA {} " +
                "  class CB<XC> {} " +
-               "  <T extends @TA Test. @TB CB<@TC IA>> void m(T p) { throw new RuntimeException(); } }";
+               "  <T extends @TA %TEST_CLASS_NAME%. @TB CB<@TC IA>> void m(T p) { throw new RuntimeException(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER,
-                paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER,
+                paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 0,
-                genericLocation = {}),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {})
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 0,
-                genericLocation = {1, 0, 3, 0}),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {1, 0, 3, 0})
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 1,
-                genericLocation = {}),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {})
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
                 paramIndex = 0, boundIndex = 1,
                 genericLocation = {3, 0})
-    })
     public String useInParam6() {
-        return "class Test {" +
+        return "class %TEST_CLASS_NAME% {" +
                "  interface IA {} " +
                "  interface IB<XB> {} " +
                "  class CC<XC> {} " +
                "  interface ID<XD> {} " +
-               "  <@TA T extends @TB Test.CC<@TC IA> & Test. @TD ID<@TE IA>> void m(T p) { throw new RuntimeException(); } }";
+               "  <@TA T extends @TB %TEST_CLASS_NAME%.CC<@TC IA> & %TEST_CLASS_NAME%. @TD ID<@TE IA>> void m(T p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularClassRepeatableAnnotation() {
+        return "<@RTA @RTA K extends @RTB @RTB Date, @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> void test() { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularClassRepeatableAnnotation2() {
+        return "<@RTA @RTA K extends @RTB @RTB Date, @RTC @RTC V extends @RTE @RTE Cloneable> void test() { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    public String regularClassParameterizedRepeatableAnnotation() {
+        return "<K extends @RTA @RTA Map<String, @RTB @RTB String>, V extends @RTF @RTF Object" +
+                " & @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> void test() { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String abstractClassRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { abstract <@RTA @RTA K extends @RTB @RTB Date," +
+                " @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    public String abstractClassParameterizedRepeatableAnnotation() {
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @RTE @RTE Object &" +
+                " @RTA @RTA Map<String, @RTB @RTB String>, V extends @RTF @RTF Object &" +
+                " @RTC @RTC List<@RTD @RTD Object>> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0, 3, 0})
+    public String abstractClassParameterizedRepeatableAnnotation2() {
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @RTA @RTA Map<String, @RTB @RTB String>," +
+                " V extends @RTC @RTC List<@RTD @RTD List<@RTE @RTE Object>>> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String abstractClassParameterizedRepeatableAnnotation3() {
+        return "abstract class %TEST_CLASS_NAME% { abstract <K extends @RTA @RTA List<String>," +
+                " V extends @RTB @RTB List<Object>> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    public String regularInterfaceRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { <@RTA @RTA K extends @RTB @RTB Date," +
+                " @RTC @RTC V extends @RTD @RTD Object & @RTE @RTE Cloneable> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1, genericLocation = {3, 1})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 1, boundIndex = 1, genericLocation = {3, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER, paramIndex = 1)
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER, paramIndex = 0)
+    public String regularInterfaceParameterizedRepeatableAnnotation() {
+        return "interface %TEST_CLASS_NAME% { <@RTF @RTF K extends @RTA @RTA Map<String, @RTB @RTB String>," +
+                " @RTE @RTE V extends @RTC @RTC List<@RTD @RTD Object>> void test(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN)
+    public String useInReturnRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { <T> @RTA @RTA T m() { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN, genericLocation = {3, 0})
+    public String useInReturnRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { <T> Class<@RTA @RTA T> m() { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN)
+    public String useInReturnRepeatableAnnotation3() {
+        return "class %TEST_CLASS_NAME% { <T extends @RTA @RTA Object> @RTB @RTB T m() { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0, genericLocation = {3, 0})
+    public String useInParamRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% { <T> void m(Class<@RTA @RTA T> p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0, genericLocation = {3, 0})
+    public String useInParamRepeatableAnnotation2() {
+        return "class %TEST_CLASS_NAME% { void m(Class<@RTA @RTA Object> p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND, paramIndex = 0, boundIndex = 2)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    public String useInParamRepeatableAnnotation3() {
+        return "interface IA {} " +
+                "interface IB<XB> {} " +
+                "interface IC<XC> {} " +
+                "class %TEST_CLASS_NAME% { <T extends @RTA @RTA IB<IA> & @RTB @RTB IC<IA>>" +
+                " void m(@RTC @RTC T p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 1,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 2,
+            genericLocation = {})
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            paramIndex = 0)
+    public String useInParamRepeatableAnnotation4() {
+        return "class %TEST_CLASS_NAME% {" +
+                "  interface IA {} " +
+                "  interface IB<XB> {} " +
+                "  interface IC<XC> {} " +
+                "  <T extends @RTA @RTA IB<IA> & @RTB @RTB IC<IA>>" +
+                " void m(@RTC @RTC T p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 0,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 0,
+            genericLocation = {1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 0,
+            genericLocation = {1, 0, 3, 0})
+    public String useInParamRepeatableAnnotation5() {
+        return "class %TEST_CLASS_NAME% {" +
+                "  interface IA {} " +
+                "  class CB<XC> {} " +
+                "  <T extends @RTA @RTA %TEST_CLASS_NAME%. @RTB @RTB" +
+                " CB<@RTC @RTC IA>> void m(T p) { throw new RuntimeException(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER,
+            paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 0,
+            genericLocation = {})
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 0,
+            genericLocation = {1, 0, 3, 0})
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 1,
+            genericLocation = {})
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND,
+            paramIndex = 0, boundIndex = 1,
+            genericLocation = {3, 0})
+    public String useInParamRepeatableAnnotation6() {
+        return "class %TEST_CLASS_NAME% {" +
+                "  interface IA {} " +
+                "  interface IB<XB> {} " +
+                "  class CC<XC> {} " +
+                "  interface ID<XD> {} " +
+                "  <@RTA @RTA T extends @RTB @RTB %TEST_CLASS_NAME%.CC<@RTC @RTC IA> &" +
+                " %TEST_CLASS_NAME%. @RTD @RTD ID<@RTE @RTE IA>> void m(T p) { throw new RuntimeException(); } }";
     }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java
index 7c16a0d..f791521 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/MultiCatch.java
@@ -25,7 +25,7 @@
 
 /*
  * @test
- * @bug 8006732 8006775
+ * @bug 8006732 8006775 8042451
  * @summary Test population of reference info for multicatch exception parameters
  * @author Werner Dietl
  * @compile -g Driver.java ReferenceInfoUtil.java MultiCatch.java
@@ -33,35 +33,59 @@
  */
 public class MultiCatch {
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
     public String multiCatch1() {
         return "void multiCatch1() { " +
             "try { new Object(); } catch (@TA NullPointerException | @TB IndexOutOfBoundsException e) { e.toString(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2),
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
     public String multiCatch2() {
         return "void multiCatch2() { " +
             "try { new Object(); } catch (@TA NullPointerException | @TB IndexOutOfBoundsException | @TC IllegalArgumentException e) { e.toString(); } }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1),
-        @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2),
-        @TADescription(annotation = "TD", type = EXCEPTION_PARAMETER, exceptionIndex = 2),
-        @TADescription(annotation = "TE", type = EXCEPTION_PARAMETER, exceptionIndex = 3),
-    })
+    @TADescription(annotation = "TA", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TB", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "TC", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    @TADescription(annotation = "TD", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    @TADescription(annotation = "TE", type = EXCEPTION_PARAMETER, exceptionIndex = 3)
     public String multiCatch3() {
         return "void multiCatch3() { " +
             "try { new Object(); } catch (NullPointerException e1) {}" +
             "try { new Object(); } catch (@TA @TB NullPointerException | @TC @TD IndexOutOfBoundsException | @TE IllegalArgumentException e2) { e2.toString(); } }";
     }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    public String multiCatchRepeatableAnnotation1() {
+        return "void multiCatch1() { " +
+                "try { new Object(); } catch (@RTA @RTA NullPointerException |" +
+                " @RTB @RTB IndexOutOfBoundsException e) { e.toString(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 0)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    public String multiCatchRepeatableAnnotation2() {
+        return "void multiCatch2() { " +
+                "try { new Object(); } catch (@RTA @RTA NullPointerException |" +
+                " @RTB @RTB IndexOutOfBoundsException | @RTC @RTC IllegalArgumentException e) { e.toString(); } }";
+    }
+
+    @TADescription(annotation = "RTAs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTBs", type = EXCEPTION_PARAMETER, exceptionIndex = 1)
+    @TADescription(annotation = "RTCs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    @TADescription(annotation = "RTDs", type = EXCEPTION_PARAMETER, exceptionIndex = 2)
+    @TADescription(annotation = "RTEs", type = EXCEPTION_PARAMETER, exceptionIndex = 3)
+    public String multiCatchRepeatableAnnotation3() {
+        return "void multiCatch3() { " +
+                "try { new Object(); } catch (NullPointerException e1) {}" +
+                "try { new Object(); } catch (@RTA @RTA @RTB @RTB NullPointerException |" +
+                " @RTC @RTC @RTD @RTD IndexOutOfBoundsException |" +
+                " @RTE @RTE IllegalArgumentException e2) { e2.toString(); } }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java
index 3bd39e5..78d5853 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NestedTypes.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451 8044009 8044010
  * @summary Test population of reference info for nested types
  * @compile -g Driver.java ReferenceInfoUtil.java NestedTypes.java
  * @run main Driver NestedTypes
@@ -33,22 +34,18 @@
 
     // method parameters
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {1, 0}, paramIndex = 0)
     public String testParam1() {
         return "void test(@TA Outer.@TB Inner a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 1, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 1, 0}, paramIndex = 0)
     public String testParam1b() {
         return "void test(List<@TA Outer.@TB Inner> a) { }";
     }
@@ -63,10 +60,9 @@
         return "void test(java.util.@TA Map.Entry a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {1, 0}, paramIndex = 0)
     })
     public String testParam1d() {
@@ -79,10 +75,9 @@
         return "void test(List<java.util.@TA Map.Entry> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+                genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
                 genericLocation = {3, 0, 1, 0}, paramIndex = 0)
     })
     public String testParam1f() {
@@ -96,89 +91,81 @@
         return "void test(List<java.util.Map. @TB Entry> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {1, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {1, 0}, paramIndex = 0)
     public String testParam2() {
         return "void test(@TA GOuter<String,String>.@TB GInner<String,String> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 1, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 1, 0}, paramIndex = 0)
     public String testParam2b() {
         return "void test(List<@TA GOuter<String,String>.@TB GInner<String,String>> a) { }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, paramIndex = 0),
-        @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {0, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0}, paramIndex = 0)
     public String testParam3() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " void test(@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a) { }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0),
-        @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0}, paramIndex = 0),
-        @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
-                genericLocation = {3, 0, 0, 0}, paramIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "TJ", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "TK", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0}, paramIndex = 0)
     public String testParam4() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " void test(List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a) { }\n" +
                 "}";
     }
@@ -186,14 +173,12 @@
 
     // Local variables
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
-                genericLocation = {},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
-                genericLocation = {1, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
-    })
+    @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
     public String testLocal1a() {
         return "void test() { @TA Outer.@TB Inner a = null; }";
     }
@@ -212,104 +197,99 @@
         return "void test() { Outer.@TB Inner a = null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
-                genericLocation = {},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
-                genericLocation = {1, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
-    })
+    @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
     public String testLocal2() {
         return "void test() { @TA GOuter<String,String>.@TB GInner<String,String> a = null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TE", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TF", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TG", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TH", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TI", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TJ", type = LOCAL_VARIABLE,
-                genericLocation = {},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TK", type = LOCAL_VARIABLE,
-                genericLocation = {0, 0},
-                lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
-    })
+    @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TE", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TF", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TG", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TH", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TI", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TJ", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TK", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
     public String testLocal3() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " void test() { @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a = null; }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TE", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TF", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TG", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TH", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TI", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TJ", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1}),
-        @TADescription(annotation = "TK", type = LOCAL_VARIABLE,
-                genericLocation = {3, 0, 0, 0},
-                lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
-    })
+
+    @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TD", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TE", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TF", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TG", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TH", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TI", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TJ", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "TK", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
     public String testLocal4() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " void test() { List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a = null; }\n" +
                 "}";
     }
@@ -317,12 +297,10 @@
 
     // fields
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = {1, 0})
-    })
+    @TADescription(annotation = "TA", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = {1, 0})
     public String testField1a() {
         return "@TA Outer.@TB Inner a;";
     }
@@ -339,79 +317,73 @@
         return "Outer.@TB Inner a;";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = {1, 0})
-    })
+    @TADescription(annotation = "TA", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = {1, 0})
     public String testField2() {
         return "@TA GOuter<String,String>.@TB GInner<String,String> a;";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TD", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TE", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}),
-        @TADescription(annotation = "TG", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TH", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TI", type = FIELD,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}),
-        @TADescription(annotation = "TJ", type = FIELD),
-        @TADescription(annotation = "TK", type = FIELD,
-                genericLocation = {0, 0})
-    })
+    @TADescription(annotation = "TA", type = FIELD,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TD", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TE", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "TG", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TH", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TI", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "TJ", type = FIELD)
+    @TADescription(annotation = "TK", type = FIELD,
+            genericLocation = {0, 0})
     public String testField3() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] a;\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TD", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TE", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}),
-        @TADescription(annotation = "TG", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TH", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TI", type = FIELD,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}),
-        @TADescription(annotation = "TJ", type = FIELD,
-                genericLocation = {3, 0}),
-        @TADescription(annotation = "TK", type = FIELD,
-                genericLocation = {3, 0, 0, 0})
-    })
+    @TADescription(annotation = "TA", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TD", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TE", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "TG", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TH", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TI", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "TJ", type = FIELD,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "TK", type = FIELD,
+            genericLocation = {3, 0, 0, 0})
     public String testField4() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> a;\n" +
                 "}";
     }
@@ -419,121 +391,111 @@
 
     // return types
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = {1, 0})
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = {})
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = {1, 0})
     public String testReturn1() {
         return "@TA Outer.@TB Inner test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = {1, 0})
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = {})
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = {1, 0})
     public String testReturn2() {
         return "@TA GOuter<String,String>.@TB GInner<String,String> test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TE", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}),
-        @TADescription(annotation = "TG", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TH", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TI", type = METHOD_RETURN,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}),
-        @TADescription(annotation = "TJ", type = METHOD_RETURN),
-        @TADescription(annotation = "TK", type = METHOD_RETURN,
-                genericLocation = {0, 0})
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TE", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "TG", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TH", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TI", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "TJ", type = METHOD_RETURN)
+    @TADescription(annotation = "TK", type = METHOD_RETURN,
+            genericLocation = {0, 0})
     public String testReturn3() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[] test() { return null; }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TE", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}),
-        @TADescription(annotation = "TF", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}),
-        @TADescription(annotation = "TG", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TH", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TI", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}),
-        @TADescription(annotation = "TJ", type = METHOD_RETURN,
-                genericLocation = {3, 0}),
-        @TADescription(annotation = "TK", type = METHOD_RETURN,
-                genericLocation = {3, 0, 0, 0})
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TE", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "TF", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "TG", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TH", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TI", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "TJ", type = METHOD_RETURN,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "TK", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0})
     public String testReturn4() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]> test() { return null; }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_RETURN,
-                genericLocation = {3, 0}),
-        @TADescription(annotation = "TB", type = METHOD_RETURN,
-                genericLocation = {3, 0, 3, 0}),
-        @TADescription(annotation = "TC", type = METHOD_RETURN,
-                genericLocation = {3, 0, 3, 1}),
-        @TADescription(annotation = "TD", type = METHOD_RETURN,
-                genericLocation = {3, 0, 3, 1, 3, 0}),
-        @TADescription(annotation = "TE", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0}),
-        @TADescription(annotation = "TF", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0, 3, 0}),
-        @TADescription(annotation = "TG", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TH", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}),
-        @TADescription(annotation = "TI", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}),
-        @TADescription(annotation = "TJ", type = METHOD_RETURN,
-                genericLocation = {3, 0, 1, 0, 1, 0}),
-    })
+    @TADescription(annotation = "TA", type = METHOD_RETURN,
+                genericLocation = {3, 0})
+    @TADescription(annotation = "TB", type = METHOD_RETURN,
+                genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "TC", type = METHOD_RETURN,
+                genericLocation = {3, 0, 3, 1})
+    @TADescription(annotation = "TD", type = METHOD_RETURN,
+                genericLocation = {3, 0, 3, 1, 3, 0})
+    @TADescription(annotation = "TE", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0})
+    @TADescription(annotation = "TF", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "TG", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TH", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "TI", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "TJ", type = METHOD_RETURN,
+                genericLocation = {3, 0, 1, 0, 1, 0})
     public String testReturn5() {
         return "class GOuter<A, B> {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " List<@TA GOuter<@TB String, @TC List<@TD Object>> . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2<String, String>> test() { return null; }\n" +
                 "}";
     }
@@ -541,138 +503,128 @@
 
     // type parameters
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {}, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0)
-    })
     public String testTypeparam1() {
         return "<X extends @TA Outer.@TB Inner> X test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {}, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0)
-    })
     public String testTypeparam2() {
         return "<X extends @TA GOuter<String,String>.@TB GInner<String,String>> X test() { return null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 3, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 3, 0, 3, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 3, 0, 3, 0, 0, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 1, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 1, 0, 3, 0},
-                paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {1, 0, 1, 0, 3, 1},
-                paramIndex = 0, boundIndex = 0),
-    })
+                paramIndex = 0, boundIndex = 0)
     public String testTypeparam3() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " <X extends @TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object>> X test() { return null; }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0},
-                paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TK", type = METHOD_TYPE_PARAMETER_BOUND,
+                paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TK", type = METHOD_TYPE_PARAMETER_BOUND,
                 genericLocation = {3, 0, 0, 0},
                 paramIndex = 0, boundIndex = 1)
-    })
     public String testTypeparam4() {
         return "class Outer {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " <X extends List<@TA Outer . @TB GInner<@TC List<@TD Object @TE[] @TF[]>>. @TG GInner2<@TH Integer, @TI Object> @TJ[] @TK[]>> X test() { return null; }\n" +
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 3, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 3, 1}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 3, 1, 3, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0, 3, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0, boundIndex = 1),
-        @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND,
-                genericLocation = {3, 0, 1, 0, 1, 0}, paramIndex = 0, boundIndex = 1),
-    })
+    @TADescription(annotation = "TA", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TB", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TC", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 3, 1}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TD", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 3, 1, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TE", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TF", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TG", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TH", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TI", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "TJ", type = METHOD_TYPE_PARAMETER_BOUND,
+                genericLocation = {3, 0, 1, 0, 1, 0}, paramIndex = 0, boundIndex = 1)
     public String testTypeparam5() {
         return "class GOuter<A, B> {\n" +
                 " class GInner<X> {\n" +
                 "  class GInner2<Y, Z> {}\n" +
                 "}}\n\n" +
-                "class Test {\n" +
+                "class %TEST_CLASS_NAME% {\n" +
                 " <X extends List<@TA GOuter<@TB String, @TC List<@TD Object>> . @TE GInner<@TF List<@TG Object @TH[] @TI[]>>. @TJ GInner2<String, String>>> X test() { return null; }\n" +
                 "}";
     }
@@ -680,91 +632,89 @@
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0})
     public String testUses1a() {
-        return "class Test { class Inner {}    List<@TA Inner> f; }";
+        return "class %TEST_CLASS_NAME% { class Inner {}    List<@TA Inner> f; }";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0})
     public String testUses1b() {
-        return "class Test { class Inner {}    List<@TA Test.Inner> f; }";
+        return "class %TEST_CLASS_NAME% { class Inner {}    List<@TA %TEST_CLASS_NAME%.Inner> f; }";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2a() {
-        return "class Test { class Inner { class Inner2{}    List<@TA Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<@TA Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2b() {
-        return "class Test { class Inner { class Inner2{}    List<@TA Inner.Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<@TA Inner.Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2c() {
-        return "class Test { class Inner { class Inner2{}    List<Inner.@TA Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<Inner.@TA Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2d() {
-        return "class Test{ class Inner { class Inner2{}    List<@TA Test.Inner.Inner2> f; }}";
+        return "class %TEST_CLASS_NAME%{ class Inner { class Inner2{}    List<@TA %TEST_CLASS_NAME%.Inner.Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2e() {
-        return "class Test { class Inner { class Inner2{}    List<Test.@TA Inner.Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<%TEST_CLASS_NAME%.@TA Inner.Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses2f() {
-        return "class Test { class Inner { class Inner2{}    List<Test.Inner.@TA Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<%TEST_CLASS_NAME%.Inner.@TA Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses3a() {
-        return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" +
-                "    List<Test.Inner.@TA Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.Inner.@TA Inner2> f; }}";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses3b() {
-        return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" +
-                "    List<Test.@TA Inner.Inner2> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.@TA Inner.Inner2> f; }}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD,
-                genericLocation = {}),
-        @TADescription(annotation = "TB", type = FIELD,
+    @TADescription(annotation = "TA", type = FIELD,
+                genericLocation = {})
+    @TADescription(annotation = "TB", type = FIELD,
                 genericLocation = {3, 0})
-    })
     public String testUses4() {
-        return "class Test { static class TInner {}\n" +
+        return "class %TEST_CLASS_NAME% { static class TInner {}\n" +
                 "    @TA TInner f; \n" +
                 "    List<@TB TInner> g; }";
     }
 
     @TADescription(annotation = "TA", type = FIELD,
             genericLocation = {3, 0, 1, 0, 3, 1})
-    @TestClass("Test$Inner")
+    @TestClass("%TEST_CLASS_NAME%$Inner")
     public String testUses3c() {
-        return "class Test { class Inner<A, B> { class Inner2<C, D>{}\n" +
-                "    List<Test.Inner<String, @TA Object>.Inner2<Test, Test>> f; }}";
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.Inner<String, @TA Object>.Inner2<%TEST_CLASS_NAME%, %TEST_CLASS_NAME%>> f; }}";
     }
 
     @TADescription(annotation = "TA", type = METHOD_FORMAL_PARAMETER, paramIndex=0)
@@ -778,24 +728,22 @@
         return "void testme(List<java.security.@TA ProtectionDomain> protectionDomain) {}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
+    @TADescription(annotation = "TA", type = LOCAL_VARIABLE,
                 genericLocation = {},
                 lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
                 lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
-                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
+                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = LOCAL_VARIABLE,
                 genericLocation = {1, 0},
                 lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
                 lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
-                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
+                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = LOCAL_VARIABLE,
                 // Only classes count, not methods.
                 genericLocation = {1, 0, 1, 0},
                 lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
                 lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
-                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE),
-    })
+                lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
     @TestClass("Outer$Inner")
     public String testMethodNesting1() {
         return "class Outer {\n" +
@@ -808,18 +756,16 @@
                 "}}\n";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW,
+    @TADescription(annotation = "TA", type = NEW,
                 genericLocation = {},
-                offset = 0),
-        @TADescription(annotation = "TB", type = NEW,
+                offset = 0)
+    @TADescription(annotation = "TB", type = NEW,
                 genericLocation = {1, 0},
-                offset = 0),
-        @TADescription(annotation = "TC", type = NEW,
+                offset = 0)
+    @TADescription(annotation = "TC", type = NEW,
                 // Only classes count, not methods.
                 genericLocation = {1, 0, 1, 0},
-                offset = 12),
-    })
+                offset = 12)
     @TestClass("Outer$Inner")
     public String testMethodNesting2() {
         return "class Outer {\n" +
@@ -832,20 +778,18 @@
                 "}}\n";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_EXTENDS,
-                genericLocation = {}, typeIndex = -1),
-        @TADescription(annotation = "TB", type = CLASS_EXTENDS,
-                genericLocation = {3, 0}, typeIndex = -1),
-        @TADescription(annotation = "TC", type = CLASS_EXTENDS,
-                genericLocation = {3, 1}, typeIndex = -1),
-        @TADescription(annotation = "TD", type = CLASS_EXTENDS,
-                genericLocation = {1, 0}, typeIndex = -1),
-        @TADescription(annotation = "TE", type = CLASS_EXTENDS,
-                genericLocation = {1, 0, 3, 0}, typeIndex = -1),
-        @TADescription(annotation = "TF", type = CLASS_EXTENDS,
+    @TADescription(annotation = "TA", type = CLASS_EXTENDS,
+                genericLocation = {}, typeIndex = -1)
+    @TADescription(annotation = "TB", type = CLASS_EXTENDS,
+                genericLocation = {3, 0}, typeIndex = -1)
+    @TADescription(annotation = "TC", type = CLASS_EXTENDS,
+                genericLocation = {3, 1}, typeIndex = -1)
+    @TADescription(annotation = "TD", type = CLASS_EXTENDS,
+                genericLocation = {1, 0}, typeIndex = -1)
+    @TADescription(annotation = "TE", type = CLASS_EXTENDS,
+                genericLocation = {1, 0, 3, 0}, typeIndex = -1)
+    @TADescription(annotation = "TF", type = CLASS_EXTENDS,
                 genericLocation = {1, 0, 3, 1}, typeIndex = -1)
-    })
     @TestClass("GOuter$GInner$Test")
     public String testExtends1() {
         return "class GOuter<A, B> {\n" +
@@ -855,19 +799,17 @@
                 "}";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER,
-                genericLocation = {}, paramIndex = 0),
-        @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND,
-                genericLocation = {}, paramIndex = 0, boundIndex = 0),
-        @TADescription(annotation = "TC", type = FIELD,
-                genericLocation = {}),
-        @TADescription(annotation = "TD", type = FIELD,
+    @TADescription(annotation = "TA", type = CLASS_TYPE_PARAMETER,
+                genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "TB", type = CLASS_TYPE_PARAMETER_BOUND,
+                genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "TC", type = FIELD,
+                genericLocation = {})
+    @TADescription(annotation = "TD", type = FIELD,
                 genericLocation = {3, 0})
-    })
-    @TestClass("Test$1Nested")
+    @TestClass("%TEST_CLASS_NAME%$1Nested")
     public String testNestedInMethod1() {
-        return "class Test {\n" +
+        return "class %TEST_CLASS_NAME% {\n" +
                 "  void foobar() {\n" +
                 "    class Nested<@TA X extends @TB Object> {\n" +
                 "      @TC List<@TD Object> f;\n" +
@@ -875,4 +817,781 @@
                 "  }" +
                 "}";
     }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {1, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation1() {
+        return "void test(@RTA @RTA Outer.@RTB @RTB Inner a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 1, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation1b() {
+        return "void test(List<@RTA @RTA Outer.@RTB @RTB Inner> a) { }";
+    }
+
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation1g() {
+        return "void test(List<java.util.Map. @RTB @RTB Entry> a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {1, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation2() {
+        return "void test(@RTA @RTA GOuter<String,String>.@RTB @RTB GInner<String,String> a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 1, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation2b() {
+        return "void test(List<@RTA @RTA GOuter<String,String>.@RTB @RTB GInner<String,String>> a) { }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTGs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTHs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTIs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "RTJs", type = METHOD_FORMAL_PARAMETER, paramIndex = 0)
+    @TADescription(annotation = "RTKs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {0, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation3() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " void test(@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer, @RTI @RTI Object>" +
+                " @RTJ @RTJ[] @RTK @RTK[] a) { }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTFs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTGs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTHs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTIs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1}, paramIndex = 0)
+    @TADescription(annotation = "RTJs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0}, paramIndex = 0)
+    @TADescription(annotation = "RTKs", type = METHOD_FORMAL_PARAMETER,
+            genericLocation = {3, 0, 0, 0}, paramIndex = 0)
+    public String testParamRepeatableAnnotation4() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " void test(List<@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[]> a) { }\n" +
+                "}";
+    }
+
+    // Local variables
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation1a() {
+        return "void test() { @RTA @RTA Outer.@RTB @RTB Inner a = null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation1b() {
+        return "void test() { @RTA @RTA Outer.Inner a = null; }";
+    }
+
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation1c() {
+        return "void test() { Outer.@RTB @RTB Inner a = null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation2() {
+        return "void test() { @RTA @RTA GOuter<String,String>.@RTB @RTB GInner<String,String> a = null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTCs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTDs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTEs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTFs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTGs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTHs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTIs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTJs", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTKs", type = LOCAL_VARIABLE,
+            genericLocation = {0, 0},
+            lvarOffset = {5}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation3() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " void test() { @RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer, @RTI @RTI Object>" +
+                " @RTJ @RTJ[] @RTK @RTK[] a = null; }\n" +
+                "}";
+    }
+
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTCs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTDs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTEs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTFs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTGs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTHs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTIs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTJs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    @TADescription(annotation = "RTKs", type = LOCAL_VARIABLE,
+            genericLocation = {3, 0, 0, 0},
+            lvarOffset = {2}, lvarLength = {1}, lvarIndex = {1})
+    public String testLocalRepeatableAnnotation4() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " void test() { List<@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD" +
+                " Object @RTE @RTE [] @RTF @RTF []>>. @RTG @RTG GInner2<@RTH @RTH" +
+                " Integer, @RTI @RTI Object> @RTJ @RTJ [] @RTK @RTK []> a = null; }\n" +
+                "}";
+    }
+
+
+    // fields
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {1, 0})
+    public String testFieldRepeatableAnnotation1a() {
+        return "@RTA @RTA Outer.@RTB @RTB Inner a;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {})
+    public String testFieldRepeatableAnnotation1b() {
+        return "@RTA @RTA Outer.Inner a;";
+    }
+
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {1, 0})
+    public String testFieldRepeatableAnnotation1c() {
+        return "Outer.@RTB @RTB Inner a;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {1, 0})
+    public String testFieldRepeatableAnnotation2() {
+        return "@RTA @RTA GOuter<String,String>.@RTB @RTB GInner<String,String> a;";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTEs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "RTGs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTHs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTIs", type = FIELD,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "RTJs", type = FIELD)
+    @TADescription(annotation = "RTKs", type = FIELD,
+            genericLocation = {0, 0})
+    public String testFieldRepeatableAnnotation3() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " @RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object @RTE @RTE[] @RTF @RTF[]>>." +
+                " @RTG @RTG GInner2<@RTH @RTH Integer, @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[] a;\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTEs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "RTGs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTHs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTIs", type = FIELD,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "RTJs", type = FIELD,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "RTKs", type = FIELD,
+            genericLocation = {3, 0, 0, 0})
+    public String testFieldRepeatableAnnotation4() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " List<@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[]> a;\n" +
+                "}";
+    }
+
+
+    // return types
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = {1, 0})
+    public String testReturnRepeatableAnnotation1() {
+        return "@RTA @RTA Outer.@RTB @RTB Inner test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = {1, 0})
+    public String testReturnRepeatableAnnotation2() {
+        return "@RTA @RTA GOuter<String,String>." +
+                "@RTB @RTB GInner<String,String> test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "RTGs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTHs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTIs", type = METHOD_RETURN,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "RTJs", type = METHOD_RETURN)
+    @TADescription(annotation = "RTKs", type = METHOD_RETURN,
+            genericLocation = {0, 0})
+    public String testReturnRepeatableAnnotation3() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " @RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object @RTE @RTE[]" +
+                " @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[] test() { return null; }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "RTFs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "RTGs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTHs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTIs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1})
+    @TADescription(annotation = "RTJs", type = METHOD_RETURN,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "RTKs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 0, 0})
+    public String testReturnRepeatableAnnotation4() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " List<@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[]> test() { return null; }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_RETURN,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "RTBs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 3, 0})
+    @TADescription(annotation = "RTCs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 3, 1})
+    @TADescription(annotation = "RTDs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 3, 1, 3, 0})
+    @TADescription(annotation = "RTEs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0})
+    @TADescription(annotation = "RTFs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0, 3, 0})
+    @TADescription(annotation = "RTGs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTHs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0})
+    @TADescription(annotation = "RTIs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0})
+    @TADescription(annotation = "RTJs", type = METHOD_RETURN,
+            genericLocation = {3, 0, 1, 0, 1, 0})
+    public String testReturnRepeatableAnnotation5() {
+        return "class GOuter<A, B> {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " List<@RTA @RTA GOuter<@RTB @RTB String, @RTC @RTC List<@RTD @RTD Object>> ." +
+                " @RTE @RTE GInner<@RTF @RTF List<@RTG @RTG Object @RTH @RTH[] @RTI @RTI[]>>." +
+                " @RTJ @RTJ GInner2<String, String>> test() { return null; }\n" +
+                "}";
+    }
+
+
+    // type parameters
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0)
+    public String testTypeparamRepeatableAnnotation1() {
+        return "<X extends @RTA @RTA Outer.@RTB @RTB Inner> X test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0}, paramIndex = 0, boundIndex = 0)
+    public String testTypeparamRepeatableAnnotation2() {
+        return "<X extends @RTA @RTA GOuter<String,String>.@RTB @RTB GInner<String,String>> X test() { return null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 3, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 3, 0, 3, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 3, 0, 3, 0, 0, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTGs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 1, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTHs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 1, 0, 3, 0},
+            paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTIs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {1, 0, 1, 0, 3, 1},
+            paramIndex = 0, boundIndex = 0)
+    public String testTypeparamRepeatableAnnotation3() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " <X extends @RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object>> X test() { return null; }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 3, 0, 3, 0, 0, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTGs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTHs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTIs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0, 3, 1},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTJs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0},
+            paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTKs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 0, 0},
+            paramIndex = 0, boundIndex = 1)
+    public String testTypeparamRepeatableAnnotation4() {
+        return "class Outer {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " <X extends List<@RTA @RTA Outer . @RTB @RTB GInner<@RTC @RTC List<@RTD @RTD Object" +
+                " @RTE @RTE[] @RTF @RTF[]>>. @RTG @RTG GInner2<@RTH @RTH Integer," +
+                " @RTI @RTI Object> @RTJ @RTJ[] @RTK @RTK[]>> X test() { return null; }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTBs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTCs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 3, 1}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTDs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 3, 1, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTEs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTFs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTGs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0, 0, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTHs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTIs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0, 3, 0, 3, 0, 0, 0}, paramIndex = 0, boundIndex = 1)
+    @TADescription(annotation = "RTJs", type = METHOD_TYPE_PARAMETER_BOUND,
+            genericLocation = {3, 0, 1, 0, 1, 0}, paramIndex = 0, boundIndex = 1)
+    public String testTypeparamRepeatableAnnotation5() {
+        return "class GOuter<A, B> {\n" +
+                " class GInner<X> {\n" +
+                "  class GInner2<Y, Z> {}\n" +
+                "}}\n\n" +
+                "class %TEST_CLASS_NAME% {\n" +
+                " <X extends List<@RTA @RTA GOuter<@RTB @RTB String, @RTC @RTC List<@RTD @RTD Object>> ." +
+                " @RTE @RTE GInner<@RTF @RTF List<@RTG @RTG Object @RTH @RTH[] @RTI @RTI[]>>." +
+                " @RTJ @RTJ GInner2<String, String>>> X test() { return null; }\n" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0})
+    public String testUsesRepeatableAnnotation1a() {
+        return "class %TEST_CLASS_NAME% { class Inner {}    List<@RTA @RTA Inner> f; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0})
+    public String testUsesRepeatableAnnotation1b() {
+        return "class %TEST_CLASS_NAME% { class Inner {}    List<@RTA @RTA %TEST_CLASS_NAME%.Inner> f; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2a() {
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<@RTA @RTA Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2b() {
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<@RTA @RTA Inner.Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2c() {
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}    List<Inner.@RTA @RTA Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2d() {
+        return "class %TEST_CLASS_NAME%{ class Inner { class Inner2{}" +
+                "    List<@RTA @RTA %TEST_CLASS_NAME%.Inner.Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2e() {
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}" +
+                "    List<%TEST_CLASS_NAME%.@RTA @RTA Inner.Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation2f() {
+        return "class %TEST_CLASS_NAME% { class Inner { class Inner2{}" +
+                "    List<%TEST_CLASS_NAME%.Inner.@RTA @RTA Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation3a() {
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.Inner.@RTA @RTA Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation3b() {
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.@RTA @RTA Inner.Inner2> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "RTBs", type = FIELD,
+            genericLocation = {3, 0})
+    public String testUsesRepeatableAnnotation4() {
+        return "class %TEST_CLASS_NAME% { static class TInner {}\n" +
+                "    @RTA @RTA TInner f; \n" +
+                "    List<@RTB @RTB TInner> g; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD,
+            genericLocation = {3, 0, 1, 0, 3, 1})
+    @TestClass("%TEST_CLASS_NAME%$Inner")
+    public String testUsesRepeatableAnnotation3c() {
+        return "class %TEST_CLASS_NAME% { class Inner<A, B> { class Inner2<C, D>{}\n" +
+                "    List<%TEST_CLASS_NAME%.Inner<String," +
+                " @RTA @RTA Object>.Inner2<%TEST_CLASS_NAME%, %TEST_CLASS_NAME%>> f; }}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex=0)
+    public String testFullyQualifiedRepeatableAnnotation1() {
+        return "void testme(java.security.@RTA @RTA ProtectionDomain protectionDomain) {}";
+    }
+
+    @TADescription(annotation = "RTAs", type = METHOD_FORMAL_PARAMETER, paramIndex=0,
+            genericLocation = {3, 0})
+    public String testFullyQualifiedRepeatableAnnotation2() {
+        return "void testme(List<java.security.@RTA @RTA ProtectionDomain> protectionDomain) {}";
+    }
+
+    @TADescription(annotation = "RTAs", type = LOCAL_VARIABLE,
+            genericLocation = {},
+            lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = LOCAL_VARIABLE,
+            genericLocation = {1, 0},
+            lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = LOCAL_VARIABLE,
+            // Only classes count, not methods.
+            genericLocation = {1, 0, 1, 0},
+            lvarOffset = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarLength = ReferenceInfoUtil.IGNORE_VALUE,
+            lvarIndex = ReferenceInfoUtil.IGNORE_VALUE)
+    @TestClass("Outer$Inner")
+    public String testMethodNestingRepeatableAnnotation1() {
+        return "class Outer {\n" +
+                " class Inner {\n" +
+                "  void foo() {\n" +
+                "    class MInner {}\n" +
+                "    @RTA @RTA Outer . @RTB @RTB Inner l1 = null;\n" +
+                "    @RTC @RTC MInner l2 = null;\n" +
+                "  }\n" +
+                "}}\n";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW,
+            genericLocation = {},
+            offset = 0)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = {1, 0},
+            offset = 0)
+    @TADescription(annotation = "RTCs", type = NEW,
+            // Only classes count, not methods.
+            genericLocation = {1, 0, 1, 0},
+            offset = 12)
+    @TestClass("Outer$Inner")
+    public String testMethodNestingRepeatableAnnotation2() {
+        return "class Outer {\n" +
+                " class Inner {\n" +
+                "  void foo() {\n" +
+                "    class MInner {}\n" +
+                "    Object o1 = new @RTA @RTA Outer . @RTB @RTB Inner();" +
+                "    Object o2 = new @RTC @RTC MInner();\n" +
+                "  }\n" +
+                "}}\n";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_EXTENDS,
+            genericLocation = {}, typeIndex = -1)
+    @TADescription(annotation = "RTBs", type = CLASS_EXTENDS,
+            genericLocation = {3, 0}, typeIndex = -1)
+    @TADescription(annotation = "RTCs", type = CLASS_EXTENDS,
+            genericLocation = {3, 1}, typeIndex = -1)
+    @TADescription(annotation = "RTDs", type = CLASS_EXTENDS,
+            genericLocation = {1, 0}, typeIndex = -1)
+    @TADescription(annotation = "RTEs", type = CLASS_EXTENDS,
+            genericLocation = {1, 0, 3, 0}, typeIndex = -1)
+    @TADescription(annotation = "RTFs", type = CLASS_EXTENDS,
+            genericLocation = {1, 0, 3, 1}, typeIndex = -1)
+    @TestClass("GOuter$GInner$Test")
+    public String testExtendsRepeatableAnnotation1() {
+        return "class GOuter<A, B> {\n" +
+                "  class GInner<X, Y> {\n" +
+                "    class Test extends @RTA @RTA GOuter<@RTB @RTB String," +
+                " @RTC @RTC String>.@RTD @RTD GInner<@RTE @RTE String, @RTF @RTF String> {}" +
+                "  }" +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = CLASS_TYPE_PARAMETER,
+            genericLocation = {}, paramIndex = 0)
+    @TADescription(annotation = "RTBs", type = CLASS_TYPE_PARAMETER_BOUND,
+            genericLocation = {}, paramIndex = 0, boundIndex = 0)
+    @TADescription(annotation = "RTCs", type = FIELD,
+            genericLocation = {})
+    @TADescription(annotation = "RTDs", type = FIELD,
+            genericLocation = {3, 0})
+    @TestClass("%TEST_CLASS_NAME%$1Nested")
+    public String testNestedInMethodRepeatableAnnotation1() {
+        return "class %TEST_CLASS_NAME% {\n" +
+                "  void foobar() {\n" +
+                "    class Nested<@RTA @RTA X extends @RTB @RTB Object> {\n" +
+                "      @RTC @RTC List<@RTD @RTD Object> f;\n" +
+                "    }\n" +
+                "  }" +
+                "}";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java
index 30913b1..8bcddc4 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/NewObjects.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for new object creations
  * @compile -g Driver.java ReferenceInfoUtil.java NewObjects.java
  * @run main Driver NewObjects
@@ -36,11 +37,9 @@
         return "Object returnObject() { return new @TA String(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnObjectGeneric() {
         return "Object returnObjectGeneric() { return new @TA ArrayList<@TB String>(); }";
     }
@@ -50,13 +49,11 @@
         return "void initObject() { Object a =  new @TA String(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = NEW,
-                genericLocation = { 3, 1 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = NEW,
+            genericLocation = { 3, 1 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String initObjectGeneric() {
         return "void initObjectGeneric() { Object a = new @TA HashMap<@TB String, @TC String>(); }";
     }
@@ -66,90 +63,182 @@
         return "void eqtestObject() { if (null == new @TA String()); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String eqtestObjectGeneric() {
         return "void eqtestObjectGeneric() { if (null == new @TA ArrayList<@TB String >()); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0}),
-        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnNewArray1() {
         return "Object returnNewArray1() { return new @TA String @TB[1]; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0}),
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
     public String returnNewArray2() {
         return "Object returnNewArray2() { return new @TA String @TB [1] @TC [2]; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0}),
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
     public String returnNewArray3() {
         return "Object returnNewArray3() { return new @TA Outer. @TB Inner @TC [1] @TD [2]; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0}),
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
     public String returnNewArray4() {
         return "Object returnNewArray4() { return new @TA Outer. @TB Middle. @TC MInner @TD [1] @TE [2]; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {3, 0, 0, 0, 0, 0}),
-        @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0}),
-        @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {3, 0}),
-        @TADescription(annotation = "TF", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {3, 0, 0, 0}),
-    })
+    @TADescription(annotation = "TA", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "TC", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TD", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "TE", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "TF", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0})
     public String returnNewArray5() {
         return "Object returnNewArray5() { return new @TA ArrayList<@TB Outer. @TC Middle. @TD MInner @TE [] @TF []>(); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0}),
-        @TADescription(annotation = "TB", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                genericLocation = {0, 0, 0, 0, 1, 0}),
-        @TADescription(annotation = "TC", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TD", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
-        genericLocation = {0, 0}),
-    })
+    @TADescription(annotation = "TA", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "TB", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "TC", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TD", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+    genericLocation = {0, 0})
     public String arrayField() {
         return "@TA Outer. @TB Inner @TC [] @TD [] f;";
     }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnObjectRepeatableAnnotation() {
+        return "Object returnObject() { return new @RTA @RTA String(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnObjectGenericRepeatableAnnotation() {
+        return "Object returnObjectGeneric() { return new @RTA @RTA ArrayList<@RTB @RTB String>(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String initObjectRepeatableAnnotation() {
+        return "void initObject() { Object a =  new @RTA @RTA String(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = NEW,
+            genericLocation = { 3, 1 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String initObjectGenericRepeatableAnnotation() {
+        return "void initObjectGeneric() { Object a = new @RTA @RTA HashMap<@RTB @RTB String, @RTC @RTC String>(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String eqtestObjectRepeatableAnnotation() {
+        return "void eqtestObject() { if (null == new @RTA @RTA String()); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String eqtestObjectGenericRepeatableAnnotation() {
+        return "void eqtestObjectGeneric() { if (null == new @RTA @RTA ArrayList<@RTB @RTB String >()); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnNewArrayRepeatableAnnotation1() {
+        return "Object returnNewArray1() { return new @RTA @RTA String @RTB @RTB[1]; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    public String returnNewArrayRepeatableAnnotation2() {
+        return "Object returnNewArray2() { return new @RTA @RTA String @RTB @RTB [1] @RTC @RTC [2]; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    public String returnNewArrayRepeatableAnnotation3() {
+        return "Object returnNewArray3() { return new @RTA @RTA Outer. @RTB @RTB Inner @RTC @RTC [1] @RTD @RTD [2]; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTEs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    public String returnNewArrayRepeatableAnnotation4() {
+        return "Object returnNewArray4() { return new @RTA @RTA Outer." +
+                " @RTB @RTB Middle. @RTC @RTC MInner @RTD @RTD [1] @RTE @RTE [2]; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0})
+    @TADescription(annotation = "RTCs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTDs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0, 0, 0, 1, 0, 1, 0})
+    @TADescription(annotation = "RTEs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "RTFs", type = NEW, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {3, 0, 0, 0})
+    public String returnNewArrayRepeatableAnnotation5() {
+        return "Object returnNewArray5() { return new @RTA @RTA ArrayList<@RTB @RTB Outer." +
+                " @RTC @RTC Middle. @RTD @RTD MInner @RTE @RTE [] @RTF @RTF []>(); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0})
+    @TADescription(annotation = "RTBs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0, 0, 0, 1, 0})
+    @TADescription(annotation = "RTCs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTDs", type = FIELD, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            genericLocation = {0, 0})
+    public String arrayFieldRepeatableAnnotation() {
+        return "@RTA @RTA Outer. @RTB @RTB Inner @RTC @RTC [] @RTD @RTD [] f;";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ReferenceInfoUtil.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ReferenceInfoUtil.java
index 0577c8b..8ed0925 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ReferenceInfoUtil.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ReferenceInfoUtil.java
@@ -41,7 +41,7 @@
     public static final int IGNORE_VALUE = -321;
 
     public static List<TypeAnnotation> extendedAnnotationsOf(ClassFile cf) {
-        List<TypeAnnotation> annos = new ArrayList<TypeAnnotation>();
+        List<TypeAnnotation> annos = new ArrayList<>();
         findAnnotations(cf, annos);
         return annos;
     }
@@ -119,128 +119,6 @@
         }
     }
 
-    /////////////////// TA Position Builder ///////////////////////
-    /* TODO: comment out this dead code. Was this unfinished code that was
-     * supposed to be used somewhere? The tests pass without this.
-    private static class TAPositionBuilder {
-        private TypeAnnotation.Position pos = new TypeAnnotation.Position();
-
-        private TAPositionBuilder() { }
-
-        public TypeAnnotation.Position build() { return pos; }
-
-        public static TAPositionBuilder ofType(TypeAnnotation.TargetType type) {
-            TAPositionBuilder builder = new TAPositionBuilder();
-            builder.pos.type = type;
-            return builder;
-        }
-
-        public TAPositionBuilder atOffset(int offset) {
-            switch (pos.type) {
-            // type cast
-            case TYPECAST:
-            // instanceof
-            case INSTANCEOF:
-            // new expression
-            case NEW:
-                pos.offset = offset;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atLocalPosition(int offset, int length, int index) {
-            switch (pos.type) {
-            // local variable
-            case LOCAL_VARIABLE:
-                pos.lvarOffset = new int[] { offset };
-                pos.lvarLength = new int[] { length };
-                pos.lvarIndex  = new int[] { index  };
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atParameterIndex(int index) {
-            switch (pos.type) {
-            // type parameters
-            case CLASS_TYPE_PARAMETER:
-            case METHOD_TYPE_PARAMETER:
-            // method parameter
-            case METHOD_FORMAL_PARAMETER:
-                pos.parameter_index = index;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atParamBound(int param, int bound) {
-            switch (pos.type) {
-            // type parameters bounds
-            case CLASS_TYPE_PARAMETER_BOUND:
-            case METHOD_TYPE_PARAMETER_BOUND:
-                pos.parameter_index = param;
-                pos.bound_index = bound;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atWildcardPosition(TypeAnnotation.Position pos) {
-            switch (pos.type) {
-            // wildcards
-            case WILDCARD_BOUND:
-                pos.wildcard_position = pos;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atTypeIndex(int index) {
-            switch (pos.type) {
-            // class extends or implements clauses
-            case CLASS_EXTENDS:
-            // throws
-            case THROWS:
-                pos.type_index = index;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atOffsetWithIndex(int offset, int index) {
-            switch (pos.type) {
-            // method type argument: wasn't specified
-            case NEW_TYPE_ARGUMENT:
-            case METHOD_TYPE_ARGUMENT:
-                pos.offset = offset;
-                pos.type_index = index;
-                break;
-            default:
-                throw new IllegalArgumentException("invalid field for given type: " + pos.type);
-            }
-            return this;
-        }
-
-        public TAPositionBuilder atGenericLocation(Integer ...loc) {
-            pos.location = Arrays.asList(loc);
-            pos.type = pos.type.getGenericComplement();
-            return this;
-        }
-    }*/
-
     /////////////////////// Equality testing /////////////////////
     private static boolean areEquals(int a, int b) {
         return a == b || a == IGNORE_VALUE || b == IGNORE_VALUE;
@@ -264,21 +142,18 @@
     }
 
     public static boolean areEquals(TypeAnnotation.Position p1, TypeAnnotation.Position p2) {
-        if (p1 == p2)
-            return true;
-        if (p1 == null || p2 == null)
-            return false;
+        return p1 == p2 || !(p1 == null || p2 == null) &&
+                p1.type == p2.type &&
+                (p1.location.equals(p2.location)) &&
+                areEquals(p1.offset, p2.offset) &&
+                areEquals(p1.lvarOffset, p2.lvarOffset) &&
+                areEquals(p1.lvarLength, p2.lvarLength) &&
+                areEquals(p1.lvarIndex, p2.lvarIndex) &&
+                areEquals(p1.bound_index, p2.bound_index) &&
+                areEquals(p1.parameter_index, p2.parameter_index) &&
+                areEquals(p1.type_index, p2.type_index) &&
+                areEquals(p1.exception_index, p2.exception_index);
 
-        return ((p1.type == p2.type)
-                && (p1.location.equals(p2.location))
-                && areEquals(p1.offset, p2.offset)
-                && areEquals(p1.lvarOffset, p2.lvarOffset)
-                && areEquals(p1.lvarLength, p2.lvarLength)
-                && areEquals(p1.lvarIndex, p2.lvarIndex)
-                && areEquals(p1.bound_index, p2.bound_index)
-                && areEquals(p1.parameter_index, p2.parameter_index)
-                && areEquals(p1.type_index, p2.type_index)
-                && areEquals(p1.exception_index, p2.exception_index));
     }
 
     private static TypeAnnotation findAnnotation(String name, List<TypeAnnotation> annotations, ClassFile cf) throws InvalidIndex, UnexpectedEntry {
@@ -306,9 +181,6 @@
             if (actual == null)
                 throw new ComparisionException("Expected annotation not found: " + aName);
 
-            // TODO: you currently get an exception if the test case does not use all necessary
-            // annotation attributes, e.g. forgetting the offset for a local variable.
-            // It would be nicer to give an understandable warning instead.
             if (!areEquals(expected, actual.position)) {
                 throw new ComparisionException("Unexpected position for annotation : " + aName +
                         "\n  Expected: " + expected.toString() +
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ResourceVariable.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ResourceVariable.java
new file mode 100644
index 0000000..b4eae54
--- /dev/null
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/ResourceVariable.java
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2012, 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.
+ */
+
+/*
+ * @test
+ * @bug 8042451
+ * @summary Test population of reference info for resource variable
+ * @compile -g Driver.java ReferenceInfoUtil.java ResourceVariable.java
+ * @run main Driver ResourceVariable
+ */
+
+import static com.sun.tools.classfile.TypeAnnotation.TargetType.RESOURCE_VARIABLE;
+import static java.lang.System.lineSeparator;
+
+public class ResourceVariable {
+
+    @TADescription(annotation = "TA", type = RESOURCE_VARIABLE,
+            lvarOffset = {10}, lvarLength = {118}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = RESOURCE_VARIABLE,
+            lvarOffset = {22}, lvarLength = {35}, lvarIndex = {3})
+    public String testResourceVariable() {
+        return
+                "public void f() throws IOException {" + lineSeparator() +
+                "    try (@TA InputStream is1 = new FileInputStream(\"\")) {" + lineSeparator() +
+                "        try (@TB InputStream is2 = new FileInputStream(\"\")) {}" + lineSeparator() +
+                "    }" + lineSeparator() +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = RESOURCE_VARIABLE,
+            lvarOffset = {10}, lvarLength = {30}, lvarIndex = {1})
+    public String testRepeatedAnnotation1() {
+        return
+                "public void f() throws IOException {" + lineSeparator() +
+                "    try (@RTA @RTA InputStream is1 = new FileInputStream(\"\")) {}" + lineSeparator() +
+                "}";
+    }
+
+    @TADescription(annotation = "RTAs", type = RESOURCE_VARIABLE,
+            lvarOffset = {10}, lvarLength = {30}, lvarIndex = {1})
+    public String testRepeatedAnnotation2() {
+        return
+                "public void f() throws IOException {" + lineSeparator() +
+                "    try (@RTAs({@RTA, @RTA}) InputStream is1 = new FileInputStream(\"\")) {}" + lineSeparator() +
+                "}";
+    }
+
+    @TADescription(annotation = "TA", type = RESOURCE_VARIABLE,
+            lvarOffset = {10}, lvarLength = {118}, lvarIndex = {1})
+    @TADescription(annotation = "TB", type = RESOURCE_VARIABLE,
+            lvarOffset = {22}, lvarLength = {35}, lvarIndex = {3})
+    public String testSeveralVariablesInTryWithResources() {
+        return
+                "public void f() throws IOException {" + lineSeparator() +
+                        "    try (@TA InputStream is1 = new FileInputStream(\"\");" + lineSeparator() +
+                        "        @TB InputStream is2 = new FileInputStream(\"\")) {}" + lineSeparator() +
+                        "}";
+    }
+}
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeCasts.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeCasts.java
index e8c5798..dd7b567 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeCasts.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeCasts.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for type casts
  * @compile -g Driver.java ReferenceInfoUtil.java TypeCasts.java
  * @run main Driver TypeCasts
@@ -37,27 +38,23 @@
         return "Object returnObject() { return (@TA String)null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TC", type = CAST,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TC", type = CAST,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String returnObjectArray() {
         return "Object returnObjectArray() { return (@TC String @TA [] @TB [])null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String returnObjectGeneric() {
         return "Object returnObjectGeneric() { return (@TA List<@TB String>)null; }";
     }
@@ -68,13 +65,11 @@
         return "Object returnPrim() { return (@TA int)0; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String returnPrimArray() {
         return "Object returnPrimArray() { return (@TB int @TA [])null; }";
     }
@@ -85,24 +80,20 @@
         return "void initObject() { Object a =  (@TA String)null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String initObjectArray() {
         return "void initObjectArray() { Object a = (@TB String @TA [])null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String initObjectGeneric() {
         return "void initObjectGeneric() { Object a = (@TA List<@TB String>)null; }";
     }
@@ -113,13 +104,11 @@
         return "void initPrim() { Object a =  (@TA int)0; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String initPrimArray() {
         return "void initPrimArray() { Object a = (@TB int @TA [])null; }";
     }
@@ -130,24 +119,20 @@
         return "void eqtestObject() { if (null == (@TA String)null); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String eqtestObjectArray() {
         return "void eqtestObjectArray() { if (null == (@TB String @TA [])null); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String eqtestObjectGeneric() {
         return "void eqtestObjectGeneric() { if (null == (@TA List<@TB String >)null); }";
     }
@@ -159,42 +144,182 @@
         return "void eqtestPrim(int a) { if (0 == (@TA int)a); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
-                typeIndex = 0)
-    })
+    @TADescription(annotation = "TA", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
     public String eqtestPrimArray() {
         return "void eqtestPrimArray() { if (null == (@TB int @TA [])null); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1),
-        @TADescription(annotation = "TC", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
-                genericLocation = {3, 0})
-    })
+    @TADescription(annotation = "TA", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1)
+    @TADescription(annotation = "TC", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
+            genericLocation = {3, 0})
     public String intersection1() {
         return "void intersection() { Object o = (@TA String & @TB Comparable<@TC String>) null; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0),
-        @TADescription(annotation = "TB", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1),
-        @TADescription(annotation = "TC", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
-                genericLocation = {3, 0}),
-        @TADescription(annotation = "TD", type = CAST,
-                offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 2),
-    })
+    @TADescription(annotation = "TA", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0)
+    @TADescription(annotation = "TB", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1)
+    @TADescription(annotation = "TC", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "TD", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 2)
     public String intersection2() {
         return "void intersection() { Object o = (@TA String & @TB Comparable<@TC String> & @TD CharSequence) null; }";
     }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnObjectRepeatableAnnotation() {
+        return "Object returnObject() { return (@RTA @RTA String)null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTCs", type = CAST,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnObjectArrayRepeatableAnnotation() {
+        return "Object returnObjectArray() { return (@RTC @RTC String @RTA @RTA [] @RTB @RTB [])null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnObjectGenericRepeatableAnnotation() {
+        return "Object returnObjectGeneric() { return (@RTA @RTA List<@RTB @RTB String>)null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnPrimRepeatableAnnotation() {
+        return "Object returnPrim() { return (@RTA @RTA int)0; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String returnPrimArrayRepeatableAnnotation() {
+        return "Object returnPrimArray() { return (@RTB @RTB int @RTA @RTA [])null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String initObjectRepeatableAnnotation() {
+        return "void initObject() { Object a =  (@RTA @RTA String)null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String initObjectArrayRepeatableAnnotation() {
+        return "void initObjectArray() { Object a = (@RTB @RTB String @RTA @RTA [])null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String initObjectGenericRepeatableAnnotation() {
+        return "void initObjectGeneric() { Object a = (@RTA @RTA List<@RTB @RTB String>)null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String initPrimRepeatableAnnotation() {
+        return "void initPrim() { Object a =  (@RTA @RTA int)0; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String initPrimArrayRepeatableAnnotation() {
+        return "void initPrimArray() { Object a = (@RTB @RTB int @RTA @RTA [])null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String eqtestObjectRepeatableAnnotation() {
+        return "void eqtestObject() { if (null == (@RTA @RTA String)null); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String eqtestObjectArrayRepeatableAnnotation() {
+        return "void eqtestObjectArray() { if (null == (@RTB @RTB String @RTA @RTA [])null); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 3, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String eqtestObjectGenericRepeatableAnnotation() {
+        return "void eqtestObjectGeneric() { if (null == (@RTA @RTA List<@RTB @RTB String >)null); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    // compiler optimizes away compile time constants casts
+    public String eqtestPrimRepeatableAnnotation() {
+        return "void eqtestPrim(int a) { if (0 == (@RTA @RTA int)a); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE,
+            typeIndex = 0)
+    public String eqtestPrimArrayRepeatableAnnotation() {
+        return "void eqtestPrimArray() { if (null == (@RTB @RTB int @RTA @RTA [])null); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1)
+    @TADescription(annotation = "RTCs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
+            genericLocation = {3, 0})
+    public String intersectionRepeatableAnnotation1() {
+        return "void intersection() { Object o = (@RTA @RTA String & @RTB @RTB Comparable<@RTC @RTC String>) null; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 0)
+    @TADescription(annotation = "RTBs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1)
+    @TADescription(annotation = "RTCs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 1,
+            genericLocation = {3, 0})
+    @TADescription(annotation = "RTDs", type = CAST,
+            offset = ReferenceInfoUtil.IGNORE_VALUE, typeIndex = 2)
+    public String intersectionRepeatableAnnotation2() {
+        return "void intersection() { Object o = (@RTA @RTA String & @RTB @RTB Comparable<@RTC @RTC String> &" +
+                " @RTD @RTD CharSequence) null; }";
+    }
 }
diff --git a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeTests.java b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeTests.java
index 8d26acf..6af89f3 100644
--- a/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeTests.java
+++ b/langtools/test/tools/javac/annotations/typeAnnotations/referenceinfos/TypeTests.java
@@ -25,6 +25,7 @@
 
 /*
  * @test
+ * @bug 8042451
  * @summary Test population of reference info for class literals
  * @compile -g Driver.java ReferenceInfoUtil.java TypeTests.java
  * @run main Driver TypeTests
@@ -36,26 +37,22 @@
         return "Object returnObject() { return null instanceof @TA String; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnObjectArray() {
         return "Object returnObjectArray() { return null instanceof @TC String @TA [] @TB []; }";
     }
 
     // no type test for primitives
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String returnPrimArray() {
         return "Object returnPrimArray() { return null instanceof @TC int @TA [] @TB []; }";
     }
@@ -68,26 +65,22 @@
         return "void initObject() { Object a =  null instanceof @TA String; }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String initObjectArray() {
         return "void initObjectArray() { Object a = null instanceof @TC String @TA [] @TB []; }";
     }
 
     // no primitive instanceof
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String initPrimArray() {
         return "void initPrimArray() { Object a = null instanceof @TC int @TA [] @TB []; }";
     }
@@ -100,26 +93,22 @@
         return "void eqtestObject() { if (true == (null instanceof @TA String)); }";
     }
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String eqtestObjectArray() {
         return "void eqtestObjectArray() { if (true == (null instanceof @TC String @TA [] @TB [])); }";
     }
 
     // no primitives
 
-    @TADescriptions({
-        @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TB", type = INSTANCEOF,
-                genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE),
-        @TADescription(annotation = "TC", type = INSTANCEOF,
-                genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
-    })
+    @TADescription(annotation = "TA", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TB", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "TC", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
     public String eqtestPrimArray() {
         return "void eqtestPrimArray() { if (true == (null instanceof @TC int @TA [] @TB [])); }";
     }
@@ -127,4 +116,72 @@
     // no void
     // no void array
 
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnObjectRepeatableAnnotation() {
+        return "Object returnObject() { return null instanceof @RTA @RTA String; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnObjectArrayRepeatableAnnotation() {
+        return "Object returnObjectArray() { return null instanceof @RTC @RTC String @RTA @RTA [] @RTB @RTB []; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String returnPrimArrayRepeatableAnnotation() {
+        return "Object returnPrimArrayRepeatableAnnotation() { return null instanceof @RTC @RTC int @RTA @RTA [] @RTB @RTB []; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String initObjectRepeatableAnnotation() {
+        return "void initObject() { Object a =  null instanceof @RTA @RTA String; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String initObjectArrayRepeatableAnnotation() {
+        return "void initObjectArray() { Object a = null instanceof @RTC @RTC String @RTA @RTA [] @RTB @RTB []; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String initPrimArrayRepeatableAnnotation() {
+        return "void initPrimArray() { Object a = null instanceof @RTC @RTC int @RTA @RTA [] @RTB @RTB []; }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String eqtestObjectRepeatableAnnotation() {
+        return "void eqtestObject() { if (true == (null instanceof @RTA @RTA String)); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String eqtestObjectArrayRepeatableAnnotation() {
+        return "void eqtestObjectArray() { if (true == (null instanceof @RTC @RTC String @RTA @RTA [] @RTB @RTB [])); }";
+    }
+
+    @TADescription(annotation = "RTAs", type = INSTANCEOF, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTBs", type = INSTANCEOF,
+            genericLocation = { 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    @TADescription(annotation = "RTCs", type = INSTANCEOF,
+            genericLocation = { 0, 0, 0, 0 }, offset = ReferenceInfoUtil.IGNORE_VALUE)
+    public String eqtestPrimArrayRepeatableAnnotation() {
+        return "void eqtestPrimArray() { if (true == (null instanceof @RTC @RTC int @RTA @RTA [] @RTB @RTB [])); }";
+    }
 }
diff --git a/langtools/test/tools/javac/api/TestSearchPaths.java b/langtools/test/tools/javac/api/TestSearchPaths.java
new file mode 100644
index 0000000..4e2a4ff
--- /dev/null
+++ b/langtools/test/tools/javac/api/TestSearchPaths.java
@@ -0,0 +1,632 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 7026941
+ * @summary path options ignored when reusing filemanager across tasks
+ */
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.net.URI;
+import java.nio.file.Files;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.EnumSet;
+import java.util.List;
+import java.util.Objects;
+import java.util.jar.JarEntry;
+import java.util.jar.JarOutputStream;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import javax.tools.JavaCompiler;
+import javax.tools.JavaCompiler.CompilationTask;
+import javax.tools.JavaFileObject;
+import javax.tools.SimpleJavaFileObject;
+import javax.tools.StandardJavaFileManager;
+import javax.tools.StandardLocation;
+import javax.tools.ToolProvider;
+
+import static javax.tools.StandardLocation.*;
+
+/**
+ * Test for combinations of using javac command-line options and fileManager setLocation
+ * calls to affect the locations available in the fileManager.
+ *
+ * Using a single Java compiler and file manager, for each of the standard locations,
+ * a series of operations is performed, using either compiler options or setLocation
+ * calls. Each operation includes a compilation, and then a check for the value of
+ * the standard location available in the file manager.
+ *
+ * The operations generate and use unique files to minimize the possibility of false
+ * positive results.
+ */
+public class TestSearchPaths {
+
+    public static void main(String... args) throws Exception {
+        TestSearchPaths t = new TestSearchPaths();
+        t.run();
+    }
+
+    void run() throws Exception {
+        compiler = ToolProvider.getSystemJavaCompiler();
+        fileManager = compiler.getStandardFileManager(null, null, null);
+
+        // basic output path
+        testClassOutput();
+
+        // basic search paths
+        testClassPath();
+        testSourcePath();
+        testPlatformClassPath();
+
+        // annotation processing
+        testAnnotationProcessorPath();
+        testSourceOutput();
+
+        // javah equivalent
+        testNativeHeaderOutput();
+
+        // future-proof: guard against new StandardLocations being added
+        if (!tested.equals(EnumSet.allOf(StandardLocation.class))) {
+            error("not all standard locations have been tested");
+            out.println("not yet tested: " + EnumSet.complementOf(tested));
+        }
+
+        if (errors > 0) {
+            throw new Exception(errors + " errors occurred");
+        }
+    }
+
+    void testClassOutput() throws IOException {
+        String test = "testClassOutput";
+
+        for (int i = 1; i <= 5; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath());
+                    break;
+
+                case 3:
+                    setLocation(CLASS_OUTPUT, classes);
+                    options = null;
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class C" + i + " { }");
+            callTask(options, sources);
+            checkPath(CLASS_OUTPUT, Mode.EQUALS, classes);
+            checkFile(CLASS_OUTPUT, "C" + i + ".class");
+        }
+
+        tested.add(CLASS_OUTPUT);
+    }
+
+    void testClassPath() throws IOException {
+        String test = "testClassPath";
+
+        for (int i = 1; i <= 5; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            File classpath = new File("testClassOutput/" + i + "/classes");
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath(), "-classpath", classpath.getPath());
+                    break;
+
+                case 3:
+                    setLocation(CLASS_PATH, classpath);
+                    options = getOptions("-d", classes.getPath());
+                    break;
+
+                case 4:
+                    options = getOptions("-d", classes.getPath(), "-cp", classpath.getPath());
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class D" + i + " { C" + i + " c; }");
+            callTask(options, sources);
+            checkPath(CLASS_PATH, Mode.EQUALS, classpath);
+            checkFile(CLASS_OUTPUT, "D" + i + ".class");
+        }
+
+        tested.add(CLASS_PATH);
+    }
+
+    void testSourcePath() throws IOException {
+        String test = "testSourcePath";
+        setLocation(CLASS_PATH); // empty
+
+        for (int i = 1; i <= 5; i++) {
+            File src = createDir(test + "/" + i + "/src");
+            writeFile(src, "C" + i + ".java", "class C" + i + "{ }");
+            File classes = createDir(test + "/" + i + "/classes");
+            File srcpath = src;
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath(), "-sourcepath", srcpath.getPath());
+                    break;
+
+                case 3:
+                    setLocation(SOURCE_PATH, srcpath);
+                    options = getOptions("-d", classes.getPath());
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class D" + i + " { C" + i + " c; }");
+            callTask(options, sources);
+            checkPath(SOURCE_PATH, Mode.EQUALS, srcpath);
+            checkFile(CLASS_OUTPUT, "D" + i + ".class");
+        }
+
+        tested.add(SOURCE_PATH);
+    }
+
+    void testPlatformClassPath() throws IOException {
+        String test = "testPlatformClassPath";
+
+        List<File> defaultPath = getLocation(PLATFORM_CLASS_PATH);
+        StringBuilder sb = new StringBuilder();
+        for (File f: defaultPath) {
+            if (sb.length() > 0)
+                sb.append(File.pathSeparator);
+            sb.append(f);
+        }
+        String defaultPathString = sb.toString();
+
+        setLocation(CLASS_PATH); // empty
+        setLocation(SOURCE_PATH); // empty
+
+        for (int i = 1; i <= 10; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            File testJars = createDir(test + "/" + i + "/testJars");
+            File testClasses = createDir(test + "/" + i + "/testClasses");
+            callTask(getOptions("-d", testClasses.getPath()), getSources("class C" + i + " { }"));
+
+            List<String> options;
+            Mode mode;
+            List<File> match;
+            String reference = "C" + i + " c;";
+
+            File jar;
+
+            switch (i) {
+                case 1:
+                    options = getOptions("-d", classes.getPath(), "-Xbootclasspath/p:" + testClasses);
+                    mode = Mode.STARTS_WITH;
+                    match = Arrays.asList(testClasses);
+                    break;
+
+                case 2:
+                    // the default values for -extdirs and -endorseddirs come after the bootclasspath;
+                    // so to check -Xbootclasspath/a: we specify empty values for those options.
+                    options = getOptions("-d", classes.getPath(),
+                            "-Xbootclasspath/a:" + testClasses,
+                            "-extdirs", "",
+                            "-endorseddirs", "");
+                    mode = Mode.ENDS_WITH;
+                    match = Arrays.asList(testClasses);
+                    break;
+
+                case 3:
+                    options = getOptions("-d", classes.getPath(), "-Xbootclasspath:" + defaultPathString);
+                    mode = Mode.EQUALS;
+                    match = defaultPath;
+                    reference = "";
+                    break;
+
+                case 4:
+                    fileManager.setLocation(PLATFORM_CLASS_PATH, null);
+                    jar = new File(testJars, "j" + i + ".jar");
+                    writeJar(jar, testClasses, "C" + i + ".class");
+                    options = getOptions("-d", classes.getPath(), "-endorseddirs", testJars.getPath());
+                    mode = Mode.CONTAINS;
+                    match = Arrays.asList(jar);
+                    break;
+
+                case 5:
+                    fileManager.setLocation(PLATFORM_CLASS_PATH, null);
+                    jar = new File(testJars, "j" + i + ".jar");
+                    writeJar(jar, testClasses, "C" + i + ".class");
+                    options = getOptions("-d", classes.getPath(), "-Djava.endorsed.dirs=" + testJars.getPath());
+                    mode = Mode.CONTAINS;
+                    match = Arrays.asList(jar);
+                    break;
+
+                case 6:
+                    fileManager.setLocation(PLATFORM_CLASS_PATH, null);
+                    jar = new File(testJars, "j" + i + ".jar");
+                    writeJar(jar, testClasses, "C" + i + ".class");
+                    options = getOptions("-d", classes.getPath(), "-extdirs", testJars.getPath());
+                    mode = Mode.CONTAINS;
+                    match = Arrays.asList(jar);
+                    break;
+
+                case 7:
+                    fileManager.setLocation(PLATFORM_CLASS_PATH, null);
+                    jar = new File(testJars, "j" + i + ".jar");
+                    writeJar(jar, testClasses, "C" + i + ".class");
+                    options = getOptions("-d", classes.getPath(), "-Djava.ext.dirs=" + testJars.getPath());
+                    mode = Mode.CONTAINS;
+                    match = Arrays.asList(jar);
+                    break;
+
+                case 8:
+                    setLocation(PLATFORM_CLASS_PATH, defaultPath);
+                    options = getOptions("-d", classes.getPath());
+                    mode = Mode.EQUALS;
+                    match = defaultPath;
+                    reference = "";
+                    break;
+
+                default:
+                    options = getOptions("-d", classes.getPath(), "-bootclasspath", defaultPathString);
+                    mode = Mode.EQUALS;
+                    match = defaultPath;
+                    reference = "";
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class D" + i + " { " + reference + " }");
+
+            callTask(options, sources);
+            checkPath(PLATFORM_CLASS_PATH, mode, match);
+            checkFile(CLASS_OUTPUT, "D" + i + ".class");
+        }
+
+        tested.add(PLATFORM_CLASS_PATH);
+    }
+
+    void testAnnotationProcessorPath() throws IOException {
+        String test = "testAnnotationProcessorPath";
+
+        String template =
+                "import java.util.*;\n"
+                + "import javax.annotation.processing.*;\n"
+                + "import javax.lang.model.*;\n"
+                + "import javax.lang.model.element.*;\n"
+                + "@SupportedAnnotationTypes(\"*\")\n"
+                + "public class A%d extends AbstractProcessor {\n"
+                + "    public boolean process(Set<? extends TypeElement> annos, RoundEnvironment rEnv) {\n"
+                + "        return true;\n"
+                + "    }\n"
+                + "    public SourceVersion getSupportedSourceVersion() {\n"
+                + "        return SourceVersion.latest();\n"
+                + "    }\n"
+                + "}";
+
+        for (int i = 1; i <= 5; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            File annodir = createDir(test + "/" + i + "/processors");
+            callTask(getOptions("-d", annodir.getPath()), getSources(String.format(template, i)));
+            File annopath = annodir;
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath(),
+                            "-processorpath", annopath.getPath(),
+                            "-processor", "A" + i);
+                    break;
+
+                case 3:
+                    setLocation(ANNOTATION_PROCESSOR_PATH, annopath);
+                    options = getOptions("-d", classes.getPath(),
+                            "-processor", "A" + i);
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class D" + i + " { }");
+            callTask(options, sources);
+            checkPath(ANNOTATION_PROCESSOR_PATH, Mode.EQUALS, annopath);
+            checkFile(CLASS_OUTPUT, "D" + i + ".class");
+        }
+
+        tested.add(ANNOTATION_PROCESSOR_PATH);
+    }
+
+    void testSourceOutput() throws IOException {
+        String test = "testAnnotationProcessorPath";
+
+        String source =
+                "import java.io.*;\n"
+                + "import java.util.*;\n"
+                + "import javax.annotation.processing.*;\n"
+                + "import javax.lang.model.*;\n"
+                + "import javax.lang.model.element.*;\n"
+                + "import javax.tools.*;\n"
+                + "@SupportedOptions(\"name\")\n"
+                + "@SupportedAnnotationTypes(\"*\")\n"
+                + "public class A extends AbstractProcessor {\n"
+                + "    int round = 0;\n"
+                + "    public boolean process(Set<? extends TypeElement> annos, RoundEnvironment rEnv) {\n"
+                + "        if (round++ == 0) try {\n"
+                + "            String name = processingEnv.getOptions().get(\"name\");\n"
+                + "            JavaFileObject fo = processingEnv.getFiler().createSourceFile(name);\n"
+                + "            try (Writer out = fo.openWriter()) {\n"
+                + "                out.write(\"class \" + name + \" { }\");\n"
+                + "            }\n"
+                + "        } catch (IOException e) { throw new Error(e); }\n"
+                + "        return true;\n"
+                + "    }\n"
+                + "    public SourceVersion getSupportedSourceVersion() {\n"
+                + "        return SourceVersion.latest();\n"
+                + "    }\n"
+                + "}";
+
+        File annodir = createDir(test + "/processors");
+        callTask(getOptions("-d", annodir.getPath()), getSources(source));
+        setLocation(ANNOTATION_PROCESSOR_PATH, annodir);
+
+        for (int i = 1; i <= 5; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            File genSrc = createDir(test + "/" + "/genSrc");
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath(),
+                            "-processor", "A", "-Aname=G" + i,
+                            "-s", genSrc.getPath());
+                    break;
+
+                case 3:
+                    setLocation(SOURCE_OUTPUT, genSrc);
+                    options = getOptions("-d", classes.getPath(),
+                            "-processor", "A", "-Aname=G" + i);
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class D" + i + " { }");
+            callTask(options, sources);
+            checkPath(SOURCE_OUTPUT, Mode.EQUALS, genSrc);
+            checkFile(CLASS_OUTPUT, "D" + i + ".class");
+            checkFile(CLASS_OUTPUT, "G" + i + ".class");
+        }
+        tested.add(SOURCE_OUTPUT);
+    }
+
+    void testNativeHeaderOutput() throws IOException {
+        String test = "testNativeHeaderOutput";
+
+        for (int i = 1; i <= 5; i++) {
+            File classes = createDir(test + "/" + i + "/classes");
+            File headers = createDir(test + "/" + i + "/hdrs");
+            List<String> options;
+            switch (i) {
+                default:
+                    options = getOptions("-d", classes.getPath(), "-h", headers.getPath());
+                    break;
+
+                case 3:
+                    setLocation(NATIVE_HEADER_OUTPUT, headers);
+                    options = getOptions("-d", classes.getPath());
+                    break;
+            }
+            List<JavaFileObject> sources = getSources("class C" + i + " { native void m(); }");
+            callTask(options, sources);
+            checkPath(NATIVE_HEADER_OUTPUT, Mode.EQUALS, headers);
+            checkFile(NATIVE_HEADER_OUTPUT, "C" + i + ".h");
+        }
+
+        tested.add(StandardLocation.NATIVE_HEADER_OUTPUT);
+    }
+
+    List<String> getOptions(String... args) {
+        return Arrays.asList(args);
+    }
+
+    List<JavaFileObject> getSources(String... sources) {
+        List<JavaFileObject> list = new ArrayList<>();
+        for (String s: sources)
+            list.add(getSource(s));
+        return list;
+    }
+
+    JavaFileObject getSource(final String source) {
+        return new SimpleJavaFileObject(getURIFromSource(source), JavaFileObject.Kind.SOURCE) {
+            @Override
+            public CharSequence getCharContent(boolean ignoreEncodingErrors) {
+                return source;
+            }
+        };
+    }
+
+    void callTask(List<String> options, List<JavaFileObject> files) {
+        out.print("compile: ");
+        if (options != null) {
+            for (String o: options) {
+                if (o.length() > 64) {
+                    o = o.substring(0, 32) + "..." + o.substring(o.length() - 32);
+                }
+                out.print(" " + o);
+            }
+        }
+        for (JavaFileObject f: files)
+            out.print(" " + f.getName());
+        out.println();
+        CompilationTask t = compiler.getTask(out, fileManager, null, options, null, files);
+        boolean ok = t.call();
+        if (!ok)
+            error("compilation failed");
+    }
+
+    enum Mode { EQUALS, CONTAINS, STARTS_WITH, ENDS_WITH };
+
+    void checkFile(StandardLocation l, String path) {
+        if (!l.isOutputLocation()) {
+            error("Not an output location: " + l);
+            return;
+        }
+
+        List<File> files = getLocation(l);
+        if (files == null) {
+            error("location is unset: " + l);
+            return;
+        }
+
+        if (files.size() != 1)
+            error("unexpected number of entries on " + l + ": " + files.size());
+
+        File f = new File(files.get(0), path);
+        if (!f.exists())
+            error("file not found: " + f);
+    }
+
+    void checkPath(StandardLocation l, Mode m, File expect) {
+        checkPath(l, m, Arrays.asList(expect));
+    }
+
+    void checkPath(StandardLocation l, Mode m, List<File> expect) {
+        List<File> files = getLocation(l);
+        if (files == null) {
+            error("location is unset: " + l);
+            return;
+        }
+
+        switch (m) {
+            case EQUALS:
+                if (!Objects.equals(files, expect)) {
+                    error("location does not match the expected files: " + l);
+                    out.println("found:  " + files);
+                    out.println("expect: " + expect);
+                }
+                break;
+
+            case CONTAINS:
+                int containsIndex = Collections.indexOfSubList(files, expect);
+                if (containsIndex == -1) {
+                    error("location does not contain the expected files: " + l);
+                    out.println("found:  " + files);
+                    out.println("expect: " + expect);
+                }
+            break;
+
+            case STARTS_WITH:
+                int startsIndex = Collections.indexOfSubList(files, expect);
+                if (startsIndex != 0) {
+                    error("location does not start with the expected files: " + l);
+                    out.println("found:  " + files);
+                    out.println("expect: " + expect);
+                }
+            break;
+
+            case ENDS_WITH:
+                int endsIndex = Collections.lastIndexOfSubList(files, expect);
+                if (endsIndex != files.size() - expect.size()) {
+                    error("location does not end with the expected files: " + l);
+                    out.println("found:  " + files);
+                    out.println("expect: " + expect);
+                }
+            break;
+
+        }
+    }
+
+    List<File> getLocation(StandardLocation l) {
+        Iterable<? extends File> iter = fileManager.getLocation(l);
+        if (iter == null)
+            return null;
+        List<File> files = new ArrayList<>();
+        for (File f: iter)
+            files.add(f);
+        return files;
+    }
+
+    void setLocation(StandardLocation l, File... files) throws IOException {
+        fileManager.setLocation(l, Arrays.asList(files));
+    }
+
+    void setLocation(StandardLocation l, List<File> files) throws IOException {
+        fileManager.setLocation(l, files);
+    }
+
+    void writeFile(File dir, String path, String body) throws IOException {
+        try (FileWriter w = new FileWriter(new File(dir, path))) {
+            w.write(body);
+        }
+    }
+
+    void writeJar(File jar, File dir, String... entries) throws IOException {
+        try (JarOutputStream j = new JarOutputStream(Files.newOutputStream(jar.toPath()))) {
+            for (String entry: entries) {
+                j.putNextEntry(new JarEntry(entry));
+                j.write(Files.readAllBytes(dir.toPath().resolve(entry)));
+            }
+        }
+    }
+
+    private static final Pattern packagePattern
+            = Pattern.compile("package\\s+(((?:\\w+\\.)*)(?:\\w+))");
+    private static final Pattern classPattern
+            = Pattern.compile("(?:public\\s+)?(?:class|enum|interface)\\s+(\\w+)");
+
+
+    private static URI getURIFromSource(String source) {
+        String packageName = null;
+
+        Matcher matcher = packagePattern.matcher(source);
+        if (matcher.find()) {
+            packageName = matcher.group(1).replace(".", "/");
+        }
+
+        matcher = classPattern.matcher(source);
+        if (matcher.find()) {
+            String className = matcher.group(1);
+            String path = ((packageName == null) ? "" : packageName + "/") + className + ".java";
+            return URI.create("myfo:///" + path);
+        } else {
+            throw new Error("Could not extract the java class "
+                    + "name from the provided source");
+        }
+    }
+
+    File createDir(String path) {
+        File dir = new File(path);
+        dir.mkdirs();
+        return dir;
+    }
+
+    JavaCompiler compiler;
+    StandardJavaFileManager fileManager;
+
+    /**
+     * Map for recording which standard locations have been tested.
+     */
+    EnumSet<StandardLocation> tested = EnumSet.noneOf(StandardLocation.class);
+
+    /**
+     * Logging stream. Used directly with test and for getTask calls.
+     */
+    final PrintWriter out = new PrintWriter(System.err, true);
+
+    /**
+     * Count of errors so far.
+     */
+    int errors;
+
+    void error(String message) {
+        errors++;
+        out.println("Error: " + message);
+    }
+}
diff --git a/langtools/test/tools/javac/api/taskListeners/CompileEvent.java b/langtools/test/tools/javac/api/taskListeners/CompileEvent.java
new file mode 100644
index 0000000..6225b179
--- /dev/null
+++ b/langtools/test/tools/javac/api/taskListeners/CompileEvent.java
@@ -0,0 +1,148 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8033414
+ * @summary Verify that the TaskEvent.COMPILATION is fired properly.
+ * @run main CompileEvent
+ */
+
+import java.io.*;
+import java.util.*;
+
+import javax.tools.*;
+
+import com.sun.source.util.*;
+import com.sun.tools.javac.Main;
+import com.sun.tools.javac.api.BasicJavacTask;
+import com.sun.tools.javac.util.Context;
+import com.sun.tools.javac.util.Log;
+import com.sun.tools.javac.util.Log.WriterKind;
+
+public class CompileEvent {
+
+    public static void main(String... args) throws IOException {
+        new CompileEvent().run();
+    }
+
+    void run() throws IOException {
+        String testClasses = System.getProperty("test.classes");
+        File pluginRegistration =
+                new File(testClasses + "/META-INF/services/com.sun.source.util.Plugin");
+        pluginRegistration.getParentFile().mkdirs();
+        try (Writer metaInfRegistration = new FileWriter(pluginRegistration)) {
+            metaInfRegistration.write("CompileEvent$PluginImpl");
+        }
+        File test = new File(testClasses + "/Test.java");
+        test.getParentFile().mkdirs();
+        try (Writer testFileWriter = new FileWriter(test)) {
+            testFileWriter.write("public class Test { }");
+        }
+
+        StringWriter out;
+
+        //test events fired to listeners registered from plugins
+        //when starting compiler using Main.compile
+        out = new StringWriter();
+        int mainResult = Main.compile(new String[] {
+            "-Xplugin:compile-event", "-processorpath", testClasses, test.getAbsolutePath()
+        }, new PrintWriter(out, true));
+        if (mainResult != 0)
+            throw new AssertionError("Compilation failed unexpectedly, exit code: " + mainResult);
+        assertOutput(out);
+
+        JavaCompiler comp = ToolProvider.getSystemJavaCompiler();
+        StandardJavaFileManager fm = comp.getStandardFileManager(null, null, null);
+        Iterable<? extends JavaFileObject> testFileObjects = fm.getJavaFileObjects(test);
+
+        //test events fired to listeners registered from plugins
+        //when starting compiler using JavaCompiler.getTak(...).call
+        List<String> options =
+                Arrays.asList("-Xplugin:compile-event", "-processorpath", testClasses);
+        out = new StringWriter();
+        boolean compResult = comp.getTask(out, null, null, options, null, testFileObjects).call();
+        if (!compResult)
+            throw new AssertionError("Compilation failed unexpectedly.");
+        assertOutput(out);
+    }
+
+    void assertOutput(StringWriter out) {
+        String lineSeparator = System.getProperty("line.separator");
+        if (!out.toString().trim().replace(lineSeparator, "\n").equals(EXPECTED)) {
+            throw new AssertionError("Unexpected events: " + out.toString());
+        }
+    }
+
+    private static final String EXPECTED =
+        "started(COMPILATION)\n" +
+        "started(PARSE:Test.java)\n" +
+        "finished(PARSE:Test.java)\n" +
+        "started(ENTER:Test.java)\n" +
+        "finished(ENTER:Test.java)\n" +
+        "started(ANALYZE:Test.java:Test)\n" +
+        "finished(ANALYZE:Test.java:Test)\n" +
+        "started(GENERATE:Test.java:Test)\n" +
+        "finished(GENERATE:Test.java:Test)\n" +
+        "finished(COMPILATION)";
+
+    private static class TaskListenerImpl implements TaskListener {
+        private final PrintWriter out;
+        public TaskListenerImpl(PrintWriter out) {
+            this.out = out;
+        }
+        @Override public void started(TaskEvent e) {
+            dumpTaskEvent("started", e);
+        }
+        @Override public void finished(TaskEvent e) {
+            dumpTaskEvent("finished", e);
+        }
+        private void dumpTaskEvent(String type, TaskEvent e) {
+            StringBuilder data = new StringBuilder();
+            data.append(type);
+            data.append("(");
+            data.append(e.getKind());
+            if (e.getSourceFile() != null) {
+                data.append(":");
+                data.append(new File(e.getSourceFile().getName()).getName());
+            }
+            if (e.getTypeElement()!= null) {
+                data.append(":");
+                data.append(e.getTypeElement().getQualifiedName());
+            }
+            data.append(")");
+            out.println(data);
+        }
+    }
+
+    public static final class PluginImpl implements Plugin {
+        @Override public String getName() {
+            return "compile-event";
+        }
+        @Override public void init(JavacTask task, String... args) {
+            Context context = ((BasicJavacTask) task).getContext();
+            Log log = Log.instance(context);
+            task.addTaskListener(new TaskListenerImpl(log.getWriter(WriterKind.NOTICE)));
+        }
+    }
+}
diff --git a/langtools/test/tools/javac/api/taskListeners/TestSimpleAddRemove.java b/langtools/test/tools/javac/api/taskListeners/TestSimpleAddRemove.java
index e102b09..e45aeb1 100644
--- a/langtools/test/tools/javac/api/taskListeners/TestSimpleAddRemove.java
+++ b/langtools/test/tools/javac/api/taskListeners/TestSimpleAddRemove.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -287,10 +287,16 @@
                         found = "{}";
                         break;
                     case REMOVE_IN_PROCESSOR:
-                        found = "{PARSE=1:1, ENTER=2:2, ANNOTATION_PROCESSING=1:0, ANNOTATION_PROCESSING_ROUND=2:1}";
+                        if (ck == CompileKind.CALL)
+                            found = "{PARSE=1:1, ENTER=2:2, ANNOTATION_PROCESSING=1:0, ANNOTATION_PROCESSING_ROUND=2:1, COMPILATION=1:0}";
+                        else
+                            found = "{PARSE=1:1, ENTER=2:2, ANNOTATION_PROCESSING=1:0, ANNOTATION_PROCESSING_ROUND=2:1}";
                         break;
                     case REMOVE_IN_LISTENER:
-                        found = "{PARSE=1:1, ENTER=3:3, ANALYZE=1:1, GENERATE=1:0, ANNOTATION_PROCESSING=1:1, ANNOTATION_PROCESSING_ROUND=2:2}";
+                        if (ck == CompileKind.CALL)
+                            found = "{PARSE=1:1, ENTER=3:3, ANALYZE=1:1, GENERATE=1:0, ANNOTATION_PROCESSING=1:1, ANNOTATION_PROCESSING_ROUND=2:2, COMPILATION=1:0}";
+                        else
+                            found = "{PARSE=1:1, ENTER=3:3, ANALYZE=1:1, GENERATE=1:0, ANNOTATION_PROCESSING=1:1, ANNOTATION_PROCESSING_ROUND=2:2}";
                         break;
                     default:
                         throw new IllegalStateException();
@@ -302,7 +308,10 @@
                 switch (rk) {
                     // Remove will fail (too early), so events to end will be recorded
                     case REMOVE_IN_TASK:
-                        found = "{ENTER=2:2, ANALYZE=1:1, GENERATE=1:1, ANNOTATION_PROCESSING=0:1, ANNOTATION_PROCESSING_ROUND=1:2}";
+                        if (ck == CompileKind.CALL)
+                            found = "{ENTER=2:2, ANALYZE=1:1, GENERATE=1:1, ANNOTATION_PROCESSING=0:1, ANNOTATION_PROCESSING_ROUND=1:2, COMPILATION=0:1}";
+                        else
+                            found = "{ENTER=2:2, ANALYZE=1:1, GENERATE=1:1, ANNOTATION_PROCESSING=0:1, ANNOTATION_PROCESSING_ROUND=1:2}";
                         break;
                     case REMOVE_IN_PROCESSOR:
                         found = "{ENTER=1:1, ANNOTATION_PROCESSING_ROUND=1:1}";
@@ -321,7 +330,10 @@
                     // Remove will fail (too early, so events to end will be recorded
                     case REMOVE_IN_TASK:
                     case REMOVE_IN_PROCESSOR:
-                        found = "{ANALYZE=0:1, GENERATE=1:1}";
+                        if (ck == CompileKind.CALL)
+                            found = "{ANALYZE=0:1, GENERATE=1:1, COMPILATION=0:1}";
+                        else
+                            found = "{ANALYZE=0:1, GENERATE=1:1}";
                         break;
                     // Remove will succeed during "GENERATE.finished" event
                     case REMOVE_IN_LISTENER:
diff --git a/langtools/test/tools/javac/diags/ArgTypeCompilerFactory.java b/langtools/test/tools/javac/diags/ArgTypeCompilerFactory.java
index f8cab93..b97bf47 100644
--- a/langtools/test/tools/javac/diags/ArgTypeCompilerFactory.java
+++ b/langtools/test/tools/javac/diags/ArgTypeCompilerFactory.java
@@ -105,14 +105,13 @@
 
             Iterable<? extends JavaFileObject> fos = fm.getJavaFileObjectsFromFiles(files);
 
-            Context c = new Context();
-            ArgTypeMessages.preRegister(c);
-            ArgTypeJavaCompiler.preRegister(c);
+            Context c = initContext();
             JavacTaskImpl t = (JavacTaskImpl) tool.getTask(out, fm, null, opts, null, fos, c);
             return t.call();
         }
     }
 
+
     /**
      * Run the test using the standard simple entry point.
      */
@@ -135,10 +134,8 @@
                 args.add(f.getPath());
 
             Main main = new Main("javac", out);
-            Context c = new Context();
+            Context c = initContext();
             JavacFileManager.preRegister(c); // can't create it until Log has been set up
-            ArgTypeJavaCompiler.preRegister(c);
-            ArgTypeMessages.preRegister(c);
             Main.Result result = main.compile(args.toArray(new String[args.size()]), c);
 
             return result.isOK();
@@ -161,18 +158,25 @@
             for (File f: files)
                 args.add(f.getPath());
 
-            Context c = new Context();
+            Context c = initContext();
             JavacFileManager.preRegister(c); // can't create it until Log has been set up
-            ArgTypeJavaCompiler.preRegister(c);
-            ArgTypeMessages.preRegister(c);
             Main m = new Main("javac", out);
             Main.Result result = m.compile(args.toArray(new String[args.size()]), c);
 
             return result.isOK();
         }
-
     }
 
+    private static Context initContext() {
+        Context context = new Context();
+        ArgTypeMessages.preRegister(context);
+        Options options = Options.instance(context);
+        options.addListener(() -> {
+            Log log = Log.instance(context);
+            log.setDiagnosticFormatter(new ArgTypeDiagnosticFormatter(options));
+        });
+        return context;
+    }
 
     // <editor-fold defaultstate="collapsed" desc="Custom Javac components">
 
@@ -228,29 +232,6 @@
     }
 
     /**
-     * Trivial subtype of JavaCompiler to get access to the protected compilerKey field.
-     * The factory is used to ensure that the log is initialized with an instance of
-     * ArgTypeDiagnosticFormatter before we create the required JavaCompiler.
-     */
-    static class ArgTypeJavaCompiler extends JavaCompiler {
-        static void preRegister(Context context) {
-            context.put(compilerKey, new Context.Factory<JavaCompiler>() {
-                public JavaCompiler make(Context c) {
-                    Log log = Log.instance(c);
-                    Options options = Options.instance(c);
-                    log.setDiagnosticFormatter(new ArgTypeDiagnosticFormatter(options));
-                    return new JavaCompiler(c);
-                }
-            });
-        }
-
-        // not used
-        private ArgTypeJavaCompiler() {
-            super(null);
-        }
-    }
-
-    /**
      * Diagnostic formatter which "localizes" a message as a line
      * containing a key, and a possibly empty set of descriptive strings for the
      * arg types.
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/langtools/test/tools/javac/diags/examples/StaticIntfMethodInvokeNotSupported.java
similarity index 76%
copy from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
copy to langtools/test/tools/javac/diags/examples/StaticIntfMethodInvokeNotSupported.java
index ba34289..c448c13 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/langtools/test/tools/javac/diags/examples/StaticIntfMethodInvokeNotSupported.java
@@ -21,16 +21,12 @@
  * questions.
  */
 
-/*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
- * @library /testlibrary
- */
+// key: compiler.err.static.intf.method.invoke.not.supported.in.source
+// options: -source 7 -Xlint:-options
+import java.util.stream.Stream;
 
-public class TestStringDeduplicationMemoryUsage {
-    public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
+class StaticIntfMethodInvokeNotSupported {
+    void test() {
+        Stream.empty();
     }
 }
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/langtools/test/tools/javac/generics/inference/8043725/T8043725.java
similarity index 75%
copy from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
copy to langtools/test/tools/javac/generics/inference/8043725/T8043725.java
index ba34289..8bd1d03 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/langtools/test/tools/javac/generics/inference/8043725/T8043725.java
@@ -21,16 +21,16 @@
  * questions.
  */
 
-/*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
- * @library /testlibrary
+/**
+ * @test
+ * @bug 8043725
+ * @summary javac fails with StackOverflowException
+ * @compile T8043725.java
  */
-
-public class TestStringDeduplicationMemoryUsage {
-    public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
+class T8043725 {
+    <T extends Comparable<T>> T m(T v) {
+        //this will generate two upper bounds, T and Comparable<T'> respectively
+        //causing infinite recursion in lub (because of JLS 18.3.1).
+        return m(v);
     }
 }
diff --git a/langtools/test/tools/javac/generics/wildcards/7034495/T7034495.out b/langtools/test/tools/javac/generics/wildcards/7034495/T7034495.out
index 39c6f7f..58aa1f6 100644
--- a/langtools/test/tools/javac/generics/wildcards/7034495/T7034495.out
+++ b/langtools/test/tools/javac/generics/wildcards/7034495/T7034495.out
@@ -1,2 +1,2 @@
-T7034495.java:40:17: compiler.err.types.incompatible.diff.ret: T7034495.B<?>, T7034495.A<?>, foo()
+T7034495.java:40:17: compiler.err.types.incompatible.diff.ret: T7034495.B<compiler.misc.type.captureof: 1, ?>, T7034495.A<compiler.misc.type.captureof: 2, ?>, foo()
 1 error
diff --git a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java b/langtools/test/tools/javac/generics/wildcards/T8015101.java
similarity index 72%
copy from hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
copy to langtools/test/tools/javac/generics/wildcards/T8015101.java
index ba34289..02409a5 100644
--- a/hotspot/test/gc/g1/TestStringDeduplicationMemoryUsage.java
+++ b/langtools/test/tools/javac/generics/wildcards/T8015101.java
@@ -22,15 +22,23 @@
  */
 
 /*
- * @test TestStringDeduplicationMemoryUsage
- * @summary Test string deduplication memory usage
- * @bug 8029075
- * @key gc
- * @library /testlibrary
+ * @test
+ * @bug 8015101
+ * @summary Mishandling of wildcards in intersection member method check
+ * @compile T8015101.java
  */
+class T8015101 {
 
-public class TestStringDeduplicationMemoryUsage {
-    public static void main(String[] args) throws Exception {
-        TestStringDeduplicationTools.testMemoryUsage();
-    }
-}
+     public static class Bug<X extends Child<?, ?> & Runnable> {
+     }
+
+     interface Parent<C> {
+         public C get();
+     }
+
+     interface Child<C, S extends C> extends Parent<C> {
+         @Override
+         public S get();
+     }
+
+ }
diff --git a/langtools/test/tools/javac/lib/DPrinter.java b/langtools/test/tools/javac/lib/DPrinter.java
index 72d4fd8..544d21f 100644
--- a/langtools/test/tools/javac/lib/DPrinter.java
+++ b/langtools/test/tools/javac/lib/DPrinter.java
@@ -21,6 +21,12 @@
  * questions.
  */
 
+/* @test
+ * @bug 8043484
+ * @summary Make sure DPrinter.java compiles
+ * @compile DPrinter.java
+ */
+
 import java.io.File;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -403,7 +409,7 @@
                 printType("type", sym.type, Details.SUMMARY);
                 printType("erasure", sym.erasure_field, Details.SUMMARY);
                 sym.accept(symVisitor, null);
-                printAnnotations("annotations", sym.getAnnotations(), Details.SUMMARY);
+                printAnnotations("annotations", sym.getMetadata(), Details.SUMMARY);
                 indent(-1);
             }
         }
@@ -529,12 +535,16 @@
     public class TreeVisitor extends JCTree.Visitor {
         @Override
         public void visitTopLevel(JCCompilationUnit tree) {
-            printList("packageAnnotations", tree.packageAnnotations);
-            printTree("pid", tree.pid);
+            printList("packageAnnotations", tree.getPackageAnnotations());
             printList("defs", tree.defs);
         }
 
         @Override
+        public void visitPackageDef(JCPackageDecl tree) {
+            printTree("pid", tree.pid);
+        }
+
+        @Override
         public void visitImport(JCImport tree) {
             printTree("qualid", tree.qualid);
         }
@@ -945,12 +955,6 @@
      * visit method for its superclass.
      */
     public class TypeVisitor implements Type.Visitor<Void,Void> {
-        public Void visitAnnotatedType(AnnotatedType type, Void ignore) {
-            printList("typeAnnotations", type.getAnnotationMirrors());
-            printType("underlyingType", type.unannotatedType(), Details.FULL);
-            return visitType(type, null);
-        }
-
         public Void visitArrayType(ArrayType type, Void ignore) {
             printType("elemType", type.elemtype, Details.FULL);
             return visitType(type, null);
diff --git a/langtools/test/tools/javac/processing/6430209/T6430209.java b/langtools/test/tools/javac/processing/6430209/T6430209.java
index 9ecc01d..611819a 100644
--- a/langtools/test/tools/javac/processing/6430209/T6430209.java
+++ b/langtools/test/tools/javac/processing/6430209/T6430209.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -55,7 +55,7 @@
         // run annotation processor b6341534 so we can check diagnostics
         // -proc:only -processor b6341534 -cp . ./src/*.java
         String testSrc = System.getProperty("test.src", ".");
-        String testClasses = System.getProperty("test.classes") + System.getProperty("path.separator") + "../../lib";
+        String testClassPath = System.getProperty("test.class.path");
         JavacTool tool = JavacTool.create();
         MyDiagListener dl = new MyDiagListener();
         StandardJavaFileManager fm = tool.getStandardFileManager(dl, null, null);
@@ -64,7 +64,7 @@
             new File(testSrc, "test0.java"), new File(testSrc, "test1.java")));
         Iterable<String> opts = Arrays.asList("-proc:only",
                                               "-processor", "b6341534",
-                                              "-processorpath", testClasses);
+                                              "-processorpath", testClassPath);
         StringWriter out = new StringWriter();
         JavacTask task = tool.getTask(out, fm, dl, opts, null, files);
         task.call();
diff --git a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java
index 13fe97c..cf112459 100644
--- a/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java
+++ b/langtools/test/tools/javac/processing/model/element/TestAnonClassNames.java
@@ -96,9 +96,10 @@
         List<String> names = new ArrayList<String>();
         for(Class<?> clazz : classes) {
             String name = clazz.getName();
-            System.out.format("%s is %s%n",
-                              clazz.getName(),
-                              clazz.getAnnotation(Nesting.class).value());
+            Nesting annotation = clazz.getAnnotation(Nesting.class);
+            NestingKind expected = annotation == null ?
+                NestingKind.ANONYMOUS : annotation.value();
+            System.out.format("%s is %s%n", name, expected);
             testClassName(name);
             names.add(name);
         }
@@ -186,7 +187,11 @@
                                   typeElt.getKind().toString(),
                                   nestingKind.toString());
 
-                if (typeElt.getAnnotation(Nesting.class).value() != nestingKind) {
+                Nesting annotation = typeElt.getAnnotation(Nesting.class);
+                NestingKind expected = annotation == null ?
+                    NestingKind.ANONYMOUS : annotation.value();
+
+                if (expected != nestingKind) {
                     throw new RuntimeException("Mismatch of expected and reported nesting kind.");
                 }
             }
diff --git a/langtools/test/tools/javac/tree/TreePosTest.java b/langtools/test/tools/javac/tree/TreePosTest.java
index 8fed3e5..f172321 100644
--- a/langtools/test/tools/javac/tree/TreePosTest.java
+++ b/langtools/test/tools/javac/tree/TreePosTest.java
@@ -367,7 +367,9 @@
                     // and because of inconsistent nesting of left and right of
                     // array declarations:
                     //    e.g.    int[][] a = new int[2][];
+                    if (!(encl.tag == REFERENCE && self.tag == ANNOTATED_TYPE)) {
                     check("encl.start <= start", encl, self, encl.start <= self.start);
+                    }
                     check("start <= pos", encl, self, self.start <= self.pos);
                     if (!( (self.tag == TYPEARRAY ||
                             isAnnotatedArray(self.tree))
@@ -377,6 +379,8 @@
                                 isAnnotatedArray(encl.tree))
                            ||
                             encl.tag == ANNOTATED_TYPE && self.tag == SELECT
+                           ||
+                            encl.tag == REFERENCE && self.tag == ANNOTATED_TYPE
                          )) {
                         check("encl.pos <= start || end <= encl.pos",
                                 encl, self, encl.pos <= self.start || self.end <= encl.pos);
diff --git a/langtools/test/tools/javac/warnings/6747671/T6747671.out b/langtools/test/tools/javac/warnings/6747671/T6747671.out
index 518804d..d3628d2 100644
--- a/langtools/test/tools/javac/warnings/6747671/T6747671.out
+++ b/langtools/test/tools/javac/warnings/6747671/T6747671.out
@@ -8,5 +8,5 @@
 T6747671.java:32:20: compiler.warn.raw.class.use: T6747671.A, T6747671<E>.A<X>
 T6747671.java:33:16: compiler.warn.raw.class.use: T6747671.A.Z, T6747671<E>.A<X>.Z<Y>
 T6747671.java:36:9: compiler.warn.raw.class.use: @T6747671.TA T6747671.B, T6747671.B<X>
-T6747671.java:36:27: compiler.warn.raw.class.use: T6747671.B, T6747671.B<X>
+T6747671.java:36:27: compiler.warn.raw.class.use: @T6747671.TA T6747671.B, T6747671.B<X>
 11 warnings
diff --git a/langtools/test/tools/javac/warnings/suppress/T6480588.out b/langtools/test/tools/javac/warnings/suppress/T6480588.out
index 6e6f367..6470e0c 100644
--- a/langtools/test/tools/javac/warnings/suppress/T6480588.out
+++ b/langtools/test/tools/javac/warnings/suppress/T6480588.out
@@ -1,6 +1,6 @@
+T6480588.java:11:2: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
 T6480588.java:12:24: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
 T6480588.java:12:51: compiler.warn.has.been.deprecated: DeprecatedInterface, compiler.misc.unnamed.package
-T6480588.java:11:2: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
 T6480588.java:14:12: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
 T6480588.java:14:65: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
 T6480588.java:13:6: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
@@ -12,7 +12,7 @@
 T6480588.java:26:5: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
 T6480588.java:25:6: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
 T6480588.java:26:33: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
+T6480588.java:28:6: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
 T6480588.java:29:25: compiler.warn.has.been.deprecated: DeprecatedClass, compiler.misc.unnamed.package
 T6480588.java:29:52: compiler.warn.has.been.deprecated: DeprecatedInterface, compiler.misc.unnamed.package
-T6480588.java:28:6: compiler.warn.has.been.deprecated: DeprecatedAnnotation, compiler.misc.unnamed.package
-17 warnings
\ No newline at end of file
+17 warnings
diff --git a/langtools/test/tools/javac/warnings/suppress/TypeAnnotations.out b/langtools/test/tools/javac/warnings/suppress/TypeAnnotations.out
index 52a5484..6d45713 100644
--- a/langtools/test/tools/javac/warnings/suppress/TypeAnnotations.out
+++ b/langtools/test/tools/javac/warnings/suppress/TypeAnnotations.out
@@ -5,28 +5,20 @@
 TypeAnnotations.java:14:13: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:14:44: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:14:33: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:23:29: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:23:18: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:16:14: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:17:58: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:17:14: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:17:58: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:20:10: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:21:54: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:21:10: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:21:54: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:23:18: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:23:29: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:28:14: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:29:58: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:29:14: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:29:58: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:32:10: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:33:54: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:33:10: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:33:54: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:35:46: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:35:35: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:35:21: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:35:10: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:35:35: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
@@ -35,7 +27,6 @@
 TypeAnnotations.java:38:6: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:38:43: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:38:32: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-TypeAnnotations.java:38:32: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:42:40: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
 TypeAnnotations.java:42:62: compiler.warn.has.been.deprecated: TA, compiler.misc.unnamed.package
-40 warnings
\ No newline at end of file
+31 warnings
diff --git a/langtools/test/tools/javap/output/RepeatingTypeAnnotations.java b/langtools/test/tools/javap/output/RepeatingTypeAnnotations.java
index f78bf12..a0bc569 100644
--- a/langtools/test/tools/javap/output/RepeatingTypeAnnotations.java
+++ b/langtools/test/tools/javap/output/RepeatingTypeAnnotations.java
@@ -245,11 +245,11 @@
                    "        @A @A @A String ls = (@B @B @B String) o;",
                    "    }");
             verify("RuntimeInvisibleTypeAnnotations",
-                   "0: #34(#35=[@#36(),@#36(),@#36()]): CAST, offset=4, type_index=0",
-                   "1: #37(#35=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #34(#35=[@#36(),@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #37(#35=[@#38(),@#38(),@#38()]): CAST, offset=4, type_index=0",
                    "RuntimeInvisibleTypeAnnotations",
-                   "0: #37(#35=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "1: #38(): METHOD_FORMAL_PARAMETER, param_index=1");
+                   "0: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "1: #34(#35=[@#36(),@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0");
         }
     }
 
@@ -261,15 +261,15 @@
                    "        @A @A @B String ls = (@B @A @B String) o;",
                    "    }");
             verify("RuntimeInvisibleTypeAnnotations",
-                   "0: #34(#35=[@#36(),@#36()]): CAST, offset=4, type_index=0",
-                   "1: #37(): CAST, offset=4, type_index=0",
-                   "2: #38(#35=[@#37(),@#37()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
-                   "3: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "2: #38(#35=[@#37(),@#37()]): CAST, offset=4, type_index=0",
+                   "3: #36(): CAST, offset=4, type_index=0",
                    "RuntimeInvisibleTypeAnnotations",
-                   "0: #38(#35=[@#37(),@#37()]): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "2: #37(): METHOD_FORMAL_PARAMETER, param_index=1",
-                   "3: #36(): METHOD_FORMAL_PARAMETER, param_index=1");
+                   "0: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "1: #37(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "3: #37(): METHOD_FORMAL_PARAMETER, param_index=0");
         }
     }
 
@@ -282,14 +282,14 @@
                    "    }");
             verify("RuntimeVisibleTypeAnnotations",
                    "RuntimeInvisibleTypeAnnotations",
-                   "0: #34(): CAST, offset=4, type_index=0",
-                   "1: #35(#36=[@#34(),@#34()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
-                   "0: #38(#36=[@#39(),@#39()]): CAST, offset=4, type_index=0",
-                   "1: #39(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
-                   "0: #35(#36=[@#34(),@#34()]): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "0: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "1: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
-                   "2: #40(): METHOD_FORMAL_PARAMETER, param_index=1");
+                   "0: #34(#35=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #36(): CAST, offset=4, type_index=0",
+                   "0: #38(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #39(#35=[@#38(),@#38()]): CAST, offset=4, type_index=0",
+                   "0: #34(#35=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "0: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "1: #40(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #38(): METHOD_FORMAL_PARAMETER, param_index=0");
         }
     }
 
@@ -301,13 +301,13 @@
                    "        @A @B @C String ls = (@C @A @B String) o;",
                    "    }");
             verify("RuntimeVisibleTypeAnnotations",
-                   "0: #34(): CAST, offset=4, type_index=0",
-                   "1: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #34(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #34(): CAST, offset=4, type_index=0",
                    "RuntimeInvisibleTypeAnnotations",
-                   "0: #36(): CAST, offset=4, type_index=0",
-                   "1: #37(): CAST, offset=4, type_index=0",
-                   "2: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
-                   "3: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "0: #36(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "1: #37(): LOCAL_VARIABLE, {start_pc=10, length=1, index=5}",
+                   "2: #36(): CAST, offset=4, type_index=0",
+                   "3: #37(): CAST, offset=4, type_index=0",
                    "0: #34(): METHOD_FORMAL_PARAMETER, param_index=0",
                    "1: #34(): METHOD_FORMAL_PARAMETER, param_index=1",
                    "0: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
@@ -325,13 +325,14 @@
                    "        return (@A @A @A String) o;",
                    "    }");
             verify("RuntimeInvisibleTypeAnnotations",
-                   "0: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=0, type_index=0",
-                   "1: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=6, type_index=0",
-                   "2: #39(#37=[@#40(),@#40(),@#40()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #36(#37=[@#38(),@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "1: #39(#37=[@#40(),@#40(),@#40()]): CAST, offset=0, type_index=0",
+                   "2: #36(#37=[@#38(),@#38(),@#38()]): CAST, offset=6, type_index=0",
                     "RuntimeInvisibleTypeAnnotations",
-                   "0: #39(#37=[@#40(),@#40(),@#40()]): METHOD_RETURN",
-                   "1: #39(#37=[@#40(),@#40(),@#40()]): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "2: #40(): METHOD_FORMAL_PARAMETER, param_index=1");
+                   "0: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "1: #36(#37=[@#38(),@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #36(#37=[@#38(),@#38(),@#38()]): METHOD_RETURN"
+                   );
         }
     }
 
@@ -345,19 +346,19 @@
                    "    }");
            verify(
                     "RuntimeInvisibleTypeAnnotations:",
-                    "0: #36(#37=[@#38(),@#38()]): CAST, offset=0, type_index=0",
-                    "1: #39(): CAST, offset=0, type_index=0",
-                  "2: #39(): CAST, offset=6, type_index=0",
-                  "3: #36(#37=[@#38(),@#38()]): CAST, offset=6, type_index=0",
-                  "4: #40(#37=[@#39(),@#39()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
-                  "5: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                  "0: #36(#37=[@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                  "1: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                  "2: #40(#37=[@#39(),@#39()]): CAST, offset=0, type_index=0",
+                  "3: #38(): CAST, offset=0, type_index=0",
+                  "4: #38(): CAST, offset=6, type_index=0",
+                  "5: #40(#37=[@#39(),@#39()]): CAST, offset=6, type_index=0",
                     "RuntimeInvisibleTypeAnnotations:",
-                  "0: #39(): METHOD_RETURN",
-                  "1: #36(#37=[@#38(),@#38()]): METHOD_RETURN",
-                  "2: #40(#37=[@#39(),@#39()]): METHOD_FORMAL_PARAMETER, param_index=0",
-                  "3: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
-                  "4: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
-                    "5: #38(): METHOD_FORMAL_PARAMETER, param_index=1"
+                  "0: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                  "1: #39(): METHOD_FORMAL_PARAMETER, param_index=1",
+                  "2: #36(#37=[@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                  "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
+                  "4: #38(): METHOD_RETURN",
+                  "5: #40(#37=[@#39(),@#39()]): METHOD_RETURN"
                  );
         }
     }
@@ -372,21 +373,21 @@
                    "    }");
             verify(
                     "RuntimeVisibleTypeAnnotations:",
-                    "0: #36(): CAST, offset=0, type_index=0",
-                   "1: #36(): CAST, offset=6, type_index=0",
-                   "2: #37(#38=[@#36(),@#36()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #36(#37=[@#38(),@#38()]): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "1: #38(): CAST, offset=0, type_index=0",
+                   "2: #38(): CAST, offset=6, type_index=0",
                     "RuntimeInvisibleTypeAnnotations:",
-                    "0: #40(#38=[@#41(),@#41()]): CAST, offset=0, type_index=0",
-                   "1: #42(#38=[@#43(),@#43()]): CAST, offset=6, type_index=0",
-                   "2: #41(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #40(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "1: #41(#37=[@#40(),@#40()]): CAST, offset=0, type_index=0",
+                   "2: #42(#37=[@#43(),@#43()]): CAST, offset=6, type_index=0",
                     "RuntimeVisibleTypeAnnotations:",
-                   "0: #36(): METHOD_RETURN",
-                   "1: #37(#38=[@#36(),@#36()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "0: #36(#37=[@#38(),@#38()]): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #38(): METHOD_RETURN",
                     "RuntimeInvisibleTypeAnnotations:",
-                   "0: #40(#38=[@#41(),@#41()]): METHOD_RETURN",
-                   "1: #41(): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "2: #41(): METHOD_FORMAL_PARAMETER, param_index=1",
-                    "3: #43(): METHOD_FORMAL_PARAMETER, param_index=1"
+                   "0: #40(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "1: #43(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #40(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "3: #41(#37=[@#40(),@#40()]): METHOD_RETURN"
                     );
         }
     }
@@ -401,26 +402,26 @@
                    "    }");
             verify(
                     "RuntimeVisibleTypeAnnotations:",
-                    "0: #36(): CAST, offset=0, type_index=0",
-                   "1: #36(): CAST, offset=6, type_index=0",
-                   "2: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #36(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "1: #36(): CAST, offset=0, type_index=0",
+                   "2: #36(): CAST, offset=6, type_index=0",
                     "RuntimeInvisibleTypeAnnotations:",
-                    "0: #38(): CAST, offset=0, type_index=0",
-                    "1: #39(): CAST, offset=0, type_index=0",
-                   "2: #39(): CAST, offset=6, type_index=0",
-                   "3: #38(): CAST, offset=6, type_index=0",
-                   "4: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
-                   "5: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "0: #38(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "1: #39(): LOCAL_VARIABLE, {start_pc=6, length=5, index=5}",
+                   "2: #38(): CAST, offset=0, type_index=0",
+                   "3: #39(): CAST, offset=0, type_index=0",
+                   "4: #39(): CAST, offset=6, type_index=0",
+                   "5: #38(): CAST, offset=6, type_index=0",
                     "RuntimeVisibleTypeAnnotations:",
-                   "0: #36(): METHOD_RETURN",
-                   "1: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "2: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "0: #36(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #36(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "2: #36(): METHOD_RETURN",
                     "RuntimeInvisibleTypeAnnotations:",
-                   "0: #38(): METHOD_RETURN",
-                   "1: #39(): METHOD_RETURN",
-                   "2: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
-                   "3: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
-                    "4: #38(): METHOD_FORMAL_PARAMETER, param_index=1"
+                   "0: #38(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "1: #39(): METHOD_FORMAL_PARAMETER, param_index=0",
+                   "2: #38(): METHOD_FORMAL_PARAMETER, param_index=1",
+                   "3: #38(): METHOD_RETURN",
+                   "4: #39(): METHOD_RETURN"
                   );
         }
     }
diff --git a/nashorn/.hgtags b/nashorn/.hgtags
index 382ab10..a702f56 100644
--- a/nashorn/.hgtags
+++ b/nashorn/.hgtags
@@ -251,3 +251,4 @@
 32b66f4661eac52f8b04fb3d7703feb2c96febb7 jdk9-b15
 fed8c83dfba4dce94d2ae1cb82f026634ff2a3e4 jdk9-b16
 4a47b7cfecdf2a865811ab08a7ef49c942801d7c jdk9-b17
+893c337bc95fef3885baa3e4ffc30d68f62a829f jdk9-b18
diff --git a/nashorn/make/build.xml b/nashorn/make/build.xml
index 0edc7e9..1b28e9b 100644
--- a/nashorn/make/build.xml
+++ b/nashorn/make/build.xml
@@ -363,40 +363,32 @@
     <echo message="WARNING: TestNG not available, will not run tests. Please copy testng.jar under test/lib directory."/>
   </target>
 
-  <target name="test" depends="jar, check-testng, check-external-tests, compile-test, generate-policy-file" if="testng.available">
-    <delete dir="${build.dir}/nashorn_code_cache"/>
-    <fileset id="test.classes" dir="${build.test.classes.dir}">
-      <include name="**/api/javaaccess/*Test.class"/>
-      <include name="**/api/scripting/*Test.class"/>
-      <include name="**/codegen/*Test.class"/>
-      <include name="**/parser/*Test.class"/>
-      <include name="**/runtime/*Test.class"/>
-      <include name="**/runtime/regexp/*Test.class"/>
-      <include name="**/runtime/regexp/joni/*Test.class"/>
-      <include name="**/framework/*Test.class"/>
-    </fileset>
+  <!-- only to be invoked as dependency of "test" target -->
+  <target name="-test-classes-all" depends="jar" unless="test.class">
+      <fileset id="test.classes" dir="${build.test.classes.dir}">
+          <include name="**/api/javaaccess/*Test.class"/>
+          <include name="**/api/scripting/*Test.class"/>
+          <include name="**/codegen/*Test.class"/>
+          <include name="**/parser/*Test.class"/>
+          <include name="**/runtime/*Test.class"/>
+          <include name="**/runtime/regexp/*Test.class"/>
+          <include name="**/runtime/regexp/joni/*Test.class"/>
+          <include name="**/framework/*Test.class"/>
+     </fileset>
+  </target>
 
+  <!-- only to be invoked as dependency of "test" target -->
+  <target name="-test-classes-single" depends="jar" if="test.class">
+     <fileset id="test.classes" dir="${build.test.classes.dir}">
+         <include name="${test.class}*"/>
+     </fileset>
+  </target>
+
+  <!-- only to be invoked as dependency of "test" target -->
+  <target name="-test-nosecurity" unless="test.class">
     <fileset id="test.nosecurity.classes" dir="${build.test.classes.dir}">
       <include name="**/framework/ScriptTest.class"/>
     </fileset>
-
-    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
-       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
-      <jvmarg line="${ext.class.path}"/>
-      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
-      <propertyset>
-        <propertyref prefix="nashorn."/>
-      </propertyset>
-      <propertyset>
-        <propertyref prefix="test-sys-prop."/>
-        <mapper from="test-sys-prop.*" to="*" type="glob"/>
-      </propertyset>
-      <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
-      <classpath>
-          <pathelement path="${run.test.classpath}"/>
-      </classpath>
-    </testng>
-
     <testng outputdir="${build.nosecurity.test.results.dir}" classfilesetref="test.nosecurity.classes"
        verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
       <jvmarg line="${ext.class.path}"/>
@@ -414,6 +406,31 @@
     </testng>
   </target>
 
+  <!-- only to be invoked as dependency of "test" target -->
+  <target name="-test-security">
+    <delete dir="${build.dir}/nashorn_code_cache"/>
+    <property name="debug.test.jvmargs" value=""/>
+    <testng outputdir="${build.test.results.dir}" classfilesetref="test.classes"
+       verbose="${testng.verbose}" haltonfailure="true" useDefaultListeners="false" listeners="${testng.listeners}" workingDir="${basedir}">
+      <jvmarg line="${ext.class.path}"/>
+      <jvmarg line="${run.test.jvmargs} -Xmx${run.test.xmx} ${run.test.jvmsecurityargs}"/>
+      <jvmarg line="${debug.test.jvmargs}"/>
+      <propertyset>
+        <propertyref prefix="nashorn."/>
+      </propertyset>
+      <propertyset>
+        <propertyref prefix="test-sys-prop."/>
+        <mapper from="test-sys-prop.*" to="*" type="glob"/>
+      </propertyset>
+      <sysproperty key="test.js.excludes.file" value="${exclude.list}"/>
+      <classpath>
+          <pathelement path="${run.test.classpath}"/>
+      </classpath>
+    </testng>
+  </target>
+
+  <target name="test" depends="jar, -test-classes-all,-test-classes-single, check-testng, check-external-tests, compile-test, generate-policy-file, -test-security, -test-nosecurity" if="testng.available"/>
+
   <target name="check-jemmy.jfx.testng" unless="jemmy.jfx.testng.available">
     <echo message="WARNING: Jemmy or JavaFX or TestNG not available, will not run tests. Please copy testng.jar, JemmyCore.jar, JemmyFX.jar, JemmyAWTInput.jar under test${file.separator}lib directory. And make sure you have jfxrt.jar in ${java.home}${file.separator}lib${file.separator}ext dir."/>
   </target>
diff --git a/nashorn/make/nbproject/ide-file-targets.xml b/nashorn/make/nbproject/ide-file-targets.xml
index cb017bb..00a0635 100644
--- a/nashorn/make/nbproject/ide-file-targets.xml
+++ b/nashorn/make/nbproject/ide-file-targets.xml
@@ -22,38 +22,14 @@
  questions.
 -->
 <project basedir=".." name="nashorn-IDE">
-    <property file="nbproject/nbjdk.properties"/>
-    <property location="${netbeans.user}/build.properties" name="user.properties.file"/>
-    <property file="${user.properties.file}"/>
-    <import file="jdk.xml"/>
-    <import file="${basedir}/build-init.xml"/>
-    <!-- TODO: edit the following target according to your needs -->
-    <!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
-    <target depends="-jdk-init, init" name="debug-selected-file-in-src">
-        <fail unless="debug.class">Must set property 'debug.class'</fail>
-        <ant antfile="build.xml" inheritall="false" target="jar"/>
+    <target name="debug-selected-file-in-src">
+        <fail unless="test.class">Must set property 'debug.class'</fail>
         <nbjpdastart addressproperty="jpda.address" name="nashorn" transport="dt_socket">
             <classpath path="${run.test.classpath}"/>
         </nbjpdastart>
-        <java classname="${debug.class}" fork="false">
-            <classpath path="${run.test.classpath}"/>
-            <jvmarg line="${boot.class.path}"/>
-            <jvmarg value="-Xdebug"/>
-            <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
-            <jvmarg line="${run.test.jvmargs}"/>
-            <arg value="${debug.class}"/>
-        </java>
-    </target>
-    <!-- TODO: edit the following target according to your needs -->
-    <!-- (more info: http://www.netbeans.org/kb/articles/freeform-config.html#runsingle) -->
-    <target depends="-jdk-init, init" name="run-selected-file-in-src">
-        <fail unless="run.class">Must set property 'run.class'</fail>
-        <ant antfile="build.xml" inheritall="false" target="jar"/>
-        <java classname="${run.class}" failonerror="true" fork="false">
-            <classpath path="${run.test.classpath}"/>
-            <jvmarg line="${boot.class.path}"/>
-            <jvmarg line="${run.test.jvmargs}"/>
-            <arg value="${run.class}"/>
-        </java>
+        <ant antfile="build.xml" inheritall="false" target="test">
+            <property name="test.class" value="${test.class}"/>
+            <property name="debug.test.jvmargs" value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+        </ant>
     </target>
 </project>
diff --git a/nashorn/make/nbproject/project.xml b/nashorn/make/nbproject/project.xml
index 828dc29..2fcc644 100644
--- a/nashorn/make/nbproject/project.xml
+++ b/nashorn/make/nbproject/project.xml
@@ -98,27 +98,27 @@
                     <script>nbproject/nbjdk.xml</script>
                     <target>debug-nb</target>
                 </action>
-                <action name="debug.single">
-                    <script>nbproject/ide-file-targets.xml</script>
-                    <target>debug-selected-file-in-src</target>
+                <action name="run.single">
+                    <script>build.xml</script>
+                    <target>test</target>
                     <context>
-                        <property>debug.class</property>
-                        <folder>test/src</folder>
+                        <property>test.class</property>
+                        <folder>../test/src</folder>
                         <pattern>\.java$</pattern>
-                        <format>java-name</format>
+                        <format>relative-path-noext</format>
                         <arity>
                             <one-file-only/>
                         </arity>
                     </context>
                 </action>
-                <action name="run.single">
+                <action name="debug.single">
                     <script>nbproject/ide-file-targets.xml</script>
-                    <target>run-selected-file-in-src</target>
+                    <target>debug-selected-file-in-src</target>
                     <context>
-                        <property>run.class</property>
-                        <folder>test/src</folder>
+                        <property>test.class</property>
+                        <folder>../test/src</folder>
                         <pattern>\.java$</pattern>
-                        <format>java-name</format>
+                        <format>relative-path-noext</format>
                         <arity>
                             <one-file-only/>
                         </arity>
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
index f067742..f19b7a3 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/AccessorProperty.java
@@ -550,8 +550,13 @@
                 "invalid getter type " + type + " for " + getKey();
 
         //all this does is add a return value filter for object fields only
-        if (GETTER_CACHE[i] == null) {
-            GETTER_CACHE[i] = debug(
+        final MethodHandle[] getterCache = GETTER_CACHE;
+        final MethodHandle cachedGetter = getterCache[i];
+        final MethodHandle getter;
+        if (cachedGetter != null) {
+            getter = cachedGetter;
+        } else {
+            getter = debug(
                 createGetter(
                     getCurrentType(),
                     type,
@@ -561,9 +566,10 @@
                 getCurrentType(),
                 type,
                 "get");
+            getterCache[i] = getter;
        }
-       assert GETTER_CACHE[i].type().returnType() == type && GETTER_CACHE[i].type().parameterType(0) == Object.class;
-       return GETTER_CACHE[i];
+       assert getter.type().returnType() == type && getter.type().parameterType(0) == Object.class;
+       return getter;
     }
 
     @Override
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Context.java b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
index a33b0d2..369c4e6 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java
@@ -1014,6 +1014,9 @@
     }
 
     private static ScriptFunction getProgramFunction(final Class<?> script, final ScriptObject scope) {
+        if (script == null) {
+            return null;
+        }
         return invokeCreateProgramFunctionHandle(getCreateProgramFunctionHandle(script), scope);
     }
 
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java b/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
index 7166ba0..d5dc560 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/DebuggerSupport.java
@@ -25,14 +25,21 @@
 
 package jdk.nashorn.internal.runtime;
 
+import static jdk.nashorn.internal.codegen.CompilerConstants.SOURCE;
 import static jdk.nashorn.internal.runtime.UnwarrantedOptimismException.INVALID_PROGRAM_POINT;
 
+import java.lang.invoke.MethodHandle;
+import java.lang.reflect.Field;
+import java.net.URL;
 import java.util.HashSet;
 import java.util.Set;
+import jdk.nashorn.internal.scripts.JS;
 
 /**
  * This class provides support for external debuggers.  Its primary purpose is
  * is to simplify the debugger tasks and provide better performance.
+ * Even though the methods are not public, there are still part of the
+ * external debugger interface.
  */
 final class DebuggerSupport {
     /**
@@ -49,6 +56,11 @@
         @SuppressWarnings("unused")
         final
         DebuggerValueDesc forceLoad = new DebuggerValueDesc(null, false, null, null);
+
+        // Hook to force the loading of the SourceInfo class
+        @SuppressWarnings("unused")
+        final
+        SourceInfo srcInfo = new SourceInfo(null, 0, null, null);
     }
 
     /** This class is used to send a bulk description of a value. */
@@ -73,6 +85,54 @@
         }
     }
 
+    static class SourceInfo {
+        final String name;
+        final URL    url;
+        final int    hash;
+        final char[] content;
+
+        SourceInfo(final String name, final int hash, final URL url, final char[] content) {
+            this.name    = name;
+            this.hash    = hash;
+            this.url     = url;
+            this.content = content;
+        }
+    }
+
+    /**
+     * Hook that is called just before invoking method handle
+     * from ScriptFunctionData via invoke, constructor method calls.
+     *
+     * @param mh script class method about to be invoked.
+     */
+    static void notifyInvoke(final MethodHandle mh) {
+        // Do nothing here. This is placeholder method on which a
+        // debugger can place a breakpoint so that it can access the
+        // (script class) method handle that is about to be invoked.
+        // See ScriptFunctionData.invoke and ScriptFunctionData.construct.
+    }
+
+    /**
+     * Return the script source info for the given script class.
+     *
+     * @param clazz compiled script class
+     * @return SourceInfo
+     */
+    static SourceInfo getSourceInfo(final Class<?> clazz) {
+        if (JS.class.isAssignableFrom(clazz)) {
+            try {
+                final Field sourceField = clazz.getDeclaredField(SOURCE.symbolName());
+                sourceField.setAccessible(true);
+                final Source src = (Source) sourceField.get(null);
+                return src.getSourceInfo();
+            } catch (final IllegalAccessException | NoSuchFieldException ignored) {
+                return null;
+            }
+        }
+
+        return null;
+    }
+
     /**
      * Return the current context global.
      * @return context global.
@@ -87,7 +147,7 @@
      * @param self            Receiver to use.
      * @param string          String to evaluate.
      * @param returnException true if exceptions are to be returned.
-     * @return Result of eval as string, or, an exception or null depending on returnException.
+     * @return Result of eval, or, an exception or null depending on returnException.
      */
     static Object eval(final ScriptObject scope, final Object self, final String string, final boolean returnException) {
         final ScriptObject global = Context.getGlobal();
@@ -238,7 +298,7 @@
      * @param value Arbitrary value to be displayed by the debugger.
      * @return A string representation of the value or an array of DebuggerValueDesc.
      */
-    private static String valueAsString(final Object value) {
+    static String valueAsString(final Object value) {
         final JSType type = JSType.of(value);
 
         switch (type) {
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
index 9483d24..455c30d 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptFunctionData.java
@@ -551,6 +551,8 @@
         final Object       selfObj = convertThisObject(self);
         final Object[]     args    = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
 
+        DebuggerSupport.notifyInvoke(mh);
+
         if (isVarArg(mh)) {
             if (needsCallee(mh)) {
                 return mh.invokeExact(fn, selfObj, args);
@@ -604,6 +606,8 @@
         final MethodHandle mh   = getGenericConstructor(fn.getScope());
         final Object[]     args = arguments == null ? ScriptRuntime.EMPTY_ARRAY : arguments;
 
+        DebuggerSupport.notifyInvoke(mh);
+
         if (isVarArg(mh)) {
             if (needsCallee(mh)) {
                 return mh.invokeExact(fn, args);
diff --git a/nashorn/src/jdk/nashorn/internal/runtime/Source.java b/nashorn/src/jdk/nashorn/internal/runtime/Source.java
index 19d3b0b..deec95c 100644
--- a/nashorn/src/jdk/nashorn/internal/runtime/Source.java
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Source.java
@@ -126,6 +126,11 @@
         }
     }
 
+    /* package-private */
+    DebuggerSupport.SourceInfo getSourceInfo() {
+        return new DebuggerSupport.SourceInfo(getName(), data.hashCode(),  data.url(), data.array());
+    }
+
     // Wrapper to manage lazy loading
     private static interface Data {
 
diff --git a/nashorn/test/script/nosecurity/JDK-8044798.js b/nashorn/test/script/nosecurity/JDK-8044798.js
new file mode 100644
index 0000000..2c94f66
--- /dev/null
+++ b/nashorn/test/script/nosecurity/JDK-8044798.js
@@ -0,0 +1,151 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8044798: API for debugging Nashorn
+ *
+ * @test
+ * @run
+ */
+
+// basic API exercise checks
+
+var Arrays = Java.type("java.util.Arrays");
+var CharArray = Java.type("char[]");
+var DebuggerSupport = Java.type("jdk.nashorn.internal.runtime.DebuggerSupport");
+var DebuggerValueDesc = Java.type("jdk.nashorn.internal.runtime.DebuggerSupport.DebuggerValueDesc");
+
+var valueDescFields = DebuggerValueDesc.class.declaredFields;
+Arrays.sort(valueDescFields, function(f1, f2) f1.name.compareTo(f2.name));
+for each (var f in valueDescFields) {
+    f.accessible = true;
+}
+
+var debuggerSupportMethods = DebuggerSupport.class.declaredMethods;
+
+// methods of DebuggerSupport that we use
+var evalMethod, valueInfoMethod, valueInfosMethod;
+var getSourceInfoMethod, valueAsStringMethod;
+
+for each (var m in debuggerSupportMethods) {
+    m.accessible = true;
+    switch (m.name) {
+        case "eval":
+            evalMethod = m;
+            break;
+        case "valueInfo":
+            if (m.parameterCount == 3) {
+                valueInfoMethod = m;
+            }
+            break;
+        case "valueInfos":
+            valueInfosMethod = m;
+            break;
+        case "valueAsString":
+            valueAsStringMethod = m;
+            break;
+        case "getSourceInfo":
+            getSourceInfoMethod = m;
+            break;
+    }
+}
+
+// eval
+var value = evalMethod.invoke(null, null, null, "33 + 55", false);
+print(value);
+
+// valueInfo
+var info = valueInfoMethod.invoke(null, "apply", Function, true);
+for each (var f in valueDescFields) {
+    print(f.name, "=", f.get(info));
+}
+
+// valueInfo - user defined object
+var info = valueInfoMethod.invoke(null, "foo", { foo: 343 }, true);
+for each (var f in valueDescFields) {
+    print(f.name, "=", f.get(info));
+}
+
+// valueInfos
+var infos = valueInfosMethod.invoke(null, Object, true);
+for each (var info in infos) {
+    for each (var f in valueDescFields) {
+        print(f.name, "=", f.get(info));
+    }  
+}
+
+// valueInfos - user defined object
+var infos = valueInfosMethod.invoke(null, { foo: 34, bar: "hello" }, true);
+for each (var info in infos) {
+    for each (var f in valueDescFields) {
+        print(f.name, "=", f.get(info));
+    }  
+}
+
+// valueAsString
+function printValue(value) {
+    print(valueAsStringMethod.invoke(null, value));
+}
+
+printValue(undefined);
+printValue(null);
+printValue("hello");
+printValue(Math.PI);
+printValue(this);
+
+// The below are not part of DebuggerSupport. But we need these to
+// test DebuggerSupport.getSourceInfo etc. which need compiled script class
+
+var Source = Java.type("jdk.nashorn.internal.runtime.Source");
+var Context = Java.type("jdk.nashorn.internal.runtime.Context");
+var sourceCls = Source.class;
+var errorMgrCls = Java.type("jdk.nashorn.internal.runtime.ErrorManager").class;
+var booleanCls = Java.type("java.lang.Boolean").TYPE;
+
+// private compile method of Context class
+var compileMethod = Context.class.getDeclaredMethod("compile",
+                sourceCls, errorMgrCls, booleanCls);
+compileMethod.accessible = true;
+
+var scriptCls = compileMethod.invoke(Context.context,
+    Source.sourceFor("test", "print('hello')"),
+    new Context.ThrowErrorManager(), false);
+
+var SCRIPT_CLASS_NAME_PREFIX = "jdk.nashorn.internal.scripts.Script$";
+print("script class name pattern satisfied? " +
+    scriptCls.name.startsWith(SCRIPT_CLASS_NAME_PREFIX));
+
+var srcInfo = getSourceInfoMethod.invoke(null, scriptCls);
+var srcInfoFields = srcInfo.class.declaredFields;
+Arrays.sort(srcInfoFields, function(f1, f2) f1.name.compareTo(f2.name));
+
+print("Source info");
+for each (var f in srcInfoFields) {
+    f.accessible = true;
+    var fieldValue = f.get(srcInfo);
+    if (fieldValue instanceof CharArray) {
+        fieldValue = new java.lang.String(fieldValue);
+    }
+
+    print(f.name, "=", fieldValue);
+}
diff --git a/nashorn/test/script/nosecurity/JDK-8044798.js.EXPECTED b/nashorn/test/script/nosecurity/JDK-8044798.js.EXPECTED
new file mode 100644
index 0000000..24d8281
--- /dev/null
+++ b/nashorn/test/script/nosecurity/JDK-8044798.js.EXPECTED
@@ -0,0 +1,104 @@
+88
+expandable = false
+key = apply
+valueAsObject = function Function() { [native code] }
+valueAsString = function Function() { [native code] }
+expandable = true
+key = foo
+valueAsObject = [object Object]
+valueAsString = {foo: 343}
+expandable = false
+key = setIndexedPropertiesToExternalArrayData
+valueAsObject = function setIndexedPropertiesToExternalArrayData() { [native code] }
+valueAsString = function setIndexedPropertiesToExternalArrayData() { [native code] }
+expandable = false
+key = getPrototypeOf
+valueAsObject = function getPrototypeOf() { [native code] }
+valueAsString = function getPrototypeOf() { [native code] }
+expandable = false
+key = setPrototypeOf
+valueAsObject = function setPrototypeOf() { [native code] }
+valueAsString = function setPrototypeOf() { [native code] }
+expandable = false
+key = getOwnPropertyDescriptor
+valueAsObject = function getOwnPropertyDescriptor() { [native code] }
+valueAsString = function getOwnPropertyDescriptor() { [native code] }
+expandable = false
+key = getOwnPropertyNames
+valueAsObject = function getOwnPropertyNames() { [native code] }
+valueAsString = function getOwnPropertyNames() { [native code] }
+expandable = false
+key = create
+valueAsObject = function create() { [native code] }
+valueAsString = function create() { [native code] }
+expandable = false
+key = defineProperty
+valueAsObject = function defineProperty() { [native code] }
+valueAsString = function defineProperty() { [native code] }
+expandable = false
+key = defineProperties
+valueAsObject = function defineProperties() { [native code] }
+valueAsString = function defineProperties() { [native code] }
+expandable = false
+key = seal
+valueAsObject = function seal() { [native code] }
+valueAsString = function seal() { [native code] }
+expandable = false
+key = freeze
+valueAsObject = function freeze() { [native code] }
+valueAsString = function freeze() { [native code] }
+expandable = false
+key = preventExtensions
+valueAsObject = function preventExtensions() { [native code] }
+valueAsString = function preventExtensions() { [native code] }
+expandable = false
+key = isSealed
+valueAsObject = function isSealed() { [native code] }
+valueAsString = function isSealed() { [native code] }
+expandable = false
+key = isFrozen
+valueAsObject = function isFrozen() { [native code] }
+valueAsString = function isFrozen() { [native code] }
+expandable = false
+key = isExtensible
+valueAsObject = function isExtensible() { [native code] }
+valueAsString = function isExtensible() { [native code] }
+expandable = false
+key = keys
+valueAsObject = function keys() { [native code] }
+valueAsString = function keys() { [native code] }
+expandable = false
+key = bindProperties
+valueAsObject = function bindProperties() { [native code] }
+valueAsString = function bindProperties() { [native code] }
+expandable = false
+key = prototype
+valueAsObject = [object Object]
+valueAsString = {toString: function toString() { [native code] }, toLocaleString: function toLocaleString() { [native code] }, valueOf: function valueOf() { [native code] }, hasOwnProperty: function hasOwnProperty() { [native code] }, isPrototypeOf: function isPrototypeOf() { [native code] }, propertyIsEnumerable: function propertyIsEnumerable() { [native code] }, constructor: function Object() { [native code] }, __proto__: null}
+expandable = false
+key = length
+valueAsObject = 1
+valueAsString = 1
+expandable = false
+key = name
+valueAsObject = Object
+valueAsString = "Object"
+expandable = false
+key = foo
+valueAsObject = 34
+valueAsString = 34
+expandable = false
+key = bar
+valueAsObject = hello
+valueAsString = "hello"
+undefined
+null
+"hello"
+3.141592653589793
+[object global]
+script class name pattern satisfied? true
+Source info
+content = print('hello')
+hash = 1655359881
+name = test
+url = null
diff --git a/nashorn/test/script/nosecurity/debuggersupportapi.js b/nashorn/test/script/nosecurity/debuggersupportapi.js
new file mode 100644
index 0000000..f2fa101
--- /dev/null
+++ b/nashorn/test/script/nosecurity/debuggersupportapi.js
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * JDK-8044798: API for debugging Nashorn
+ *
+ * @test
+ * @run
+ */
+
+// Basic API class, method, field existence checks.
+
+// The following classes and the associated methods and fields are used as
+// private debugger interface. Though private/implementation defined, nashorn
+// code should not be changed to remove these classes, fields and methods.
+// The test takes signatures of debugger interface and stores in .EXPECTED file.
+// If any incompatible change is made to nashorn to break any of these, this
+// test will fail.
+
+var Arrays = Java.type("java.util.Arrays");
+var DebuggerSupport = Java.type("jdk.nashorn.internal.runtime.DebuggerSupport");
+
+print(DebuggerSupport.class);
+print();
+var methods = DebuggerSupport.class.declaredMethods;
+Arrays.sort(methods, function(m1, m2) m1.name.compareTo(m2.name));
+for each (var mth in methods) {
+    switch (mth.name) {
+        case "eval":
+        case "notifyInvoke":
+        case "getSourceInfo":
+        case "valueAsString":
+        case "valueInfos":
+            print(mth);
+            break;
+        case "valueInfo":
+            if (mth.parameterCount == 3) {
+                print(mth);
+            }
+            break;
+    }
+}
+print();
+
+var DebuggerValueDesc = Java.type("jdk.nashorn.internal.runtime.DebuggerSupport.DebuggerValueDesc");
+print(DebuggerValueDesc.class);
+print();
+var fields = DebuggerValueDesc.class.declaredFields;
+Arrays.sort(fields, function(f1, f2) f1.name.compareTo(f2.name));
+for each (var fld in fields) {
+    switch (fld.name) {
+        case "key":
+        case "expandable":
+        case "valueAsObject":
+        case "valueAsString":
+            print(fld);
+    }
+}
+print();
+
+var SourceInfo = Java.type("jdk.nashorn.internal.runtime.DebuggerSupport.SourceInfo");
+print(SourceInfo.class);
+print();
+var fields = SourceInfo.class.declaredFields;
+Arrays.sort(fields, function(f1, f2) f1.name.compareTo(f2.name));
+for each (var fld in fields) {
+    switch (fld.name) {
+        case "name":
+        case "hash":
+        case "url":
+        case "content":
+            print(fld);
+    }
+}
diff --git a/nashorn/test/script/nosecurity/debuggersupportapi.js.EXPECTED b/nashorn/test/script/nosecurity/debuggersupportapi.js.EXPECTED
new file mode 100644
index 0000000..0db8b30
--- /dev/null
+++ b/nashorn/test/script/nosecurity/debuggersupportapi.js.EXPECTED
@@ -0,0 +1,22 @@
+class jdk.nashorn.internal.runtime.DebuggerSupport
+
+static java.lang.Object jdk.nashorn.internal.runtime.DebuggerSupport.eval(jdk.nashorn.internal.runtime.ScriptObject,java.lang.Object,java.lang.String,boolean)
+static jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo jdk.nashorn.internal.runtime.DebuggerSupport.getSourceInfo(java.lang.Class)
+static void jdk.nashorn.internal.runtime.DebuggerSupport.notifyInvoke(java.lang.invoke.MethodHandle)
+static java.lang.String jdk.nashorn.internal.runtime.DebuggerSupport.valueAsString(java.lang.Object)
+static jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc jdk.nashorn.internal.runtime.DebuggerSupport.valueInfo(java.lang.String,java.lang.Object,boolean)
+static jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc[] jdk.nashorn.internal.runtime.DebuggerSupport.valueInfos(java.lang.Object,boolean)
+
+class jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc
+
+final boolean jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc.expandable
+final java.lang.String jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc.key
+final java.lang.Object jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc.valueAsObject
+final java.lang.String jdk.nashorn.internal.runtime.DebuggerSupport$DebuggerValueDesc.valueAsString
+
+class jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo
+
+final char[] jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo.content
+final int jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo.hash
+final java.lang.String jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo.name
+final java.net.URL jdk.nashorn.internal.runtime.DebuggerSupport$SourceInfo.url
diff --git a/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java b/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java
index 4c4a8c6..8e17e34 100644
--- a/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java
+++ b/nashorn/test/src/jdk/nashorn/internal/runtime/ContextTest.java
@@ -28,6 +28,7 @@
 import static jdk.nashorn.internal.runtime.Source.sourceFor;
 import static org.testng.Assert.assertEquals;
 import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
 
 import java.util.Map;
 import jdk.nashorn.internal.objects.Global;
@@ -60,6 +61,27 @@
         }
     }
 
+    // Make sure trying to compile an invalid script returns null - see JDK-8046215.
+    @Test
+    public void compileErrorTest() {
+        final Options options = new Options("");
+        final ErrorManager errors = new ErrorManager();
+        final Context cx = new Context(options, errors, Thread.currentThread().getContextClassLoader());
+        final Global oldGlobal = Context.getGlobal();
+        Context.setGlobal(cx.createGlobal());
+        try {
+            final ScriptFunction script = cx.compileScript(sourceFor("<evalCompileErrorTest>", "*/"), Context.getGlobal());
+            if (script != null) {
+                fail("Invalid script compiled without errors");
+            }
+            if (errors.getNumberOfErrors() != 1) {
+                fail("Wrong number of errors: " + errors.getNumberOfErrors());
+            }
+        } finally {
+            Context.setGlobal(oldGlobal);
+        }
+    }
+
     // basic check for JS reflection access - java.util.Map-like access on ScriptObject
     @Test
     public void reflectionTest() {