Ask Your Question
0

there should be some improvement about the auto generated codes from YANGTOOLs

asked 2015-05-06 01:48:08 -0700

chenguohai gravatar image

updated 2015-05-06 18:04:32 -0700

Hi folks,

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

THANKS

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
0

answered 2015-05-06 06:40:09 -0700

Dana gravatar image

You can open a bug for yangtools in bugzilla: https://bugs.opendaylight.org

edit flag offensive delete publish link more

Comments

ok, i'll do that.

chenguohai ( 2015-05-06 18:03:04 -0700 )edit

i have submitted

chenguohai ( 2015-05-12 17:53:37 -0700 )edit
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2015-05-06 01:48:08 -0700

Seen: 4,672 times

Last updated: May 06 '15