View Javadoc
1   package org.codehaus.plexus.compiler.javac;
2   
3   /**
4    * The MIT License
5    *
6    * Copyright (c) 2005, The Codehaus
7    *
8    * Permission is hereby granted, free of charge, to any person obtaining a copy of
9    * this software and associated documentation files (the "Software"), to deal in
10   * the Software without restriction, including without limitation the rights to
11   * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
12   * of the Software, and to permit persons to whom the Software is furnished to do
13   * so, subject to the following conditions:
14   *
15   * The above copyright notice and this permission notice shall be included in all
16   * copies or substantial portions of the Software.
17   *
18   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24   * SOFTWARE.
25   */
26  import java.io.BufferedReader;
27  import java.io.IOException;
28  import java.io.StringReader;
29  import java.util.ArrayList;
30  import java.util.List;
31  import java.util.stream.Collectors;
32  import java.util.stream.Stream;
33  
34  import org.codehaus.plexus.compiler.CompilerMessage;
35  import org.codehaus.plexus.util.Os;
36  import org.junit.jupiter.api.Test;
37  import org.junit.jupiter.params.ParameterizedTest;
38  import org.junit.jupiter.params.provider.Arguments;
39  import org.junit.jupiter.params.provider.MethodSource;
40  
41  import static org.codehaus.plexus.compiler.javac.JavacCompiler.Messages.*;
42  import static org.junit.jupiter.api.Assertions.assertEquals;
43  import static org.junit.jupiter.api.Assertions.assertFalse;
44  import static org.junit.jupiter.api.Assertions.assertNotNull;
45  import static org.junit.jupiter.api.Assertions.assertTrue;
46  
47  /**
48   * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
49   * @author Alexander Kriegisch
50   */
51  public class ErrorMessageParserTest {
52      private static final String EOL = System.getProperty("line.separator");
53      private static final String ANNOTATION_PROCESSING_NOTE =
54              "Note: Annotation processing is enabled because one or more processors were found" + EOL
55                      + "  on the class path. A future release of javac may disable annotation processing" + EOL
56                      + "  unless at least one processor is specified by name (-processor), or a search" + EOL
57                      + "  path is specified (--processor-path, --processor-module-path), or annotation" + EOL
58                      + "  processing is enabled explicitly (-proc:only, -proc:full)." + EOL
59                      + "  Use -Xlint:-options to suppress this message." + EOL
60                      + "  Use -proc:none to disable annotation processing." + EOL;
61  
62      private static final String UNIDENTIFIED_LOG_LINES =
63              "These log lines should be cut off\n" + "when preceding known error message headers\n";
64  
65      @Test
66      public void testDeprecationMessage() throws Exception {
67          String error =
68                  "target/compiler-src/testDeprecation/Foo.java:1: warning: Date(java.lang.String) in java.util.Date has been deprecated"
69                          + EOL + "import java.util.Date;public class Foo{    private Date date = new Date( \"foo\");}"
70                          + EOL + "                                                               ^"
71                          + EOL;
72  
73          CompilerMessage compilerError = JavacCompiler.parseModernError(0, error);
74  
75          assertNotNull(compilerError);
76  
77          assertFalse(compilerError.isError());
78  
79          assertEquals("Date(java.lang.String) in java.util.Date has been deprecated", compilerError.getMessage());
80  
81          assertEquals(64, compilerError.getStartColumn());
82  
83          assertEquals(66, compilerError.getEndColumn());
84  
85          assertEquals(1, compilerError.getStartLine());
86  
87          assertEquals(1, compilerError.getEndLine());
88      }
89  
90      @Test
91      public void testWarningMessage() {
92          String error = "target/compiler-src/testWarning/Foo.java:8: warning: finally clause cannot complete normally"
93                  + EOL + "        finally { return; }"
94                  + EOL + "                          ^"
95                  + EOL;
96  
97          CompilerMessage compilerError = JavacCompiler.parseModernError(0, error);
98  
99          assertNotNull(compilerError);
100 
101         assertFalse(compilerError.isError());
102 
103         assertEquals("finally clause cannot complete normally", compilerError.getMessage());
104 
105         assertEquals(27, compilerError.getStartColumn());
106 
107         assertEquals(27, compilerError.getEndColumn());
108 
109         assertEquals(8, compilerError.getStartLine());
110 
111         assertEquals(8, compilerError.getEndLine());
112     }
113 
114     @Test
115     public void testErrorMessage() {
116         String error = "Foo.java:7: not a statement" + EOL + "         i;" + EOL + "         ^" + EOL;
117 
118         CompilerMessage compilerError = JavacCompiler.parseModernError(1, error);
119 
120         assertNotNull(compilerError);
121 
122         assertTrue(compilerError.isError());
123 
124         assertEquals("not a statement", compilerError.getMessage());
125 
126         assertEquals(10, compilerError.getStartColumn());
127 
128         assertEquals(11, compilerError.getEndColumn());
129 
130         assertEquals(7, compilerError.getStartLine());
131 
132         assertEquals(7, compilerError.getEndLine());
133     }
134 
135     @Test
136     public void testErrorColumnIsOneBased() {
137         String error = "Test.java:5: error: not a statement" + EOL + " null;" + EOL + " ^" + EOL;
138 
139         CompilerMessage compilerError = JavacCompiler.parseModernError(1, error);
140 
141         assertEquals(5, compilerError.getStartLine());
142         assertEquals(2, compilerError.getStartColumn());
143         assertEquals("Test.java:[5,2] not a statement", compilerError.toString());
144     }
145 
146     @Test
147     public void testUnknownSymbolError() {
148         String error = "./org/codehaus/foo/UnknownSymbol.java:7: cannot find symbol" + EOL + "symbol  : method foo()"
149                 + EOL + "location: class org.codehaus.foo.UnknownSymbol"
150                 + EOL + "        foo();"
151                 + EOL + "        ^"
152                 + EOL;
153 
154         CompilerMessage compilerError = JavacCompiler.parseModernError(1, error);
155 
156         assertNotNull(compilerError);
157 
158         assertTrue(compilerError.isError());
159 
160         assertEquals(
161                 "cannot find symbol" + EOL + "symbol  : method foo()" + EOL
162                         + "location: class org.codehaus.foo.UnknownSymbol",
163                 compilerError.getMessage());
164 
165         assertEquals(9, compilerError.getStartColumn());
166 
167         assertEquals(14, compilerError.getEndColumn());
168 
169         assertEquals(7, compilerError.getStartLine());
170 
171         assertEquals(7, compilerError.getEndLine());
172     }
173 
174     @Test
175     public void testTwoErrors() throws IOException {
176         String errors = "./org/codehaus/foo/ExternalDeps.java:4: package org.apache.commons.lang does not exist" + EOL
177                 + "import org.apache.commons.lang.StringUtils;"
178                 + EOL + "                               ^"
179                 + EOL + "./org/codehaus/foo/ExternalDeps.java:12: cannot find symbol"
180                 + EOL + "symbol  : variable StringUtils"
181                 + EOL + "location: class org.codehaus.foo.ExternalDeps"
182                 + EOL + "          System.out.println( StringUtils.upperCase( str)  );"
183                 + EOL + "                              ^"
184                 + EOL + "2 errors"
185                 + EOL;
186 
187         List<CompilerMessage> messages =
188                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(errors)));
189 
190         assertEquals(2, messages.size());
191     }
192 
193     @Test
194     public void testAnotherTwoErrors() throws IOException {
195         String errors = "./org/codehaus/foo/ExternalDeps.java:4: package org.apache.commons.lang does not exist" + EOL
196                 + "import org.apache.commons.lang.StringUtils;"
197                 + EOL + "                               ^"
198                 + EOL + "./org/codehaus/foo/ExternalDeps.java:12: cannot find symbol"
199                 + EOL + "symbol  : variable StringUtils"
200                 + EOL + "location: class org.codehaus.foo.ExternalDeps"
201                 + EOL + "          System.out.println( StringUtils.upperCase( str)  );"
202                 + EOL + "                              ^"
203                 + EOL + "2 errors"
204                 + EOL;
205 
206         List<CompilerMessage> messages =
207                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(errors)));
208 
209         assertEquals(2, messages.size());
210     }
211 
212     @Test
213     public void testAssertError() throws IOException {
214         String errors =
215                 "./org/codehaus/foo/ReservedWord.java:5: as of release 1.4, 'assert' is a keyword, and may not be used as an identifier"
216                         + EOL + "(try -source 1.3 or lower to use 'assert' as an identifier)"
217                         + EOL + "        String assert;"
218                         + EOL + "               ^"
219                         + EOL + "1 error"
220                         + EOL;
221 
222         List<CompilerMessage> messages =
223                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(errors)));
224 
225         assertEquals(1, messages.size());
226     }
227 
228     @Test
229     public void testLocalizedWarningNotTreatedAsError() throws IOException {
230         String errors =
231                 "./src/main/java/Main.java:9: \u8b66\u544a:[deprecation] java.io.File \u306e toURL() \u306f\u63a8\u5968\u3055\u308c\u307e\u305b\u3093\u3002"
232                         + EOL + "    new File( path ).toURL()"
233                         + EOL + "                    ^"
234                         + EOL + "\u8b66\u544a 1 \u500b"
235                         + EOL;
236 
237         List<CompilerMessage> messages =
238                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(errors)));
239 
240         assertEquals(1, messages.size());
241         assertFalse(messages.get(0).isError());
242     }
243 
244     @Test
245     public void testUnixFileNames() {
246         String error = "/my/prj/src/main/java/test/prj/App.java:11: not a statement" + EOL
247                 + "        System.out.println( \"Hello World!\" );x"
248                 + EOL + "                                             ^"
249                 + EOL;
250 
251         CompilerMessage compilerError = JavacCompiler.parseModernError(1, error);
252 
253         assertEquals("/my/prj/src/main/java/test/prj/App.java:[11,46] not a statement", String.valueOf(compilerError));
254     }
255 
256     @Test
257     public void testWindowsDriveLettersMCOMPILER140() {
258         String error =
259                 "c:\\Documents and Settings\\My Self\\Documents\\prj\\src\\main\\java\\test\\prj\\App.java:11: not a statement"
260                         + EOL + "        System.out.println( \"Hello World!\" );x"
261                         + EOL + "                                             ^"
262                         + EOL;
263 
264         CompilerMessage compilerError = JavacCompiler.parseModernError(1, error);
265 
266         assertEquals(
267                 "c:\\Documents and Settings\\My Self\\Documents\\prj\\src\\main\\java\\test\\prj\\App.java:[11,46] not a statement",
268                 String.valueOf(compilerError));
269     }
270 
271     /**
272      * Test that CRLF is parsed correctly wrt. the filename in warnings.
273      *
274      * @throws Exception
275      */
276     @Test
277     public void testCRLF_windows() throws Exception {
278         // This test is only relevant on windows (test hardcodes EOL)
279         if (!Os.isFamily("windows")) {
280             return;
281         }
282 
283         String CRLF = new String(new byte[] {(byte) 0x0D, (byte) 0x0A});
284         String errors = "warning: [options] bootstrap class path not set in conjunction with -source 1.6" + CRLF
285                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpServerImpl.java]]"
286                 + CRLF + "[parsing completed 19ms]"
287                 + CRLF
288                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpServer.java]]"
289                 + CRLF + "[parsing completed 1ms]"
290                 + CRLF
291                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpServerAware.java]]"
292                 + CRLF + "[parsing completed 1ms]"
293                 + CRLF
294                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java]]"
295                 + CRLF + "[parsing completed 3ms]"
296                 + CRLF
297                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpThreadPool.java]]"
298                 + CRLF + "[parsing completed 3ms]"
299                 + CRLF
300                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpQueueAware.java]]"
301                 + CRLF + "[parsing completed 0ms]"
302                 + CRLF
303                 + "[parsing started RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpThreadPoolAware.java]]"
304                 + CRLF + "[parsing completed 1ms]"
305                 + CRLF + "[search path for source files: C:\\commander\\pre\\ec\\ec-http\\src\\main\\java]"
306                 + CRLF
307                 + "[search path for class files: C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\resources.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\rt.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\sunrsasign.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\jsse.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\jce.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\charsets.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\jfr.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\classes,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\dnsns.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\localedata.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\sunec.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\sunjce_provider.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\sunmscapi.jar,C:\\Program Files\\Java\\jdk1.7.0_04\\jre\\lib\\ext\\zipfs.jar,C:\\commander\\pre\\ec\\ec-http\\target\\classes,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-lock\\1.0.0-SNAPSHOT\\ec-lock-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-timer\\1.0.0-SNAPSHOT\\ec-timer-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\org\\apache\\commons\\commons-math\\2.2\\commons-math-2.2.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-validation\\1.0.0-SNAPSHOT\\ec-validation-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-xml\\1.0.0-SNAPSHOT\\ec-xml-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\commons-beanutils\\commons-beanutils\\1.8.3-PATCH1\\commons-beanutils-1.8.3-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\commons-collections\\commons-collections\\3.2.1\\commons-collections-3.2.1.jar,C:\\Users\\anders\\.m2\\repository\\dom4j\\dom4j\\1.6.1-PATCH1\\dom4j-1.6.1-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\javax\\validation\\validation-api\\1.0.0.GA\\validation-api-1.0.0.GA.jar,C:\\Users\\anders\\.m2\\repository\\org\\codehaus\\jackson\\jackson-core-asl\\1.9.7\\jackson-core-asl-1.9.7.jar,C:\\Users\\anders\\.m2\\repository\\org\\codehaus\\jackson\\jackson-mapper-asl\\1.9.7\\jackson-mapper-asl-1.9.7.jar,C:\\Users\\anders\\.m2\\repository\\org\\hibernate\\hibernate-core\\3.6.7-PATCH14\\hibernate-core-3.6.7-PATCH14.jar,C:\\Users\\anders\\.m2\\repository\\antlr\\antlr\\2.7.6\\antlr-2.7.6.jar,C:\\Users\\anders\\.m2\\repository\\org\\hibernate\\hibernate-commons-annotations\\3.2.0.Final\\hibernate-commons-annotations-3.2.0.Final.jar,C:\\Users\\anders\\.m2\\repository\\javax\\transaction\\jta\\1.1\\jta-1.1.jar,C:\\Users\\anders\\.m2\\repository\\org\\hibernate\\javax\\persistence\\hibernate-jpa-2.0-api\\1.0.1.Final\\hibernate-jpa-2.0-api-1.0.1.Final.jar,C:\\Users\\anders\\.m2\\repository\\org\\hyperic\\sigar\\1.6.5.132\\sigar-1.6.5.132.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-context\\3.1.1.RELEASE-PATCH1\\spring-context-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-expression\\3.1.1.RELEASE-PATCH1\\spring-expression-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-core\\3.1.1.RELEASE-PATCH1\\spring-core-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\tanukisoft\\wrapper\\3.5.14\\wrapper-3.5.14.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-log\\1.0.0-SNAPSHOT\\ec-log-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\ch\\qos\\logback\\logback-classic\\1.0.3-PATCH4\\logback-classic-1.0.3-PATCH4.jar,C:\\Users\\anders\\.m2\\repository\\ch\\qos\\logback\\logback-core\\1.0.3-PATCH4\\logback-core-1.0.3-PATCH4.jar,C:\\Users\\anders\\.m2\\repository\\org\\slf4j\\slf4j-api\\1.6.4\\slf4j-api-1.6.4.jar,C:\\Users\\anders\\.m2\\repository\\org\\slf4j\\jul-to-slf4j\\1.6.4\\jul-to-slf4j-1.6.4.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-queue\\1.0.0-SNAPSHOT\\ec-queue-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-security\\1.0.0-SNAPSHOT\\ec-security-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-acl\\1.0.0-SNAPSHOT\\ec-acl-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-transaction\\1.0.0-SNAPSHOT\\ec-transaction-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\org\\aspectj\\aspectjrt\\1.7.0.M1-PATCH1\\aspectjrt-1.7.0.M1-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-crypto\\1.0.0-SNAPSHOT\\ec-crypto-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\org\\bouncycastle\\bcprov-jdk16\\1.46\\bcprov-jdk16-1.46.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-property\\1.0.0-SNAPSHOT\\ec-property-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\org\\apache\\commons\\commons-lang3\\3.1\\commons-lang3-3.1.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-tx\\3.1.1.RELEASE-PATCH1\\spring-tx-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\org\\aopalliance\\com.springsource.org.aopalliance\\1.0.0\\com.springsource.org.aopalliance-1.0.0.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\ldap\\spring-ldap-core\\1.3.1.RELEASE\\spring-ldap-core-1.3.1.RELEASE.jar,C:\\Users\\anders\\.m2\\repository\\commons-lang\\commons-lang\\2.5\\commons-lang-2.5.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\security\\spring-security-core\\2.0.6.PATCH1\\spring-security-core-2.0.6.PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar,C:\\Users\\anders\\.m2\\repository\\cglib\\cglib-nodep\\2.2.2\\cglib-nodep-2.2.2.jar,C:\\Users\\anders\\.m2\\repository\\org\\apache\\commons\\commons-digester3\\3.2-PATCH5\\commons-digester3-3.2-PATCH5.jar,C:\\Users\\anders\\.m2\\repository\\cglib\\cglib\\2.2.2\\cglib-2.2.2.jar,C:\\Users\\anders\\.m2\\repository\\asm\\asm\\3.3.1\\asm-3.3.1.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-aop\\3.1.1.RELEASE-PATCH1\\spring-aop-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\com\\google\\guava\\guava\\12.0\\guava-12.0.jar,C:\\Users\\anders\\.m2\\repository\\com\\google\\code\\findbugs\\jsr305\\2.0.0\\jsr305-2.0.0.jar,C:\\Users\\anders\\.m2\\repository\\com\\intellij\\annotations\\116.108\\annotations-116.108.jar,C:\\Users\\anders\\.m2\\repository\\commons-io\\commons-io\\2.3\\commons-io-2.3.jar,C:\\Users\\anders\\.m2\\repository\\net\\jcip\\jcip-annotations\\1.0\\jcip-annotations-1.0.jar,C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar,C:\\Users\\anders\\.m2\\repository\\commons-codec\\commons-codec\\1.6\\commons-codec-1.6.jar,C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\orbit\\javax.servlet\\3.0.0.v201112011016\\javax.servlet-3.0.0.v201112011016.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-continuation\\8.1.4.v20120524\\jetty-continuation-8.1.4.v20120524.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-http\\8.1.4.v20120524\\jetty-http-8.1.4.v20120524.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-io\\8.1.4.v20120524\\jetty-io-8.1.4.v20120524.jar,C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar,C:\\Users\\anders\\.m2\\repository\\org\\mortbay\\jetty\\servlet-api\\3.0.20100224\\servlet-api-3.0.20100224.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-beans\\3.1.1.RELEASE-PATCH1\\spring-beans-3.1.1.RELEASE-PATCH1.jar,C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-asm\\3.1.1.RELEASE-PATCH1\\spring-asm-3.1.1.RELEASE-PATCH1.jar,.]"
308                 + CRLF
309                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/net/BindException.class)]]"
310                 + CRLF
311                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/ArrayList.class)]]"
312                 + CRLF
313                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/Collection.class)]]"
314                 + CRLF
315                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/Collections.class)]]"
316                 + CRLF
317                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/HashSet.class)]]"
318                 + CRLF
319                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/concurrent/TimeUnit.class)]]"
320                 + CRLF
321                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/Handler.class)]]"
322                 + CRLF
323                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/Server.class)]]"
324                 + CRLF
325                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/nio/SelectChannelConnector.class)]]"
326                 + CRLF
327                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/ssl/SslSelectChannelConnector.class)]]"
328                 + CRLF
329                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/ssl/SslContextFactory.class)]]"
330                 + CRLF
331                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\intellij\\annotations\\116.108\\annotations-116.108.jar(org/jetbrains/annotations/NonNls.class)]]"
332                 + CRLF
333                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\intellij\\annotations\\116.108\\annotations-116.108.jar(org/jetbrains/annotations/NotNull.class)]]"
334                 + CRLF
335                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\intellij\\annotations\\116.108\\annotations-116.108.jar(org/jetbrains/annotations/TestOnly.class)]]"
336                 + CRLF
337                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-beans\\3.1.1.RELEASE-PATCH1\\spring-beans-3.1.1.RELEASE-PATCH1.jar(org/springframework/beans/factory/BeanNameAware.class)]]"
338                 + CRLF
339                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-beans\\3.1.1.RELEASE-PATCH1\\spring-beans-3.1.1.RELEASE-PATCH1.jar(org/springframework/beans/factory/annotation/Autowired.class)]]"
340                 + CRLF
341                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\google\\guava\\guava\\12.0\\guava-12.0.jar(com/google/common/collect/Iterables.class)]]"
342                 + CRLF
343                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-log\\1.0.0-SNAPSHOT\\ec-log-1.0.0-SNAPSHOT.jar(com/electriccloud/log/Log.class)]]"
344                 + CRLF
345                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-log\\1.0.0-SNAPSHOT\\ec-log-1.0.0-SNAPSHOT.jar(com/electriccloud/log/LogFactory.class)]]"
346                 + CRLF
347                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar(com/electriccloud/service/ServiceManager.class)]]"
348                 + CRLF
349                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar(com/electriccloud/service/ServiceState.class)]]"
350                 + CRLF
351                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/ExceptionUtil.class)]]"
352                 + CRLF
353                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/SystemUtil.class)]]"
354                 + CRLF
355                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/ToString.class)]]"
356                 + CRLF
357                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/ToStringSupport.class)]]"
358                 + CRLF
359                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/String.class)]]"
360                 + CRLF
361                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Object.class)]]"
362                 + CRLF
363                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/io/Serializable.class)]]"
364                 + CRLF
365                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Comparable.class)]]"
366                 + CRLF
367                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/CharSequence.class)]]"
368                 + CRLF
369                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Enum.class)]]"
370                 + CRLF
371                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/ToStringAware.class)]]"
372                 + CRLF
373                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\springframework\\spring-beans\\3.1.1.RELEASE-PATCH1\\spring-beans-3.1.1.RELEASE-PATCH1.jar(org/springframework/beans/factory/Aware.class)]]"
374                 + CRLF
375                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar(com/electriccloud/service/Service.class)]]"
376                 + CRLF
377                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Integer.class)]]"
378                 + CRLF
379                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/concurrent/RejectedExecutionException.class)]]"
380                 + CRLF
381                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/component/AbstractLifeCycle.class)]]"
382                 + CRLF
383                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/thread/ThreadPool.class)]]"
384                 + CRLF
385                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-queue\\1.0.0-SNAPSHOT\\ec-queue-1.0.0-SNAPSHOT.jar(com/electriccloud/queue/ExecuteQueue.class)]]"
386                 + CRLF
387                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar(com/electriccloud/service/ServiceManagerAware.class)]]"
388                 + CRLF
389                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-util\\1.0.0-SNAPSHOT\\ec-util-1.0.0-SNAPSHOT.jar(com/electriccloud/util/ToStringImpl.class)]]"
390                 + CRLF
391                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/component/LifeCycle.class)]]"
392                 + CRLF
393                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/InterruptedException.class)]]"
394                 + CRLF
395                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Runnable.class)]]"
396                 + CRLF
397                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Exception.class)]]"
398                 + CRLF
399                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/io/IOException.class)]]"
400                 + CRLF
401                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/KeyManagementException.class)]]"
402                 + CRLF
403                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/NoSuchAlgorithmException.class)]]"
404                 + CRLF
405                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/SecureRandom.class)]]"
406                 + CRLF
407                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/SSLContext.class)]]"
408                 + CRLF
409                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/TrustManager.class)]]"
410                 + CRLF
411                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/HttpResponse.class)]]"
412                 + CRLF
413                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/HttpClient.class)]]"
414                 + CRLF
415                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/methods/HttpGet.class)]]"
416                 + CRLF
417                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/methods/HttpPost.class)]]"
418                 + CRLF
419                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/methods/HttpUriRequest.class)]]"
420                 + CRLF
421                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/Scheme.class)]]"
422                 + CRLF
423                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/ssl/SSLSocketFactory.class)]]"
424                 + CRLF
425                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/entity/StringEntity.class)]]"
426                 + CRLF
427                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/impl/client/DefaultConnectionKeepAliveStrategy.class)]]"
428                 + CRLF
429                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/impl/client/DefaultHttpClient.class)]]"
430                 + CRLF
431                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/impl/client/DefaultHttpRequestRetryHandler.class)]]"
432                 + CRLF
433                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/impl/conn/tsccm/ThreadSafeClientConnManager.class)]]"
434                 + CRLF
435                 + "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java:31: warning: [deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated"
436                 + CRLF + "import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;"
437                 + CRLF + "                                      ^"
438                 + CRLF
439                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/params/HttpParams.class)]]"
440                 + CRLF
441                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/protocol/HttpContext.class)]]"
442                 + CRLF
443                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/util/EntityUtils.class)]]"
444                 + CRLF
445                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-security\\1.0.0-SNAPSHOT\\ec-security-1.0.0-SNAPSHOT.jar(com/electriccloud/security/DummyX509TrustManager.class)]]"
446                 + CRLF
447                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/SchemeLayeredSocketFactory.class)]]"
448                 + CRLF
449                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/SchemeSocketFactory.class)]]"
450                 + CRLF
451                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/LayeredSchemeSocketFactory.class)]]"
452                 + CRLF
453                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/LayeredSocketFactory.class)]]"
454                 + CRLF
455                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/SocketFactory.class)]]"
456                 + CRLF
457                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/params/CoreConnectionPNames.class)]]"
458                 + CRLF
459                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/SuppressWarnings.class)]]"
460                 + CRLF
461                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Retention.class)]]"
462                 + CRLF
463                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/annotation/RetentionPolicy.class)]]"
464                 + CRLF
465                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Target.class)]]"
466                 + CRLF
467                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/annotation/ElementType.class)]]"
468                 + CRLF
469                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\google\\guava\\guava\\12.0\\guava-12.0.jar(com/google/common/annotations/GwtCompatible.class)]]"
470                 + CRLF
471                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\google\\guava\\guava\\12.0\\guava-12.0.jar(com/google/common/annotations/GwtIncompatible.class)]]"
472                 + CRLF
473                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\com\\electriccloud\\ec-core\\1.0.0-SNAPSHOT\\ec-core-1.0.0-SNAPSHOT.jar(com/electriccloud/infoset/InfosetType.class)]]"
474                 + CRLF
475                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/annotation/Annotation.class)]]"
476                 + CRLF
477                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Override.class)]]"
478                 + CRLF + "[checking com.electriccloud.http.HttpServerImpl]"
479                 + CRLF
480                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Error.class)]]"
481                 + CRLF
482                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Throwable.class)]]"
483                 + CRLF
484                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/RuntimeException.class)]]"
485                 + CRLF
486                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/AutoCloseable.class)]]"
487                 + CRLF
488                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Class.class)]]"
489                 + CRLF
490                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Number.class)]]"
491                 + CRLF
492                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/AbstractList.class)]]"
493                 + CRLF
494                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/AbstractCollection.class)]]"
495                 + CRLF
496                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Iterable.class)]]"
497                 + CRLF
498                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Byte.class)]]"
499                 + CRLF
500                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Character.class)]]"
501                 + CRLF
502                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Short.class)]]"
503                 + CRLF
504                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/nio/AbstractNIOConnector.class)]]"
505                 + CRLF
506                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/AbstractConnector.class)]]"
507                 + CRLF
508                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/component/AggregateLifeCycle.class)]]"
509                 + CRLF
510                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/Connector.class)]]"
511                 + CRLF
512                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/component/Destroyable.class)]]"
513                 + CRLF
514                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-util\\8.1.4.v20120524\\jetty-util-8.1.4.v20120524.jar(org/eclipse/jetty/util/component/Dumpable.class)]]"
515                 + CRLF
516                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-http\\8.1.4.v20120524\\jetty-http-8.1.4.v20120524.jar(org/eclipse/jetty/http/HttpBuffers.class)]]"
517                 + CRLF
518                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/handler/HandlerWrapper.class)]]"
519                 + CRLF
520                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/handler/AbstractHandlerContainer.class)]]"
521                 + CRLF
522                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\eclipse\\jetty\\jetty-server\\8.1.4.v20120524\\jetty-server-8.1.4.v20120524.jar(org/eclipse/jetty/server/handler/AbstractHandler.class)]]"
523                 + CRLF
524                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/net/SocketException.class)]]"
525                 + CRLF
526                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Thread.class)]]"
527                 + CRLF
528                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/IllegalStateException.class)]]"
529                 + CRLF
530                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/AbstractSet.class)]]"
531                 + CRLF
532                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/Iterator.class)]]"
533                 + CRLF
534                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/IllegalArgumentException.class)]]"
535                 + CRLF
536                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/Locale.class)]]"
537                 + CRLF
538                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Long.class)]]"
539                 + CRLF
540                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Float.class)]]"
541                 + CRLF
542                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Double.class)]]"
543                 + CRLF
544                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Boolean.class)]]"
545                 + CRLF
546                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/Void.class)]]"
547                 + CRLF
548                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/AssertionError.class)]]"
549                 + CRLF
550                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpServerImpl.class]]"
551                 + CRLF + "[checking com.electriccloud.http.HttpServer]"
552                 + CRLF
553                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpServer.class]]"
554                 + CRLF + "[checking com.electriccloud.http.HttpThreadPoolAware]"
555                 + CRLF
556                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpThreadPoolAware.class]]"
557                 + CRLF + "[checking com.electriccloud.http.HttpThreadPool]"
558                 + CRLF
559                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/concurrent/Future.class)]]"
560                 + CRLF
561                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/concurrent/Callable.class)]]"
562                 + CRLF
563                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/util/Date.class)]]"
564                 + CRLF
565                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpThreadPool.class]]"
566                 + CRLF + "[checking com.electriccloud.http.HttpQueueAware]"
567                 + CRLF
568                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpQueueAware.class]]"
569                 + CRLF + "[checking com.electriccloud.http.HttpServerAware]"
570                 + CRLF
571                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpServerAware.class]]"
572                 + CRLF + "[checking com.electriccloud.http.HttpUtil]"
573                 + CRLF
574                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/net/URI.class)]]"
575                 + CRLF
576                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/methods/HttpRequestBase.class)]]"
577                 + CRLF
578                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/message/AbstractHttpMessage.class)]]"
579                 + CRLF
580                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/HttpMessage.class)]]"
581                 + CRLF
582                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/impl/client/AbstractHttpClient.class)]]"
583                 + CRLF
584                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/annotation/GuardedBy.class)]]"
585                 + CRLF
586                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/ResponseHandler.class)]]"
587                 + CRLF
588                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/ClientProtocolException.class)]]"
589                 + CRLF
590                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/HttpEntity.class)]]"
591                 + CRLF
592                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/methods/HttpEntityEnclosingRequestBase.class)]]"
593                 + CRLF
594                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/entity/AbstractHttpEntity.class)]]"
595                 + CRLF
596                 + "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java:151: warning: [deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated"
597                 + CRLF + "        ThreadSafeClientConnManager connectionManager ="
598                 + CRLF + "        ^"
599                 + CRLF
600                 + "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java:152: warning: [deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated"
601                 + CRLF + "            new ThreadSafeClientConnManager();"
602                 + CRLF + "                ^"
603                 + CRLF
604                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/GeneralSecurityException.class)]]"
605                 + CRLF
606                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/X509TrustManager.class)]]"
607                 + CRLF
608                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/KeyException.class)]]"
609                 + CRLF
610                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/ssl/X509HostnameVerifier.class)]]"
611                 + CRLF
612                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/SSLSocketFactory.class)]]"
613                 + CRLF
614                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/HostNameResolver.class)]]"
615                 + CRLF
616                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/HostnameVerifier.class)]]"
617                 + CRLF
618                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/ssl/TrustStrategy.class)]]"
619                 + CRLF
620                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/security/KeyStore.class)]]"
621                 + CRLF
622                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/scheme/SchemeRegistry.class)]]"
623                 + CRLF
624                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/ClientConnectionManager.class)]]"
625                 + CRLF
626                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/client/HttpRequestRetryHandler.class)]]"
627                 + CRLF
628                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpclient\\4.2\\httpclient-4.2.jar(org/apache/http/conn/ConnectionKeepAliveStrategy.class)]]"
629                 + CRLF
630                 + "[loading ZipFileIndexFileObject[C:\\Users\\anders\\.m2\\repository\\org\\apache\\httpcomponents\\httpcore\\4.2\\httpcore-4.2.jar(org/apache/http/ParseException.class)]]"
631                 + CRLF
632                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/io/UnsupportedEncodingException.class)]]"
633                 + CRLF
634                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpUtil$1.class]]"
635                 + CRLF
636                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/StringBuilder.class)]]"
637                 + CRLF
638                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/AbstractStringBuilder.class)]]"
639                 + CRLF
640                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/java/lang/StringBuffer.class)]]"
641                 + CRLF
642                 + "[loading ZipFileIndexFileObject[C:\\Program Files\\Java\\jdk1.7.0_04\\lib\\ct.sym(META-INF/sym/rt.jar/javax/net/ssl/KeyManager.class)]]"
643                 + CRLF
644                 + "[wrote RegularFileObject[C:\\commander\\pre\\ec\\ec-http\\target\\classes\\com\\electriccloud\\http\\HttpUtil.class]]"
645                 + CRLF + "[total 654ms]"
646                 + CRLF + "4 warnings"
647                 + CRLF;
648         List<CompilerMessage> compilerMessages =
649                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(errors)));
650         assertEquals(187, compilerMessages.size(), "count");
651         List<CompilerMessage> compilerErrors = new ArrayList<>(3);
652         for (CompilerMessage message : compilerMessages) {
653             if (message.getKind() != CompilerMessage.Kind.OTHER) {
654                 compilerErrors.add(message);
655             }
656         }
657 
658         CompilerMessage expected = new CompilerMessage(
659                 "[options] bootstrap class path not set in conjunction with -source " + "1.6",
660                 CompilerMessage.Kind.WARNING);
661         CompilerMessage actual = compilerErrors.get(0);
662         assertEquals(expected.getMessage(), actual.getMessage());
663         assertEquals(expected.getKind(), actual.getKind());
664         CompilerMessage error1 = compilerErrors.get(1);
665         assertEquals(
666                 "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java",
667                 error1.getFile(),
668                 "file");
669         assertEquals(
670                 "[deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated",
671                 error1.getMessage(),
672                 "message");
673         assertEquals(31, error1.getStartLine(), "line");
674         assertEquals(39, error1.getStartColumn(), "column");
675         CompilerMessage error2 = compilerErrors.get(2);
676         assertEquals(
677                 "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java",
678                 error2.getFile(),
679                 "file");
680         assertEquals(
681                 "[deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated",
682                 error2.getMessage(),
683                 "message");
684         assertEquals(151, error2.getStartLine(), "line");
685         assertEquals(9, error2.getStartColumn(), "column");
686         CompilerMessage error3 = compilerErrors.get(3);
687         assertEquals(
688                 "C:\\commander\\pre\\ec\\ec-http\\src\\main\\java\\com\\electriccloud\\http\\HttpUtil.java",
689                 error3.getFile(),
690                 "file");
691         assertEquals(
692                 "[deprecation] ThreadSafeClientConnManager in org.apache.http.impl.conn.tsccm has been deprecated",
693                 error3.getMessage(),
694                 "message");
695         assertEquals(152, error3.getStartLine(), "line");
696         assertEquals(17, error3.getStartColumn(), "column");
697     }
698 
699     @Test
700     public void testJava6Error() throws Exception {
701         String out = "Error.java:3: cannot find symbol" + EOL + "symbol  : class Properties"
702                 + EOL + "location: class Error"
703                 + EOL + "                Properties p = new Properties();"
704                 + EOL + "                ^"
705                 + EOL + "Error.java:3: cannot find symbol"
706                 + EOL + "symbol  : class Properties"
707                 + EOL + "location: class Error"
708                 + EOL + "                Properties p = new Properties();"
709                 + EOL + "                                   ^"
710                 + EOL + "2 errors";
711 
712         List<CompilerMessage> compilerErrors =
713                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(out)));
714 
715         assertNotNull(compilerErrors);
716 
717         CompilerMessage message1 = compilerErrors.get(0);
718 
719         assertTrue(message1.isError());
720 
721         assertEquals(
722                 "cannot find symbol" + EOL + "symbol  : class Properties" + EOL + "location: class Error",
723                 message1.getMessage());
724 
725         assertEquals(17, message1.getStartColumn());
726 
727         assertEquals(26, message1.getEndColumn());
728 
729         assertEquals(3, message1.getStartLine());
730 
731         assertEquals(3, message1.getEndLine());
732 
733         CompilerMessage message2 = compilerErrors.get(1);
734 
735         assertTrue(message2.isError());
736 
737         assertEquals(
738                 "cannot find symbol" + EOL + "symbol  : class Properties" + EOL + "location: class Error",
739                 message2.getMessage());
740 
741         assertEquals(36, message2.getStartColumn());
742 
743         assertEquals(48, message2.getEndColumn());
744 
745         assertEquals(3, message2.getStartLine());
746 
747         assertEquals(3, message2.getEndLine());
748     }
749 
750     @Test
751     public void testJava7Error() throws Exception {
752         String out =
753                 "Error.java:3: error: cannot find symbol" + EOL + "                Properties p = new Properties();"
754                         + EOL + "                ^"
755                         + EOL + "  symbol:   class Properties"
756                         + EOL + "  location: class Error"
757                         + EOL + "Error.java:3: error: cannot find symbol"
758                         + EOL + "                Properties p = new Properties();"
759                         + EOL + "                                   ^"
760                         + EOL + "  symbol:   class Properties"
761                         + EOL + "  location: class Error"
762                         + EOL + "2 errors";
763 
764         List<CompilerMessage> compilerErrors =
765                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(out)));
766 
767         assertNotNull(compilerErrors);
768 
769         CompilerMessage message1 = compilerErrors.get(0);
770 
771         assertTrue(message1.isError());
772 
773         assertEquals(
774                 "cannot find symbol" + EOL + "  symbol:   class Properties" + EOL + "  location: class Error",
775                 message1.getMessage());
776 
777         assertEquals(17, message1.getStartColumn());
778 
779         assertEquals(26, message1.getEndColumn());
780 
781         assertEquals(3, message1.getStartLine());
782 
783         assertEquals(3, message1.getEndLine());
784 
785         CompilerMessage message2 = compilerErrors.get(1);
786 
787         assertTrue(message2.isError());
788 
789         assertEquals(
790                 "cannot find symbol" + EOL + "  symbol:   class Properties" + EOL + "  location: class Error",
791                 message2.getMessage());
792 
793         assertEquals(36, message2.getStartColumn());
794 
795         assertEquals(48, message2.getEndColumn());
796 
797         assertEquals(3, message2.getStartLine());
798 
799         assertEquals(3, message2.getEndLine());
800     }
801 
802     @ParameterizedTest(name = "{0}")
803     @MethodSource("testStackTraceWithUnknownHeader_args")
804     public void testStackTraceWithUnknownHeader(String scenario, String stackTraceHeader) throws Exception {
805         String stackTraceWithHeader = UNIDENTIFIED_LOG_LINES + stackTraceHeader + stackTraceInternalCompilerError;
806 
807         List<CompilerMessage> compilerMessages =
808                 JavacCompiler.parseModernStream(4, new BufferedReader(new StringReader(stackTraceWithHeader)));
809 
810         assertNotNull(compilerMessages);
811         assertEquals(1, compilerMessages.size());
812 
813         String message = compilerMessages.get(0).getMessage().replaceAll(EOL, "\n");
814         // Parser retains neither unidentified log lines nor slightly modified stack trace header
815         assertTrue(!message.contains(UNIDENTIFIED_LOG_LINES));
816         assertTrue(!message.contains(stackTraceHeader));
817         // Parser returns stack strace without any preceding lines
818         assertTrue(message.startsWith(stackTraceInternalCompilerError));
819     }
820 
821     private static Stream<Arguments> testStackTraceWithUnknownHeader_args() {
822         return Stream.of(
823                 Arguments.of(
824                         "modified compiler error header",
825                         FILE_A_BUG_ERROR_HEADERS[0].replaceAll("\\{0\\}", "21").replaceAll("bug", "beetle")),
826                 Arguments.of(
827                         "modified annotation processor error header",
828                         ANNOTATION_PROCESSING_ERROR_HEADERS[0].replaceAll("uncaught", "undandled")),
829                 Arguments.of(
830                         "modified out of resources error header",
831                         SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[0].replaceAll("resources", "memory")),
832                 Arguments.of("modified I/O error header", IO_ERROR_HEADERS[0].replaceAll("input/output", "I/O")),
833                 Arguments.of(
834                         "modified plugin error header", PLUGIN_ERROR_HEADERS[0].replaceAll("uncaught", "unhandled")));
835     }
836 
837     @ParameterizedTest(name = "{0}")
838     @MethodSource("testBugParade_args")
839     public void testBugParade(String jdkAndLocale, String stackTraceHeader) throws Exception {
840         String stackTraceWithHeader = UNIDENTIFIED_LOG_LINES + stackTraceHeader + stackTraceInternalCompilerError;
841 
842         List<CompilerMessage> compilerMessages =
843                 JavacCompiler.parseModernStream(4, new BufferedReader(new StringReader(stackTraceWithHeader)));
844 
845         assertNotNull(compilerMessages);
846         assertEquals(1, compilerMessages.size());
847 
848         String message = compilerMessages.get(0).getMessage().replaceAll(EOL, "\n");
849         // Parser retains stack trace header
850         assertTrue(message.startsWith(stackTraceHeader));
851         assertTrue(message.endsWith(stackTraceInternalCompilerError));
852     }
853 
854     private static final String stackTraceInternalCompilerError =
855             "com.sun.tools.javac.code.Symbol$CompletionFailure: class file for java.util.Optional not found\n"
856                     + "\tat com.sun.tools.javac.comp.MemberEnter.baseEnv(MemberEnter.java:1388)\n"
857                     + "\tat com.sun.tools.javac.comp.MemberEnter.complete(MemberEnter.java:1046)\n"
858                     + "\tat com.sun.tools.javac.code.Symbol.complete(Symbol.java:574)\n"
859                     + "\tat com.sun.tools.javac.code.Symbol$ClassSymbol.complete(Symbol.java:1037)\n"
860                     + "\tat com.sun.tools.javac.code.Symbol$ClassSymbol.flags(Symbol.java:973)\n"
861                     + "\tat com.sun.tools.javac.code.Symbol$ClassSymbol.getKind(Symbol.java:1101)\n"
862                     + "\tat com.sun.tools.javac.code.Kinds.kindName(Kinds.java:162)\n"
863                     + "\tat com.sun.tools.javac.comp.Check.duplicateError(Check.java:329)\n"
864                     + "\tat com.sun.tools.javac.comp.Check.checkUnique(Check.java:3435)\n"
865                     + "\tat com.sun.tools.javac.comp.Enter.visitTypeParameter(Enter.java:454)\n"
866                     + "\tat com.sun.tools.javac.tree.JCTree$JCTypeParameter.accept(JCTree.java:2224)\n"
867                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:258)\n"
868                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:272)\n"
869                     + "\tat com.sun.tools.javac.comp.Enter.visitClassDef(Enter.java:418)\n"
870                     + "\tat com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693)\n"
871                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:258)\n"
872                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:272)\n"
873                     + "\tat com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:334)\n"
874                     + "\tat com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:518)\n"
875                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:258)\n"
876                     + "\tat com.sun.tools.javac.comp.Enter.classEnter(Enter.java:272)\n"
877                     + "\tat com.sun.tools.javac.comp.Enter.complete(Enter.java:486)\n"
878                     + "\tat com.sun.tools.javac.comp.Enter.main(Enter.java:471)\n"
879                     + "\tat com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:982)\n"
880                     + "\tat com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)\n"
881                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:523)\n"
882                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:381)\n"
883                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:370)\n"
884                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:361)\n"
885                     + "\tat com.sun.tools.javac.Main.compile(Main.java:56)\n"
886                     + "\tat com.sun.tools.javac.Main.main(Main.java:42)\n";
887 
888     private static Stream<Arguments> testBugParade_args() {
889         return Stream.of(
890                 Arguments.of("JDK 8 English", FILE_A_BUG_ERROR_HEADERS[0].replaceFirst("\\{0\\}", "21")),
891                 Arguments.of("JDK 8 Japanese", FILE_A_BUG_ERROR_HEADERS[1].replaceFirst("\\{0\\}", "21")),
892                 Arguments.of("JDK 8 Chinese", FILE_A_BUG_ERROR_HEADERS[2].replaceFirst("\\{0\\}", "21")),
893                 Arguments.of("JDK 9 English", FILE_A_BUG_ERROR_HEADERS[3].replaceFirst("\\{0\\}", "21")),
894                 Arguments.of("JDK 9 Japanese", FILE_A_BUG_ERROR_HEADERS[4].replaceFirst("\\{0\\}", "21")),
895                 Arguments.of("JDK 9 Chinese", FILE_A_BUG_ERROR_HEADERS[5].replaceFirst("\\{0\\}", "21")),
896                 Arguments.of("JDK 21 English", FILE_A_BUG_ERROR_HEADERS[6].replaceFirst("\\{0\\}", "21")),
897                 Arguments.of("JDK 21 Japanese", FILE_A_BUG_ERROR_HEADERS[7].replaceFirst("\\{0\\}", "21")),
898                 Arguments.of("JDK 21 Chinese", FILE_A_BUG_ERROR_HEADERS[8].replaceFirst("\\{0\\}", "21")),
899                 Arguments.of("JDK 21 German", FILE_A_BUG_ERROR_HEADERS[9].replaceFirst("\\{0\\}", "21")));
900     }
901 
902     @ParameterizedTest(name = "{0}")
903     @MethodSource("testSystemOutOfResourcesError_args")
904     public void testSystemOutOfResourcesError(String jdkAndLocale, String stackTraceHeader) throws Exception {
905         String stackTraceWithHeader = UNIDENTIFIED_LOG_LINES + stackTraceHeader + stackTraceSystemOutOfResourcesError;
906 
907         List<CompilerMessage> compilerMessages =
908                 JavacCompiler.parseModernStream(4, new BufferedReader(new StringReader(stackTraceWithHeader)));
909 
910         assertNotNull(compilerMessages);
911         assertEquals(1, compilerMessages.size());
912 
913         String message = compilerMessages.get(0).getMessage().replaceAll(EOL, "\n");
914         // Parser retains stack trace header
915         assertTrue(message.startsWith(stackTraceHeader));
916         assertTrue(message.endsWith(stackTraceSystemOutOfResourcesError));
917     }
918 
919     private static final String stackTraceSystemOutOfResourcesError =
920             "java.lang.OutOfMemoryError: GC overhead limit exceeded\n"
921                     + "\tat com.sun.tools.javac.util.List.of(List.java:135)\n"
922                     + "\tat com.sun.tools.javac.util.ListBuffer.append(ListBuffer.java:129)\n"
923                     + "\tat com.sun.tools.javac.parser.JavacParser.variableDeclaratorsRest(JavacParser.java:3006)\n"
924                     + "\tat com.sun.tools.javac.parser.JavacParser.classOrInterfaceBodyDeclaration(JavacParser.java:3537)\n"
925                     + "\tat com.sun.tools.javac.parser.JavacParser.classOrInterfaceBody(JavacParser.java:3436)\n"
926                     + "\tat com.sun.tools.javac.parser.JavacParser.classDeclaration(JavacParser.java:3285)\n"
927                     + "\tat com.sun.tools.javac.parser.JavacParser.classOrInterfaceOrEnumDeclaration(JavacParser.java:3226)\n"
928                     + "\tat com.sun.tools.javac.parser.JavacParser.typeDeclaration(JavacParser.java:3215)\n"
929                     + "\tat com.sun.tools.javac.parser.JavacParser.parseCompilationUnit(JavacParser.java:3155)\n"
930                     + "\tat com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:628)\n"
931                     + "\tat com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:665)\n"
932                     + "\tat com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:950)\n"
933                     + "\tat com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:857)\n"
934                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:523)\n"
935                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:381)\n"
936                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:370)\n"
937                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:361)\n"
938                     + "\tat com.sun.tools.javac.Main.compile(Main.java:56)\n"
939                     + "\tat com.sun.tools.javac.Main.main(Main.java:42)\n";
940 
941     private static Stream<Arguments> testSystemOutOfResourcesError_args() {
942         return Stream.of(
943                 Arguments.of("JDK 8 English", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[0]),
944                 Arguments.of("JDK 8 Japanese", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[1]),
945                 Arguments.of("JDK 8 Chinese", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[2]),
946                 Arguments.of("JDK 21 English", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[3]),
947                 Arguments.of("JDK 21 Japanese", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[4]),
948                 Arguments.of("JDK 21 Chinese", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[5]),
949                 Arguments.of("JDK 21 German", SYSTEM_OUT_OF_RESOURCES_ERROR_HEADERS[6]));
950     }
951 
952     @ParameterizedTest(name = "{0}")
953     @MethodSource("testIOError_args")
954     public void testIOError(String jdkAndLocale, String stackTraceHeader) throws Exception {
955         String stackTraceWithHeader = UNIDENTIFIED_LOG_LINES + stackTraceHeader + stackTraceIOError;
956 
957         List<CompilerMessage> compilerMessages =
958                 JavacCompiler.parseModernStream(4, new BufferedReader(new StringReader(stackTraceWithHeader)));
959 
960         assertNotNull(compilerMessages);
961         assertEquals(1, compilerMessages.size());
962 
963         String message = compilerMessages.get(0).getMessage().replaceAll(EOL, "\n");
964         // Parser retains stack trace header
965         assertTrue(message.startsWith(stackTraceHeader));
966         assertTrue(message.endsWith(stackTraceIOError));
967     }
968 
969     private static final String stackTraceIOError =
970             "An input/output error occurred.\n" + "Consult the following stack trace for details.\n"
971                     + "java.nio.charset.MalformedInputException: Input length = 1\n"
972                     + "\tat java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)\n"
973                     + "\tat java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)\n"
974                     + "\tat java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)\n"
975                     + "\tat java.base/java.io.InputStreamReader.read(InputStreamReader.java:185)\n"
976                     + "\tat java.base/java.io.BufferedReader.fill(BufferedReader.java:161)\n"
977                     + "\tat java.base/java.io.BufferedReader.read(BufferedReader.java:182)\n"
978                     + "\tat jdk.compiler/com.sun.tools.javac.main.CommandLine$Tokenizer.<init>(CommandLine.java:143)\n"
979                     + "\tat jdk.compiler/com.sun.tools.javac.main.CommandLine.loadCmdFile(CommandLine.java:129)\n"
980                     + "\tat jdk.compiler/com.sun.tools.javac.main.CommandLine.appendParsedCommandArgs(CommandLine.java:71)\n"
981                     + "\tat jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:102)\n"
982                     + "\tat jdk.compiler/com.sun.tools.javac.main.CommandLine.parse(CommandLine.java:123)\n"
983                     + "\tat jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:215)\n"
984                     + "\tat jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)\n"
985                     + "\tat jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)\n"
986                     + "\tat jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)\n";
987 
988     private static Stream<Arguments> testIOError_args() {
989         return Stream.of(
990                 Arguments.of("JDK 8 English", IO_ERROR_HEADERS[0]),
991                 Arguments.of("JDK 8 Japanese", IO_ERROR_HEADERS[1]),
992                 Arguments.of("JDK 8 Chinese", IO_ERROR_HEADERS[2]),
993                 Arguments.of("JDK 21 English", IO_ERROR_HEADERS[3]),
994                 Arguments.of("JDK 21 Japanese", IO_ERROR_HEADERS[4]),
995                 Arguments.of("JDK 21 Chinese", IO_ERROR_HEADERS[5]),
996                 Arguments.of("JDK 21 German", IO_ERROR_HEADERS[6]));
997     }
998 
999     @ParameterizedTest(name = "{0}")
1000     @MethodSource("testPluginError_args")
1001     public void testPluginError(String jdkAndLocale, String stackTraceHeader) throws Exception {
1002         String stackTraceWithHeader = UNIDENTIFIED_LOG_LINES + stackTraceHeader + stackTracePluginError;
1003 
1004         List<CompilerMessage> compilerMessages =
1005                 JavacCompiler.parseModernStream(4, new BufferedReader(new StringReader(stackTraceWithHeader)));
1006 
1007         assertNotNull(compilerMessages);
1008         assertEquals(1, compilerMessages.size());
1009 
1010         String message = compilerMessages.get(0).getMessage().replaceAll(EOL, "\n");
1011         // Parser retains stack trace header
1012         assertTrue(message.startsWith(stackTraceHeader));
1013         assertTrue(message.endsWith(stackTracePluginError));
1014     }
1015 
1016     private static final String stackTracePluginError =
1017             "A plugin threw an uncaught exception.\n" + "Consult the following stack trace for details.\n"
1018                     + "java.lang.NoSuchMethodError: com.sun.tools.javac.util.JavacMessages.add(Lcom/sun/tools/javac/util/JavacMessages$ResourceBundleHelper;)V\n"
1019                     + "\tat com.google.errorprone.BaseErrorProneJavaCompiler.setupMessageBundle(BaseErrorProneJavaCompiler.java:202)\n"
1020                     + "\tat com.google.errorprone.ErrorProneJavacPlugin.init(ErrorProneJavacPlugin.java:40)\n"
1021                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:470)\n"
1022                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:381)\n"
1023                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:370)\n"
1024                     + "\tat com.sun.tools.javac.main.Main.compile(Main.java:361)\n"
1025                     + "\tat com.sun.tools.javac.Main.compile(Main.java:56)\n"
1026                     + "\tat com.sun.tools.javac.Main.main(Main.java:42)\n";
1027 
1028     private static Stream<Arguments> testPluginError_args() {
1029         return Stream.of(
1030                 Arguments.of("JDK 8 English", PLUGIN_ERROR_HEADERS[0]),
1031                 Arguments.of("JDK 8 Japanese", PLUGIN_ERROR_HEADERS[1]),
1032                 Arguments.of("JDK 8 Chinese", PLUGIN_ERROR_HEADERS[2]),
1033                 Arguments.of("JDK 21 English", PLUGIN_ERROR_HEADERS[3]),
1034                 Arguments.of("JDK 21 Japanese", PLUGIN_ERROR_HEADERS[4]),
1035                 Arguments.of("JDK 21 Chinese", PLUGIN_ERROR_HEADERS[5]),
1036                 Arguments.of("JDK 21 German", PLUGIN_ERROR_HEADERS[6]));
1037     }
1038 
1039     @Test
1040     public void testNonAnchoredWarning() throws IOException {
1041         final String error = "warning: [options] bootstrap class path not set in conjunction with -source 1.6" + EOL
1042                 + "1 warning" + EOL;
1043 
1044         final List<CompilerMessage> compilerErrors =
1045                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(error)));
1046 
1047         assertNotNull(compilerErrors);
1048         assertEquals(1, compilerErrors.size());
1049         assertEquivalent(
1050                 new CompilerMessage(
1051                         "[options] bootstrap class path not set in conjunction with -source 1.6",
1052                         CompilerMessage.Kind.WARNING),
1053                 compilerErrors.get(0));
1054     }
1055 
1056     @Test
1057     public void testAnchoredWarning() throws IOException {
1058         final String error = "C:\\repo\\src\\it\\includes-output-when-compiler-forked\\src\\main"
1059                 + "\\java\\MyClass.java:23: warning: [divzero] division by zero"
1060                 + EOL + "      System.out.println(1/0);"
1061                 + EOL + "                           ^"
1062                 + EOL + "1 warnings"
1063                 + EOL;
1064 
1065         final List<CompilerMessage> compilerErrors =
1066                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(error)));
1067 
1068         assertNotNull(compilerErrors);
1069         assertEquals(1, compilerErrors.size());
1070         assertEquivalent(
1071                 new CompilerMessage(
1072                         "C:\\repo\\src\\it\\includes-output-when-compiler-forked\\src\\main\\java\\MyClass" + ".java",
1073                         CompilerMessage.Kind.WARNING,
1074                         23,
1075                         28,
1076                         23,
1077                         30,
1078                         "[divzero] division by zero"),
1079                 compilerErrors.get(0));
1080     }
1081 
1082     @Test
1083     public void testMixedWarnings() throws IOException {
1084         final String error = "warning: [options] bootstrap class path not set in conjunction with -source 1.6" + EOL
1085                 + "C:\\repo\\src\\it\\includes-output-when-compiler-forked\\src\\main\\java"
1086                 + "\\MyClass.java:23: warning: [divzero] division by zero"
1087                 + EOL + "      System.out.println(1/0);"
1088                 + EOL + "                           ^"
1089                 + EOL + "2 warnings";
1090 
1091         final List<CompilerMessage> compilerErrors =
1092                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(error)));
1093 
1094         assertNotNull(compilerErrors);
1095         assertEquals(2, compilerErrors.size());
1096         assertEquivalent(
1097                 new CompilerMessage(
1098                         "[options] bootstrap class path not set in conjunction with -source 1.6",
1099                         CompilerMessage.Kind.WARNING),
1100                 compilerErrors.get(0));
1101         assertEquivalent(
1102                 new CompilerMessage(
1103                         "C:\\repo\\src\\it\\includes-output-when-compiler-forked\\src\\main\\java\\MyClass" + ".java",
1104                         CompilerMessage.Kind.WARNING,
1105                         23,
1106                         28,
1107                         23,
1108                         30,
1109                         "[divzero] division by zero"),
1110                 compilerErrors.get(1));
1111     }
1112 
1113     @Test
1114     public void testIssue37() throws IOException {
1115         String error =
1116                 "warning: [path] bad path element \"d:\\maven_repo\\.m2\\repository\\org\\ow2\\asm\\asm-xml\\5.0.3\\asm-5.0.3.jar\": no such file or directory"
1117                         + EOL
1118                         + "warning: [path] bad path element \"d:\\maven_repo\\.m2\\repository\\org\\ow2\\asm\\asm-xml\\5.0.3\\asm-util-5.0.3.jar\": no such file or directory"
1119                         + EOL + "warning: [options] bootstrap class path not set in conjunction with -source 1.7"
1120                         + EOL + "3 warnings"
1121                         + EOL
1122                         + "An exception has occurred in the compiler (9). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you."
1123                         + EOL + "java.lang.NullPointerException"
1124                         + EOL + "\tat jdk.zipfs/jdk.nio.zipfs.JarFileSystem.getVersionMap(JarFileSystem.java:137)"
1125                         + EOL
1126                         + "\tat jdk.zipfs/jdk.nio.zipfs.JarFileSystem.createVersionedLinks(JarFileSystem.java:112)"
1127                         + EOL + "\tat jdk.zipfs/jdk.nio.zipfs.JarFileSystem.<init>(JarFileSystem.java:85)"
1128                         + EOL
1129                         + "\tat jdk.zipfs/jdk.nio.zipfs.ZipFileSystemProvider.newFileSystem(ZipFileSystemProvider.java:134)"
1130                         + EOL
1131                         + "\tat jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:517)"
1132                         + EOL
1133                         + "\tat jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:319)"
1134                         + EOL
1135                         + "\tat jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:715)"
1136                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:722)"
1137                         + EOL
1138                         + "\tat jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:655)"
1139                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:526)"
1140                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:293)"
1141                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:633)"
1142                         + EOL
1143                         + "\tat jdk.compiler/com.sun.tools.javac.code.Symbol$PackageSymbol.members(Symbol.java:1120)"
1144                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.code.Symtab.listPackageModules(Symtab.java:810)"
1145                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:344)"
1146                         + EOL
1147                         + "\tat jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)"
1148                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:285)"
1149                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:300)"
1150                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:570)"
1151                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:554)"
1152                         + EOL
1153                         + "\tat jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1052)"
1154                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:923)"
1155                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:302)"
1156                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:162)"
1157                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)"
1158                         + EOL + "\tat jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)";
1159 
1160         List<CompilerMessage> compilerErrors =
1161                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(error)));
1162 
1163         assertNotNull(compilerErrors);
1164         assertEquals(4, compilerErrors.size());
1165 
1166         assertEquivalent(
1167                 new CompilerMessage(
1168                         "[path] bad path element \"d:\\maven_repo\\"
1169                                 + ".m2\\repository\\org\\ow2\\asm\\asm-xml\\5.0.3\\asm-5.0.3.jar\": no such file or directory",
1170                         CompilerMessage.Kind.WARNING),
1171                 compilerErrors.get(0));
1172         assertEquivalent(
1173                 new CompilerMessage(
1174                         "warning: [path] bad path element \"d:\\maven_repo\\.m2\\repository\\org\\ow2\\asm\\asm-xml\\5.0.3\\asm-util-5.0.3.jar\": no such file or directory",
1175                         CompilerMessage.Kind.WARNING),
1176                 compilerErrors.get(1));
1177         assertEquivalent(
1178                 new CompilerMessage(
1179                         "[options] bootstrap class path not set in conjunction with -source 1.7",
1180                         CompilerMessage.Kind.WARNING),
1181                 compilerErrors.get(2));
1182 
1183         CompilerMessage finalMessage = compilerErrors.get(3);
1184         assertEquals(CompilerMessage.Kind.ERROR, finalMessage.getKind());
1185         assertTrue(
1186                 finalMessage.getMessage().startsWith("An exception has occurred in the compiler"), "Starts correctly");
1187         assertTrue(
1188                 finalMessage
1189                         .getMessage()
1190                         .endsWith("\tat jdk.compiler/com.sun" + ".tools.javac.Main.main(Main.java:43)" + EOL),
1191                 "continues through end of output");
1192     }
1193 
1194     @Test
1195     public void testJvmBootLayerInitializationError() throws Exception {
1196         String out = "Error occurred during initialization of boot layer\n"
1197                 + "java.lang.module.FindException: Module java.xml.bind not found";
1198 
1199         List<CompilerMessage> compilerErrors =
1200                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(UNIDENTIFIED_LOG_LINES + out)));
1201 
1202         assertNotNull(compilerErrors);
1203         assertEquals(1, compilerErrors.size());
1204         assertEquals(CompilerMessage.Kind.ERROR, compilerErrors.get(0).getKind());
1205         assertTrue(compilerErrors.get(0).getMessage().replaceAll(EOL, "\n").startsWith(out));
1206     }
1207 
1208     @Test
1209     public void testJvmInitializationError() throws Exception {
1210         String out = "Error occurred during initialization of VM\n"
1211                 + "Initial heap size set to a larger value than the maximum heap size";
1212 
1213         List<CompilerMessage> compilerErrors =
1214                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(UNIDENTIFIED_LOG_LINES + out)));
1215 
1216         assertNotNull(compilerErrors);
1217         assertEquals(1, compilerErrors.size());
1218         assertEquals(CompilerMessage.Kind.ERROR, compilerErrors.get(0).getKind());
1219         assertTrue(compilerErrors.get(0).getMessage().replaceAll(EOL, "\n").startsWith(out));
1220     }
1221 
1222     @Test
1223     public void testBadSourceFileError() throws Exception {
1224         String out = "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:12: error: cannot access Cls2\n"
1225                 + "    Cls2 tvar;\n"
1226                 + "    ^\n"
1227                 + "  bad source file: /MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls2.java\n"
1228                 + "    file does not contain class ch.pecunifex.x.Cls2\n"
1229                 + "    Please remove or make sure it appears in the correct subdirectory of the sourcepath.";
1230 
1231         List<CompilerMessage> compilerErrors =
1232                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(out)));
1233 
1234         assertNotNull(compilerErrors);
1235 
1236         assertEquals(1, compilerErrors.size());
1237 
1238         CompilerMessage message = compilerErrors.get(0);
1239         validateBadSourceFile(message);
1240     }
1241 
1242     @Test
1243     public void testWarningFollowedByBadSourceFileError() throws Exception {
1244         String out =
1245                 "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:3: warning: FontDesignMetrics is internal proprietary API and may be removed in a future release\n"
1246                         + "import sun.font.FontDesignMetrics;\n"
1247                         + "               ^\n"
1248                         + "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java:12: error: cannot access Cls2\n"
1249                         + "    Cls2 tvar;\n"
1250                         + "    ^\n"
1251                         + "  bad source file: /MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls2.java\n"
1252                         + "    file does not contain class ch.pecunifex.x.Cls2\n"
1253                         + "    Please remove or make sure it appears in the correct subdirectory of the sourcepath.";
1254 
1255         List<CompilerMessage> compilerErrors =
1256                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(out)));
1257 
1258         assertNotNull(compilerErrors);
1259 
1260         assertEquals(2, compilerErrors.size());
1261 
1262         CompilerMessage firstMessage = compilerErrors.get(0);
1263         assertEquals(CompilerMessage.Kind.WARNING, firstMessage.getKind(), "Is a Warning");
1264         assertEquals(
1265                 "/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java", firstMessage.getFile(), "On Correct File");
1266         assertEquals(
1267                 "FontDesignMetrics is internal proprietary API and may be removed in a future release",
1268                 firstMessage.getMessage(),
1269                 "Internal API Warning");
1270 
1271         CompilerMessage secondMessage = compilerErrors.get(1);
1272         validateBadSourceFile(secondMessage);
1273     }
1274 
1275     @Test
1276     public void testUnrecognisedOutputIsReportedWhenCompilationFails() throws IOException {
1277         String output = "some diagnostic nobody taught this parser about" + EOL + "and a second line of it" + EOL;
1278 
1279         List<CompilerMessage> messages =
1280                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(output)));
1281 
1282         assertEquals(1, messages.size());
1283         assertEquals(CompilerMessage.Kind.ERROR, messages.get(0).getKind());
1284         assertTrue(messages.get(0).getMessage().contains("nobody taught this parser about"));
1285         assertTrue(messages.get(0).getMessage().contains("second line"));
1286     }
1287 
1288     @Test
1289     public void testUnrecognisedOutputIsIgnoredWhenCompilationSucceeds() throws IOException {
1290         String output = "some diagnostic nobody taught this parser about" + EOL;
1291 
1292         List<CompilerMessage> messages =
1293                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1294 
1295         assertTrue(messages.isEmpty());
1296     }
1297 
1298     @Test
1299     public void testCountSummaryAloneIsNotReported() throws IOException {
1300         String output = "2 errors" + EOL;
1301 
1302         List<CompilerMessage> messages =
1303                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(output)));
1304 
1305         assertTrue(messages.isEmpty());
1306     }
1307 
1308     /**
1309      * Warnings promoted by {@code -Werror} carry the file name inline rather than as a prefix, so none of the
1310      * classifiers match them and they used to be dropped, leaving the failure unexplained.
1311      */
1312     @Test
1313     public void testWerrorWarningsAreReported() throws IOException {
1314         String output =
1315                 "gson-2.10.2-SNAPSHOT.jar(/com/google/gson/JsonParser.class): warning: Cannot find annotation method 'replacement()' in type 'InlineMe'"
1316                         + EOL + "error: warnings found and -Werror specified"
1317                         + EOL + "1 error"
1318                         + EOL + "1 warning"
1319                         + EOL;
1320 
1321         List<CompilerMessage> messages =
1322                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(output)));
1323 
1324         assertTrue(
1325                 messages.stream().anyMatch(m -> m.getMessage().contains("Cannot find annotation method")),
1326                 "the unclassified warning should survive: " + messages);
1327     }
1328 
1329     @Test
1330     public void testNoteIsReported() throws IOException {
1331         String output = "Note: SomeFile.java uses unchecked or unsafe operations." + EOL;
1332 
1333         List<CompilerMessage> messages =
1334                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1335 
1336         assertEquals(1, messages.size());
1337         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1338         assertEquals(
1339                 "SomeFile.java uses unchecked or unsafe operations.",
1340                 messages.get(0).getMessage());
1341     }
1342 
1343     /**
1344      * Since JDK 21 javac wraps its notes over several lines, indenting every line but the first. See
1345      * <a href="https://inside.java/2023/07/29/quality-heads-up/">the JDK quality heads-up</a>.
1346      */
1347     @Test
1348     public void testMultiLineNoteIsReportedAsASingleMessage() throws IOException {
1349         List<CompilerMessage> messages =
1350                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(ANNOTATION_PROCESSING_NOTE)));
1351 
1352         assertEquals(1, messages.size());
1353         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1354         String message = messages.get(0).getMessage();
1355         assertTrue(
1356                 message.startsWith("Annotation processing is enabled"), "note starts with its first line: " + message);
1357         assertTrue(
1358                 message.contains("Use -proc:none to disable annotation processing."),
1359                 "note keeps its last line: " + message);
1360     }
1361 
1362     /**
1363      * The continuation lines of a multi-line note used to fall through to the unclassified buffer, which then
1364      * swallowed everything that followed it.
1365      */
1366     @Test
1367     public void testMultiLineNoteDoesNotSwallowLaterDiagnostics() throws IOException {
1368         String output = ANNOTATION_PROCESSING_NOTE + "warning: [options] bootstrap class path not set" + EOL;
1369 
1370         List<CompilerMessage> messages =
1371                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1372 
1373         assertEquals(2, messages.size(), "note and warning stay separate: " + messages);
1374         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1375         assertEquals(CompilerMessage.Kind.WARNING, messages.get(1).getKind());
1376         assertEquals("[options] bootstrap class path not set", messages.get(1).getMessage());
1377     }
1378 
1379     /**
1380      * A failing compile reports whatever the classifiers did not recognise, so note continuation lines left in the
1381      * buffer would have surfaced as a compiler error.
1382      */
1383     @Test
1384     public void testMultiLineNoteIsNotReportedAsAnErrorWhenCompilationFails() throws IOException {
1385         String output = ANNOTATION_PROCESSING_NOTE + "error: cannot find symbol" + EOL;
1386 
1387         List<CompilerMessage> messages =
1388                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(output)));
1389 
1390         List<CompilerMessage> reportedErrors = messages.stream()
1391                 .filter(m -> m.getKind() == CompilerMessage.Kind.ERROR)
1392                 .collect(Collectors.toList());
1393 
1394         assertEquals(2, messages.size(), "the note and the error, nothing else: " + messages);
1395         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1396         assertEquals(1, reportedErrors.size(), "only the real error is an error: " + messages);
1397         assertEquals("error: cannot find symbol", reportedErrors.get(0).getMessage());
1398     }
1399 
1400     /**
1401      * A note ends at the first line that is not indented, so an anchored diagnostic that follows one keeps its own
1402      * identity. This is the interleaving where the note state and the pending-error flush meet.
1403      */
1404     @Test
1405     public void testNoteFollowedByAnchoredDiagnostic() throws IOException {
1406         String output = "Note: SomeFile.java uses unchecked or unsafe operations." + EOL
1407                 + "target/compiler-src/Foo.java:1: warning: something is off" + EOL
1408                 + "public class Foo {}" + EOL
1409                 + "       ^" + EOL;
1410 
1411         List<CompilerMessage> messages =
1412                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1413 
1414         assertEquals(2, messages.size(), "note and diagnostic stay separate: " + messages);
1415         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1416         assertEquals(CompilerMessage.Kind.WARNING, messages.get(1).getKind());
1417         assertEquals("target/compiler-src/Foo.java", messages.get(1).getFile());
1418     }
1419 
1420     /**
1421      * The reverse order, which exercises the pending-error flush running before a note is recognised.
1422      */
1423     @Test
1424     public void testAnchoredDiagnosticFollowedByNote() throws IOException {
1425         String output = "target/compiler-src/Foo.java:1: warning: something is off" + EOL
1426                 + "public class Foo {}" + EOL
1427                 + "       ^" + EOL
1428                 + "Note: Recompile with -Xlint:unchecked for details." + EOL;
1429 
1430         List<CompilerMessage> messages =
1431                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1432 
1433         assertEquals(2, messages.size(), "diagnostic and note stay separate: " + messages);
1434         assertEquals(CompilerMessage.Kind.WARNING, messages.get(0).getKind());
1435         assertEquals(CompilerMessage.Kind.NOTE, messages.get(1).getKind());
1436         assertEquals(
1437                 "Recompile with -Xlint:unchecked for details.", messages.get(1).getMessage());
1438     }
1439 
1440     /**
1441      * The deprecation and unchecked notes always arrive as a pair of single-line notes.
1442      */
1443     @Test
1444     public void testConsecutiveNotesStaySeparate() throws IOException {
1445         String output = "Note: Some input files use or override a deprecated API." + EOL
1446                 + "Note: Recompile with -Xlint:deprecation for details." + EOL;
1447 
1448         List<CompilerMessage> messages =
1449                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1450 
1451         assertEquals(2, messages.size(), "two notes: " + messages);
1452         assertEquals(
1453                 "Some input files use or override a deprecated API.",
1454                 messages.get(0).getMessage());
1455         assertEquals(
1456                 "Recompile with -Xlint:deprecation for details.",
1457                 messages.get(1).getMessage());
1458     }
1459 
1460     /**
1461      * A note that runs to the end of the stream is flushed after the loop, and a failing compile must not report it
1462      * a second time as unrecognised output.
1463      */
1464     @Test
1465     public void testMultiLineNoteAtEndOfStreamIsReportedOnceWhenCompilationFails() throws IOException {
1466         List<CompilerMessage> messages =
1467                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(ANNOTATION_PROCESSING_NOTE)));
1468 
1469         assertEquals(1, messages.size(), "the note is the only message: " + messages);
1470         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1471     }
1472 
1473     /**
1474      * Stack trace frames are indented with a tab rather than a space, so a crash dump that follows a note is not
1475      * absorbed into it.
1476      */
1477     @Test
1478     public void testTabIndentedStackTraceDoesNotContinueANote() throws IOException {
1479         String output = "Note: SomeFile.java uses unchecked or unsafe operations." + EOL
1480                 + "\tat com.sun.tools.javac.comp.Attr.visitIdent(Attr.java:1)" + EOL
1481                 + "\tat com.sun.tools.javac.tree.JCTree.accept(JCTree.java:2)" + EOL;
1482 
1483         List<CompilerMessage> messages =
1484                 JavacCompiler.parseModernStream(1, new BufferedReader(new StringReader(output)));
1485 
1486         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1487         assertEquals(
1488                 "SomeFile.java uses unchecked or unsafe operations.",
1489                 messages.get(0).getMessage());
1490         assertTrue(
1491                 messages.stream()
1492                         .anyMatch(m -> m.getKind() == CompilerMessage.Kind.ERROR
1493                                 && m.getMessage().contains("visitIdent")),
1494                 "the stack trace is reported on its own: " + messages);
1495     }
1496 
1497     /**
1498      * Only the English prefix is stripped from a note, so a localised one keeps its own. Pinned here because the
1499      * asymmetry lives in the shared API module and outlives this parser.
1500      */
1501     @Test
1502     public void testLocalisedNoteKeepsItsPrefixAndItsContinuation() throws IOException {
1503         String output = "\u6ce8: \u6ce8\u91c8\u51e6\u7406\u304c\u6709\u52b9\u3067\u3059" + EOL
1504                 + "  \u30af\u30e9\u30b9\u30d1\u30b9\u4e0a\u306b\u898b\u3064\u304b\u308a\u307e\u3057\u305f" + EOL;
1505 
1506         List<CompilerMessage> messages =
1507                 JavacCompiler.parseModernStream(0, new BufferedReader(new StringReader(output)));
1508 
1509         assertEquals(1, messages.size(), "one note: " + messages);
1510         assertEquals(CompilerMessage.Kind.NOTE, messages.get(0).getKind());
1511         assertTrue(messages.get(0).getMessage().startsWith("\u6ce8: "), "prefix is kept for a localised note");
1512         assertTrue(messages.get(0).getMessage().contains("\u30af\u30e9\u30b9"), "continuation is kept");
1513     }
1514 
1515     private void validateBadSourceFile(CompilerMessage message) {
1516         assertEquals(CompilerMessage.Kind.ERROR, message.getKind(), "Is an Error");
1517         assertEquals("/MTOOLCHAINS-19/src/main/java/ch/pecunifex/x/Cls1.java", message.getFile(), "On Correct File");
1518         assertTrue(message.getMessage().startsWith("cannot access Cls2"), "Message starts with access Error");
1519     }
1520 
1521     private static void assertEquivalent(CompilerMessage expected, CompilerMessage actual) {
1522         assertEquals(expected.getMessage(), actual.getMessage(), "Message did not match");
1523         assertEquals(expected.getKind(), actual.getKind(), "Kind did not match");
1524         assertEquals(expected.getFile(), actual.getFile(), "File did not match");
1525         assertEquals(expected.getStartLine(), actual.getStartLine(), "Start line did not match");
1526         assertEquals(expected.getStartColumn(), actual.getStartColumn(), "Start column did not match");
1527         assertEquals(expected.getEndLine(), actual.getEndLine(), "End line did not match");
1528         assertEquals(expected.getEndColumn(), actual.getEndColumn(), "End column did not match");
1529     }
1530 }