GitHub PullRequestReviewCommentEvent at 2014-02-28 13:44:05
Repository: junit-interface
Actor: szeiger
Payload: {"comment":{"url":"https://api.github.com/repos/sbt/junit-interface/pulls/comments/10164001","id":10164001,"diff_hunk":"@@ -0,0 +1,73 @@\n+package com.novocode.junit;\n+\n+import java.io.ByteArrayOutputStream;\n+import java.io.IOException;\n+import java.io.PrintStream;\n+import java.lang.reflect.Method;\n+\n+final class OutputCapture\n+{\n+  private final PrintStream originalOut = System.out;\n+  private final PrintStream originalScalaOut = getScalaOut();\n+  private final ByteArrayOutputStream buffer = new ByteArrayOutputStream();\n+  private final PrintStream prBuffer = new PrintStream(buffer, true);\n+  private final boolean scalaOutSet;\n+\n+  private OutputCapture()\n+  {\n+    //System.err.println(\"***** Replacing \"+System.out+\" with buffer \"+prBuffer);\n+    System.out.flush();\n+    System.setOut(prBuffer);\n+    scalaOutSet = setScalaOut(prBuffer);\n+  }\n+\n+  static OutputCapture start() { return new OutputCapture(); }\n+\n+  void stop()\n+  {\n+    //System.err.println(\"***** Restoring \"+originalOut);\n+    System.out.flush();\n+    System.setOut(originalOut);","path":"src/main/java/com/novocode/junit/OutputCapture.java","position":30,"original_position":30,"commit_id":"c6d51ac5e56d0e7f47cc1973d3e32d615594ee93","original_commit_id":"c6d51ac5e56d0e7f47cc1973d3e32d615594ee93","user":{"login":"szeiger","id":54262,"avatar_url":"https://avatars.githubusercontent.com/u/54262","gravatar_id":"f3d8455e07577a34fe95bc5bb0e58e9f","url":"https://api.github.com/users/szeiger","html_url":"https://github.com/szeiger","followers_url":"https://api.github.com/users/szeiger/followers","following_url":"https://api.github.com/users/szeiger/following{/other_user}","gists_url":"https://api.github.com/users/szeiger/gists{/gist_id}","starred_url":"https://api.github.com/users/szeiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szeiger/subscriptions","organizations_url":"https://api.github.com/users/szeiger/orgs","repos_url":"https://api.github.com/users/szeiger/repos","events_url":"https://api.github.com/users/szeiger/events{/privacy}","received_events_url":"https://api.github.com/users/szeiger/received_events","type":"User","site_admin":false},"body":"It's not. This is the same hack that it used to be. There is no clean way to swap out the stdio streams. There's no point in synchronizing on anything and pretending to be atomic because there is no standard protocol that others would follow, too. The situation is so screwed up that System.setOut does not swap out some internal delegate of System out, it changes the value of System.out itself (a public static final field)","created_at":"2014-02-28T13:44:05Z","updated_at":"2014-02-28T13:44:05Z","html_url":"https://github.com/sbt/junit-interface/pull/46#discussion_r10164001","pull_request_url":"https://api.github.com/repos/sbt/junit-interface/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/sbt/junit-interface/pulls/comments/10164001"},"html":{"href":"https://github.com/sbt/junit-interface/pull/46#discussion_r10164001"},"pull_request":{"href":"https://api.github.com/repos/sbt/junit-interface/pulls/46"}}}}