Buggy code:
protected DbClientContext localContext ; protected DbClientContext geoContext ; private String keyspaceName ; private String localDbSvcName = Constants . DBSVC_NAME ; private String geoDbSvcName = Constants . GEODBSVC_NAME ; private String clusterName ; private DbVersionInfo _dbVersionInfo ; private boolean _bypassMigrationLock ; protected CoordinatorClient _coordinator ; protected IndexCleaner _indexCleaner ; protected EncryptionProvider _encryptionProvider ; protected EncryptionProvider _geoEncryptionProvider ; private boolean initDone = false ; private String _geoVersion ; public String getGeoVersion ( ) { } public void setLocalContext ( DbClientContext localContext ) { } public DbClientContext getLocalContext ( ) { } public void setGeoContext ( DbClientContext geoContext ) { } public DbClientContext getGeoContext ( ) { } public void setClusterName ( String cn ) { } public void setKeyspaceName ( String ks ) { } public void setDbVersionInfo ( DbVersionInfo dbVersionInfo ) { } @ SuppressWarnings ( "findbugs:IS2_INCONSISTENT_SYNC" ) public void setCoordinatorClient ( CoordinatorClient coordinator ) { } @ SuppressWarnings ( "findbugs:IS2_INCONSISTENT_SYNC" ) public CoordinatorClient getCoordinatorClient ( ) { } @ SuppressWarnings ( "findbugs:IS2_INCONSISTENT_SYNC" ) public void setGeoEncryptionProvider ( EncryptionProvider encryptionProvider ) { } @ SuppressWarnings ( "findbugs:IS2_INCONSISTENT_SYNC" ) public void setEncryptionProvider ( EncryptionProvider encryptionProvider ) { } public void setBypassMigrationLock ( boolean bypassMigrationLock ) { } @ Override public synchronized void start ( ) { } public boolean isInitDone ( ) { } protected void setupContext ( ) { } protected void setupContext ( DbClientContext ctx , String dbSvcName ) { } protected Keyspace getLocalKeyspace ( ) { } protected Keyspace getGeoKeyspace ( ) { } protected Keyspace getKeyspace ( DataObject dataObj ) { } protected < T extends DataObject > Keyspace getKeyspace ( Class < T > clazz ) { } @ Override public synchronized void stop ( ) { } @ Override public < T extends DataObject > T queryObject ( Class < T > clazz , NamedURI id ) { } @ Override public DataObject queryObject ( URI id ) { } @ Override public < T extends DataObject > T queryObject ( Class < T > clazz , URI id ) { } @ Override public < T extends DataObject > List < T > queryObject ( Class < T > clazz , URI ... id ) { } @ Override public < T extends DataObject > List < T > queryObject ( Class < T > clazz , Collection < URI > ids ) { } @ Override public < T extends DataObject > List < T > queryObject ( Class < T > clazz , Collection < URI > ids , boolean activeOnly ) { } protected < T extends DataObject > List < T > internalQueryObject ( Class < T > clazz , Collection < URI > ids , boolean activeOnly ) { } @ Override public < T extends DataObject > Iterator < T > queryIterativeObjects ( final Class < T > clazz , Collection < URI > ids ) { } @ Override public < T extends DataObject > Iterator < T > queryIterativeObjects ( final Class < T > clazz , Collection < URI > ids , final boolean activeOnly ) { } @ Override public < T extends DataObject > Iterator < T > queryIterativeObjectField ( final Class < T > clazz , final String fieldName , Collection < URI > ids ) { } @ Override public < T extends DataObject > List < T > queryObjectField ( Class < T > clazz , String fieldName , Collection < URI > ids ) { } @ Override public < T extends DataObject > Iterator < T > queryIterativeObjectFields ( final Class < T > clazz , final Collection < String > fieldNames , Collection < URI > ids ) { BulkDataObjQueryResultIterator < T > bulkQueryIterator = new BulkDataObjQueryResultIterator < T > ( ids . iterator ( ) ) { @ Override protected void run ( ) { currentIt = null ; getNextBatch ( ) ; while ( ! ( nextBatch . isEmpty ( ) ) ) { <START_BUG> currentIt = queryObjectFields ( clazz , fieldNames , nextBatch ) . iterator ( ) ; <END_BUG> if ( currentIt . hasNext ( ) ) { break ; } getNextBatch ( ) ; } } } ; return bulkQueryIterator ; } @ Override public < T extends DataObject > Collection < T > queryObjectFields ( Class < T > clazz , Collection < String > fieldNames , Collection < URI > ids ) { } protected < T extends DataObject > Collection < T > internalQueryObjectFields ( Class < T > clazz , Collection < String > fieldNames , Collection < URI > ids ) { } @ Override public < T extends DataObject > void aggregateObjectField ( Class < T > clazz , Iterator < URI > ids , DbAggregatorItf aggregator ) { } private void aggregateObjectFieldBatch ( DbAggregatorItf aggregator , Keyspace ks , Collection < String > strIds , DataObjectType doType , boolean buildRange , CompositeColumnName [ ] columns ) { } private static class FilteredCfScanIterator implements Iterator < URI > { private final Iterator < Row < String , CompositeColumnName > > it ; private URI cached ; public FilteredCfScanIterator ( Iterator < Row < String , CompositeColumnName > > it ) { } protected boolean shouldFilter ( Row < String , CompositeColumnName > row ) { } private boolean tryAdvance ( ) { } @ Override public boolean hasNext ( ) { } @ Override public URI next ( ) { } @ Override public void remove ( ) { } } private < T extends DataObject > Iterable < Row < String , CompositeColumnName > > scanRowsByType ( Class < T > clazz , Boolean inactiveValue , URI startId , int count ) { } private < T extends DataObject > URIQueryResultList scanByType ( Class < T > clazz , final Boolean inactiveValue , URI startId , int count ) { }

Fix:
currentIt = internalQueryObjectFields ( clazz , fieldNames , nextBatch ) . iterator ( ) ;