diff -r a25c5ec5e40e -r 57cf2a1c1a05 jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java --- a/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java Wed Jul 05 16:49:07 2017 +0200 +++ b/jaxws/src/share/classes/com/sun/codemodel/internal/JCodeModel.java Mon Apr 20 15:14:39 2009 -0700 @@ -1,5 +1,5 @@ /* - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * Copyright 2005-2006 Sun Microsystems, Inc. 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 @@ -446,13 +446,29 @@ JClass clazz = ref(s.substring(start,idx)); + return parseSuffix(clazz); + } + + /** + * Parses additional left-associative suffixes, like type arguments + * and array specifiers. + */ + private JClass parseSuffix(JClass clazz) throws ClassNotFoundException { if(idx==s.length()) return clazz; // hit EOL char ch = s.charAt(idx); if(ch=='<') - return parseArguments(clazz); + return parseSuffix(parseArguments(clazz)); + + if(ch=='[') { + if(s.charAt(idx+1)==']') { + idx+=2; + return parseSuffix(clazz.array()); + } + throw new IllegalArgumentException("Expected ']' but found "+s.substring(idx+1)); + } return clazz; }