Skip to content

Commit

Permalink
Remove unnecessary Subject array in RMIConnectionImpl, update docs in…
Browse files Browse the repository at this point in the history
… RMIConnection
  • Loading branch information
kevinjwalls committed May 15, 2024
1 parent 7f76b56 commit ef84485
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,9 @@ public void removeNotificationListener(ObjectName name,
* @param filters an array of marshalled representations of the
* <code>NotificationFilters</code>. Elements of this array can
* be null.
* @param delegationSubjects must be {@code null}.
* @param delegationSubjects should be {@code null}, but a non-null
* array is accepted for compatibilty reasons, which must not contain
* any entries.
*
* @return an array of <code>listenerIDs</code> identifying the
* local listeners. This array has the same number of elements as
Expand All @@ -974,7 +976,8 @@ public void removeNotificationListener(ObjectName name,
* @throws SecurityException if, for one of the MBeans, the
* client does not have permission to add a listener.
* @throws IOException if a general communication exception occurred.
* @throws UnsupportedOperationException if {@code delegationSubject} is non-null.
* @throws UnsupportedOperationException if {@code delegationSubjects}
* contains any non-null values.
*/
public Integer[] addNotificationListeners(ObjectName[] names,
MarshalledObject[] filters,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -980,10 +980,8 @@ public Integer[] addNotificationListeners(ObjectName[] names,
}
}
}
Subject[] sbjs = new Subject[names.length];
if (names.length != filters.length || filters.length != sbjs.length) {
final String msg =
"The value lengths of 3 parameters are not same.";
if (names.length != filters.length) {
final String msg = "The lengths of names and filters parameters are not same.";
throw new IllegalArgumentException(msg);
}

Expand Down Expand Up @@ -1011,7 +1009,7 @@ public Integer[] addNotificationListeners(ObjectName[] names,

filterValues[i] =
unwrap(filters[i], targetCl, defaultClassLoader,
NotificationFilter.class, sbjs[i]);
NotificationFilter.class, null);

if (debug) logger.debug("addNotificationListener"+
"(ObjectName,NotificationFilter)",
Expand All @@ -1023,7 +1021,7 @@ public Integer[] addNotificationListeners(ObjectName[] names,
doPrivilegedOperation(ADD_NOTIFICATION_LISTENERS,
new Object[] { names[i],
filterValues[i] },
sbjs[i]);
null);
}

return ids;
Expand Down

0 comments on commit ef84485

Please sign in to comment.