/** * Load the block at the given offset. */ @Override protected ByteBuffer getBlockAt(final int offset) throws IOException { // The header block doesn't count, so add one long blockWanted = offset + 1L; long startAt = blockWanted * bigBlockSize.getBigBlockSize(); try { return _data.read(bigBlockSize.getBigBlockSize(), startAt); } catch (IndexOutOfBoundsException e) { IndexOutOfBoundsException wrapped = new IndexOutOfBoundsException("Block " + offset + " not found"); wrapped.initCause(e); throw wrapped; } }
newIOOB.initCause(ioob); ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB); throw ioob;
ioobe.initCause(eof); throw ioobe;
/** * Wraps {@link IndexOutOfBoundsException} with custom message. * @param cause Original exception * @return Wrapped exception */ private IndexOutOfBoundsException wrapException( final IndexOutOfBoundsException cause) { final IndexOutOfBoundsException exc = new IndexOutOfBoundsException(this.message); exc.initCause(cause); return exc; } }
/** * Wraps {@link IndexOutOfBoundsException} with custom message. * @param cause Original exception * @return Wrapped exception */ private IndexOutOfBoundsException wrapException( final IndexOutOfBoundsException cause) { final IndexOutOfBoundsException exc = new IndexOutOfBoundsException(this.message); exc.initCause(cause); return exc; } }
public static CharSequence getCharSequence(Document doc) { CharSequence cs = (CharSequence) doc.getProperty(CharSequence.class); if (cs == null) { try { cs = doc.getText(0, doc.getLength()); } catch (BadLocationException ex) { // throw the same exception as CharSequence.subSequence throw (IndexOutOfBoundsException) new IndexOutOfBoundsException().initCause(ex); } } return cs; }
public static CharSequence getCharSequence(Document doc, int begin, int end) { CharSequence cs = (CharSequence) doc.getProperty(CharSequence.class); if (cs != null) { cs = cs.subSequence(begin, end); } else { try { cs = doc.getText(begin, end - begin); } catch (BadLocationException ex) { // throw the same exception as CharSequence.subSequence throw (IndexOutOfBoundsException) new IndexOutOfBoundsException().initCause(ex); } } return cs; }
throw (IndexOutOfBoundsException) new IndexOutOfBoundsException("Problem formatting match with result: " + mr + " on target: " + target).initCause(e);
/** * Load the block at the given offset. */ @Override protected ByteBuffer getBlockAt(final int offset) throws IOException { // The header block doesn't count, so add one long blockWanted = offset + 1L; long startAt = blockWanted * bigBlockSize.getBigBlockSize(); try { return _data.read(bigBlockSize.getBigBlockSize(), startAt); } catch (IndexOutOfBoundsException e) { IndexOutOfBoundsException wrapped = new IndexOutOfBoundsException("Block " + offset + " not found"); wrapped.initCause(e); throw wrapped; } }
"t.length=" + t.length + ", a.length=" + a.length + ", n=" + n); ex2.initCause(ex); throw ex2;
"t.length=" + t.length + ", a.length=" + a.length + ", n=" + n); ex2.initCause(ex); throw ex2;
ioobe.initCause(eof); throw ioobe;
/** * Tests if the token part before {@code pos} is a javadoc line break. * @param token a token to test * @param pos position in the token * @return {@code true} in case the token is something like {@code "\n\t* |\n\t*"} */ public static boolean isLineBreak(Token<JavadocTokenId> token, int pos) { if (token == null || token.id() != JavadocTokenId.OTHER_TEXT) { return false; } try { CharSequence text = token.text(); if (pos < token.length()) text = text.subSequence(0, pos); boolean result = pos > 0 && JAVADOC_LINE_BREAK.matcher(text).find() && (pos == token.length() || !isInsideIndent(token, pos)); return result; } catch (IndexOutOfBoundsException e) { throw (IndexOutOfBoundsException) new IndexOutOfBoundsException("pos: " + pos + ", token.length: " + token.length() + ", token text: " + token.text()).initCause(e); } }
newIOOB.initCause(ioob); ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB); throw ioob;
newIOOB.initCause(ioob); ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB); throw ioob;
newIOOB.initCause(ioob); ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB); throw ioob;
newIOOB.initCause(ioob); ActiveMQClientLogger.LOGGER.unableToGetMessage(newIOOB); throw ioob;