Skip to content
Permalink
Browse files
8261450: JShell crashes with SIOOBE in tab completion
Reviewed-by: vromero
  • Loading branch information
Jan Lahoda committed Mar 4, 2021
1 parent b817855 commit 94f26e4df8eae6f242695194b3b190ed639e0167
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -593,6 +593,7 @@ public Object scan(DocTree node, Object p) {
private void reflowTillNow() {
while (result.length() > 0 && result.charAt(result.length() - 1) == ' ')
result.delete(result.length() - 1, result.length());
reflownTo = Math.min(reflownTo, result.length());
reflow(result, reflownTo, indent, limit);
reflownTo = result.length();
}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -23,7 +23,7 @@

/*
* @test
* @bug 8131019 8169561
* @bug 8131019 8169561 8261450
* @summary Test JavadocFormatter
* @library /tools/lib
* @modules jdk.compiler/jdk.internal.shellsupport.doc
@@ -401,4 +401,16 @@ public void testReflow() {
}
}

public void testSpaceAtEndOfLine() {
String header = "Class<?> Class<T>.forName(Module module, String name)";
String javadoc = """
@throws SecurityException
<ul>
<li> test </li>
</ul>
""";

new JavadocFormatter(60, true).formatJavadoc(header, javadoc);
}

}

0 comments on commit 94f26e4

Please sign in to comment.