NO-JIRA Fix compiler warning in FederationStreamConnectMessage

This fixes the following compiler warning that is reported in Travis builds:

```
/home/travis/build/apache/activemq-artemis/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/wireformat/FederationStreamConnectMessage.java:151: warning: non-varargs call of varargs method with inexact argument type for last parameter;

         return (FederationPolicy) Class.forName(clazz).getConstructor(null).newInstance();

  cast to Class<?> for a varargs call
  cast to Class<?>[] for a non-varargs call and to suppress this warning
```
This commit is contained in:
Sebastian Thomschke 2020-01-29 22:39:52 +01:00 committed by GitHub
parent 0be433ee73
commit 9fe17d4081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -148,7 +148,7 @@ public abstract class FederationStreamConnectMessage <T extends FederationStream
private FederationPolicy getFederationPolicy(String clazz) {
try {
return (FederationPolicy) Class.forName(clazz).getConstructor(null).newInstance();
return (FederationPolicy) Class.forName(clazz).getConstructor((Class<?>) null).newInstance();
} catch (Exception e) {
throw new IllegalStateException("Error. Unable to instantiate FederationPolicy: " + e.getMessage(), e);
}