RFR: 8332303: Better JMX interoperability with older JDKs, after removing Subject Delegation

Daniel Fuchs dfuchs at openjdk.org
Thu May 16 09:44:12 UTC 2024


On Wed, 15 May 2024 20:02:26 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

>> src/java.management.rmi/share/classes/javax/management/remote/rmi/RMIConnectionImpl.java line 984:
>> 
>>> 982:         }
>>> 983:         if (names.length != filters.length) {
>>> 984:             final String msg = "The lengths of names and filters parameters are not same.";
>> 
>> I wonder if we should check that if present, `delegationSubjects.length == names.length`?
>
> That seems pretty extreme -- it's an array we explicitly don't want and are going to ignore?  If somebody passes a non-null member, we will throw as unsupported.  I was thinking that was enough, hence removing the sbjs array to be quite certain we can't pass on any supplied Subjects.

Well my thinking was this: the fact that the jconsole tab was blank shows that the array may being passed. The previous code verified that all three arrays had the same length - so it would have failed if the array had a length different than the other two. So I would prefer if we kept on throwing in that case. In other words, we now allow and prefer `null` - but if non-null - we will allow a null-filled array passed by an older client but  we should not accept something that would have been invalid then.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19253#discussion_r1603000965


More information about the serviceability-dev mailing list