MCPcopy Create free account
hub / github.com/beanshell/beanshell / getErrorLineNumber

Method getErrorLineNumber

src/bsh/ParseException.java:300–321  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

298 // Begin BeanShell Modification - override error methods and toString
299
300 public int getErrorLineNumber()
301 {
302 if (currentToken == null) {
303 String message = getMessage();
304 int index = message.indexOf(" at line ");
305 if (index > -1) {
306 message = message.substring(index + 9);
307 index = message.indexOf(',');
308 try {
309 if (index == -1) {
310 return Integer.parseInt(message);
311 }
312 return Integer.parseInt(message.substring(0, index));
313 } catch (NumberFormatException e) {
314 // ignore, we have no valid line information, just return -1 for now
315 }
316 }
317 return -1;
318 } else {
319 return currentToken.next.beginLine;
320 }
321 }
322
323 public String getErrorText() {
324 // copied from generated getMessage()

Callers

nothing calls this directly

Calls 2

getMessageMethod · 0.95
parseIntMethod · 0.80

Tested by

no test coverage detected