
import java.sql.ResultSetMetaData;
import java.sql.ResultSet;
import java.sql.SQLException;

public class BadResultSetAccessTest
{
	public void test0( ResultSet rs ) throws SQLException {
		ResultSetMetaData rsmd = rs.getMetaData();
		int numCols = rsmd.getColumnCount();
		
		for (int i = 0; i < numCols; i++) {
			System.out.print( "i = [" + i + "]  " );
			String s = rs.getString(i);
			System.out.println(s);
		}	
	}

	public void test1( ResultSet rs ) throws SQLException {
		int i = rs.getInt(0);
		i++;
		rs.updateInt(0, i );
	}
	
	public void test2( ResultSet rs ) throws SQLException {
		String s = rs.getString(0);
		s = s.substring(1);
		rs.updateString(0, s );
	}
	
	public void test3( ResultSet rs ) throws SQLException {
		String s = rs.getString("foo");
		s = s.substring(1);
		rs.updateString("foo", s );
	}
	
	public void test4( ResultSet rs ) throws SQLException {
		rs.updateBinaryStream( 1, null, 0 );
	}
}
@@ -920,9 +920,329 @@
 0 );%0A%09%7D%0A
+%09%0A%09public void test5( ResultSet rs ) throws SQLException %7B%0A%09%09//This is ok, but generated false positives at one time%0A%09%09int idx = 0;%0A%09%09int rowId = rs.getInt(++idx);%0A%09%09String name = rs.getString(++idx);%0A%09%09String value = rs.getString(++idx);%0A%09%09int groupId = rs.getInt(++idx);%0A%09%09String description = rs.getString(++idx);%0A%09%7D%0A
 %7D

add once false positive cases, that are now fixed