< prev index next >

src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java

Print this page

        

*** 3497,3510 **** } } int pstart = (int) diag.getStartPosition(); int pend = (int) diag.getEndPosition(); - if (pstart < 0 || pend < 0) { - pstart = 0; - pend = source.length(); - } Matcher m = LINEBREAK.matcher(source); int pstartl = 0; int pendl = -2; while (m.find(pstartl)) { pendl = m.start(); --- 3497,3506 ----
*** 3512,3522 **** break; } else { pstartl = m.end(); } } ! if (pendl < pstartl) { pendl = source.length(); } toDisplay.add(source.substring(pstartl, pendl)); StringBuilder sb = new StringBuilder(); --- 3508,3518 ---- break; } else { pstartl = m.end(); } } ! if (pendl < pstart) { pendl = source.length(); } toDisplay.add(source.substring(pstartl, pendl)); StringBuilder sb = new StringBuilder();
< prev index next >