From: Tony Tkacik Date: Mon, 15 Dec 2014 13:20:47 +0000 (+0000) Subject: Merge "BUG-2511 Fix XXE vulnerability in Netconf" X-Git-Tag: release/lithium~760 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=4a34b09f1bc3500e5722ee1e4dee0da05acf6a4c;hp=8ef160aa623096fc2905bb449997306bbec2b295 Merge "BUG-2511 Fix XXE vulnerability in Netconf" --- diff --git a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java index 64f4c7ef1e..f10c116755 100644 --- a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java +++ b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/Entity.java @@ -165,8 +165,9 @@ public class Entity implements Comparable { public void setLastSeenTimestamp(Date lastSeenTimestamp) { if (activeSince == null || (activeSince.getTime() + ACTIVITY_TIMEOUT) < lastSeenTimestamp - .getTime()) + .getTime()) { this.activeSince = lastSeenTimestamp; + } this.lastSeenTimestamp = lastSeenTimestamp; } @@ -180,8 +181,9 @@ public class Entity implements Comparable { @Override public int hashCode() { - if (hashCode != 0) + if (hashCode != 0) { return hashCode; + } final int prime = 31; hashCode = 1; hashCode = prime * hashCode @@ -194,30 +196,40 @@ public class Entity implements Comparable { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } Entity other = (Entity) obj; if (ipv4Address == null) { - if (other.ipv4Address != null) + if (other.ipv4Address != null) { return false; - } else if (!ipv4Address.equals(other.ipv4Address)) + } + } else if (!ipv4Address.equals(other.ipv4Address)) { return false; - if (macAddress != other.macAddress) + } + if (macAddress != other.macAddress) { return false; + } if (port == null) { - if (other.port != null) + if (other.port != null) { return false; - } else if (!port.equals(other.port)) + } + } else if (!port.equals(other.port)) { return false; + } if (vlan == null) { - if (other.vlan != null) + if (other.vlan != null) { return false; - } else if (!vlan.equals(other.vlan)) + } + } else if (!vlan.equals(other.vlan)) { return false; + } return true; } @@ -257,8 +269,9 @@ public class Entity implements Comparable { Comparable switchId = (Comparable) port.getNode().getID(); Comparable oswitchId = (Comparable) o.port.getNode().getID(); r = switchId.compareTo(oswitchId); - if (r != 0) + if (r != 0) { return r; + } Comparable portId = (Comparable) port.getID(); Comparable oportId = (Comparable) o.port.getID(); diff --git a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/SwitchPort.java b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/SwitchPort.java index e60f8b4b0e..892e1d6c79 100644 --- a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/SwitchPort.java +++ b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/SwitchPort.java @@ -127,20 +127,26 @@ public class SwitchPort { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (obj == null) + } + if (obj == null) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } SwitchPort other = (SwitchPort) obj; - if (errorStatus != other.errorStatus) + if (errorStatus != other.errorStatus) { return false; + } if (port == null) { - if (other.port != null) + if (other.port != null) { return false; - } else if (!port.equals(other.port)) + } + } else if (!port.equals(other.port)) { return false; + } return true; } diff --git a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java index fe396ba92b..86376be5c5 100644 --- a/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java +++ b/opendaylight/adsal/hosttracker_new/api/src/main/java/org/opendaylight/controller/hosttracker/hostAware/HostNodeConnector.java @@ -150,22 +150,29 @@ public class HostNodeConnector extends Host { @Override public boolean equals(Object obj) { - if (this == obj) + if (this == obj) { return true; - if (!super.equals(obj)) + } + if (!super.equals(obj)) { return false; - if (getClass() != obj.getClass()) + } + if (getClass() != obj.getClass()) { return false; + } HostNodeConnector other = (HostNodeConnector) obj; if (nodeConnector == null) { - if (other.nodeConnector != null) + if (other.nodeConnector != null) { return false; - } else if (!nodeConnector.equals(other.nodeConnector)) + } + } else if (!nodeConnector.equals(other.nodeConnector)) { return false; - if (staticHost != other.staticHost) + } + if (staticHost != other.staticHost) { return false; - if (vlan != other.vlan) + } + if (vlan != other.vlan) { return false; + } return true; } @@ -181,8 +188,9 @@ public class HostNodeConnector extends Host { EthernetAddress e = (EthernetAddress) getDataLayerAddress(); macaddr = e.getValue(); } - if (macaddr == null) + if (macaddr == null) { return false; + } return !Arrays.equals(emptyArray, macaddr); } diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/IteratableTypeInfo.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/IteratableTypeInfo.java index 3977837c7f..d0386ed2c5 100644 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/IteratableTypeInfo.java +++ b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/IteratableTypeInfo.java @@ -29,7 +29,9 @@ import java.util.List; Object item = it.next(); for (TypeInfo child : _types.values()) { Object val = child.retrieve(item, query, index); - if (val != null) objects.add(val); + if (val != null) { + objects.add(val); + } } } return objects; @@ -38,7 +40,9 @@ import java.util.List; @Override public synchronized void explore() { - if (_explored) return; + if (_explored) { + return; + } if (LOGGER.isDebugEnabled()) { LOGGER.debug("exploring iteratable type: {} gtype: {}", _class, _accessor.getGenericType()); diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryContextImpl.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryContextImpl.java index 13d70b1cb0..8f83c147c8 100644 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryContextImpl.java +++ b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryContextImpl.java @@ -16,17 +16,25 @@ import org.slf4j.LoggerFactory; @Override public Query createQuery(String queryString, Class type) throws QueryException { - if (queryString == null || queryString.trim().length() == 0) return null; + if (queryString == null || queryString.trim().length() == 0) { + return null; + } try { - if (LOGGER.isDebugEnabled()) LOGGER.debug("Processing query: {}", queryString); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Processing query: {}", queryString); + } // FiqlParser is a parser generated by javacc Expression expression = FiqlParser.parse(queryString); - if (LOGGER.isDebugEnabled()) LOGGER.debug("Query expression: {}", expression); + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("Query expression: {}", expression); + } // create Query and return; return new QueryImpl(type, expression); } catch (Exception ex) { - if (LOGGER.isDebugEnabled()) LOGGER.error("Query processing failed = {}", + if (LOGGER.isDebugEnabled()) { + LOGGER.error("Query processing failed = {}", queryString, ex); + } throw new QueryException("Unable to parse query.", ex); } } diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryImpl.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryImpl.java index a520f98fc0..cb77e04a59 100644 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryImpl.java +++ b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/QueryImpl.java @@ -158,7 +158,9 @@ import org.slf4j.LoggerFactory; } private boolean compare(Object valueToMatch, Object actualValue, OP operator) { - if (valueToMatch == null || actualValue == null) return false; + if (valueToMatch == null || actualValue == null) { + return false; + } if (ALLOW_OBJECT_STRING_COMPARE && (valueToMatch instanceof String) && !(actualValue instanceof String)) { actualValue = actualValue.toString(); @@ -203,7 +205,9 @@ import org.slf4j.LoggerFactory; } } private Object parse(String arg, Object value) { - if (value == null) return null; + if (value == null) { + return null; + } try { if (value instanceof String) { diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/TypeInfo.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/TypeInfo.java index 91f01d8ad7..6c0c5dc816 100644 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/TypeInfo.java +++ b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/TypeInfo.java @@ -107,7 +107,9 @@ import org.slf4j.LoggerFactory; if (LOGGER.isDebugEnabled()) { LOGGER.debug("retrieve: {}/{} type:{}", index, query.length, target.getClass()); } - if (index >= query.length) return null; + if (index >= query.length) { + return null; + } explore(); if (!target.getClass().equals(_class)) { if (_class.isAssignableFrom(target.getClass())) { @@ -124,7 +126,9 @@ import org.slf4j.LoggerFactory; } } TypeInfo child = getChild(query[index]); - if (child == null) return null; + if (child == null) { + return null; + } target = child.getAccessor().getValue(target); if (index+1 == query.length) { // match found @@ -137,27 +141,35 @@ import org.slf4j.LoggerFactory; * Explore the type info for children. */ public synchronized void explore() { - if (_explored) return; + if (_explored) { + return; + } for (Class c = _class; c != null; c = c.getSuperclass()) { - if (c.equals(Object.class)) break; + if (c.equals(Object.class)) { + break; + } // Currently only fields and methods annotated with JAXB annotations are // considered as valid for search purposes. //check methods first for (Method m : c.getDeclaredMethods()) { String tn = getTypeName(m, _accessType); if (tn != null) { - if (LOGGER.isDebugEnabled()) LOGGER.debug( + if (LOGGER.isDebugEnabled()) { + LOGGER.debug( "exploring type: {} name: {} method: {}", _class.getSimpleName(), tn, m); + } _types.put(tn, createTypeInfo(tn, new Accessor(m))); } } for (Field f : c.getDeclaredFields()) { String tn = getTypeName(f, _accessType); if (tn != null) { - if (LOGGER.isDebugEnabled()) LOGGER.debug( + if (LOGGER.isDebugEnabled()) { + LOGGER.debug( "exploring type: {} name: {} field: {}", _class.getSimpleName(), tn, f); + } _types.put(tn, createTypeInfo(tn, new Accessor(f))); } } @@ -219,7 +231,9 @@ import org.slf4j.LoggerFactory; PropertyDescriptor[] props = info.getPropertyDescriptors(); for (PropertyDescriptor pd : props) { - if (m.equals(pd.getReadMethod())) return pd.getName(); + if (m.equals(pd.getReadMethod())) { + return pd.getName(); + } } } catch (IntrospectionException e) @@ -234,8 +248,12 @@ import org.slf4j.LoggerFactory; // root is always a composite type // FIXME assert its a JAXB type XmlRootElement root = clz.getAnnotation(XmlRootElement.class); - if (root == null) throw new IllegalArgumentException("Not a JAXB type: " + clz); - if (name == null) name = getRootName(clz); + if (root == null) { + throw new IllegalArgumentException("Not a JAXB type: " + clz); + } + if (name == null) { + name = getRootName(clz); + } return new TypeInfo(name, clz, null); } @@ -252,7 +270,9 @@ import org.slf4j.LoggerFactory; public static String getRootName(Class cls) { XmlRootElement root = cls.getAnnotation(XmlRootElement.class); - if (root == null) return null; + if (root == null) { + return null; + } String rootName = root.name(); if (DEFAULT_NAME.equals(rootName)) { String clsName = cls.getSimpleName(); @@ -281,7 +301,9 @@ import org.slf4j.LoggerFactory; return null; } } - if (DEFAULT_NAME.equals(name)) return dflt; + if (DEFAULT_NAME.equals(name)) { + return dflt; + } return name; } diff --git a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/WrapperTypeInfo.java b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/WrapperTypeInfo.java index a8172f2add..156942c61d 100644 --- a/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/WrapperTypeInfo.java +++ b/opendaylight/adsal/northbound/commons/src/main/java/org/opendaylight/controller/northbound/commons/query/WrapperTypeInfo.java @@ -24,10 +24,14 @@ public class WrapperTypeInfo extends TypeInfo { if (LOGGER.isDebugEnabled()) { LOGGER.debug("retrieve collection: {}/{}", index, query.length); } - if (index >= query.length) return null; + if (index >= query.length) { + return null; + } explore(); TypeInfo child = getChild(query[index]); - if (child == null) return null; + if (child == null) { + return null; + } if (query.length == index+1) { // skipping this node return target; }else { // if list of list go to next node to get value @@ -37,7 +41,9 @@ public class WrapperTypeInfo extends TypeInfo { @Override public synchronized void explore() { - if (_explored) return; + if (_explored) { + return; + } if (LOGGER.isDebugEnabled()) { LOGGER.debug("exploring wrapper type: {} gtype: {}", _class, _accessor.getGenericType()); diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java index 3380a10afe..b09017fe55 100644 --- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java +++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/JmxAttributeValidationException.java @@ -84,7 +84,7 @@ public class JmxAttributeValidationException extends RuntimeException { public static void checkCondition(boolean condition, String message, JmxAttribute jmxAttribute) throws JmxAttributeValidationException { - if (condition == false) { + if (!condition) { throw new JmxAttributeValidationException( jmxAttribute.getAttributeName() + " " + message, jmxAttribute); diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java index ee23206eeb..0c7478dca0 100644 --- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java +++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/jmx/ObjectNameUtil.java @@ -128,7 +128,7 @@ public class ObjectNameUtil { if (quoted == null) { throw new IllegalArgumentException("Cannot find " + SERVICE_QNAME_KEY + " in " + objectName); } - if (quoted.startsWith("\"") == false || quoted.endsWith("\"") == false) { + if (!quoted.startsWith("\"") || !quoted.endsWith("\"")) { throw new IllegalArgumentException("Quotes not found in " + objectName); } String substring = quoted.substring(1); @@ -201,7 +201,7 @@ public class ObjectNameUtil { throw new IllegalArgumentException( "Expected ObjectName with transaction:" + inputON); } - if (ON_DOMAIN.equals(inputON.getDomain()) == false) { + if (!ON_DOMAIN.equals(inputON.getDomain())) { throw new IllegalArgumentException("Expected different domain: " + inputON); } @@ -263,7 +263,7 @@ public class ObjectNameUtil { Map allProperties = getAdditionalProperties(on); Map result = new HashMap<>(); for (Entry entry : allProperties.entrySet()) { - if (blacklist.contains(entry.getKey()) == false) { + if (!blacklist.contains(entry.getKey())) { result.put(entry.getKey(), entry.getValue()); } } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java index 13a9f1cc10..de28ae81fc 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java @@ -8,7 +8,13 @@ package org.opendaylight.controller.sal.binding.impl; import static com.google.common.base.Preconditions.checkState; - +import com.google.common.base.Preconditions; +import com.google.common.base.Throwables; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.util.concurrent.UncheckedExecutionException; import java.util.EventListener; import java.util.HashMap; import java.util.Map; @@ -17,7 +23,6 @@ import java.util.Set; import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; - import org.opendaylight.controller.md.sal.common.api.routing.RouteChange; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangeListener; import org.opendaylight.controller.md.sal.common.api.routing.RouteChangePublisher; @@ -40,13 +45,6 @@ import org.opendaylight.yangtools.yang.binding.RpcService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.google.common.base.Throwables; -import com.google.common.cache.Cache; -import com.google.common.cache.CacheBuilder; -import com.google.common.cache.CacheLoader; -import com.google.common.cache.LoadingCache; -import com.google.common.util.concurrent.UncheckedExecutionException; - public class RpcProviderRegistryImpl implements RpcProviderRegistry, RouteChangePublisher> { private RuntimeCodeGenerator rpcFactory = SingletonHolder.RPC_GENERATOR_IMPL; @@ -222,11 +220,10 @@ public class RpcProviderRegistryImpl implements RpcProviderRegistry, RouteChange } - private class RouteChangeForwarder implements RouteChangeListener, InstanceIdentifier> { - + private final class RouteChangeForwarder implements RouteChangeListener, InstanceIdentifier> { private final Class type; - public RouteChangeForwarder(final Class type) { + RouteChangeForwarder(final Class type) { this.type = type; } @@ -256,15 +253,14 @@ public class RpcProviderRegistryImpl implements RpcProviderRegistry, RouteChange } } - public static class RpcProxyRegistration extends AbstractObjectRegistration implements RpcRegistration { - + private static final class RpcProxyRegistration extends AbstractObjectRegistration implements RpcRegistration { + private final RpcProviderRegistryImpl registry; private final Class serviceType; - private RpcProviderRegistryImpl registry; - public RpcProxyRegistration(final Class type, final T service, final RpcProviderRegistryImpl registry) { + RpcProxyRegistration(final Class type, final T service, final RpcProviderRegistryImpl registry) { super(service); + this.registry = Preconditions.checkNotNull(registry); this.serviceType = type; - this.registry = registry; } @Override @@ -274,13 +270,10 @@ public class RpcProviderRegistryImpl implements RpcProviderRegistry, RouteChange @Override protected void removeRegistration() { - if (registry != null) { - T publicProxy = registry.getRpcService(serviceType); - RpcService currentDelegate = RuntimeCodeHelper.getDelegate(publicProxy); - if (currentDelegate == getInstance()) { - RuntimeCodeHelper.setDelegate(publicProxy, null); - } - registry = null; + T publicProxy = registry.getRpcService(serviceType); + RpcService currentDelegate = RuntimeCodeHelper.getDelegate(publicProxy); + if (currentDelegate == getInstance()) { + RuntimeCodeHelper.setDelegate(publicProxy, null); } } } diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwarder.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwarder.java index 0f450d10bd..9bff0e9609 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwarder.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/connect/dom/DomToBindingRpcForwarder.java @@ -3,7 +3,7 @@ package org.opendaylight.controller.sal.binding.impl.connect.dom; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkState; import com.google.common.base.Function; -import com.google.common.collect.FluentIterable; +import com.google.common.collect.Collections2; import com.google.common.collect.ImmutableSet; import com.google.common.util.concurrent.Futures; import com.google.common.util.concurrent.ListenableFuture; @@ -19,7 +19,7 @@ import java.util.concurrent.Callable; import org.opendaylight.controller.sal.binding.api.RpcProviderRegistry; import org.opendaylight.controller.sal.binding.api.rpc.RpcRouter; import org.opendaylight.controller.sal.binding.impl.RpcProviderRegistryImpl; -import org.opendaylight.controller.sal.core.api.Broker; +import org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration; import org.opendaylight.controller.sal.core.api.RpcImplementation; import org.opendaylight.controller.sal.core.api.RpcProvisionRegistry; import org.opendaylight.yangtools.concepts.CompositeObjectRegistration; @@ -45,7 +45,7 @@ class DomToBindingRpcForwarder implements RpcImplementation, InvocationHandler { private final Set supportedRpcs; private final WeakReference> rpcServiceType; - private Set registrations; + private Set registrations; private final Map strategiesByQName = new HashMap<>(); private final WeakHashMap strategiesByMethod = new WeakHashMap<>(); private final RpcService proxy; @@ -102,7 +102,7 @@ class DomToBindingRpcForwarder implements RpcImplementation, InvocationHandler { final RpcProvisionRegistry biRpcRegistry, final RpcProviderRegistry baRpcRegistry, final RpcProviderRegistryImpl registryImpl) { this(service, mappingService, biRpcRegistry, baRpcRegistry,registryImpl); - final ImmutableSet.Builder registrationsBuilder = ImmutableSet.builder(); + final ImmutableSet.Builder registrationsBuilder = ImmutableSet.builder(); try { for (QName rpc : supportedRpcs) { registrationsBuilder.add(biRpcRegistry.addRoutedRpcImplementation(rpc, this)); @@ -159,9 +159,8 @@ class DomToBindingRpcForwarder implements RpcImplementation, InvocationHandler { public void registerPaths(final Class context, final Class service, final Set> set) { QName ctx = BindingReflections.findQName(context); - for (YangInstanceIdentifier path : FluentIterable.from(set).transform( - toDOMInstanceIdentifier)) { - for (org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration reg : registrations) { + for (YangInstanceIdentifier path : Collections2.transform(set, toDOMInstanceIdentifier)) { + for (RoutedRpcRegistration reg : registrations) { reg.registerPath(ctx, path); } } @@ -185,9 +184,8 @@ class DomToBindingRpcForwarder implements RpcImplementation, InvocationHandler { public void removePaths(final Class context, final Class service, final Set> set) { QName ctx = BindingReflections.findQName(context); - for (YangInstanceIdentifier path : FluentIterable.from(set).transform( - toDOMInstanceIdentifier)) { - for (org.opendaylight.controller.sal.core.api.Broker.RoutedRpcRegistration reg : registrations) { + for (YangInstanceIdentifier path : Collections2.transform(set, toDOMInstanceIdentifier)) { + for (RoutedRpcRegistration reg : registrations) { reg.unregisterPath(ctx, path); } }