}
@SuppressWarnings("checkstyle:IllegalCatch")
- private void close(AutoCloseable closeable) {
+ private static void close(AutoCloseable closeable) {
try {
closeable.close();
} catch (Exception e) {
: new NetconfDeviceCommunicator(remoteDeviceId, device, rpcMessageLimit), salFacade);
}
- private Optional<NetconfSessionPreferences> getUserCapabilities(final NetconfNode node) {
+ private static Optional<NetconfSessionPreferences> getUserCapabilities(final NetconfNode node) {
if (node.getYangModuleCapabilities() == null && node.getNonModuleCapabilities() == null) {
return Optional.empty();
}
}
//TODO: duplicate code
- private InetSocketAddress getSocketAddress(final Host host, final int port) {
+ private static InetSocketAddress getSocketAddress(final Host host, final int port) {
if (host.getDomainName() != null) {
return new InetSocketAddress(host.getDomainName().getValue(), port);
} else {
return builder.build();
}
- private List<Uri> getOdlHelloCapabilities(final NetconfNode node) {
+ private static List<Uri> getOdlHelloCapabilities(final NetconfNode node) {
final OdlHelloMessageCapabilities helloCapabilities = node.getOdlHelloMessageCapabilities();
- if (helloCapabilities != null) {
- return helloCapabilities.getCapability();
- }
- return null;
+ return helloCapabilities != null ? helloCapabilities.getCapability() : null;
}
private AuthenticationHandler getHandlerFromCredentials(final Credentials credentials) {
LOG.info("****** Setup complete");
}
- private void deleteCacheDir() {
+ private static void deleteCacheDir() {
FileUtils.deleteQuietly(new File(NetconfTopologyUtils.CACHE_DIRECTORY));
}
doReturn(mockMountPointReg).when(mockMountPointBuilder).register();
}
- private PotentialSchemaSource<?> withSourceId(final SourceIdentifier identifier) {
+ private static PotentialSchemaSource<?> withSourceId(final SourceIdentifier identifier) {
return argThat(new ArgumentMatcher<PotentialSchemaSource<?>>() {
@Override
public boolean matches(final Object argument) {
});
}
- private String convertStreamToString(final InputStream is) {
+ private static String convertStreamToString(final InputStream is) {
try (Scanner scanner = new Scanner(is)) {
return scanner.useDelimiter("\\A").hasNext() ? scanner.next() : "";
}
}
}
- private void verifyDocumentedException(Throwable cause) {
+ private static void verifyDocumentedException(Throwable cause) {
assertTrue("Unexpected cause " + cause, cause instanceof DocumentedException);
final DocumentedException de = (DocumentedException) cause;
assertEquals(DocumentedException.ErrorSeverity.WARNING, de.getErrorSeverity());
protected abstract RemoteDeviceHandler<NetconfSessionPreferences> createSalFacade(RemoteDeviceId id);
- private InetSocketAddress getSocketAddress(final Host host, final int port) {
+ private static InetSocketAddress getSocketAddress(final Host host, final int port) {
if (host.getDomainName() != null) {
return new InetSocketAddress(host.getDomainName().getValue(), port);
- } else {
- final IpAddress ipAddress = host.getIpAddress();
- final String ip = ipAddress.getIpv4Address() != null
- ? ipAddress.getIpv4Address().getValue() : ipAddress.getIpv6Address().getValue();
- return new InetSocketAddress(ip, port);
}
+
+ final IpAddress ipAddress = host.getIpAddress();
+ final String ip = ipAddress.getIpv4Address() != null ? ipAddress.getIpv4Address().getValue()
+ : ipAddress.getIpv6Address().getValue();
+ return new InetSocketAddress(ip, port);
}
- private Optional<UserPreferences> getUserCapabilities(final NetconfNode node) {
+ private static Optional<UserPreferences> getUserCapabilities(final NetconfNode node) {
// if none of yang-module-capabilities or non-module-capabilities is specified
// just return absent
if (node.getYangModuleCapabilities() == null && node.getNonModuleCapabilities() == null) {