From: Tony Tkacik Date: Thu, 23 Jul 2015 11:11:08 +0000 (+0200) Subject: Bug 4035: Fixed some sonar / findbugs issues in DOM MD-SAL. X-Git-Tag: release/beryllium~349 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=refs%2Fchanges%2F65%2F24465%2F9 Bug 4035: Fixed some sonar / findbugs issues in DOM MD-SAL. Change-Id: Id0ab9f65e4f1663f9e6cd85a6235a0a5fdee6f88 Signed-off-by: Tony Tkacik --- diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractConsumer.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractConsumer.java index c14d5a679c..12c26a9856 100644 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractConsumer.java +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractConsumer.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.core.api; import java.util.Collection; import java.util.Collections; - import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -18,15 +17,12 @@ import org.osgi.util.tracker.ServiceTrackerCustomizer; public abstract class AbstractConsumer implements Consumer, BundleActivator,ServiceTrackerCustomizer { - - - private BundleContext context; private ServiceTracker tracker; private Broker broker; @Override - public final void start(BundleContext context) throws Exception { + public final void start(final BundleContext context) throws Exception { this.context = context; this.startImpl(context); tracker = new ServiceTracker<>(context, Broker.class, this); @@ -36,16 +32,16 @@ public abstract class AbstractConsumer implements Consumer, BundleActivator,Serv @Override - public final void stop(BundleContext context) throws Exception { + public final void stop(final BundleContext context) throws Exception { stopImpl(context); broker = null; tracker.close(); } - protected void startImpl(BundleContext context) { + protected void startImpl(final BundleContext context) { // NOOP } - protected void stopImpl(BundleContext context) { + protected void stopImpl(final BundleContext context) { // NOOP } @@ -56,7 +52,7 @@ public abstract class AbstractConsumer implements Consumer, BundleActivator,Serv @Override - public Broker addingService(ServiceReference reference) { + public Broker addingService(final ServiceReference reference) { if(broker == null) { broker = context.getService(reference); broker.registerConsumer(this, context); @@ -67,12 +63,12 @@ public abstract class AbstractConsumer implements Consumer, BundleActivator,Serv } @Override - public void modifiedService(ServiceReference reference, Broker service) { + public void modifiedService(final ServiceReference reference, final Broker service) { // NOOP } @Override - public void removedService(ServiceReference reference, Broker service) { + public void removedService(final ServiceReference reference, final Broker service) { stopImpl(context); } } diff --git a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractProvider.java b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractProvider.java index 22b0bf25cf..e300279d7b 100644 --- a/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractProvider.java +++ b/opendaylight/md-sal/sal-dom-api/src/main/java/org/opendaylight/controller/sal/core/api/AbstractProvider.java @@ -9,7 +9,6 @@ package org.opendaylight.controller.sal.core.api; import java.util.Collection; import java.util.Collections; - import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceReference; @@ -21,28 +20,29 @@ public abstract class AbstractProvider implements BundleActivator, Provider,Serv private Broker broker; private BundleContext context; private ServiceTracker tracker; + @Override public Collection getProviderFunctionality() { return Collections.emptySet(); } @Override - public final void start(BundleContext context) throws Exception { + public final void start(final BundleContext context) throws Exception { this.context = context; this.startImpl(context); tracker = new ServiceTracker<>(context, Broker.class, this); tracker.open(); } - protected void startImpl(BundleContext context) { + protected void startImpl(final BundleContext context) { // NOOP } - protected void stopImpl(BundleContext context) { + protected void stopImpl(final BundleContext context) { // NOOP } @Override - public final void stop(BundleContext context) throws Exception { + public final void stop(final BundleContext context) throws Exception { broker = null; tracker.close(); tracker = null; @@ -50,7 +50,7 @@ public abstract class AbstractProvider implements BundleActivator, Provider,Serv } @Override - public Broker addingService(ServiceReference reference) { + public Broker addingService(final ServiceReference reference) { if(broker == null) { broker = context.getService(reference); broker.registerProvider(this, context); @@ -61,12 +61,12 @@ public abstract class AbstractProvider implements BundleActivator, Provider,Serv } @Override - public void modifiedService(ServiceReference reference, Broker service) { + public void modifiedService(final ServiceReference reference, final Broker service) { // NOOP } @Override - public void removedService(ServiceReference reference, Broker service) { + public void removedService(final ServiceReference reference, final Broker service) { stopImpl(context); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java index a644f4d283..da7a0d19f0 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/CommitCoordinationTask.java @@ -31,7 +31,7 @@ final class CommitCoordinationTask implements Callable { canCommit, preCommit, doCommit, - }; + } private static final Logger LOG = LoggerFactory.getLogger(CommitCoordinationTask.class); private final Collection cohorts; @@ -66,7 +66,7 @@ final class CommitCoordinationTask implements Callable { LOG.debug("Transaction {}: doCommit completed", tx.getIdentifier()); return null; - } catch (TransactionCommitFailedException e) { + } catch (final TransactionCommitFailedException e) { LOG.warn("Tx: {} Error during phase {}, starting Abort", tx.getIdentifier(), phase, e); abortBlocking(e); throw e; @@ -90,7 +90,7 @@ final class CommitCoordinationTask implements Callable { * */ private void canCommitBlocking() throws TransactionCommitFailedException { - for (ListenableFuture canCommit : canCommitAll()) { + for (final ListenableFuture canCommit : canCommitAll()) { try { final Boolean result = (Boolean)canCommit.get(); if (result == null || !result) { @@ -117,7 +117,7 @@ final class CommitCoordinationTask implements Callable { private ListenableFuture[] canCommitAll() { final ListenableFuture[] ops = new ListenableFuture[cohorts.size()]; int i = 0; - for (DOMStoreThreePhaseCommitCohort cohort : cohorts) { + for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) { ops[i++] = cohort.canCommit(); } return ops; @@ -139,7 +139,7 @@ final class CommitCoordinationTask implements Callable { private void preCommitBlocking() throws TransactionCommitFailedException { final ListenableFuture[] preCommitFutures = preCommitAll(); try { - for(ListenableFuture future : preCommitFutures) { + for(final ListenableFuture future : preCommitFutures) { future.get(); } } catch (InterruptedException | ExecutionException e) { @@ -164,7 +164,7 @@ final class CommitCoordinationTask implements Callable { private ListenableFuture[] preCommitAll() { final ListenableFuture[] ops = new ListenableFuture[cohorts.size()]; int i = 0; - for (DOMStoreThreePhaseCommitCohort cohort : cohorts) { + for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) { ops[i++] = cohort.preCommit(); } return ops; @@ -185,7 +185,7 @@ final class CommitCoordinationTask implements Callable { private void commitBlocking() throws TransactionCommitFailedException { final ListenableFuture[] commitFutures = commitAll(); try { - for(ListenableFuture future : commitFutures) { + for(final ListenableFuture future : commitFutures) { future.get(); } } catch (InterruptedException | ExecutionException e) { @@ -207,7 +207,7 @@ final class CommitCoordinationTask implements Callable { private ListenableFuture[] commitAll() { final ListenableFuture[] ops = new ListenableFuture[cohorts.size()]; int i = 0; - for (DOMStoreThreePhaseCommitCohort cohort : cohorts) { + for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) { ops[i++] = cohort.commit(); } return ops; @@ -254,11 +254,12 @@ final class CommitCoordinationTask implements Callable { * @return Future which will complete once all cohorts completed * abort. */ + @SuppressWarnings({"unchecked", "rawtypes"}) private ListenableFuture abortAsyncAll() { final ListenableFuture[] ops = new ListenableFuture[cohorts.size()]; int i = 0; - for (DOMStoreThreePhaseCommitCohort cohort : cohorts) { + for (final DOMStoreThreePhaseCommitCohort cohort : cohorts) { ops[i++] = cohort.abort(); } @@ -267,8 +268,6 @@ final class CommitCoordinationTask implements Callable { * order to fail composite future if any of them failed. * See Futures.allAsList for this description. */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - ListenableFuture compositeResult = (ListenableFuture) Futures.allAsList(ops); - return compositeResult; + return (ListenableFuture) Futures.allAsList(ops); } } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java index b5ec58d54a..55f8a1557d 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongDataBroker.java @@ -33,7 +33,7 @@ public final class PingPongDataBroker extends ForwardingDOMDataBroker implements * * @param delegate Backend broker, may not be null. */ - public PingPongDataBroker(final @Nonnull DOMDataBroker delegate) { + public PingPongDataBroker(@Nonnull final DOMDataBroker delegate) { this.delegate = Preconditions.checkNotNull(delegate); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java index 611303a41a..68ef76056a 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/PingPongFuture.java @@ -12,7 +12,8 @@ import com.google.common.util.concurrent.ListenableFuture; import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException; /** - * A {@link Future} used to report the status of an future {@link java.util.concurrent.Future}. + * A {@link java.util.concurrent.Future} used to report the status of an future + * {@link java.util.concurrent.Future}. */ final class PingPongFuture extends AbstractCheckedFuture { protected PingPongFuture(final ListenableFuture delegate) { @@ -24,7 +25,7 @@ final class PingPongFuture extends AbstractCheckedFuture shardMap) { // Record the producer's attachment points final DOMDataTreeProducer ret = ShardedDOMDataTreeProducer.create(this, shardMap); - for (final DOMDataTreeIdentifier s : shardMap.keySet()) { + for (DOMDataTreeIdentifier s : shardMap.keySet()) { idToProducer.put(s, ret); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java index 9712b25ac9..9b485df13a 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/ShardedDOMDataTreeProducer.java @@ -54,13 +54,13 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { final Builder cb = ImmutableBiMap.builder(); final Queue es = new LinkedList<>(); - for (DOMDataTreeShard s : shards) { + for (final DOMDataTreeShard s : shards) { if (s instanceof DOMStore) { try { final DOMStoreTransactionChain c = ((DOMStore)s).createTransactionChain(); LOG.trace("Using DOMStore chain {} to access shard {}", c, s); cb.put(s, c); - } catch (Exception e) { + } catch (final Exception e) { LOG.error("Failed to instantiate chain for shard {}", s, e); es.add(e); } @@ -72,11 +72,11 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { // An error was encountered, close chains and report the error if (shardToChain.size() != shards.size()) { - for (DOMStoreTransactionChain c : shardToChain.values()) { + for (final DOMStoreTransactionChain c : shardToChain.values()) { try { c.close(); - } catch (Exception e) { - LOG.warn("Exception raised while closing chain %s", c, e); + } catch (final Exception e) { + LOG.warn("Exception raised while closing chain {}", c, e); } } @@ -98,13 +98,13 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { // Allocate backing transactions final Map shardToTx = new HashMap<>(); - for (Entry e : shardToChain.entrySet()) { + for (final Entry e : shardToChain.entrySet()) { shardToTx.put(e.getKey(), e.getValue().newWriteOnlyTransaction()); } // Create the ID->transaction map final ImmutableMap.Builder b = ImmutableMap.builder(); - for (Entry e : idToShard.entrySet()) { + for (final Entry e : idToShard.entrySet()) { b.put(e.getKey(), shardToTx.get(e.getValue())); } @@ -115,7 +115,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { @GuardedBy("this") private boolean haveSubtree(final DOMDataTreeIdentifier subtree) { - for (DOMDataTreeIdentifier i : idToShard.keySet()) { + for (final DOMDataTreeIdentifier i : idToShard.keySet()) { if (i.contains(subtree)) { return true; } @@ -126,7 +126,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { @GuardedBy("this") private DOMDataTreeProducer lookupChild(final DOMDataTreeIdentifier s) { - for (Entry e : children.entrySet()) { + for (final Entry e : children.entrySet()) { if (e.getKey().contains(s)) { return e.getValue(); } @@ -140,7 +140,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { Preconditions.checkState(!closed, "Producer is already closed"); Preconditions.checkState(openTx == null, "Transaction %s is still open", openTx); - for (DOMDataTreeIdentifier s : subtrees) { + for (final DOMDataTreeIdentifier s : subtrees) { // Check if the subtree was visible at any time if (!haveSubtree(s)) { throw new IllegalArgumentException(String.format("Subtree %s was never available in producer %s", s, this)); @@ -151,7 +151,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { Preconditions.checkArgument(child == null, "Subtree %s is delegated to child producer %s", s, child); // Check if part of the requested subtree is not delegated to a child. - for (DOMDataTreeIdentifier c : children.keySet()) { + for (final DOMDataTreeIdentifier c : children.keySet()) { if (s.contains(c)) { throw new IllegalArgumentException(String.format("Subtree %s cannot be delegated as it is superset of already-delegated %s", s, c)); } @@ -161,7 +161,7 @@ final class ShardedDOMDataTreeProducer implements DOMDataTreeProducer { final DOMDataTreeProducer ret = dataTree.createProducer(this, subtrees); final ImmutableMap.Builder cb = ImmutableMap.builder(); cb.putAll(children); - for (DOMDataTreeIdentifier s : subtrees) { + for (final DOMDataTreeIdentifier s : subtrees) { cb.put(s, ret); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java index 6958f7a249..11e2a195d9 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/broker/impl/TransactionCommitFailedExceptionMapper.java @@ -28,7 +28,7 @@ public final class TransactionCommitFailedExceptionMapper super( opName, TransactionCommitFailedException.class ); } - public static final TransactionCommitFailedExceptionMapper create(final String opName) { + public static TransactionCommitFailedExceptionMapper create(final String opName) { return new TransactionCommitFailedExceptionMapper(opName); } diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java index 17d8229675..03fbb18cae 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/BrokerImpl.java @@ -12,6 +12,11 @@ import com.google.common.base.Preconditions; import com.google.common.collect.ClassToInstanceMap; import com.google.common.collect.ImmutableClassToInstanceMap; import com.google.common.util.concurrent.CheckedFuture; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; import org.opendaylight.controller.md.sal.dom.api.DOMRpcAvailabilityListener; import org.opendaylight.controller.md.sal.dom.api.DOMRpcException; import org.opendaylight.controller.md.sal.dom.api.DOMRpcIdentifier; @@ -32,12 +37,6 @@ import org.osgi.framework.BundleContext; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collections; -import java.util.HashSet; -import java.util.Set; - public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, AutoCloseable { private final static Logger log = LoggerFactory.getLogger(BrokerImpl.class); @@ -74,7 +73,7 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, // Validation private void checkPredicates(final Provider prov) { Preconditions.checkNotNull(prov, "Provider should not be null."); - for (ProviderContextImpl session : providerSessions) { + for (final ProviderContextImpl session : providerSessions) { if (prov.equals(session.getProvider())) { throw new IllegalStateException("Provider already registered"); } @@ -84,7 +83,7 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, private void checkPredicates(final Consumer cons) { Preconditions.checkNotNull(cons, "Consumer should not be null."); - for (ConsumerContextImpl session : sessions) { + for (final ConsumerContextImpl session : sessions) { if (cons.equals(session.getConsumer())) { throw new IllegalStateException("Consumer already registered"); } @@ -93,12 +92,12 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, // Private Factory methods private ConsumerContextImpl newSessionFor(final Consumer provider) { - ConsumerContextImpl ret = new ConsumerContextImpl(provider, this); + final ConsumerContextImpl ret = new ConsumerContextImpl(provider, this); return ret; } private ProviderContextImpl newSessionFor(final Provider provider) { - ProviderContextImpl ret = new ProviderContextImpl(provider, this); + final ProviderContextImpl ret = new ProviderContextImpl(provider, this); return ret; } @@ -152,7 +151,7 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, @Override - public ConsumerSession registerConsumer(Consumer consumer) { + public ConsumerSession registerConsumer(final Consumer consumer) { checkPredicates(consumer); log.trace("Registering consumer {}", consumer); final ConsumerContextImpl session = newSessionFor(consumer); @@ -163,7 +162,7 @@ public class BrokerImpl implements Broker, DOMRpcProviderService, DOMRpcService, @Override - public ProviderSession registerProvider(Provider provider) { + public ProviderSession registerProvider(final Provider provider) { checkPredicates(provider); final ProviderContextImpl session = newSessionFor(provider); provider.onSessionInitiated(session); diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java index 0d1e1af671..6806c5d4a4 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/impl/SchemaContextProviders.java @@ -14,6 +14,10 @@ import org.opendaylight.yangtools.yang.model.api.SchemaContextProvider; public class SchemaContextProviders { + private SchemaContextProviders() { + throw new UnsupportedOperationException("Utility class."); + } + public static final SchemaContextProvider fromSchemaService(final SchemaService schemaService) { if (schemaService instanceof SchemaContextProvider) { return (SchemaContextProvider) schemaService; @@ -21,7 +25,7 @@ public class SchemaContextProviders { return new SchemaServiceAdapter(schemaService); } - private final static class SchemaServiceAdapter implements SchemaContextProvider, Delegator { + private static final class SchemaServiceAdapter implements SchemaContextProvider, Delegator { private final SchemaService service; diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java index fdacd8b3d6..c397eec192 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/osgi/ProxyFactory.java @@ -26,28 +26,28 @@ public class ProxyFactory { return ((T) _createProxyImpl); } - private static Object _createProxyImpl(final ServiceReference ref, + private static Object createProxyImpl(final ServiceReference ref, final DOMMountPointService service) { return new DOMMountPointServiceProxy( ((ServiceReference) ref), service); } - private static Object _createProxyImpl(final ServiceReference ref, + private static Object createProxyImpl(final ServiceReference ref, final SchemaService service) { return new SchemaServiceProxy(((ServiceReference) ref), service); } - private static DOMDataBrokerProxy _createProxyImpl( + private static DOMDataBrokerProxy createProxyImpl( final ServiceReference ref, final DOMDataBroker service) { return new DOMDataBrokerProxy(((ServiceReference) ref), service); } - private static Object _createProxyImpl(final ServiceReference reference, + private static Object createProxyImplFallback(final ServiceReference reference, final BrokerService service) { return service; @@ -57,13 +57,13 @@ public class ProxyFactory { final BrokerService service) { if (service instanceof DOMDataBroker) { - return _createProxyImpl(ref, (DOMDataBroker) service); + return createProxyImpl(ref, (DOMDataBroker) service); } else if (service instanceof SchemaService) { - return _createProxyImpl(ref, (SchemaService) service); + return createProxyImpl(ref, (SchemaService) service); } else if (service instanceof DOMMountPointService) { - return _createProxyImpl(ref, (DOMMountPointService) service); + return createProxyImpl(ref, (DOMMountPointService) service); } else if (service != null) { - return _createProxyImpl(ref, service); + return createProxyImplFallback(ref, service); } else { throw new IllegalArgumentException("Unhandled parameter types: " + Arrays. asList(ref, service).toString());