@@ -134,7 +134,6 @@ public void close() throws SQLException
134134 {
135135//release resources held (memory for tuples)
136136if (rows !=null ) {
137- rows .setSize (0 );
138137rows =null ;
139138 }
140139 }
@@ -710,7 +709,8 @@ public int findColumn(String columnName) throws SQLException
710709 {
711710int i ;
712711
713- for (i =0 ;i <fields .length ; ++i )
712+ final int flen =fields .length ;
713+ for (i =0 ;i <flen ; ++i )
714714if (fields [i ].getName ().equalsIgnoreCase (columnName ))
715715return (i +1 );
716716throw new PSQLException ("postgresql.res.colname" ,columnName );
@@ -726,11 +726,13 @@ public boolean absolute(int index) throws SQLException
726726if (index ==0 )
727727throw new SQLException ("Cannot move to index of 0" );
728728
729+ final int rows_size =rows .size ();
730+
729731//if index<0, count from the end of the result set, but check
730732//to be sure that it is not beyond the first index
731733if (index <0 )
732- if (index >=- rows . size () )
733- internalIndex = rows . size () +index ;
734+ if (index > - rows_size )
735+ internalIndex = rows_size +index ;
734736else {
735737beforeFirst ();
736738return false ;
@@ -739,7 +741,7 @@ public boolean absolute(int index) throws SQLException
739741//must be the case that index>0,
740742//find the correct place, assuming that
741743//the index is not too large
742- if (index <= rows . size () )
744+ if (index <= rows_size )
743745internalIndex =index -1 ;
744746else {
745747afterLast ();
@@ -753,8 +755,9 @@ public boolean absolute(int index) throws SQLException
753755
754756public void afterLast ()throws SQLException
755757 {
756- if (rows .size () >0 )
757- current_row =rows .size ();
758+ final int rows_size =rows .size ();
759+ if (rows_size >0 )
760+ current_row =rows_size ;
758761 }
759762
760763public void beforeFirst ()throws SQLException
@@ -967,7 +970,8 @@ public void insertRow() throws SQLException
967970
968971public boolean isAfterLast ()throws SQLException
969972 {
970- return (current_row >=rows .size () &&rows .size () >0 );
973+ final int rows_size =rows .size ();
974+ return (current_row >=rows_size &&rows_size >0 );
971975 }
972976
973977public boolean isBeforeFirst ()throws SQLException
@@ -982,16 +986,18 @@ public boolean isFirst() throws SQLException
982986
983987public boolean isLast ()throws SQLException
984988 {
985- return (current_row ==rows .size () -1 &&rows .size () >0 );
989+ final int rows_size =rows .size ();
990+ return (current_row ==rows_size -1 &&rows_size >0 );
986991 }
987992
988993public boolean last ()throws SQLException
989994 {
990- if (rows .size () <=0 )
991- return false ;
992- current_row =rows .size () -1 ;
993- this_row = (byte [][])rows .elementAt (current_row );
994- return true ;
995+ final int rows_size =rows .size ();
996+ if (rows_size <=0 )
997+ return false ;
998+ current_row =rows_size -1 ;
999+ this_row = (byte [][])rows .elementAt (current_row );
1000+ return true ;
9951001 }
9961002
9971003public void moveToCurrentRow ()throws SQLException
@@ -1480,4 +1486,3 @@ public static Timestamp toTimestamp(String s, ResultSet resultSet) throws SQLExc
14801486}
14811487}
14821488}
1483-