Review request: 8003562: Provide a command-line tool to find static dependencies

Ulf Zibis Ulf.Zibis at CoSoCo.de
Fri Dec 14 16:35:00 PST 2012


Thanks for your explanations Mandy.

Am 14.12.2012 21:54, schrieb Mandy Chung:
>
> On 12/14/2012 3:54 AM, Ulf Zibis wrote:
>> In many places the source is exhausting to read, e.g
>>         if (f.exists()) {
>>             ClassFileReader reader = ClassFileReader.newInstance(f);
>>             Archive archive = new Archive(f, reader);
>>             result.add(archive);
>>         }
>> could simply be:
>>         if (f.exists())
>>             result.add(new Archive(f, ClassFileReader.newInstance(f)));
>>
>> ... also spreading around the variable definitions at different places.
>
> Fixed.

Other examples:
===================================
  484                 while (arg != null) {
   ...
  490                     arg = iter.hasNext() ? iter.next() : null;
  491                 }
Could be:
  484                 for (; iter.hasNext(); arg = iter.next()) {
   ...
  491                 }
===================================
  224         Dependency.Finder finder = Dependencies.getClassDependencyFinder();
   ...
  238         findDependencies(finder, filter);
   ...
  273     private void findDependencies(Dependency.Finder finder,
  274                                   Dependency.Filter filter)
Could be:
  238         findDependencies(filter);
   ...
  273     private void findDependencies(Dependency.Filter filter) {
  274         Dependency.Finder finder = Dependencies.getClassDependencyFinder();
at least remove line 224 and use:
  238 findDependencies(Dependencies.getClassDependencyFinder(), filter);
===================================


-Ulf




More information about the compiler-dev mailing list