Print this page


Split Close
Expand all
Collapse all
          --- old/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java
          +++ new/test/java/util/concurrent/locks/Lock/TimedAcquireLeak.java
↓ open down ↓ 56 lines elided ↑ open up ↑
  57   57          int n;
  58   58          while ((n = r.read(buf)) > 0)
  59   59              sb.append(buf, 0, n);
  60   60          return sb.toString();
  61   61      }
  62   62  
  63   63      static String outputOf(InputStream is) throws IOException {
  64   64          return outputOf(new InputStreamReader(is, "UTF-8"));
  65   65      }
  66   66  
  67      -    final static ExecutorService drainers = Executors.newFixedThreadPool(12);
       67 +    static final ExecutorService drainers = Executors.newFixedThreadPool(12);
  68   68      static Future<String> futureOutputOf(final InputStream is) {
  69   69          return drainers.submit(
  70   70              new Callable<String>() { public String call() throws IOException {
  71   71                      return outputOf(is); }});}
  72   72  
  73   73      static String outputOf(final Process p) {
  74   74          try {
  75   75              Future<String> outputFuture = futureOutputOf(p.getInputStream());
  76   76              Future<String> errorFuture = futureOutputOf(p.getErrorStream());
  77   77              final String output = outputFuture.get();
↓ open down ↓ 193 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX