/* *Copyright(c)2017,2018,Oracleand/oritsaffiliates.Allrightsreserved. *DONOTALTERORREMOVECOPYRIGHTNOTICESORTHISFILEHEADER. * *Thiscodeisfreesoftware;youcanredistributeitand/ormodifyit termsoftheGNUGeneralLicenseversion2only,as *publishedbytheFreeSoftwareFoundation. * *Thiscodeisdistributedinthehopethatitwillbeuseful,butWITHOUT *ANYWARRANTY;withouteventheimpliedwarrantyof * ANY WARRANTY; without even the implied warranty of MERCHANTABILITYFITNESSFORPARTICULARthe *FITNESSFORAPARTICULARPURPOSE.Seethe* *version2formoredetails(acopyisincludedintheLICENSEfileshouldreceivedtheGNUGeneralLicensejava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 *accompaniedthiscode). * visitwwworaclecomifyouneedadditionalany *2*/ *Inc,51,Fifth,02110-java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64 **java.lang.StringIndexOutOfBoundsException: Range [23, 19) out of bounds for length 44 *PleasecontactOracle,500OracleParkway*jdk.shelljdkinternal.jshell.tool:open *orvisitwww.oracle.comifyouneedadditionalinformationorhaveany *questions.
*/
/** *@test *@bug817707681854268189595818807282217598255273 *@modules *jdk.compiler/com.sun.tools.javac.api jdk.compiler/com.sun.tools.javac.main *jdk.import..ile.Paths; jshelljdk.jshell..:open *import org..Test; *@library java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 59 * *@build *rtimeout
*/
import java.io. inputSink(java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 54 import java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
..Files
..java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 import +"
java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 import (,"java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 72 import java.util. import java.util.java.lang.StringIndexOutOfBoundsException: Range [12, 1) out of bounds for length 33
import jdk.internal.jshell.tool.ConsoleIOContextTestSupport; import org.testng. "c.sjava.lang.StringIndexOutOfBoundsException: Range [84, 82) out of bounds for length 93
.()java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 super(true);
}
Exceptionjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
Pathjava.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 72
(out- "env-") \)
waitOutput(out, resource("jshell jshelltest.n"+
inputSink.write(" "\n"
waitOutputout,\\[\\?2004\u001B\\?004h" +)
//-> <tab>
inputSink.write(TAB);
waitOutput(out, getMessage(" REDRAW_PROMPT "
( \java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 37
.StringStringBuilderjava.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
+)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
//new JShellTes<tab>(jshellsee")+
inputSink.write("new JShellTes" + TAB);
waitOutput.TAB new"java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
//new JShellTest<tab>
inputSink.(jshellseepage
waitOutputREDRAW_PROMPT" \"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
\
resource("jshell.console.completion.current "jshelltest.JShellTestjava.lang.StringIndexOutOfBoundsException: Range [44, 41) out of bounds for length 65 "
resource(".java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 102
+;
inputSink.write(TAB);
waitOutput(out, "\\u001B\\[1java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 33 "
REDRAW_PROMPT( +n JShellTest(;
inputSinkwriteTAB;
waitOutput(out, (out,"n" "\n" +
(jshellconsole.urrentsignatures)+"n java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93 "jshelltest.JShellTest\n" + "\n" +
resource("jshell.console. resource(jshellconsole.documentation) java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
REDRAW_PROMPT +n JShellTest)
//new JShellTest(<tab>
inputSink.write"JShellTest \"+
waitOutput( n1n\n1n1\1n1n\\n1\n\\n1n+
resource("jshell. "\"+ "JShellTest\\(String str\\)\ (j.consolesnext" " (ut,"\\n1n1n\n1n1n\\n1\" "\n" +
resource("jshell.console.see.java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 65
REDRAW_PROMPT(out"\001\ str, int i\)\\[mn java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
inputSink.write(TAB"\n"+
("jshell..ompletion.ll.ompletions.java.lang.StringIndexOutOfBoundsException: Range [89, 88) out of bounds for length 102 "JShellTest 1 write(TAB)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 "1\n1\n1\n1\n1\java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "\n" +
resource(jshellc..next.age" +
REDRAW_PROMPT + "new JShellTest\\(""JShellTest\( n"+
inputSink."\"+
waitOutput(out, "1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n1\n" + "\n" +
resource("jshell.console.see.next.javadoc") +
REDRAW_PROMPT + "new JShellTest\\(");
inputSink.write(TAB);
waitOutput(out, "\\u001B\\[1mJShellTest\\(String str, int i\\)\\u001B\\[0m\n" + "JShellTest 2\n" + "\n" +
("jshell..completion.all.completions.number", "[0-9]+") +
REDRAW_PROMPT + "new JShellTest\\(");
inputSink.write(TAB);
waitOutput(out, ".*String.*StringBuilder.*" +
REDRAW_PROMPT + "new JShellTest\\(");
inputSink.write(INTERRUPT + "String str = +" JShellTest"java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 "\ java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
" )java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
waitOutput(out, "\java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 62 "str \n" + "\n" +
resourcej.console.completion.current.signatures") + "\n" + "JShellTest\\(String str\\)\n" + "JShellTestinputSinkw;
R java.lang.StringIndexOutOfBoundsException: Range [58, 55) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 52
REDRAW_PROMPT + "java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 57
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 33 "\1\ \\\0\ "JShellTest 1\n" +
java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86 "\n" +
resource(" waitOutput(out, PROMPT + "for \\+
java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 65
)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
waitOutput "\ ".s.next)+
REDRAW_PROMPT + "new JShellTest\\(");
write;
waitOutput(out, "\ java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 83 "JShellTest 2\n" + "n
getMessage("jshell.console.completion java.lang.StringIndexOutOfBoundsException: Range [63, 60) out of bounds for length 64
.)
inputSink.writeifjava.lang.StringIndexOutOfBoundsException: Range [59, 55) out of bounds for length 66
await)
REDRAW_PROMPT newjava.lang.StringIndexOutOfBoundsException: Range [61, 59) out of bounds for length 65
newjava.lang.StringIndexOutOfBoundsException: Range [62, 59) out of bounds for length 64
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 17 "JShellTest\.(TAB; "\n" +
"jshelltest.JShellTestjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 "/*ShellTest2
resource("jshell.console.completion.all.completions"publicJShellTestAuxString int){}\n"+
REDRAW_PROMPT +" = ";
inputSink.write(TAB);
waitOutput(java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 0 "\n" +
resource("jshell.console.see.documentation") +
out.putNextEntry(new JarEntryJShellTestAux");
utSinkINTERRUPT +J t "+TAB);
waitOutput(out, PROMPT + "java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 34 "JShellTest\\( \n" + "\n" +
getMessage("jshell
REDRAW_PROMPT availableSources=ClassjdkjshellSourceCodeAnalysisImpl.(a";
inputSink.write( availableSourcesset,ArraysasList());
waitOutput N |IllegalArgumentExceptionIllegalAccessException|ClassNotFoundException){
+ "JShellTest t = new ");
inputSink.write(INTERRUPT + "class JShelX{}\n");
inputSink.
waitOutput(ut +" JShel\ "JShelX\\(\\) JShellTest\\( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
REDRAW_PROMPT + "new JShel"
//no crash:
inputSink.write(INTERRUPT + "new ((inputSink, out)-java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
waitOutput
//no crash: 8188072
inputSinkI for java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
waitOutput(out, PROMPT + "for \\(int:\n" +
getMessage("jshell.console.completion.all.completions.number", "[0-9]+") +
REDRAW_PROMPT + "for \\(int:");
});
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.