RFR: 8299183: Invokers.checkExactType passes parameters to create WMTE in opposite order

Jaikiran Pai jpai at openjdk.org
Fri Jan 6 01:08:48 UTC 2023


On Thu, 5 Jan 2023 20:45:20 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> Trivial fix.  Fix `Invokers.checkExactType` to call `newWrongMethodTypeException(actual, expected)` with parameters in right order.

Hello Mandy, this looks good to me. The copyright year on the file will need an update.

There's another call to this `newWrongMethodTypeException` method on line 515 and I am guessing that one is already passing the params in the correct order. If I go by that same logic, then there appears to be a direct construction of `WrongMethodTypeException` on line 497 and I suspect the `String` passed to it is perhaps using the wrong order? It currently says:


if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
     throw new WrongMethodTypeException("expected " + handle.accessModeType(ad.type) + " but found "
                    + ad.symbolicMethodTypeExact);
}

Should it instead say:

if (handle.hasInvokeExactBehavior() && handle.accessModeType(ad.type) != ad.symbolicMethodTypeExact) {
    throw new WrongMethodTypeException("expected " + ad.symbolicMethodTypeExact + " but found "
                    + handle.accessModeType(ad.type));
}

-------------

PR: https://git.openjdk.org/jdk/pull/11870


More information about the core-libs-dev mailing list