changeset 2956:17d1e0cb6083

Merge
author jjg
date Fri, 27 Mar 2015 16:40:35 -0700
parents bbfc8cd47a91 11b710868183
children 171268c46d77
files make/Makefile
diffstat 24 files changed, 2098 insertions(+), 137 deletions(-) [+]
line wrap: on
line diff
--- a/make/Makefile	Fri Mar 27 15:51:17 2015 -0700
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-#
-# 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.  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.
-#
-
-# Locate this Makefile
-ifeq ($(filter /%, $(lastword $(MAKEFILE_LIST))), )
-  makefile_path := $(CURDIR)/$(lastword $(MAKEFILE_LIST))
-else
-  makefile_path := $(lastword $(MAKEFILE_LIST))
-endif
-repo_dir := $(patsubst %/make/Makefile, %, $(makefile_path))
-
-# What is the name of this subsystem (langtools, corba, etc)?
-subsystem_name := $(notdir $(repo_dir))
-
-# Try to locate top-level makefile
-top_level_makefile := $(repo_dir)/../Makefile
-ifneq ($(wildcard $(top_level_makefile)), )
-  $(info Will run $(subsystem_name) target on top-level Makefile)
-  $(info WARNING: This is a non-recommended way of building!)
-  $(info ===================================================)
-else
-  $(info Cannot locate top-level Makefile. Is this repo not checked out as part of a complete forest?)
-  $(error Build from top-level Makefile instead)
-endif
-
-all:
-	@$(MAKE) -f $(top_level_makefile) $(subsystem_name)
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Kinds.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -67,22 +67,22 @@
         POLY(Category.BASIC, KindSelector.POLY),
         MDL(Category.BASIC, KindSelector.MDL),
         ERR(Category.ERROR, KindSelector.ERR),
-        AMBIGUOUS(Category.OVERLOAD),
-        HIDDEN(Category.OVERLOAD),
-        STATICERR(Category.OVERLOAD),
-        MISSING_ENCL(Category.OVERLOAD),
-        ABSENT_VAR(Category.OVERLOAD, KindName.VAR),
-        WRONG_MTHS(Category.OVERLOAD, KindName.METHOD),
-        WRONG_MTH(Category.OVERLOAD, KindName.METHOD),
-        ABSENT_MTH(Category.OVERLOAD, KindName.METHOD),
-        ABSENT_TYP(Category.OVERLOAD, KindName.CLASS);
+        AMBIGUOUS(Category.RESOLUTION_TARGET),                         // overloaded       target
+        HIDDEN(Category.RESOLUTION_TARGET),                            // not overloaded   non-target
+        STATICERR(Category.RESOLUTION_TARGET),                         // overloaded?      target
+        MISSING_ENCL(Category.RESOLUTION),                             // not overloaded   non-target
+        ABSENT_VAR(Category.RESOLUTION_TARGET, KindName.VAR),          // not overloaded   non-target
+        WRONG_MTHS(Category.RESOLUTION_TARGET, KindName.METHOD),       // overloaded       target
+        WRONG_MTH(Category.RESOLUTION_TARGET, KindName.METHOD),        // not overloaded   target
+        ABSENT_MTH(Category.RESOLUTION_TARGET, KindName.METHOD),       // not overloaded   non-target
+        ABSENT_TYP(Category.RESOLUTION_TARGET, KindName.CLASS);        // not overloaded   non-target
 
         // There are essentially two "levels" to the Kind datatype.
         // The first is a totally-ordered set of categories of
         // solutions.  Within each category, we have more
         // possibilities.
         private enum Category {
-            BASIC, ERROR, OVERLOAD;
+            BASIC, ERROR, RESOLUTION, RESOLUTION_TARGET;
         }
 
         private final KindName kindName;
@@ -128,8 +128,12 @@
             return selector.contains(kindSelectors);
         }
 
