src/jdk.jdi/share/classes/com/sun/tools/jdi/MethodImpl.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -313,14 +313,15 @@
ArrayReference argArray = lastParamType.newInstance(0);
arguments.add(argArray);
return;
}
Value nthArgValue = arguments.get(paramCount - 1);
- if (nthArgValue == null) {
+ if (nthArgValue == null && argCount == paramCount) {
+ // The only one varargs parameter is null
return;
}
- Type nthArgType = nthArgValue.type();
+ Type nthArgType = (nthArgValue == null) ? null : nthArgValue.type();
if (nthArgType instanceof ArrayTypeImpl) {
if (argCount == paramCount &&
((ArrayTypeImpl)nthArgType).isAssignableTo(lastParamType)) {
/*
* This is case 1. A compatible array is being passed to the