ExceptionInfo (int offset, String message) { if (!message.startsWith(COMMON_PREFIX)) return null; int parameter; int indexOffset = COMMON_PREFIX.length(); if (message.startsWith(SOURCE_INDEX_PREFIX, COMMON_PREFIX.length())) { parameter = 1; indexOffset += SOURCE_INDEX_PREFIX.length(); } else if (message.startsWith(DESTINATION_INDEX_PREFIX, COMMON_PREFIX.length())) { parameter = 3; indexOffset += DESTINATION_INDEX_PREFIX.length(); } else if (message.startsWith(LENGTH_PREFIX, COMMON_PREFIX.length())) { parameter = 4; indexOffset += LENGTH_PREFIX.length(); } else { return null; } int indexEndOffset = message.indexOf(' ', indexOffset); if (indexEndOffset == -1) return null; String indexStr = message.substring(indexOffset, indexEndOffset); int index; try { index = Integer.parseInt(indexStr); } catch (NumberFormatException ignored) { return null; } return new ArrayCopyIndexOutOfBoundsExceptionInfo(offset, message, index, parameter); }