| 132 | } |
| 133 | |
| 134 | public void extractOutput(String output) throws NumberFormatException { |
| 135 | for (String line : output.split("\\n")) { |
| 136 | rawOutput.add(line); |
| 137 | int lineNumberStart = line.indexOf(", line") + 6; |
| 138 | if (lineNumberStart > 6) { |
| 139 | int lineNumberEnd = line.indexOf(' ', lineNumberStart+1); |
| 140 | int actualLineNumber = Integer.parseUnsignedInt(line.substring(lineNumberStart, lineNumberEnd).trim()); |
| 141 | String message = line.substring(lineNumberEnd).trim(); |
| 142 | if (line.startsWith("Error")) { |
| 143 | errors.put(actualLineNumber, message); |
| 144 | } else { |
| 145 | warnings.put(actualLineNumber, message); |
| 146 | } |
| 147 | } else { |
| 148 | if (line.trim().length() > 1) { |
| 149 | otherWarnings.add(line); |
| 150 | } |
| 151 | } |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | public void restoreSystemOutput() { |
| 156 | System.setOut(systemOut); |