< prev index next >

src/java.base/share/classes/sun/reflect/generics/reflectiveObjects/ParameterizedTypeImpl.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2003, 2019, 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 --- 1,7 ---- /* ! * Copyright (c) 2003, 2016, 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
*** 53,71 **** } private void validateConstructorArguments() { TypeVariable<?>[] formals = rawType.getTypeParameters(); // check correct arity of actual type args ! if (formals.length != actualTypeArguments.length) { ! throw new MalformedParameterizedTypeException(String.format("Mismatch of count of " + ! "formal and actual type " + ! "arguments in constructor " + ! "of %s: %d formal argument(s) "+ ! "%d actual argument(s)", ! rawType.getName(), ! formals.length, ! actualTypeArguments.length)); } for (int i = 0; i < actualTypeArguments.length; i++) { // check actuals against formals' bounds } } --- 53,64 ---- } private void validateConstructorArguments() { TypeVariable<?>[] formals = rawType.getTypeParameters(); // check correct arity of actual type args ! if (formals.length != actualTypeArguments.length){ ! throw new MalformedParameterizedTypeException(); } for (int i = 0; i < actualTypeArguments.length; i++) { // check actuals against formals' bounds } }
< prev index next >