Details
-
Bug
-
Resolution: Fixed
-
P3
-
9, 10
Description
FULL PRODUCT VERSION :
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Jshell crashes
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Enter jshell and import the java.lang.*
Declare a StringBuilder (or StringBuffer)
StringBuilder sb = new StringBuilder()
Try to see the document by pressing tab multiple times for
sb.append(
will crash jshell. This is the stacktrace:
<press tab again to see documentation>
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected to see the java doc
ACTUAL -
jshell> import java.lang.*
jshell> StringBuilder sb = new StringBuilder()
sb ==>
jshell> sb.
append( appendCodePoint( delete( deleteCharAt( equals( getClass() hashCode() indexOf(
insert( lastIndexOf( notify() notifyAll() replace( reverse() toString() wait(
jshell> sb.append
append( appendCodePoint(
jshell> sb.append(
sb
Signatures:
StringBuilder StringBuilder.append(Object obj)
StringBuilder StringBuilder.append(String str)
StringBuilder StringBuilder.append(StringBuffer sb)
StringBuilder StringBuilder.append(CharSequence s)
StringBuilder StringBuilder.append(CharSequence s, int start, int end)
StringBuilder StringBuilder.append(char[] str)
StringBuilder StringBuilder.append(char[] str, int offset, int len)
StringBuilder StringBuilder.append(boolean b)
StringBuilder StringBuilder.append(char c)
StringBuilder StringBuilder.append(int i)
StringBuilder StringBuilder.append(long lng)
StringBuilder StringBuilder.append(float f)
StringBuilder StringBuilder.append(double d)
<press tab again to see documentation>
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:172)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.constructDocumentation(SourceCodeAnalysisImpl.java:1217)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.lambda$documentationImpl$48(SourceCodeAnalysisImpl.java:1200)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentationImpl(SourceCodeAnalysisImpl.java:1202)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentation(SourceCodeAnalysisImpl.java:1114)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:629)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:172)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.constructDocumentation(SourceCodeAnalysisImpl.java:1217)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.lambda$documentationImpl$48(SourceCodeAnalysisImpl.java:1200)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentationImpl(SourceCodeAnalysisImpl.java:1202)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentation(SourceCodeAnalysisImpl.java:1114)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:629)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)
REPRODUCIBILITY :
This bug can be reproduced always.
java version "9"
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
Jshell crashes
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Enter jshell and import the java.lang.*
Declare a StringBuilder (or StringBuffer)
StringBuilder sb = new StringBuilder()
Try to see the document by pressing tab multiple times for
sb.append(
will crash jshell. This is the stacktrace:
<press tab again to see documentation>
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected to see the java doc
ACTUAL -
jshell> import java.lang.*
jshell> StringBuilder sb = new StringBuilder()
sb ==>
jshell> sb.
append( appendCodePoint( delete( deleteCharAt( equals( getClass() hashCode() indexOf(
insert( lastIndexOf( notify() notifyAll() replace( reverse() toString() wait(
jshell> sb.append
append( appendCodePoint(
jshell> sb.append(
sb
Signatures:
StringBuilder StringBuilder.append(Object obj)
StringBuilder StringBuilder.append(String str)
StringBuilder StringBuilder.append(StringBuffer sb)
StringBuilder StringBuilder.append(CharSequence s)
StringBuilder StringBuilder.append(CharSequence s, int start, int end)
StringBuilder StringBuilder.append(char[] str)
StringBuilder StringBuilder.append(char[] str, int offset, int len)
StringBuilder StringBuilder.append(boolean b)
StringBuilder StringBuilder.append(char c)
StringBuilder StringBuilder.append(int i)
StringBuilder StringBuilder.append(long lng)
StringBuilder StringBuilder.append(float f)
StringBuilder StringBuilder.append(double d)
<press tab again to see documentation>
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:172)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.constructDocumentation(SourceCodeAnalysisImpl.java:1217)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.lambda$documentationImpl$48(SourceCodeAnalysisImpl.java:1200)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentationImpl(SourceCodeAnalysisImpl.java:1202)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentation(SourceCodeAnalysisImpl.java:1114)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:629)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)
ERROR MESSAGES/STACK TRACES THAT OCCUR :
jshell> sb.append(Exception in thread "main" java.lang.StringIndexOutOfBoundsException: start -59, end -59, length 238
at java.base/java.lang.AbstractStringBuilder.checkRangeSIOOBE(AbstractStringBuilder.java:1698)
at java.base/java.lang.AbstractStringBuilder.delete(AbstractStringBuilder.java:837)
at java.base/java.lang.StringBuilder.delete(StringBuilder.java:251)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:481)
at jdk.compiler/jdk.internal.shellsupport.doc.JavadocHelper$OnDemandJavadocHelper.getResolvedDocComment(JavadocHelper.java:172)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.constructDocumentation(SourceCodeAnalysisImpl.java:1217)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.lambda$documentationImpl$48(SourceCodeAnalysisImpl.java:1200)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1492)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:511)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentationImpl(SourceCodeAnalysisImpl.java:1202)
at jdk.jshell/jdk.jshell.SourceCodeAnalysisImpl.documentation(SourceCodeAnalysisImpl.java:1114)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$ExpressionJavadocTask.perform(ConsoleIOContext.java:629)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.complete(ConsoleIOContext.java:287)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.access$000(ConsoleIOContext.java:69)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext$1.complete(ConsoleIOContext.java:100)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2684)
at jdk.internal.le/jdk.internal.jline.console.ConsoleReader.readLine(ConsoleReader.java:2279)
at jdk.jshell/jdk.internal.jshell.tool.ConsoleIOContext.readLine(ConsoleIOContext.java:139)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:1140)
at jdk.jshell/jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:929)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolBuilder.run(JShellToolBuilder.java:239)
at jdk.jshell/jdk.internal.jshell.tool.JShellToolProvider.main(JShellToolProvider.java:119)
REPRODUCIBILITY :
This bug can be reproduced always.