Skip to content

report initialization of boot layer error messages #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,17 @@ static List<CompilerMessage> parseModernStream( int exitCode, BufferedReader inp
{
// javac output not detected by other parsing
// maybe better to ignore only the summary an mark the rest as error
if (buffer.length() > 0 && buffer.toString().startsWith("javac:"))
String bufferAsString = buffer.toString();
if ( buffer.length() > 0 )
{
errors.add( new CompilerMessage( buffer.toString(), CompilerMessage.Kind.ERROR ) );
if ( bufferAsString.startsWith("javac:"))
{
errors.add( new CompilerMessage( bufferAsString, CompilerMessage.Kind.ERROR ) );
}
else if ( bufferAsString.startsWith("Error occurred during initialization of boot layer"))
{
errors.add( new CompilerMessage( bufferAsString, CompilerMessage.Kind.OTHER ) );
}
}
return errors;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -894,6 +894,18 @@ public final void testIssue37() throws IOException {
".tools.javac.Main.main(Main.java:43)" + EOL));
}

public void testJvmError() throws Exception
{
String out = "Error occurred during initialization of boot layer" + EOL +
"java.lang.module.FindException: Module java.xml.bind not found";

List<CompilerMessage> compilerErrors = JavacCompiler.parseModernStream( 1, new BufferedReader( new StringReader( out ) ));

assertNotNull( compilerErrors );

assertEquals( 1, compilerErrors.size() );
}

private static void assertEquivalent(CompilerMessage expected, CompilerMessage actual){
assertEquals("Message did not match", expected.getMessage(), actual.getMessage());
assertEquals("Kind did not match", expected.getKind(), actual.getKind());
Expand Down