dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #14438
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 4904: Codestyle
------------------------------------------------------------
revno: 4904
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2011-10-12 11:23:31 +0200
message:
Codestyle
modified:
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcStoreIterator.java
--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk
Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java 2011-09-23 14:45:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcAggregatedDataValueStore.java 2011-10-12 09:23:31 +0000
@@ -310,13 +310,13 @@
Statement statement = holder.getStatement();
- statement.setFetchSize(FETCH_SIZE);
+ statement.setFetchSize( FETCH_SIZE );
final ResultSet resultSet = statement.executeQuery( sql );
RowMapper<AggregatedDataValue> rm = new AggregatedDataValueRowMapper();
- return new JdbcStoreIterator<AggregatedDataValue>(resultSet, holder, rm);
+ return new JdbcStoreIterator<AggregatedDataValue>( resultSet, holder, rm );
}
catch ( SQLException ex )
{
@@ -583,12 +583,12 @@
Statement statement = holder.getStatement();
- statement.setFetchSize(FETCH_SIZE);
+ statement.setFetchSize( FETCH_SIZE );
final ResultSet resultSet = statement.executeQuery( sql );
RowMapper<AggregatedIndicatorValue> rm = new AggregatedIndicatorValueRowMapper();
- return new JdbcStoreIterator<AggregatedIndicatorValue>(resultSet, holder, rm);
+ return new JdbcStoreIterator<AggregatedIndicatorValue>( resultSet, holder, rm );
}
catch ( SQLException ex )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcStoreIterator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcStoreIterator.java 2011-01-21 10:40:31 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/aggregation/jdbc/JdbcStoreIterator.java 2011-10-12 09:23:31 +0000
@@ -38,19 +38,22 @@
/**
* @author bobj
*/
-public class JdbcStoreIterator<T> implements StoreIterator<T> {
-
- private static final Log log = LogFactory.getLog(JdbcStoreIterator.class);
+public class JdbcStoreIterator<T>
+ implements StoreIterator<T>
+{
+ private static final Log log = LogFactory.getLog( JdbcStoreIterator.class );
private RowMapper<T> rowmapper;
private ResultSet resultSet;
- public ResultSet getResultSet() {
+ public ResultSet getResultSet()
+ {
return resultSet;
}
- public void setResultSet(ResultSet resultSet) {
+ public void setResultSet( ResultSet resultSet )
+ {
this.resultSet = resultSet;
}
@@ -66,35 +69,48 @@
this.holder = holder;
}
- public JdbcStoreIterator(ResultSet resultSet, StatementHolder holder, RowMapper<T> rowmapper) {
+ public JdbcStoreIterator( ResultSet resultSet, StatementHolder holder, RowMapper<T> rowmapper )
+ {
this.resultSet = resultSet;
this.holder = holder;
this.rowmapper = rowmapper;
}
@Override
- public T next() {
+ public T next()
+ {
T row = null;
- try {
- if (resultSet.next()) {
- row = rowmapper.mapRow(resultSet);
- } else {
- this.close();
- }
- } catch (SQLException ex) {
- log.warn("Error reading row: " + ex);
+ try
+ {
+ if ( resultSet.next() )
+ {
+ row = rowmapper.mapRow( resultSet );
+ }
+ else
+ {
+ close();
+ }
+ }
+ catch ( SQLException ex )
+ {
+ log.warn( "Error reading row: " + ex );
}
return row;
}
@Override
- public void close() {
- try {
- if (!resultSet.isClosed()) {
+ public void close()
+ {
+ try
+ {
+ if ( !resultSet.isClosed() )
+ {
resultSet.close();
}
- } catch (SQLException ex) {
- log.warn("Error closing resultset: " + ex);
+ }
+ catch ( SQLException ex )
+ {
+ log.warn( "Error closing resultset: " + ex );
}
holder.close();