Buggy code:
public class ESConnection implements Connection { private String host ; private int port ; private String index ; private Properties props ; private Client client ; private boolean active = true ; private int timeout = Integer . MAX_VALUE ; private final Logger logger = LoggerFactory . getLogger ( this . getClass ( ) ) ; private boolean autoCommit = false ; private boolean readOnly = true ; private List < ESStatement > statements = new ArrayList < ESStatement > ( ) ; public ESConnection ( String host , int port , String index , Properties props ) throws SQLException { } private Client buildClient ( ) throws SQLException { } public Client getClient ( ) { } @ Override public < T > T unwrap ( Class < T > iface ) throws SQLException { } @ Override public boolean isWrapperFor ( Class < ? > iface ) throws SQLException { } @ Override public Statement createStatement ( ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql ) throws SQLException { } @ Override public CallableStatement prepareCall ( String sql ) throws SQLException { } @ Override public Statement createStatement ( int resultSetType , int resultSetConcurrency ) throws SQLException { } @ Override public String nativeSQL ( String sql ) throws SQLException { } @ Override public void setAutoCommit ( boolean autoCommit ) throws SQLException { } @ Override public boolean getAutoCommit ( ) throws SQLException { } @ Override public void commit ( ) throws SQLException { } @ Override public void rollback ( ) throws SQLException { } @ Override public void close ( ) throws SQLException { } @ Override public boolean isClosed ( ) throws SQLException { <START_BUG> return active ; <END_BUG> } @ Override public DatabaseMetaData getMetaData ( ) throws SQLException { } @ Override public void setReadOnly ( boolean readOnly ) throws SQLException { } @ Override public boolean isReadOnly ( ) throws SQLException { } @ Override public void setCatalog ( String catalog ) throws SQLException { } @ Override public String getCatalog ( ) throws SQLException { } @ Override public void setTransactionIsolation ( int level ) throws SQLException { } @ Override public int getTransactionIsolation ( ) throws SQLException { } @ Override public SQLWarning getWarnings ( ) throws SQLException { } @ Override public void clearWarnings ( ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql , int resultSetType , int resultSetConcurrency ) throws SQLException { } @ Override public CallableStatement prepareCall ( String sql , int resultSetType , int resultSetConcurrency ) throws SQLException { } @ Override public Map < String , Class < ? > > getTypeMap ( ) throws SQLException { } @ Override public void setTypeMap ( Map < String , Class < ? > > map ) throws SQLException { } @ Override public void setHoldability ( int holdability ) throws SQLException { } @ Override public int getHoldability ( ) throws SQLException { } @ Override public Savepoint setSavepoint ( ) throws SQLException { } @ Override public Savepoint setSavepoint ( String name ) throws SQLException { } @ Override public void rollback ( Savepoint savepoint ) throws SQLException { } @ Override public void releaseSavepoint ( Savepoint savepoint ) throws SQLException { } @ Override public Statement createStatement ( int resultSetType , int resultSetConcurrency , int resultSetHoldability ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql , int resultSetType , int resultSetConcurrency , int resultSetHoldability ) throws SQLException { } @ Override public CallableStatement prepareCall ( String sql , int resultSetType , int resultSetConcurrency , int resultSetHoldability ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql , int autoGeneratedKeys ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql , int [ ] columnIndexes ) throws SQLException { } @ Override public PreparedStatement prepareStatement ( String sql , String [ ] columnNames ) throws SQLException { } @ Override public Clob createClob ( ) throws SQLException { } @ Override public Blob createBlob ( ) throws SQLException { } @ Override public NClob createNClob ( ) throws SQLException { } @ Override public SQLXML createSQLXML ( ) throws SQLException { } @ Override public boolean isValid ( int timeout ) throws SQLException { } @ Override public void setClientInfo ( String name , String value ) throws SQLClientInfoException { } @ Override public void setClientInfo ( Properties properties ) throws SQLClientInfoException { } @ Override public String getClientInfo ( String name ) throws SQLException { } @ Override public Properties getClientInfo ( ) throws SQLException { } @ Override public Array createArrayOf ( String typeName , Object [ ] elements ) throws SQLException { } @ Override public Struct createStruct ( String typeName , Object [ ] attributes ) throws SQLException { } @ Override public void setSchema ( String schema ) throws SQLException { } @ Override public String getSchema ( ) throws SQLException { } @ Override public void abort ( Executor executor ) throws SQLException { } @ Override public void setNetworkTimeout ( Executor executor , int milliseconds ) throws SQLException { } @ Override public int getNetworkTimeout ( ) throws SQLException { } }

Fix:
return ! ( active ) ;