Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-148

auto generated code by YANGTOOLS could be more efficient (binding spec. v2)

XMLWordPrintable

      +++ This bug was initially created as a clone of MDSAL-84 +++

      I am reading the code under ALTO@ODL. And here are my two comments.

      1:File named ‘AltoProviderImplBuilder’under alto-provider/……./modules/module/configuration :in function named 'toString',first is defined to judge a common should be inserted, i recommend writting as following

      @Override
      public java.lang.String toString() {
      java.lang.StringBuilder builder = new java.lang.StringBuilder ("AltoProviderImpl [");
      //boolean first = true;

      if (_dataBroker != null) {
      //if (first)

      { // first = false; //} else { // builder.append(", "); //}
      builder.append("_dataBroker=");
      builder.append(_dataBroker);
      builder.append(", ");//new added

      }
      if (_rpcRegistry != null) {
      //if (first) { // first = false; //}

      else

      { // builder.append(", "); //}

      builder.append("_rpcRegistry=");
      builder.append(_rpcRegistry);
      builder.append(", ");//new added

      }
      //if (first)

      { // first = false; //}

      else

      { // builder.append(", "); //}

      builder.append("augmentation=");
      builder.append(augmentation.values());
      return builder.append(']').toString();
      }
      }
      Fewer judgement, fewer jumpes and simplified, consistent code,Make sense. There are similar something in file named RpcRegistryBuilder.java under alto-provider/……../modules/module/configuration/alto/provider/impl

      BTW,could anyone tell me who is responsible for the improvements

            Unassigned Unassigned
            martin.ciglan Martin Ciglan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: