()
| 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() |
nothing calls this directly
no test coverage detected