Better way to order call methods inside method -


let's supose following piece of code:

private void createdependencies() {     inject(afake.class,            whatevera());     inject(cfake.class,            whateverc());     inject(bfake.class,            whateverb());     inject(dfake.class,            whateverd());     // ... , 200 more } 

which better way order alphabetically createdependencies->inject(...) methods, have following result?

private void createdependencies() {     inject(afake.class,            whatevera());     inject(bfake.class,            whateverb());     inject(cfake.class,            whateverc());     inject(dfake.class,            whateverd());     // ... , 200 more } 

maybe bash script? maybe creating hole (and boring) java project , using sorting algorithm?

after several time searching easy way this, best/easy way (for me):

  • copy content of createdependencies() method file, let's aux.txt.

  • save it.

  • open vim , run:

    :%s/,\n/, /g

    :%sort

    :x

  • now copy content of aux.txt , replace content of createdependencies() in real file.

  • run reformat in ide! :)


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -