title: Closing ResultSet twice throws an exception
body: <p>I recently upgraded the Oracle JDBC driver version from 11.2.0.1 to 12.1.0.1. However, a very strange thing I noticed. In one of my tests I was closing the ResultSet object twice using following code in Java:</p>
  
  <pre><code>if (resSet != null) {
              try {
                  resSet.getStatement().close();
              } catch (NullPointerException ne) {
                  // nothing to do!
                  // NullPointerException seen at Oracle and Sybase!
              }
          }
  </code></pre>
  
  <p>This worked without any exception when I used old JDBC driver 11.2.0.1. But when I switch to new JDBC driver 12.1.0.1, it throws an exception:</p>
  
  <pre><code>java.sql.SQLException: Closed Resultset: getStatement
      at oracle.jdbc.driver.InsensitiveScrollableResultSet.getStatement(InsensitiveScrollableResultSet.java:272)
  </code></pre>
  
  <p>Why does this happen? When I checked the JavaDoc of ResultSet it says: Calling the method close on a ResultSet object that is already closed is a no-op.</p>
  
  <p>So now I am confused, calling a close twice is a no-op means it shouldn't throw any exception, right?</p>
  
  <p>I am using JDK7u45 with java.sql.ResultSet.</p>