Merge "Update comment and remove unwanted FIXME in SchemaSetup"
authorTomas Cere <tcere@cisco.com>
Fri, 6 May 2016 10:26:49 +0000 (10:26 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 6 May 2016 10:26:49 +0000 (10:26 +0000)
1  2 
netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/NetconfDevice.java

index cc6e666980a1cf34dcfbb0f96735e612327ec379,a3234e59d74f73cd058d5b7137eaf8839b9e9010..a590c10850643ca26e7ba3596922fc475cd7943d
@@@ -87,6 -87,11 +87,6 @@@ public class NetconfDevice implements R
      // Message transformer is constructed once the schemas are available
      private MessageTransformer<NetconfMessage> messageTransformer;
  
 -    public NetconfDevice(final SchemaResourcesDTO schemaResourcesDTO, final RemoteDeviceId id, final RemoteDeviceHandler<NetconfSessionPreferences> salFacade,
 -                         final ExecutorService globalProcessingExecutor) {
 -        this(schemaResourcesDTO, id, salFacade, globalProcessingExecutor, false);
 -    }
 -
      /**
       * Create rpc implementation capable of handling RPC for monitoring and notifications even before the schemas of remote device are downloaded
       */
          return new NetconfDeviceRpc(baseSchema.getSchemaContext(), listener, new NetconfMessageTransformer(baseSchema.getSchemaContext(), false, baseSchema));
      }
  
 -
 -    // FIXME reduce parameters
 -    public NetconfDevice(final SchemaResourcesDTO schemaResourcesDTO, final RemoteDeviceId id, final RemoteDeviceHandler<NetconfSessionPreferences> salFacade,
 +    protected NetconfDevice(final SchemaResourcesDTO schemaResourcesDTO, final RemoteDeviceId id, final RemoteDeviceHandler<NetconfSessionPreferences> salFacade,
                           final ExecutorService globalProcessingExecutor, final boolean reconnectOnSchemasChange) {
          this.id = id;
          this.reconnectOnSchemasChange = reconnectOnSchemasChange;
                      if (t instanceof MissingSchemaSourceException){
                          requiredSources = handleMissingSchemaSourceException(requiredSources, (MissingSchemaSourceException) t);
                      } else if (t instanceof SchemaResolutionException) {
-                         // FIXME do not wrap MissingSchemaSourceException in a
-                         // SchemaResolutionException. Somewhere this exception
-                         // is wrapped thus the instanceod isn't seeing the root
-                         // the cause of the exception.
+                         // schemaBuilderFuture.checkedGet() throws only SchemaResolutionException
+                         // that might be wrapping a MissingSchemaSourceException so we need to look
+                         // at the cause of the exception to make sure we don't misinterpret it.
                          if (t.getCause() instanceof MissingSchemaSourceException) {
                              requiredSources = handleMissingSchemaSourceException(requiredSources, (MissingSchemaSourceException) t.getCause());
                              continue;