Do not declare Throwable as thrown 55/7155/1
authorRobert Varga <rovarga@cisco.com>
Sun, 18 May 2014 13:38:43 +0000 (15:38 +0200)
committerRobert Varga <rovarga@cisco.com>
Sun, 18 May 2014 13:46:24 +0000 (15:46 +0200)
Let's not force our callers to deal with Throwable -- Exception is bad
enough.

Change-Id: I938ddfd6c08d5cf5a954a3455cfea612ea742784
Signed-off-by: Robert Varga <rovarga@cisco.com>
restconf/restconf-client-impl/src/main/java/org/opendaylight/yangtools/restconf/client/BindingToRestRpc.java

index fe4eb76695e25b08007f27215ce3cd26bc1d7e7a..40d29da662a56e725d8ad0af79a409ee1a07e6d5 100644 (file)
@@ -48,7 +48,7 @@ public class BindingToRestRpc implements InvocationHandler {
     private final SchemaContext schcemaContext;
     private final Module module;
 
-    public BindingToRestRpc(Class<?> proxiedInterface,BindingIndependentMappingService mappingService,RestconfClientImpl client,SchemaContext schemaContext) throws Exception {
+    public BindingToRestRpc(final Class<?> proxiedInterface,final BindingIndependentMappingService mappingService,final RestconfClientImpl client,final SchemaContext schemaContext) throws Exception {
         this.mappingService = mappingService;
         this.client  = client;
         this.schcemaContext = schemaContext;
@@ -57,7 +57,7 @@ public class BindingToRestRpc implements InvocationHandler {
     }
 
     @Override
-    public Object invoke(Object o,final Method method, Object[] objects) throws Throwable {
+    public Object invoke(final Object o,final Method method, final Object[] objects) throws Exception {
         for (RpcDefinition rpcDef:module.getRpcs()){
             if (method.getName().equals(BindingMapping.getMethodName(rpcDef.getQName()))){
 
@@ -77,7 +77,7 @@ public class BindingToRestRpc implements InvocationHandler {
                 final DataSchemaNode rpcOutputSchema = rpcDef.getOutput();
                 return client.post(ResourceUri.OPERATIONS.getPath() + "/" + moduleName + ":" + rpcMethodName,payloadString,new Function<ClientResponse, Object>() {
                     @Override
-                    public Object apply(ClientResponse clientResponse) {
+                    public Object apply(final ClientResponse clientResponse) {
                         if (clientResponse.getStatus() != 200) {
                             throw new IllegalStateException("Can't get data from restconf. "+clientResponse.getClientResponseStatus());
                         }
@@ -101,10 +101,10 @@ public class BindingToRestRpc implements InvocationHandler {
         throw new IllegalStateException("Unexpected state of proxy method.");
     }
 
-    public static<T> T getProxy(Class<T> proxiedInterface,
-                                BindingIndependentMappingService mappingService,
-                                RestconfClientImpl restconfClient,
-                                SchemaContext schemaContext) {
+    public static<T> T getProxy(final Class<T> proxiedInterface,
+                                final BindingIndependentMappingService mappingService,
+                                final RestconfClientImpl restconfClient,
+                                final SchemaContext schemaContext) {
         T proxiedType = null;
         try {
             proxiedType = (T) Proxy.newProxyInstance