- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {Connection c =
DataSource dataSource;dataSource.getConnection()
String url;DriverManager.getConnection(url)
IdentityDatabaseUtil.getDBConnection()
- Smart code suggestions by Codota
}
/** * Checks if the given index is in range. If not, throws an appropriate * runtime exception. This method does *not* check if the index is * negative: It is always used immediately prior to an array access, * which throws an ArrayIndexOutOfBoundsException if index is negative. */ protected void rangeCheck(int index) { if (index >= size) throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); positiveIndexCheck(index); }
protected void rangeCheckForInsert(int index) { if (index > size) throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size); positiveIndexCheck(index); }
/** * Returns the element at the specified position in this list. * The list will grow if the given index is greater or equal to * the size this list. * * @param index index of the element to return * @return the element at the specified position in this list * @throws IndexOutOfBoundsException if the index is negative (<tt>index < 0</tt>) */ public T getAndGrowIfNeeded(int index) { positiveIndexCheck(index); if (index >= size) { size = index + 1; ensureCapacity(size); } return elementData[index]; }