diff -r c4800cdd45c7 -r 3085969bdf91 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java --- a/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Tue May 22 14:54:55 2018 +0200 +++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java Tue May 22 13:37:05 2018 +0100 @@ -4989,6 +4989,20 @@ public static abstract class SignatureGenerator { + public static class InvalidSignatureException extends RuntimeException { + private static final long serialVersionUID = 0; + + private final Type type; + + InvalidSignatureException(Type type) { + this.type = type; + } + + public Type type() { + return type; + } + } + private final Types types; protected abstract void append(char ch); @@ -5033,6 +5047,9 @@ append('V'); break; case CLASS: + if (type.isCompound()) { + throw new InvalidSignatureException(type); + } append('L'); assembleClassSig(type); append(';'); @@ -5075,6 +5092,9 @@ break; } case TYPEVAR: + if (((TypeVar)type).isCaptured()) { + throw new InvalidSignatureException(type); + } append('T'); append(type.tsym.name); append(';');