-        public boolean isOverloadError() {
-            return category == Category.OVERLOAD;
+        public boolean isResolutionError() {
+            return category == Category.RESOLUTION || category == Category.RESOLUTION_TARGET;
+        }
+
+        public boolean isResolutionTargetError() {
+            return category == Category.RESOLUTION_TARGET;
         }
 
         public boolean isValid() {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Mar 27 16:40:35 2015 -0700
@@ -2111,7 +2111,7 @@
                 clazztype = cdef.sym.type;
                 Symbol sym = tree.constructor = rs.resolveConstructor(
                     tree.pos(), localEnv, clazztype, argtypes, typeargtypes);
-                Assert.check(!sym.kind.isOverloadError());
+                Assert.check(!sym.kind.isResolutionError());
                 tree.constructor = sym;
                 tree.constructorType = checkId(noCheckTree,
                     clazztype,
@@ -2649,17 +2649,20 @@
             Symbol refSym = refResult.fst;
             Resolve.ReferenceLookupHelper lookupHelper = refResult.snd;
 
+            /** this switch will need to go away and be replaced by the new RESOLUTION_TARGET testing
+             *  JDK-8075541
+             */
             if (refSym.kind != MTH) {
                 boolean targetError;
                 switch (refSym.kind) {
                     case ABSENT_MTH:
+                    case MISSING_ENCL:
                         targetError = false;
                         break;
                     case WRONG_MTH:
                     case WRONG_MTHS:
                     case AMBIGUOUS:
                     case HIDDEN:
-                    case MISSING_ENCL:
                     case STATICERR:
                         targetError = true;
                         break;
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/DeferredAttr.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1209,8 +1209,8 @@
                     rs.getMemberReference(tree, localEnv, mref2,
                         exprTree.type, tree.name);
             tree.sym = res;
-            if (res.kind.isOverloadError() ||
-                    res.type.hasTag(FORALL) ||
+            if (res.kind.isResolutionTargetError() ||
+                    res.type != null && res.type.hasTag(FORALL) ||
                     (res.flags() & Flags.VARARGS) != 0 ||
                     (TreeInfo.isStaticSelector(exprTree, tree.name.table.names) &&
                     exprTree.type.isRaw())) {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1885,7 +1885,7 @@
              * Translate a symbol of a given kind into something suitable for the
              * synthetic lambda body
              */
-            Symbol translate(Name name, final Symbol sym, LambdaSymbolKind skind) {
+            Symbol translate(final Symbol sym, LambdaSymbolKind skind) {
                 Symbol ret;
                 switch (skind) {
                     case CAPTURED_THIS:
@@ -1893,7 +1893,7 @@
                         break;
                     case TYPE_VAR:
                         // Just erase the type var
-                        ret = new VarSymbol(sym.flags(), name,
+                        ret = new VarSymbol(sym.flags(), sym.name,
                                 types.erasure(sym.type), sym.owner);
 
                         /* this information should also be kept for LVT generation at Gen
@@ -1902,7 +1902,7 @@
                         ((VarSymbol)ret).pos = ((VarSymbol)sym).pos;
                         break;
                     case CAPTURED_VAR:
-                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, name, types.erasure(sym.type), translatedSym) {
+                        ret = new VarSymbol(SYNTHETIC | FINAL | PARAMETER, sym.name, types.erasure(sym.type), translatedSym) {
                             @Override
                             public Symbol baseSymbol() {
                                 //keep mapping with original captured symbol
@@ -1911,16 +1911,16 @@
                         };
                         break;
                     case LOCAL_VAR:
-                        ret = new VarSymbol(sym.flags() & FINAL, name, sym.type, translatedSym);
+                        ret = new VarSymbol(sym.flags() & FINAL, sym.name, sym.type, translatedSym);
                         ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
                         break;
                     case PARAM:
-                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, name, types.erasure(sym.type), translatedSym);
+                        ret = new VarSymbol((sym.flags() & FINAL) | PARAMETER, sym.name, types.erasure(sym.type), translatedSym);
                         ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
                         break;
                     default:
-                        ret = makeSyntheticVar(FINAL, name, types.erasure(sym.type), translatedSym);
-                        ((VarSymbol) ret).pos = ((VarSymbol) sym).pos;
+                        Assert.error(skind.name());
+                        throw new AssertionError();
                 }
                 if (ret != sym) {
                     ret.setDeclarationAttributes(sym.getRawAttributes());
@@ -1931,27 +1931,8 @@
 
             void addSymbol(Symbol sym, LambdaSymbolKind skind) {
                 Map<Symbol, Symbol> transMap = getSymbolMap(skind);
-                Name preferredName;
-                switch (skind) {
-                    case CAPTURED_THIS:
-                        preferredName = names.fromString("encl$" + transMap.size());
-                        break;
-                    case CAPTURED_VAR:
-                        preferredName = names.fromString("cap$" + transMap.size());
-                        break;
-                    case LOCAL_VAR:
-                        preferredName = sym.name;
-                        break;
-                    case PARAM:
-                        preferredName = sym.name;
-                        break;
-                    case TYPE_VAR:
-                        preferredName = sym.name;
-                        break;
-                    default: throw new AssertionError();
-                }
                 if (!transMap.containsKey(sym)) {
-                    transMap.put(sym, translate(preferredName, sym, skind));
+                    transMap.put(sym, translate(sym, skind));
                 }
             }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Mar 27 16:40:35 2015 -0700
@@ -203,7 +203,7 @@
 
     void reportVerboseResolutionDiagnostic(DiagnosticPosition dpos, Name name, Type site,
             List<Type> argtypes, List<Type> typeargtypes, Symbol bestSoFar) {
-        boolean success = !bestSoFar.kind.isOverloadError();
+        boolean success = !bestSoFar.kind.isResolutionError();
 
         if (success && !verboseResolutionMode.contains(VerboseResolutionMode.SUCCESS)) {
             return;
@@ -1407,7 +1407,7 @@
                 if (currentSymbol.kind != VAR)
                     continue;
                 // invariant: sym.kind == Symbol.Kind.VAR
-                if (!bestSoFar.kind.isOverloadError() &&
+                if (!bestSoFar.kind.isResolutionError() &&
                     currentSymbol.owner != bestSoFar.owner)
                     return new AmbiguityError(bestSoFar, currentSymbol);
                 else if (!bestSoFar.kind.betterThan(VAR)) {
@@ -1450,11 +1450,11 @@
                 !sym.isInheritedIn(site.tsym, types)) {
             return bestSoFar;
         } else if (useVarargs && (sym.flags() & VARARGS) == 0) {
-            return bestSoFar.kind.isOverloadError() ?
+            return bestSoFar.kind.isResolutionError() ?
                     new BadVarargsMethod((ResolveError)bestSoFar.baseSymbol()) :
                     bestSoFar;
         }
-        Assert.check(!sym.kind.isOverloadError());
+        Assert.check(!sym.kind.isResolutionError());
         try {
             Type mt = rawInstantiate(env, site, sym, null, argtypes, typeargtypes,
                                allowBoxing, useVarargs, types.noWarnings);
@@ -1475,7 +1475,7 @@
                 ? new AccessError(env, site, sym)
                 : bestSoFar;
         }
-        return (bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS)
+        return (bestSoFar.kind.isResolutionError() && bestSoFar.kind != AMBIGUOUS)
             ? sym
             : mostSpecific(argtypes, sym, bestSoFar, env, site, useVarargs);
     }
@@ -1957,8 +1957,8 @@
              bestSoFar.kind != AMBIGUOUS && l.nonEmpty();
              l = l.tail) {
             sym = findMemberType(env, site, name, l.head.tsym);
-            if (!bestSoFar.kind.isOverloadError() &&
-                !sym.kind.isOverloadError() &&
+            if (!bestSoFar.kind.isResolutionError() &&
+                !sym.kind.isResolutionError() &&
                 sym.owner != bestSoFar.owner)
                 bestSoFar = new AmbiguityError(bestSoFar, sym);
             else
@@ -2194,7 +2194,7 @@
                   List<Type> argtypes,
                   List<Type> typeargtypes,
                   LogResolveHelper logResolveHelper) {
-        if (sym.kind.isOverloadError()) {
+        if (sym.kind.isResolutionError()) {
             ResolveError errSym = (ResolveError)sym.baseSymbol();
             sym = errSym.access(name, qualified ? site.tsym : syms.noSymbol);
             argtypes = logResolveHelper.getArgumentTypes(errSym, sym, name, argtypes);
@@ -2384,7 +2384,7 @@
             }
             @Override
             Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                if (sym.kind.isOverloadError()) {
+                if (sym.kind.isResolutionError()) {
                     sym = super.access(env, pos, location, sym);
                 } else if (allowMethodHandles) {
                     MethodSymbol msym = (MethodSymbol)sym;
@@ -2541,7 +2541,7 @@
                     }
                     @Override
                     Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-                        if (sym.kind.isOverloadError()) {
+                        if (sym.kind.isResolutionError()) {
                             if (sym.kind != WRONG_MTH &&
                                 sym.kind != WRONG_MTHS) {
                                 sym = super.access(env, pos, location, sym);
@@ -2951,7 +2951,7 @@
          */
         final boolean shouldStop(Symbol sym, MethodResolutionPhase phase) {
             return phase.ordinal() > maxPhase.ordinal() ||
-                !sym.kind.isOverloadError() || sym.kind == AMBIGUOUS;
+                !sym.kind.isResolutionError() || sym.kind == AMBIGUOUS;
         }
 
         /**
@@ -2997,7 +2997,7 @@
 
         @Override
         Symbol access(Env<AttrContext> env, DiagnosticPosition pos, Symbol location, Symbol sym) {
-            if (sym.kind.isOverloadError()) {
+            if (sym.kind.isResolutionError()) {
                 //if nothing is found return the 'first' error
                 sym = accessMethod(sym, pos, location, site, name, true, argtypes, typeargtypes);
             }
@@ -3339,7 +3339,7 @@
 
     boolean hasEnclosingInstance(Env<AttrContext> env, Type type) {
         Symbol encl = resolveSelfContainingInternal(env, type.tsym, false);
-        return encl != null && !encl.kind.isOverloadError();
+        return encl != null && !encl.kind.isResolutionError();
     }
 
     private Symbol resolveSelfContainingInternal(Env<AttrContext> env,
@@ -3521,7 +3521,7 @@
 
         @Override
         public Symbol access(Name name, TypeSymbol location) {
-            if (!sym.kind.isOverloadError() && sym.kind.matches(KindSelector.TYP))
+            if (!sym.kind.isResolutionError() && sym.kind.matches(KindSelector.TYP))
                 return types.createErrorType(name, location, sym.type).tsym;
             else
                 return sym;
@@ -4089,7 +4089,7 @@
             } else {
                 key = "bad.instance.method.in.unbound.lookup";
             }
-            return sym.kind.isOverloadError() ?
+            return sym.kind.isResolutionError() ?
                     ((ResolveError)sym).getDiagnostic(dkind, pos, location, site, name, argtypes, typeargtypes) :
                     diags.create(dkind, log.currentSource(), pos, key, Kinds.kindName(sym), sym);
         }
@@ -4268,8 +4268,8 @@
             @Override
             public Symbol mergeResults(Symbol bestSoFar, Symbol sym) {
                 //Check invariants (see {@code LookupHelper.shouldStop})
-                Assert.check(bestSoFar.kind.isOverloadError() && bestSoFar.kind != AMBIGUOUS);
-                if (!sym.kind.isOverloadError()) {
+                Assert.check(bestSoFar.kind.isResolutionError() && bestSoFar.kind != AMBIGUOUS);
+                if (!sym.kind.isResolutionError()) {
                     //varargs resolution successful
                     return sym;
                 } else {
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Code.java	Fri Mar 27 16:40:35 2015 -0700
@@ -2166,7 +2166,11 @@
         boolean keepLocalVariables = varDebugInfo ||
             (var.sym.isExceptionParameter() && var.sym.hasTypeAnnotations());
         if (!keepLocalVariables) return;
-        if ((var.sym.flags() & Flags.SYNTHETIC) != 0) return;
+        //don't keep synthetic vars, unless they are lambda method parameters
+        boolean ignoredSyntheticVar = (var.sym.flags() & Flags.SYNTHETIC) != 0 &&
+                ((var.sym.owner.flags() & Flags.LAMBDA_METHOD) == 0 ||
+                 (var.sym.flags() & Flags.PARAMETER) == 0);
+        if (ignoredSyntheticVar) return;
         if (varBuffer == null)
             varBuffer = new LocalVar[20];
         else
--- a/test/tools/javac/MethodParameters/LambdaTest.out	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/MethodParameters/LambdaTest.out	Fri Mar 27 16:40:35 2015 -0700
@@ -2,6 +2,6 @@
 LambdaTest.<init>()
 LambdaTest.foo(i)
 LambdaTest.lambda$static$1(x1/*synthetic*/)/*synthetic*/
-LambdaTest.lambda$null$0(final cap$0/*synthetic*/, x2/*synthetic*/)/*synthetic*/
+LambdaTest.lambda$null$0(final x1/*synthetic*/, x2/*synthetic*/)/*synthetic*/
 static interface LambdaTest$I -- inner
 LambdaTest$I.m(x)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/ConstructorTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for constructors.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build ConstructorTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver ConstructorTest
+ */
+
+import java.lang.ref.ReferenceQueue;
+import java.util.*;
+
+@ExpectedSignature(descriptor = "ConstructorTest", signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+public class ConstructorTest<T> {
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, boolean)", signature = "(TT;Z)V")
+    ConstructorTest(T a, boolean b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, byte)", signature = "(TT;B)V")
+    ConstructorTest(T a, byte b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, char)", signature = "(TT;C)V")
+    ConstructorTest(T a, char b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, short)", signature = "(TT;S)V")
+    ConstructorTest(T a, short b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, int)", signature = "(TT;I)V")
+    ConstructorTest(T a, int b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, long)", signature = "(TT;J)V")
+    ConstructorTest(T a, long b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, float)", signature = "(TT;F)V")
+    ConstructorTest(T a, float b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, double)", signature = "(TT;D)V")
+    ConstructorTest(T a, double b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, java.lang.Runnable)", signature = "(TT;Ljava/lang/Runnable;)V")
+    ConstructorTest(T a, Runnable r) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, boolean[])", signature = "(TT;[Z)V")
+    ConstructorTest(T a, boolean[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, byte[])", signature = "(TT;[B)V")
+    ConstructorTest(T a, byte[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, char[])", signature = "(TT;[C)V")
+    ConstructorTest(T a, char[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, short[])", signature = "(TT;[S)V")
+    ConstructorTest(T a, short[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, int[])", signature = "(TT;[I)V")
+    ConstructorTest(T a, int[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, long[])", signature = "(TT;[J)V")
+    ConstructorTest(T a, long[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, float[])", signature = "(TT;[F)V")
+    ConstructorTest(T a, float[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, double[])", signature = "(TT;[D)V")
+    ConstructorTest(T a, double[] b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, java.lang.Runnable[])", signature = "(TT;[Ljava/lang/Runnable;)V")
+    ConstructorTest(T a, Runnable[] r) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object[])", signature = "([TT;)V")
+    ConstructorTest(T[] a) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Runnable[])",
+            signature = "<T::Ljava/lang/Runnable;>([TT;)V")
+    <T extends Runnable> ConstructorTest(T...a) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.util.Map)", signature = "(Ljava/util/Map<**>;)V")
+    ConstructorTest(Map<?, ?> a) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object)", signature = "(TT;)V")
+    ConstructorTest(T a) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.util.Set, java.util.Set)",
+            signature = "<E::Ljava/util/Set<+TT;>;>(TE;TE;)V")
+    <E extends Set<? extends T>> ConstructorTest(E a, E b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.ref.ReferenceQueue, java.lang.ref.ReferenceQueue)",
+            signature = "<E:Ljava/lang/ref/ReferenceQueue<-TT;>;:Ljava/util/Map<-TT;+TT;>;>(TE;TE;)V")
+    <E extends ReferenceQueue<? super T> & Map<? super T, ? extends T>> ConstructorTest(E a, E b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.util.List)", signature = "(Ljava/util/List<+TT;>;)V")
+    ConstructorTest(List<? extends T> b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.util.Set)", signature = "(Ljava/util/Set<-TT;>;)V")
+    ConstructorTest(Set<? super T> b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Runnable)", signature = "<E::Ljava/lang/Runnable;>(TE;)V")
+    <E extends Runnable> ConstructorTest(E a) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, java.lang.Object)", signature = "<E:TT;>(TT;TE;)V")
+    <E extends T> ConstructorTest(T a, E b) {
+    }
+
+    // no Signature attribute
+    ConstructorTest(boolean b) {
+    }
+
+    // no Signature attribute
+    ConstructorTest(HashMap a) {
+    }
+
+    // no Signature attribute
+    ConstructorTest(boolean[] b) {
+    }
+
+    // no Signature attribute
+    ConstructorTest(HashMap[] a) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/Driver.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,239 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import com.sun.tools.classfile.*;
+import com.sun.tools.classfile.Field;
+import com.sun.tools.classfile.Method;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.lang.reflect.*;
+import java.util.*;
+import java.util.function.Function;
+import java.util.function.Predicate;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+/**
+ * The main class of Signature tests.
+ * Driver reads golden data of each class member that must have a Signature attribute,
+ * after that the class compares expected data with actual one.
+ *
+ * Example of usage Driver:
+ * java Driver Test
+ *
+ * Each member of the class Test should have @ExpectedSignature annotations
+ * if it must have the Signature attribute. Anonymous class cannot be annotated.
+ * So its enclosing class should be annotated and method isAnonymous
+ * of ExpectedSignature must return true.
+ */
+public class Driver extends TestResult {
+
+    private final static String ACC_BRIDGE = "ACC_BRIDGE";
+
+    private final String topLevelClassName;
+    private final File[] files;
+
+    public Driver(String topLevelClassName) {
+        this.topLevelClassName = topLevelClassName;
+        // Get top level class and all inner classes.
+        FilenameFilter filter = (dir, file) ->
+                file.equals(topLevelClassName + ".class")
+                        || file.matches(topLevelClassName + "\\$.*\\.class");
+        files = getClassDir().listFiles(filter);
+    }
+
+    private boolean isAnonymous(String className) {
+        return className.matches(".*\\$\\d+$");
+    }
+
+    private Class<?> getEnclosingClass(String className) throws ClassNotFoundException {
+        return Class.forName(className.replaceFirst("\\$\\d+$", ""));
+    }
+
+    private ExpectedSignature getExpectedClassSignature(String className, Class<?> clazz)
+            throws ClassNotFoundException {
+        // anonymous class cannot be annotated, so information about anonymous class
+        // is located in its enclosing class.
+        boolean isAnonymous = isAnonymous(className);
+        clazz = isAnonymous ? getEnclosingClass(className) : clazz;
+        return Stream.of(clazz.getAnnotationsByType(ExpectedSignature.class))
+                .filter(s -> s.isAnonymous() == isAnonymous)
+                .collect(Collectors.toMap(ExpectedSignature::descriptor, Function.identity()))
+                .get(className);
+    }
+
+    // Class.getName() cannot be used here, because the method can rely on signature attribute.
+    private Map<String, ExpectedSignature> getClassExpectedSignature(String className, Class<?> clazz)
+            throws ClassNotFoundException {
+        Map<String, ExpectedSignature> classSignatures = new HashMap<>();
+        ExpectedSignature classSignature = getExpectedClassSignature(className, clazz);
+        if (classSignature != null) {
+            classSignatures.put(className, classSignature);
+        }
+        return classSignatures;
+    }
+
+    private Map<String, ExpectedSignature> getExpectedExecutableSignatures(Executable[] executables,
+                                                                           Predicate<Executable> filterBridge) {
+        return Stream.of(executables)
+                .filter(filterBridge)
+                .map(e -> e.getAnnotation(ExpectedSignature.class))
+                .filter(Objects::nonNull)
+                .collect(Collectors.toMap(ExpectedSignature::descriptor, Function.identity()));
+    }
+
+    private Map<String, ExpectedSignature> getExpectedMethodSignatures(Class<?> clazz) {
+        Map<String, ExpectedSignature> methodSignatures =
+                getExpectedExecutableSignatures(clazz.getDeclaredMethods(),
+                        m -> !((java.lang.reflect.Method) m).isBridge());
+        methodSignatures.putAll(
+                getExpectedExecutableSignatures(clazz.getDeclaredConstructors(),
+                        m -> true));
+        return methodSignatures;
+    }
+
+    private Map<String, ExpectedSignature> getExpectedFieldSignatures(Class<?> clazz) {
+        return Stream.of(clazz.getDeclaredFields())
+                .map(f -> f.getAnnotation(ExpectedSignature.class))
+                .filter(Objects::nonNull)
+                .collect(Collectors.toMap(ExpectedSignature::descriptor, Function.identity()));
+    }
+
+    public void test() throws TestFailedException {
+        try {
+            addTestCase("Source is " + topLevelClassName + ".java");
+            assertTrue(files.length > 0, "No class files found");
+            for (File file : files) {
+                try {
+                    String className = file.getName().replace(".class", "");
+                    Class<?> clazz = Class.forName(className);
+                    printf("Testing class %s\n", className);
+                    ClassFile classFile = readClassFile(file);
+
+                    // test class signature
+                    testAttribute(
+                            className,
+                            classFile,
+                            () -> (Signature_attribute) classFile.getAttribute(Attribute.Signature),
+                            getClassExpectedSignature(className, clazz).get(className));
+
+                    testFields(getExpectedFieldSignatures(clazz), classFile);
+
+                    testMethods(getExpectedMethodSignatures(clazz), classFile);
+                } catch (Exception e) {
+                    addFailure(e);
+                }
+            }
+        } catch (Exception e) {
+            addFailure(e);
+        } finally {
+            checkStatus();
+        }
+    }
+
+    private void checkAllMembersFound(Set<String> found, Map<String, ExpectedSignature> signatures, String message) {
+        if (signatures != null) {
+            checkContains(found,
+                    signatures.values().stream()
+                            .map(ExpectedSignature::descriptor)
+                            .collect(Collectors.toSet()),
+                    message);
+        }
+    }
+
+    private void testMethods(Map<String, ExpectedSignature> expectedSignatures, ClassFile classFile)
+            throws ConstantPoolException, Descriptor.InvalidDescriptor {
+        String className = classFile.getName();
+        Set<String> foundMethods = new HashSet<>();
+        for (Method method : classFile.methods) {
+            String methodName = getMethodName(classFile, method);
+            printf("Testing method %s\n", methodName);
+            if (method.access_flags.getMethodFlags().contains(ACC_BRIDGE)) {
+                printf("Bridge method is skipped : %s\n", methodName);
+                continue;
+            }
+            testAttribute(
+                    methodName,
+                    classFile,
+                    () -> (Signature_attribute) method.attributes.get(Attribute.Signature),
+                    expectedSignatures.get(methodName));
+            foundMethods.add(methodName);
+        }
+        checkAllMembersFound(foundMethods, expectedSignatures,
+                "Checking that all methods of class " + className + " with Signature attribute found");
+    }
+
+    private String getMethodName(ClassFile classFile, Method method)
+            throws ConstantPoolException, Descriptor.InvalidDescriptor {
+        return String.format("%s%s",
+                method.getName(classFile.constant_pool),
+                method.descriptor.getParameterTypes(classFile.constant_pool));
+    }
+
+    private void testFields(Map<String, ExpectedSignature> expectedSignatures, ClassFile classFile)
+            throws ConstantPoolException {
+        String className = classFile.getName();
+        Set<String> foundFields = new HashSet<>();
+        for (Field field : classFile.fields) {
+            String fieldName = field.getName(classFile.constant_pool);
+            printf("Testing field %s\n", fieldName);
+            testAttribute(
+                    fieldName,
+                    classFile,
+                    () -> (Signature_attribute) field.attributes.get(Attribute.Signature),
+                    expectedSignatures.get(fieldName));
+            foundFields.add(fieldName);
+        }
+        checkAllMembersFound(foundFields, expectedSignatures,
+                "Checking that all fields of class " + className + " with Signature attribute found");
+    }
+
+    private void testAttribute(
+            String memberName,
+            ClassFile classFile,
+            Supplier<Signature_attribute> sup,
+            ExpectedSignature expectedSignature)
+            throws ConstantPoolException {
+
+        Signature_attribute attribute = sup.get();
+        if (expectedSignature != null && checkNotNull(attribute, memberName + " must have attribute")) {
+            checkEquals(classFile.constant_pool.getUTF8Value(attribute.attribute_name_index),
+                    "Signature", "Attribute's name : " + memberName);
+            checkEquals(attribute.attribute_length, 2, "Attribute's length : " + memberName);
+            checkEquals(attribute.getSignature(classFile.constant_pool),
+                    expectedSignature.signature(),
+                    "Testing signature of : " + memberName);
+        } else {
+            checkNull(attribute, memberName + " must not have attribute");
+        }
+    }
+
+    public static void main(String[] args) throws TestFailedException {
+        if (args.length != 1) {
+            throw new IllegalArgumentException("Usage: Driver <class-name>");
+        }
+        new Driver(args[0]).test();
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/EnumTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for enum.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build EnumTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver EnumTest
+ */
+
+@ExpectedSignature(descriptor = "EnumTest", signature = "Ljava/lang/Enum<LEnumTest;>;")
+public enum EnumTest {;
+    // see 8026480
+    @ExpectedSignature(descriptor = "<init>(java.lang.String, int)", signature = "()V")
+    private EnumTest() {}
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/ExceptionTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,98 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for methods which throw exceptions.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build ExceptionTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver ExceptionTest
+ */
+
+import java.io.IOError;
+import java.io.IOException;
+
+@ExpectedSignature(descriptor = "ExceptionTest",
+        signature = "<Exc:Ljava/lang/RuntimeException;:Ljava/lang/Runnable;>Ljava/lang/Object;")
+public class ExceptionTest<Exc extends RuntimeException & Runnable> {
+
+    @ExpectedSignature(descriptor = "<init>()", signature = "<E:Ljava/lang/Exception;>()V^TE;")
+    <E extends Exception> ExceptionTest() throws E {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(int)",
+            signature = "<E:Ljava/lang/Exception;>(I)V^Ljava/io/IOException;^TE;^Ljava/io/IOError;")
+    <E extends Exception> ExceptionTest(int a) throws IOException, E, IOError {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(long)", signature = "(J)V^TExc;")
+    ExceptionTest(long a) throws Exc {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(byte)", signature = "(B)V^Ljava/io/IOError;^TExc;^Ljava/io/IOException;")
+    ExceptionTest(byte a) throws IOError, Exc, IOException {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.RuntimeException)", signature = "(TExc;)V")
+    ExceptionTest(Exc a) throws IOException {
+    }
+
+    // no Signature attribute
+    ExceptionTest(String a) throws IOError {
+    }
+
+    void noSignatureAttributeMethod() throws IOException {
+    }
+
+    @ExpectedSignature(descriptor = "genericMethod(int)", signature = "(I)V^TExc;")
+    void genericMethod(int a) throws Exc {
+    }
+
+    @ExpectedSignature(descriptor = "genericMethod(long)", signature = "(J)V^TExc;^Ljava/io/IOException;")
+    void genericMethod(long a) throws Exc, IOException {
+    }
+
+    @ExpectedSignature(descriptor = "genericMethod(java.lang.RuntimeException)", signature = "(TExc;)V")
+    void genericMethod(Exc a) throws IOError {
+    }
+
+    static void staticNoSignatureAttributeMethod() throws IOException {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericMethod(int)",
+            signature = "<E:Ljava/lang/Exception;:Ljava/lang/Runnable;>(I)V^TE;")
+    static <E extends Exception & Runnable> void staticGenericMethod(int a) throws E {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericMethod(long)",
+            signature = "<E:Ljava/lang/Exception;>(J)V^Ljava/io/IOError;^TE;^Ljava/io/IOException;")
+    static <E extends Exception> void staticGenericMethod(long a) throws IOError, E, IOException {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericMethod(java.lang.Exception)",
+            signature = "<E:Ljava/lang/Exception;>(TE;)V")
+    static <E extends Exception> void staticGenericMethod(E a) throws IOError {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/ExpectedSignature.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.annotation.Repeatable;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Repeatable(ExpectedSignatureContainer.class)
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpectedSignature {
+    boolean isAnonymous() default false;
+    String descriptor();
+    String signature();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/ExpectedSignatureContainer.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ExpectedSignatureContainer {
+    ExpectedSignature[] value();
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/FieldTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,206 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for fields.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build FieldTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver FieldTest
+ */
+
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+@ExpectedSignature(descriptor = "FieldTest", signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+public class FieldTest<T> {
+
+    @ExpectedSignature(descriptor = "typeInList", signature = "Ljava/util/List<TT;>;")
+    List<T> typeInList;
+
+    @ExpectedSignature(descriptor = "boundsType", signature = "Ljava/util/List<Ljava/util/Map<+TT;-TT;>;>;")
+    List<Map<? extends T, ? super T>> boundsType;
+
+    @ExpectedSignature(descriptor = "type", signature = "TT;")
+    T type;
+
+    @ExpectedSignature(descriptor = "typeInArray", signature = "[TT;")
+    T[] typeInArray;
+
+    @ExpectedSignature(descriptor = "byteArrayInList", signature = "Ljava/util/List<[B>;")
+    List<byte[]> byteArrayInList;
+
+    @ExpectedSignature(descriptor = "shortArrayInList", signature = "Ljava/util/List<[S>;")
+    List<short[]> shortArrayInList;
+
+    @ExpectedSignature(descriptor = "intArrayInList", signature = "Ljava/util/List<[I>;")
+    List<int[]> intArrayInList;
+
+    @ExpectedSignature(descriptor = "longArrayInList", signature = "Ljava/util/List<[J>;")
+    List<long[]> longArrayInList;
+
+    @ExpectedSignature(descriptor = "charArrayInList", signature = "Ljava/util/List<[C>;")
+    List<char[]> charArrayInList;
+
+    @ExpectedSignature(descriptor = "booleanArrayInList", signature = "Ljava/util/List<[Z>;")
+    List<boolean[]> booleanArrayInList;
+
+    @ExpectedSignature(descriptor = "floatArrayInList", signature = "Ljava/util/List<[F>;")
+    List<float[]> floatArrayInList;
+
+    @ExpectedSignature(descriptor = "doubleArrayInList", signature = "Ljava/util/List<[D>;")
+    List<double[]> doubleArrayInList;
+
+    @ExpectedSignature(descriptor = "integerInList", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
+    List<Integer> integerInList;
+
+    @ExpectedSignature(descriptor = "typeInMultiArray", signature = "[[TT;")
+    T[][] typeInMultiArray;
+
+    @ExpectedSignature(descriptor = "arrayOfClasses", signature = "[Ljava/util/List<TT;>;")
+    List<T>[] arrayOfClasses;
+
+    @ExpectedSignature(descriptor = "extendsWildCard", signature = "Ljava/util/List<+TT;>;")
+    List<? extends T> extendsWildCard;
+
+    @ExpectedSignature(descriptor = "superWildCard", signature = "Ljava/util/Comparator<-TT;>;")
+    Comparator<? super T> superWildCard;
+
+    @ExpectedSignature(descriptor = "extendsSuperWildCard",
+            signature = "Ljava/util/List<+Ljava/util/Comparator<-TT;>;>;")
+    List<? extends Comparator<? super T>> extendsSuperWildCard;
+
+    @ExpectedSignature(descriptor = "wildCard", signature = "Ljava/util/Comparator<*>;")
+    Comparator<?> wildCard;
+
+    @ExpectedSignature(descriptor = "boundsBooleanArray", signature = "Ljava/util/Map<+[Z-[Z>;")
+    Map<? extends boolean[], ? super boolean[]> boundsBooleanArray;
+
+    @ExpectedSignature(descriptor = "boundsByteArray", signature = "Ljava/util/Map<+[B-[B>;")
+    Map<? extends byte[], ? super byte[]> boundsByteArray;
+
+    @ExpectedSignature(descriptor = "boundsShortArray", signature = "Ljava/util/Map<+[S-[S>;")
+    Map<? extends short[], ? super short[]> boundsShortArray;
+
+    @ExpectedSignature(descriptor = "boundsIntArray", signature = "Ljava/util/Map<+[I-[I>;")
+    Map<? extends int[], ? super int[]> boundsIntArray;
+
+    @ExpectedSignature(descriptor = "boundsLongArray", signature = "Ljava/util/Map<+[J-[J>;")
+    Map<? extends long[], ? super long[]> boundsLongArray;
+
+    @ExpectedSignature(descriptor = "boundsCharArray", signature = "Ljava/util/Map<+[C-[C>;")
+    Map<? extends char[], ? super char[]> boundsCharArray;
+
+    @ExpectedSignature(descriptor = "boundsFloatArray", signature = "Ljava/util/Map<+[F-[F>;")
+    Map<? extends float[], ? super float[]> boundsFloatArray;
+
+    @ExpectedSignature(descriptor = "boundsDoubleArray", signature = "Ljava/util/Map<+[D-[D>;")
+    Map<? extends double[], ? super double[]> boundsDoubleArray;
+
+    @ExpectedSignature(descriptor = "boundsObjectArray",
+            signature = "Ljava/util/Map<+[Ljava/lang/Object;-[Ljava/lang/Object;>;")
+    Map<? extends Object[], ? super Object[]> boundsObjectArray;
+
+    boolean booleanNoSignatureAttribute;
+    byte byteNoSignatureAttribute;
+    char charNoSignatureAttribute;
+    short shortNoSignatureAttribute;
+    int intNoSignatureAttribute;
+    long longNoSignatureAttribute;
+    float floatNoSignatureAttribute;
+    double doubleNoSignatureAttribute;
+
+    List listNoSignatureAttribute;
+
+    @ExpectedSignature(descriptor = "staticByteArrayInList", signature = "Ljava/util/List<[B>;")
+    static List<byte[]> staticByteArrayInList;
+
+    @ExpectedSignature(descriptor = "staticShortArrayInList", signature = "Ljava/util/List<[S>;")
+    static List<short[]> staticShortArrayInList;
+
+    @ExpectedSignature(descriptor = "staticIntArrayInList", signature = "Ljava/util/List<[I>;")
+    static List<int[]> staticIntArrayInList;
+
+    @ExpectedSignature(descriptor = "staticLongArrayInList", signature = "Ljava/util/List<[J>;")
+    static List<long[]> staticLongArrayInList;
+
+    @ExpectedSignature(descriptor = "staticCharArrayInList", signature = "Ljava/util/List<[C>;")
+    static List<char[]> staticCharArrayInList;
+
+    @ExpectedSignature(descriptor = "staticBooleanArrayInList", signature = "Ljava/util/List<[Z>;")
+    static List<boolean[]> staticBooleanArrayInList;
+
+    @ExpectedSignature(descriptor = "staticFloatArrayInList", signature = "Ljava/util/List<[F>;")
+    static List<float[]> staticFloatArrayInList;
+
+    @ExpectedSignature(descriptor = "staticDoubleArrayInList", signature = "Ljava/util/List<[D>;")
+    static List<double[]> staticDoubleArrayInList;
+
+    @ExpectedSignature(descriptor = "staticIntegerInList", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
+    static List<Integer> staticIntegerInList;
+
+    @ExpectedSignature(descriptor = "staticWildCard", signature = "Ljava/util/Comparator<*>;")
+    static Comparator<?> staticWildCard;
+
+    @ExpectedSignature(descriptor = "staticBoundsBooleanArray", signature = "Ljava/util/Map<+[Z-[Z>;")
+    static Map<? extends boolean[], ? super boolean[]> staticBoundsBooleanArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsByteArray", signature = "Ljava/util/Map<+[B-[B>;")
+    static Map<? extends byte[], ? super byte[]> staticBoundsByteArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsShortArray", signature = "Ljava/util/Map<+[S-[S>;")
+    static Map<? extends short[], ? super short[]> staticBoundsShortArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsIntArray", signature = "Ljava/util/Map<+[I-[I>;")
+    static Map<? extends int[], ? super int[]> staticBoundsIntArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsLongArray", signature = "Ljava/util/Map<+[J-[J>;")
+    static Map<? extends long[], ? super long[]> staticBoundsLongArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsCharArray", signature = "Ljava/util/Map<+[C-[C>;")
+    static Map<? extends char[], ? super char[]> staticBoundsCharArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsFloatArray", signature = "Ljava/util/Map<+[F-[F>;")
+    static Map<? extends float[], ? super float[]> staticBoundsFloatArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsDoubleArray", signature = "Ljava/util/Map<+[D-[D>;")
+    static Map<? extends double[], ? super double[]> staticBoundsDoubleArray;
+
+    @ExpectedSignature(descriptor = "staticBoundsObjectArray",
+            signature = "Ljava/util/Map<+[Ljava/lang/Object;-[Ljava/lang/Object;>;")
+    static Map<? extends Object[], ? super Object[]> staticBoundsObjectArray;
+
+    static boolean staticBooleanNoSignatureAttribute;
+    static byte staticByteNoSignatureAttribute;
+    static char staticCharNoSignatureAttribute;
+    static short staticShortNoSignatureAttribute;
+    static int staticIntNoSignatureAttribute;
+    static long staticLongNoSignatureAttribute;
+    static float staticFloatNoSignatureAttribute;
+    static double staticDoubleNoSignatureAttribute;
+
+    static List staticListNoSignatureAttribute;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/InnerClassTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,362 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for inner classes.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build InnerClassTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver InnerClassTest
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.Callable;
+
+@ExpectedSignature(descriptor = "InnerClassTest",
+        signature = "<T:Ljava/util/ArrayList<TT;>;:Ljava/lang/Runnable;>Ljava/lang/Object;")
+@ExpectedSignature(descriptor = "InnerClassTest$1",
+        signature = "LInnerClassTest$1Local1;", isAnonymous = true)
+@ExpectedSignature(descriptor = "InnerClassTest$2",
+        signature = "LInnerClassTest$1Local2<Ljava/util/ArrayList<TT;>;" +
+                "Ljava/util/Map<Ljava/util/ArrayList<TT;>;Ljava/util/ArrayList<TT;>;>;>;", isAnonymous = true)
+public class InnerClassTest<T extends ArrayList<T> & Runnable> {
+
+    {
+        class Local1 {
+            // no Signature attribute
+            Local1() {
+            }
+
+            @ExpectedSignature(descriptor = "genericType", signature = "TT;")
+            T genericType;
+
+            @ExpectedSignature(descriptor = "genericTypeArray", signature = "[TT;")
+            T[] genericTypeArray;
+        }
+
+        @ExpectedSignature(descriptor = "InnerClassTest$1Local2",
+                signature = "<T:Ljava/lang/Object;U::Ljava/util/Map<+TT;-TT;>;>Ljava/lang/Object;")
+        class Local2<T, U extends Map<? extends T, ? super T>> {
+            // no Signature attribute
+            Local2() {
+            }
+
+            @ExpectedSignature(descriptor = "<init>(InnerClassTest, java.lang.Object, java.util.Map)",
+                    signature = "(TT;TU;)V")
+            Local2(T a, U b) {
+            }
+
+            @ExpectedSignature(descriptor = "genericMethod(java.lang.Object[])",
+                    signature = "([TT;)[TU;")
+            U[] genericMethod(T...a) {
+                return null;
+            }
+        }
+
+        @ExpectedSignature(descriptor = "InnerClassTest$1Local3",
+                signature = "LInnerClassTest$1Local2<Ljava/util/ArrayList<TT;>;" +
+                        "Ljava/util/Map<Ljava/util/ArrayList<TT;>;Ljava/util/ArrayList<TT;>;>;>;")
+        class Local3 extends Local2<ArrayList<T>, Map<ArrayList<T>, ArrayList<T>>> {
+        }
+
+        new Local1() {
+            @ExpectedSignature(descriptor = "genericType", signature = "TT;")
+            T genericType;
+
+            @ExpectedSignature(descriptor = "genericTypeArray", signature = "[TT;")
+            T[] genericTypeArray;
+        };
+
+        new Local2<ArrayList<T>, Map<ArrayList<T>, ArrayList<T>>>() {
+        };
+    }
+
+    @ExpectedSignature(descriptor = "InnerClassTest$InnerClass1",
+            signature = "<E:TT;U::Ljava/util/Set<-TE;>;>Ljava/lang/Object;")
+    class InnerClass1<E extends T, U extends Set<? super E>> {
+        @ExpectedSignature(descriptor = "genericTypeArray", signature = "[TT;")
+        T[] genericTypeArray;
+
+        @ExpectedSignature(descriptor = "genericListExtendsBound", signature = "Ljava/util/List<+TT;>;")
+        List<? extends T> genericListExtendsBound;
+
+        @ExpectedSignature(descriptor = "genericListSuperBound", signature = "Ljava/util/List<-TU;>;")
+        List<? super U> genericListSuperBound;
+
+        @ExpectedSignature(descriptor = "genericListWildCard", signature = "Ljava/util/List<*>;")
+        List<?> genericListWildCard;
+
+        @ExpectedSignature(descriptor = "genericListExactType", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
+        List<Integer> genericListExactType;
+
+        @ExpectedSignature(descriptor = "listWithGenericType", signature = "Ljava/util/List<TE;>;")
+        List<E> listWithGenericType;
+
+        List listNoSignatureAttribute;
+
+        // no Signature attribute
+        InnerClass1(List a) {
+        }
+
+        @ExpectedSignature(descriptor = "<init>(InnerClassTest, java.util.ArrayList)",
+                signature = "(TT;)V")
+        InnerClass1(T a) {
+        }
+
+        @ExpectedSignature(descriptor = "<init>(InnerClassTest, java.util.ArrayList, java.util.ArrayList)",
+                signature = "(TT;TE;)V")
+        InnerClass1(T a, E b) {
+        }
+
+        @ExpectedSignature(descriptor = "genericMethod(java.util.ArrayList)",
+                signature = "(TT;)TE;")
+        E genericMethod(T a) {
+            return null;
+        }
+    }
+
+    @ExpectedSignature(descriptor = "InnerClassTest$InnerInterface",
+            signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+    interface InnerInterface<T> {
+        @ExpectedSignature(descriptor = "genericMethod(java.lang.Object)", signature = "(TT;)TT;")
+        T genericMethod(T a);
+
+        @ExpectedSignature(descriptor = "genericListExtendsBound", signature = "Ljava/util/List<+Ljava/lang/Number;>;")
+        List<? extends Number> genericListExtendsBound = null;
+
+        @ExpectedSignature(descriptor = "genericListSuperBound", signature = "Ljava/util/List<-Ljava/lang/Number;>;")
+        List<? super Number> genericListSuperBound = null;
+
+        @ExpectedSignature(descriptor = "genericListWildCard", signature = "Ljava/util/List<*>;")
+        List<?> genericListWildCard = null;
+
+        @ExpectedSignature(descriptor = "genericListExactType", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
+        List<Integer> genericListExactType = null;
+
+        List listNoSignatureAttribute = null;
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod1(java.util.List)",
+                signature = "(Ljava/util/List<-TT;>;)Ljava/util/List<+TT;>;")
+        List<? extends T> genericBoundsMethod1(List<? super T> a);
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod2(java.util.List)",
+                signature = "(Ljava/util/List<+TT;>;)Ljava/util/List<-TT;>;")
+        List<? super T> genericBoundsMethod2(List<? extends T> a);
+
+        @ExpectedSignature(descriptor = "genericWildCardMethod(java.util.Map)",
+                signature = "(Ljava/util/Map<**>;)Ljava/util/Map<**>;")
+        Map<?, ?> genericWildCardMethod(Map<?, ?> a);
+
+        @ExpectedSignature(descriptor = "defaultGenericMethod(java.util.List, java.util.List, java.util.Map)",
+                signature = "(Ljava/util/List<+TT;>;Ljava/util/List<-TT;>;Ljava/util/Map<**>;)Ljava/util/List<*>;")
+        default List<?> defaultGenericMethod(List<? extends T> list1, List<? super T> list2, Map<?, ?> map) { return null; }
+
+
+        default List defaultNoSignatureAttributeMethod(List list1, List list2, Map list3) { return null; }
+
+        @ExpectedSignature(descriptor = "staticGenericMethod(java.util.List, java.util.List, java.util.Map)",
+                signature = "<T::Ljava/lang/Runnable;>(Ljava/util/List<+TT;>;Ljava/util/List<-TT;>;Ljava/util/Map<**>;)Ljava/util/List<*>;")
+        static <T extends Runnable> List<?> staticGenericMethod(List<? extends T> list1, List<? super T> list2, Map<?, ?> map) { return null; }
+
+
+        static List staticNoSignatureAttributeMethod(List list1, List list2, Map list3) { return null; }
+    }
+
+    @ExpectedSignature(descriptor = "InnerClassTest$InnerClass2",
+            signature = "LInnerClassTest<TT;>.InnerClass1<TT;Ljava/util/Set<TT;>;>;LInnerClassTest$InnerInterface<TT;>;")
+    class InnerClass2 extends InnerClass1<T, Set<T>> implements InnerInterface<T> {
+
+        // no Signature attribute
+        InnerClass2() {
+            super(null);
+        }
+
+        @ExpectedSignature(descriptor = "<init>(InnerClassTest, java.util.ArrayList)",
+                signature = "(TT;)V")
+        InnerClass2(T a) {
+            super(a);
+        }
+
+        @ExpectedSignature(descriptor = "<init>(InnerClassTest, java.util.ArrayList, java.util.ArrayList)",
+                signature = "(TT;TT;)V")
+        InnerClass2(T a, T b) {
+            super(a, b);
+        }
+
+        @ExpectedSignature(descriptor = "genericMethod(java.util.ArrayList)", signature = "(TT;)TT;")
+        @Override
+        public T genericMethod(T a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod1(java.util.List)",
+                signature = "(Ljava/util/List<-TT;>;)Ljava/util/List<+TT;>;")
+        @Override
+        public List<? extends T> genericBoundsMethod1(List<? super T> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod2(java.util.List)",
+                signature = "(Ljava/util/List<+TT;>;)Ljava/util/List<-TT;>;")
+        @Override
+        public List<? super T> genericBoundsMethod2(List<? extends T> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericWildCardMethod(java.util.Map)",
+                signature = "(Ljava/util/Map<**>;)Ljava/util/Map<**>;")
+        @Override
+        public Map<?, ?> genericWildCardMethod(Map<?, ?> a) {
+            return null;
+        }
+    }
+
+    @ExpectedSignature(descriptor = "InnerClassTest$StaticInnerClass",
+            signature = "<T:Ljava/lang/String;E::Ljava/util/Set<TT;>;>" +
+                    "Ljava/lang/Object;LInnerClassTest$InnerInterface<TE;>;")
+    static class StaticInnerClass<T extends String, E extends Set<T>> implements InnerInterface<E> {
+        // no Signature attribute
+        StaticInnerClass(List a) {
+        }
+
+        @ExpectedSignature(descriptor = "<init>(java.lang.Runnable)",
+                signature = "<E::Ljava/lang/Runnable;>(TE;)V")
+        <E extends Runnable> StaticInnerClass(E a) {
+        }
+
+        @ExpectedSignature(descriptor = "<init>(java.lang.String)",
+                signature = "(TT;)V")
+        StaticInnerClass(T a) {
+        }
+
+        @ExpectedSignature(descriptor = "<init>(java.lang.String, java.util.Set)",
+                signature = "(TT;TE;)V")
+        StaticInnerClass(T a, E b) {
+        }
+
+        @ExpectedSignature(descriptor = "genericListExtendsBound", signature = "Ljava/util/List<+Ljava/lang/Number;>;")
+        static List<? extends Number> genericListExtendsBound;
+
+        @ExpectedSignature(descriptor = "genericListSuperBound", signature = "Ljava/util/List<-Ljava/lang/Number;>;")
+        static List<? super Number> genericListSuperBound;
+
+        @ExpectedSignature(descriptor = "genericListWildCard", signature = "Ljava/util/List<*>;")
+        static List<?> genericListWildCard;
+
+        @ExpectedSignature(descriptor = "genericListExactType", signature = "Ljava/util/List<Ljava/lang/Integer;>;")
+        static List<Integer> genericListExactType;
+
+        static List listNoSignatureAttribute;
+
+        @ExpectedSignature(descriptor = "genericMethod(java.util.Set)",
+                signature = "(TE;)TE;")
+        @Override
+        public E genericMethod(E a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod1(java.util.List)",
+                signature = "(Ljava/util/List<-TE;>;)Ljava/util/List<+TE;>;")
+        @Override
+        public List<? extends E> genericBoundsMethod1(List<? super E> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericBoundsMethod2(java.util.List)",
+                signature = "(Ljava/util/List<+TE;>;)Ljava/util/List<-TE;>;")
+        @Override
+        public List<? super E> genericBoundsMethod2(List<? extends E> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "genericWildCardMethod(java.util.Map)",
+                signature = "(Ljava/util/Map<**>;)Ljava/util/Map<**>;")
+        @Override
+        public Map<?, ?> genericWildCardMethod(Map<?, ?> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "staticGenericMethod(java.lang.Object)",
+                signature = "<E:Ljava/lang/Object;>(TE;)TE;")
+        public static <E> E staticGenericMethod(E a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "staticGenericBoundsMethod1(java.util.List)",
+                signature = "<E:Ljava/lang/Object;>(Ljava/util/List<-TE;>;)Ljava/util/List<+TE;>;")
+        public static <E> List<? extends E> staticGenericBoundsMethod1(List<? super E> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "staticGenericBoundsMethod2(java.util.List)",
+                signature = "<E:Ljava/lang/Object;>(Ljava/util/List<+TE;>;)Ljava/util/List<-TE;>;")
+        public static <E> List<? super E> staticGenericBoundsMethod2(List<? extends E> a) {
+            return null;
+        }
+
+        @ExpectedSignature(descriptor = "staticGenericWildCardMethod(java.util.Map)",
+                signature = "<E:Ljava/lang/Object;>(Ljava/util/Map<**>;)Ljava/util/Map<**>;")
+        public static <E> Map<?, ?> staticGenericWildCardMethod(Map<?, ?> a) {
+            return null;
+        }
+    }
+
+    @ExpectedSignature(descriptor = "InnerClassTest$InnerClass3",
+            signature = "Ljava/lang/Object;LInnerClassTest$ExceptionHolder" +
+                    "<Ljava/lang/RuntimeException;>;Ljava/util/concurrent/Callable<Ljava/util/Map<**>;>;")
+    public static class InnerClass3 implements  ExceptionHolder<RuntimeException>, Callable<Map<?, ?>> {
+        @ExpectedSignature(descriptor = "call()", signature = "()Ljava/util/Map<**>;")
+        @Override
+        public Map<?, ?> call() throws Exception {
+            return null;
+        }
+
+        @Override
+        public void Throw() throws RuntimeException {
+        }
+
+        @Override
+        public RuntimeException Return() {
+            return null;
+        }
+    }
+
+    /**
+     * Class is for checking that the Signature attribute is not generated
+     * for overridden methods despite of the appropriate methods in the parent class
+     * have the Signature attribute.
+     */
+    @ExpectedSignature(descriptor = "InnerClassTest$ExceptionHolder",
+            signature = "<E:Ljava/lang/Exception;>Ljava/lang/Object;")
+    interface ExceptionHolder<E extends Exception> {
+        @ExpectedSignature(descriptor = "Throw()", signature = "()V^TE;")
+        void Throw() throws E;
+        @ExpectedSignature(descriptor = "Return()", signature = "()TE;")
+        E Return();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/MethodParameterTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,203 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for method parameters.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build MethodParameterTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver MethodParameterTest
+ */
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+@ExpectedSignature(descriptor = "MethodParameterTest", signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+public class MethodParameterTest<T> {
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, java.util.Set, java.util.ArrayList)",
+            signature = "<E:TT;U::Ljava/util/List<TE;>;:Ljava/lang/Runnable;>" +
+                    "(TT;Ljava/util/Set<-TE;>;Ljava/util/ArrayList<+Ljava/util/Set<TU;>;>;)V")
+    <E extends T, U extends List<E> & Runnable>
+    MethodParameterTest(T a, Set<? super E> b, ArrayList<? extends Set<U>> c) {
+    }
+
+    @ExpectedSignature(descriptor = "method(java.lang.Object, java.util.List, java.util.ArrayList)",
+            signature = "<E:TT;U::Ljava/util/List<TE;>;:Ljava/lang/Runnable;>" +
+                    "(TT;TU;Ljava/util/ArrayList<+Ljava/util/Set<TU;>;>;)V")
+    <E extends T, U extends List<E> & Runnable>
+    void method(T a, U b, ArrayList<? extends Set<U>> c) {
+    }
+
+    @ExpectedSignature(descriptor = "staticMethod(java.util.Set, java.util.List[], java.util.Map)",
+            signature = "<T::Ljava/util/List<*>;E::Ljava/util/Set<-TT;>;>(TE;[TT;Ljava/util/Map<*+TE;>;)TE;")
+    static <T extends List<?>, E extends Set<? super T>> E staticMethod(E a, T[] b, Map<?, ? extends E> c) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, boolean[])", signature = "(TT;[Z)V")
+    MethodParameterTest(T a, boolean...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, char[])", signature = "(TT;[C)V")
+    MethodParameterTest(T a, char...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, byte[])", signature = "(TT;[B)V")
+    MethodParameterTest(T a, byte...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, short[])", signature = "(TT;[S)V")
+    MethodParameterTest(T a, short...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, int[])", signature = "(TT;[I)V")
+    MethodParameterTest(T a, int...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, long[])", signature = "(TT;[J)V")
+    MethodParameterTest(T a, long...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, float[])", signature = "(TT;[F)V")
+    MethodParameterTest(T a, float...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, double[])", signature = "(TT;[D)V")
+    MethodParameterTest(T a, double...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object, java.lang.Object[])",
+            signature = "(TT;[Ljava/lang/Object;)V")
+    MethodParameterTest(T a, Object...b) {
+    }
+
+    @ExpectedSignature(descriptor = "<init>(java.lang.Object[])", signature = "([TT;)V")
+    MethodParameterTest(T...a) {
+    }
+
+    // no Signature attribute
+    MethodParameterTest(int...a) {
+    }
+
+    @ExpectedSignature(descriptor = "genericBooleanMethod(java.lang.Object, boolean[])", signature = "(TT;[Z)V")
+    void genericBooleanMethod(T a, boolean...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericCharMethod(java.lang.Object, char[])", signature = "(TT;[C)V")
+    void genericCharMethod(T a, char...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericByteMethod(java.lang.Object, byte[])", signature = "(TT;[B)V")
+    void genericByteMethod(T a, byte...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericShortMethod(java.lang.Object, short[])", signature = "(TT;[S)V")
+    void genericShortMethod(T a, short...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericIntMethod(java.lang.Object, int[])", signature = "(TT;[I)V")
+    void genericIntMethod(T a, int...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericLongMethod(java.lang.Object, long[])", signature = "(TT;[J)V")
+    void genericLongMethod(T a, long...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericFloatMethod(java.lang.Object, float[])", signature = "(TT;[F)V")
+    void genericFloatMethod(T a, float...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericDoubleMethod(java.lang.Object, double[])", signature = "(TT;[D)V")
+    void genericDoubleMethod(T a, double...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericObjectMethod(java.lang.Object, java.lang.Object[])",
+            signature = "(TT;[Ljava/lang/Object;)V")
+    void genericObjectMethod(T a, Object...b) {
+    }
+
+    @ExpectedSignature(descriptor = "genericMethod(java.lang.Object[])", signature = "([TT;)V")
+    void genericMethod(T...a) {
+    }
+
+    void noSignature(int...a) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericBooleanMethod(java.lang.Object, boolean[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[Z)V")
+    static <T> void staticGenericBooleanMethod(T a, boolean...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericCharMethod(java.lang.Object, char[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[C)V")
+    static <T> void staticGenericCharMethod(T a, char...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericByteMethod(java.lang.Object, byte[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[B)V")
+    static <T> void staticGenericByteMethod(T a, byte...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericShortMethod(java.lang.Object, short[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[S)V")
+    static <T> void staticGenericShortMethod(T a, short...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericIntMethod(java.lang.Object, int[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[I)V")
+    static <T> void staticGenericIntMethod(T a, int...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericLongMethod(java.lang.Object, long[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[J)V")
+    static <T> void staticGenericLongMethod(T a, long...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericFloatMethod(java.lang.Object, float[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[F)V")
+    static <T> void staticGenericFloatMethod(T a, float...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericDoubleMethod(java.lang.Object, double[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[D)V")
+    static <T> void staticGenericDoubleMethod(T a, double...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericObjectMethod(java.lang.Object, java.lang.Object[])",
+            signature = "<T:Ljava/lang/Object;>(TT;[Ljava/lang/Object;)V")
+    static <T> void staticGenericObjectMethod(T a, Object...b) {
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericMethod(java.lang.Object[])",
+            signature = "<T:Ljava/lang/Object;>([TT;)V")
+    static <T> void staticGenericMethod(T...a) {
+    }
+
+    static void staticNoSignatureAttribute(int...a) {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/MethodTypeBoundTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for type bounds.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build MethodTypeBoundTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver MethodTypeBoundTest
+ */
+
+import java.util.*;
+
+@ExpectedSignature(descriptor = "MethodTypeBoundTest", signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+public class MethodTypeBoundTest<T> {
+
+    @ExpectedSignature(descriptor = "method1(java.lang.String)",
+            signature = "<E:Ljava/lang/String;:Ljava/lang/Runnable;:Ljava/util/Collection<+TT;>;>(TE;)TE;")
+    <E extends String & Runnable & Collection<? extends T>> E method1(E a) {
+        return a;
+    }
+
+    @ExpectedSignature(descriptor = "method2(java.lang.Runnable)",
+            signature = "<E::Ljava/lang/Runnable;:Ljava/util/Collection<-TT;>;>(TE;)TE;")
+    <E extends Runnable & Collection<? super T>> E method2(E a) {
+        return a;
+    }
+
+    @ExpectedSignature(descriptor = "method3(java.util.ArrayList)",
+            signature = "<E:Ljava/util/ArrayList<+TT;>;>(TE;)TE;")
+    <E extends ArrayList<? extends T>> E method3(E a) {
+        return a;
+    }
+
+    @ExpectedSignature(descriptor = "method4(java.util.LinkedList)",
+            signature = "<E:Ljava/util/LinkedList<TE;>;:Ljava/util/List<TE;>;>(TE;)TE;")
+    <E extends LinkedList<E> & List<E>> E method4(E a) {
+        return a;
+    }
+
+    @ExpectedSignature(descriptor = "method5(java.util.Iterator)",
+            signature = "<E:Ljava/util/LinkedList<TE;>;:Ljava/util/List<TE;>;" +
+                    "U::Ljava/util/Iterator<-LMethodTypeBoundTest<TT;>.InnerClass<TE;>;>;>(TU;)TE;")
+    <E extends LinkedList<E> & List<E>, U extends Iterator<? super InnerClass<E>>> E method5(U a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "method6()",
+            signature = "<E:Ljava/util/LinkedList<TT;>;U:TE;>()V")
+    <E extends LinkedList<T>, U extends E> void method6() {
+    }
+
+    @ExpectedSignature(descriptor = "MethodTypeBoundTest$InnerClass",
+            signature = "<T:Ljava/lang/Object;>Ljava/lang/Object;")
+    class InnerClass<T> {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/tools/javac/classfiles/attributes/Signature/ReturnTypeTest.java	Fri Mar 27 16:40:35 2015 -0700
@@ -0,0 +1,549 @@
+/*
+ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/*
+ * @test
+ * @bug 8049238
+ * @summary Checks Signature attribute for array return type of method.
+ * @library /tools/lib /tools/javac/lib ../lib
+ * @build TestBase TestResult InMemoryFileManager ToolBox
+ * @build ReturnTypeTest Driver ExpectedSignature ExpectedSignatureContainer
+ * @run main Driver ReturnTypeTest
+ */
+
+import java.awt.Frame;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+
+@ExpectedSignature(descriptor = "ReturnTypeTest",
+        signature = "<T:Ljava/awt/Frame;:Ljava/lang/Runnable;:Ljava/util/concurrent/Callable<[TT;>;>Ljava/lang/Object;")
+public class ReturnTypeTest<T extends Frame & Runnable & Callable<T[]>> {
+
+    @ExpectedSignature(descriptor = "byteArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[B")
+    byte[] byteArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "shortArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[S")
+    short[] shortArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "charArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[C")
+    char[] charArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "intArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[I")
+    int[] intArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "longArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[J")
+    long[] longArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "booleanArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[Z")
+    boolean[] booleanArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "floatArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[F")
+    float[] floatArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "doubleArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[D")
+    double[] doubleArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "objectArrayReturnType(java.awt.Frame)",
+            signature = "(TT;)[Ljava/lang/Object;")
+    Object[] objectArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticByteArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[B")
+    static <T> byte[] staticByteArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticShortArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[S")
+    static <T> short[] staticShortArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticCharArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[C")
+    static <T> char[] staticCharArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticIntArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[I")
+    static <T> int[] staticIntArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticLongArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[J")
+    static <T> long[] staticLongArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticBooleanArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[Z")
+    static <T> boolean[] staticBooleanArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticFloatArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[F")
+    static <T> float[] staticFloatArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticDoubleArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[D")
+    static <T> double[] staticDoubleArrayReturnType(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticObjectArrayReturnType(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)[Ljava/lang/Object;")
+    static <T> Object[] staticObjectArrayReturnType(T a) {
+        return null;
+    }
+
+    byte[] byteArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    short[] shortArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    char[] charArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    int[] intArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    long[] longArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    boolean[] booleanArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    float[] floatArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    double[] doubleArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    Object[] objectArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static byte[] staticByteArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static short[] staticShortArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static char[] staticCharArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static int[] staticIntArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static long[] staticLongArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static boolean[] staticBooleanArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static float[] staticFloatArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static double[] staticDoubleArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    static Object[] staticObjectArrayReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "typeReturnType()",
+            signature = "()TT;")
+    T typeReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "typeArrayReturnType()",
+            signature = "()[TT;")
+    T[] typeArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "extendsReturnType()",
+            signature = "<E:TT;>()TE;")
+    <E extends T> E extendsReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "extendsArrayReturnType()",
+            signature = "<E:TT;>()[TE;")
+    <E extends T> E[] extendsArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "genericListReturnType()",
+            signature = "()Ljava/util/List<TT;>;")
+    List<T> genericListReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "genericListArrayReturnType()",
+            signature = "()[Ljava/util/List<TT;>;")
+    List<T>[] genericListArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "extendsBoundReturnType()",
+            signature = "()Ljava/util/List<+TT;>;")
+    List<? extends T> extendsBoundReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "extendsBoundArrayReturnType()",
+            signature = "()[Ljava/util/List<+TT;>;")
+    List<? extends T>[] extendsBoundArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "superBoundReturnType()",
+            signature = "()Ljava/util/List<-TT;>;")
+    List<? super T> superBoundReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "superBoundArrayReturnType()",
+            signature = "()[Ljava/util/List<-TT;>;")
+    List<? super T>[] superBoundArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "wildcardReturnType()",
+            signature = "()Ljava/util/Map<**>;")
+    Map<?, ?> wildcardReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "wildcardArrayReturnType()",
+            signature = "()[Ljava/util/Map<**>;")
+    Map<?, ?>[] wildcardArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticTypeReturnType()",
+            signature = "<T:Ljava/lang/Object;>()TT;")
+    static <T> T staticTypeReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticTypeArrayReturnType()",
+            signature = "<T:Ljava/lang/Object;>()[TT;")
+    static <T> T[] staticTypeArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticExtendsReturnType()",
+            signature = "<T:Ljava/lang/Object;E:TT;>()TE;")
+    static <T, E extends T> E staticExtendsReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticExtendsArrayReturnType()",
+            signature = "<T:Ljava/lang/Object;E:TT;>()[TE;")
+    static <T, E extends T> E[] staticExtendsArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericListReturnType()",
+            signature = "<T:Ljava/lang/Object;>()Ljava/util/List<TT;>;")
+    static <T> List<T> staticGenericListReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticGenericListArrayReturnType()",
+            signature = "<T:Ljava/lang/Object;>()[Ljava/util/List<TT;>;")
+    static <T> List<T>[] staticGenericListArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticExtendsBoundReturnType()",
+            signature = "<T:Ljava/lang/Object;>()Ljava/util/List<+TT;>;")
+    static <T> List<? extends T> staticExtendsBoundReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticExtendsBoundArrayReturnType()",
+            signature = "<T:Ljava/lang/Object;>()[Ljava/util/List<+TT;>;")
+    static <T> List<? extends T>[] staticExtendsBoundArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticSuperBoundReturnType()",
+            signature = "<T:Ljava/lang/Object;>()Ljava/util/List<-TT;>;")
+    static <T> List<? super T> staticSuperBoundReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticSuperBoundArrayReturnType()",
+            signature = "<T:Ljava/lang/Object;>()[Ljava/util/List<-TT;>;")
+    static <T> List<? super T>[] staticSuperBoundArrayReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticWildcardReturnType()",
+            signature = "()Ljava/util/Map<**>;")
+    static Map<?, ?> staticWildcardReturnType() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticWildcardArrayReturnType()",
+            signature = "()[Ljava/util/Map<**>;")
+    static Map<?, ?>[] staticWildcardArrayReturnType() {
+        return null;
+    }
+
+    List noSignature() {
+        return null;
+    }
+
+    static List staticNoSignatureAttribute() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsBooleanArray()",
+            signature = "()Ljava/util/Map<+[Z-[Z>;")
+    Map<? extends boolean[], ? super boolean[]> boundsBooleanArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsByteArray()",
+            signature = "()Ljava/util/Map<+[B-[B>;")
+    Map<? extends byte[], ? super byte[]> boundsByteArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsShortArray()",
+            signature = "()Ljava/util/Map<+[S-[S>;")
+    Map<? extends short[], ? super short[]> boundsShortArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsIntArray()",
+            signature = "()Ljava/util/Map<+[I-[I>;")
+    Map<? extends int[], ? super int[]> boundsIntArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsLongArray()",
+            signature = "()Ljava/util/Map<+[J-[J>;")
+    Map<? extends long[], ? super long[]> boundsLongArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsCharArray()",
+            signature = "()Ljava/util/Map<+[C-[C>;")
+    Map<? extends char[], ? super char[]> boundsCharArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsFloatArray()",
+            signature = "()Ljava/util/Map<+[F-[F>;")
+    Map<? extends float[], ? super float[]> boundsFloatArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsDoubleArray()",
+            signature = "()Ljava/util/Map<+[D-[D>;")
+    Map<? extends double[], ? super double[]> boundsDoubleArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "boundsObjectArray()",
+            signature = "()Ljava/util/Map<+[Ljava/lang/Object;-[Ljava/lang/Object;>;")
+    Map<? extends Object[], ? super Object[]> boundsObjectArray() {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "voidMethod(java.awt.Frame)", signature = "(TT;)V")
+    void voidMethod(T a) {
+    }
+
+    @ExpectedSignature(descriptor = "byteMethod(java.awt.Frame)", signature = "(TT;)B")
+    byte byteMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "shortMethod(java.awt.Frame)", signature = "(TT;)S")
+    short shortMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "charMethod(java.awt.Frame)", signature = "(TT;)C")
+    char charMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "intMethod(java.awt.Frame)", signature = "(TT;)I")
+    int intMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "longMethod(java.awt.Frame)", signature = "(TT;)J")
+    long longMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "booleanMethod(java.awt.Frame)", signature = "(TT;)Z")
+    boolean booleanMethod(T a) {
+        return false;
+    }
+
+    @ExpectedSignature(descriptor = "floatMethod(java.awt.Frame)", signature = "(TT;)F")
+    float floatMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "doubleMethod(java.awt.Frame)", signature = "(TT;)D")
+    double doubleMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "objectMethod(java.awt.Frame)", signature = "(TT;)Ljava/lang/Object;")
+    Object objectMethod(T a) {
+        return null;
+    }
+
+    @ExpectedSignature(descriptor = "staticVoidMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)V")
+    static <T> void staticVoidMethod(T a) {
+    }
+
+    @ExpectedSignature(descriptor = "staticByteMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)B")
+    static <T> byte staticByteMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticShortMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)S")
+    static <T> short staticShortMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticCharMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)C")
+    static <T> char staticCharMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticIntMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)I")
+    static <T> int staticIntMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticLongMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)J")
+    static <T> long staticLongMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticBooleanMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)Z")
+    static <T> boolean staticBooleanMethod(T a) {
+        return false;
+    }
+
+    @ExpectedSignature(descriptor = "staticFloatMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)F")
+    static <T> float staticFloatMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticDoubleMethod(java.lang.Object)", signature = "<T:Ljava/lang/Object;>(TT;)D")
+    static <T> double staticDoubleMethod(T a) {
+        return 0;
+    }
+
+    @ExpectedSignature(descriptor = "staticObjectMethod(java.lang.Object)",
+            signature = "<T:Ljava/lang/Object;>(TT;)Ljava/lang/Object;")
+    static <T> Object staticObjectMethod(T a) {
+        return null;
+    }
+
+    void voidReturnTypeNoSignatureAttribute() {
+    }
+
+    byte byteReturnTypeNoSignatureAttribute() {
+        return 0;
+    }
+
+    Object objectReturnNoSignatureAttribute() {
+        return null;
+    }
+
+    static void staticVoidReturnTypeNoSignatureAttribute() {
+    }
+
+    static byte staticByteReturnTypeNoSignatureAttribute() {
+        return 0;
+    }
+
+    static Object staticObjectReturnTypeNoSignatureAttribute() {
+        return null;
+    }
+}
--- a/test/tools/javac/classfiles/attributes/lib/TestResult.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/classfiles/attributes/lib/TestResult.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -56,8 +56,9 @@
     public boolean checkEquals(Object actual, Object expected, String message) {
         echo("Testing : " + message);
         if (!Objects.equals(actual, expected)) {
-            getLastTestCase().addAssert(new AssertionFailedException(
-                    String.format("%s%nGot: %s, Expected: %s", message, actual, expected)));
+            getLastTestCase().addAssert(String.format("%s\n" +
+                            "Expected: %s,\n" +
+                            "     Got: %s", message, expected, actual));
             return false;
         }
         return true;
@@ -70,8 +71,7 @@
     public boolean checkNotNull(Object actual, String message) {
         echo("Testing : " + message);
         if (Objects.isNull(actual)) {
-            getLastTestCase().addAssert(new AssertionFailedException(
-                    message + " : Expected not null value"));
+            getLastTestCase().addAssert(message + " : Expected not null value");
             return false;
         }
         return true;
@@ -88,7 +88,11 @@
     public boolean checkContains(Set<?> found, Set<?> expected, String message) {
         Set<?> copy = new HashSet<>(expected);
         copy.removeAll(found);
-        return checkTrue(found.containsAll(expected), message + " : " + copy);
+        if (!found.containsAll(expected)) {
+            return checkTrue(false, message + " FAIL : not found elements : " + copy);
+        } else {
+            return checkTrue(true, message + " PASS : all elements found");
+        }
     }
 
     public void addFailure(Throwable th) {
@@ -119,7 +123,7 @@
     private class Info {
 
         private final String info;
-        private final List<AssertionFailedException> asserts;
+        private final List<String> asserts;
         private final List<Throwable> errors;
 
         private Info(String info) {
@@ -141,19 +145,25 @@
             printf("[ERROR] : %s\n", getStackTrace(th));
         }
 
-        public void addAssert(AssertionFailedException e) {
+        public void addAssert(String e) {
             asserts.add(e);
-            printf("[ASSERT] : %s\n", getStackTrace(e));
+            printf("[ASSERT] : %s\n", e);
         }
 
         public String getMessage() {
-            return (asserts.size() > 0 ? getErrorMessage("[ASSERT]", asserts) + "\n" : "")
-                    + getErrorMessage("[ERROR]", errors);
+            return (asserts.size() > 0 ? getAssertMessages(asserts) + "\n" : "")
+                    + getErrorMessages(errors);
         }
 
-        public String getErrorMessage(String header, List<? extends Throwable> list) {
+        public String getAssertMessages(List<String> list) {
             return list.stream()
-                    .map(throwable -> String.format("%s : %s", header, getStackTrace(throwable)))
+                    .map(message -> String.format("[ASSERT] : %s", message))
+                    .collect(Collectors.joining("\n"));
+        }
+
+        public String getErrorMessages(List<? extends Throwable> list) {
+            return list.stream()
+                    .map(throwable -> String.format("[ERROR] : %s", getStackTrace(throwable)))
                     .collect(Collectors.joining("\n"));
         }
 
--- a/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/diags/examples/CantAccessInnerClsConstr.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -21,9 +21,8 @@
  * questions.
  */
 
-// key: compiler.err.prob.found.req
 // key: compiler.misc.cant.access.inner.cls.constr
-// key: compiler.misc.invalid.mref
+// key: compiler.err.invalid.mref
 
 class CantAccessInnerClsConstructor {
 
--- a/test/tools/javac/lambda/LocalVariableTable.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/lambda/LocalVariableTable.java	Fri Mar 27 16:40:35 2015 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8025998 8026749
+ * @bug 8025998 8026749 8054220 8058227
  * @summary Missing LV table in lambda bodies
  * @compile -g LocalVariableTable.java
  * @run main LocalVariableTable
@@ -183,7 +183,7 @@
         Run1 r = (a) -> { int x = a; };
     }
 
-    @Expect({ "a", "x" })
+    @Expect({ "a", "x", "v" })
     static class Lambda_Args1_Local1_Captured1 {
         void m() {
             int v = 0;
@@ -191,7 +191,7 @@
         }
     }
 
-    @Expect({ "a1", "a2", "x1", "x2", "this" })
+    @Expect({ "a1", "a2", "x1", "x2", "this", "v1", "v2" })
     static class Lambda_Args2_Local2_Captured2_this {
         int v;
         void m() {
@@ -204,7 +204,7 @@
         }
     }
 
-    @Expect({ "e" })
+    @Expect({ "e", "c" })
     static class Lambda_Try_Catch {
         private static Runnable asUncheckedRunnable(Closeable c) {
             return () -> {
--- a/test/tools/javac/lambda/MethodReference23.java	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/lambda/MethodReference23.java	Fri Mar 27 16:40:35 2015 -0700
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8003280
+ * @bug 8003280 8075184
  * @summary Add lambda tests
  *  check that pair of bound/non-bound constructor references is flagged as ambiguous
  * @author  Maurizio Cimadamore
--- a/test/tools/javac/lambda/MethodReference23.out	Fri Mar 27 15:51:17 2015 -0700
+++ b/test/tools/javac/lambda/MethodReference23.out	Fri Mar 27 16:40:35 2015 -0700
@@ -1,6 +1,6 @@
-MethodReference23.java:52:19: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23))
-MethodReference23.java:53:15: compiler.err.cant.apply.symbol: kindname.method, call11, MethodReference23.SAM11, @1140, kindname.class, MethodReference23, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)))
-MethodReference23.java:57:19: compiler.err.prob.found.req: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23))
-MethodReference23.java:58:15: compiler.err.cant.apply.symbol: kindname.method, call12, MethodReference23.SAM12, @1282, kindname.class, MethodReference23, (compiler.misc.no.conforming.assignment.exists: (compiler.misc.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)))
+MethodReference23.java:52:19: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)
+MethodReference23.java:53:16: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, MethodReference23, MethodReference23)
+MethodReference23.java:57:19: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)
+MethodReference23.java:58:16: compiler.err.invalid.mref: kindname.constructor, (compiler.misc.cant.access.inner.cls.constr: Inner1, , MethodReference23)
 MethodReference23.java:72:9: compiler.err.ref.ambiguous: call3, kindname.method, call3(MethodReference23.SAM21), MethodReference23, kindname.method, call3(MethodReference23.SAM22), MethodReference23
 5 errors