test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java

changeset 2174
62a67e0875ff
parent 1448
7d34e91f66bb
child 2227
998b10c43157
     1.1 --- a/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java	Wed Oct 30 18:09:49 2013 +0000
     1.2 +++ b/test/tools/javac/lambdaShapes/org/openjdk/tests/separate/Compiler.java	Wed Oct 30 14:12:16 2013 -0400
     1.3 @@ -46,7 +46,7 @@
     1.4          USECACHE // Keeps results around for reuse.  Only use this is
     1.5                   // you're sure that each compilation name maps to the
     1.6                   // same source code
     1.7 -    };
     1.8 +    }
     1.9  
    1.10      private static final AtomicInteger counter = new AtomicInteger();
    1.11      private static final String targetDir = "gen-separate";
    1.12 @@ -85,7 +85,7 @@
    1.13      }
    1.14  
    1.15      public void setFlags(Flags ... flags) {
    1.16 -        this.flags = new HashSet<Flags>(Arrays.asList(flags));
    1.17 +        this.flags = new HashSet<>(Arrays.asList(flags));
    1.18      }
    1.19  
    1.20      public void addPostprocessor(ClassFilePreprocessor cfp) {
    1.21 @@ -131,17 +131,10 @@
    1.22          outputDirs.put(type.getName(), outDir);
    1.23  
    1.24          Class superClass = type.getSuperclass();
    1.25 -        if (superClass != null) {
    1.26 -            for( Map.Entry<String,File> each : compileHierarchy(superClass).entrySet()) {
    1.27 -                outputDirs.put(each.getKey(), each.getValue());
    1.28 -            }
    1.29 -        }
    1.30 -        for (Extends ext : type.getSupertypes()) {
    1.31 -            Type iface = ext.getType();
    1.32 -            for( Map.Entry<String,File> each : compileHierarchy(iface).entrySet()) {
    1.33 -                outputDirs.put(each.getKey(), each.getValue());
    1.34 -            }
    1.35 -        }
    1.36 +        if (superClass != null)
    1.37 +            outputDirs.putAll(compileHierarchy(superClass));
    1.38 +        for (Extends ext : type.getSupertypes())
    1.39 +            outputDirs.putAll(compileHierarchy(ext.getType()));
    1.40  
    1.41          return outputDirs;
    1.42      }
    1.43 @@ -157,8 +150,12 @@
    1.44          SourceProcessor accum =
    1.45              (name, src) -> { files.add(new SourceFile(name, src)); };
    1.46  
    1.47 -        for (Type dep : type.typeDependencies()) {
    1.48 -            dep.generateAsDependency(accum, type.methodDependencies());
    1.49 +        Collection<Type> deps = type.typeDependencies(type.isFullCompilation());
    1.50 +        for (Type dep : deps) {
    1.51 +            if (type.isFullCompilation())
    1.52 +                dep.generate(accum);
    1.53 +            else
    1.54 +                dep.generateAsDependency(accum, type.methodDependencies());
    1.55          }
    1.56  
    1.57          type.generate(accum);
    1.58 @@ -185,7 +182,7 @@
    1.59                  StandardLocation.CLASS_OUTPUT, Arrays.asList(destDir));
    1.60          } catch (IOException e) {
    1.61              throw new RuntimeException(
    1.62 -                "IOException encountered during compilation");
    1.63 +                "IOException encountered during compilation", e);
    1.64          }
    1.65          Boolean result = ct.call();
    1.66          if (result == Boolean.FALSE) {

mercurial