Buggy code:
public class CreateLocationOverlapIndex { protected ObjectStoreWriterInterMineImpl osw ; private static final String RANGE_TYPE = "int4range" ; private static final Logger LOG = Logger . getLogger ( CreateLocationOverlapIndex . class ) ; public CreateLocationOverlapIndex ( ObjectStoreWriter osw ) { } public void create ( ) throws SQLException { Database db = this . osw . getDatabase ( ) ; if ( osw . getSchema ( ) . useRangeTypes ( ) ) { Connection con = db . getConnection ( ) ; try { if ( hasIndexAlready ( con ) ) { return ; } String indexType = ( db . isVersionAtLeast ( "9.3" ) ) ? "SPGIST" : "GIST" ; long startTime = System . currentTimeMillis ( ) ; <START_BUG> String indexSql = ( ( ( ( "CREATE<seq2seq4repair_space>INDEX<seq2seq4repair_space>location__int4range<seq2seq4repair_space>" + "ON<seq2seq4repair_space>location<seq2seq4repair_space>USING<seq2seq4repair_space>" ) + indexType ) + "<seq2seq4repair_space>(" ) + ( CreateLocationOverlapIndex . RANGE_TYPE ) ) + "(intermine_start,<seq2seq4repair_space>intermine_end))" ; <END_BUG> CreateLocationOverlapIndex . LOG . info ( indexSql ) ; Statement statement = con . createStatement ( ) ; statement . executeUpdate ( indexSql ) ; statement . close ( ) ; long took = ( System . currentTimeMillis ( ) ) - startTime ; CreateLocationOverlapIndex . LOG . info ( ( ( ( ( "Created<seq2seq4repair_space>" + ( CreateLocationOverlapIndex . RANGE_TYPE ) ) + "<seq2seq4repair_space>index<seq2seq4repair_space>on<seq2seq4repair_space>location,<seq2seq4repair_space>took:<seq2seq4repair_space>" ) + took ) + "ms." ) ) ; } catch ( SQLException e ) { throw new SQLException ( ( ( "Failed<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>location__" + ( CreateLocationOverlapIndex . RANGE_TYPE ) ) + ".<seq2seq4repair_space>You<seq2seq4repair_space>likely<seq2seq4repair_space>have<seq2seq4repair_space>bad<seq2seq4repair_space>locations.<seq2seq4repair_space>" ) , e ) ; } finally { con . close ( ) ; } } else if ( osw . getSchema ( ) . hasBioSeg ( ) ) { Connection con = db . getConnection ( ) ; try { con . setAutoCommit ( false ) ; String indexSql = "CREATE<seq2seq4repair_space>INDEX<seq2seq4repair_space>location__bioseg<seq2seq4repair_space>ON<seq2seq4repair_space>location<seq2seq4repair_space>" + "USING<seq2seq4repair_space>gist<seq2seq4repair_space>(bioseg_create(intermine_start,<seq2seq4repair_space>intermine_end))" ; Statement statement = con . createStatement ( ) ; statement . executeUpdate ( indexSql ) ; statement . close ( ) ; con . commit ( ) ; } finally { con . close ( ) ; } } else { throw new IllegalArgumentException ( ( "Attempt<seq2seq4repair_space>to<seq2seq4repair_space>create<seq2seq4repair_space>index<seq2seq4repair_space>for<seq2seq4repair_space>range<seq2seq4repair_space>queries<seq2seq4repair_space>on" + ( "<seq2seq4repair_space>location<seq2seq4repair_space>table<seq2seq4repair_space>but<seq2seq4repair_space>database<seq2seq4repair_space>doesn't<seq2seq4repair_space>support<seq2seq4repair_space>Postgres<seq2seq4repair_space>built<seq2seq4repair_space>in<seq2seq4repair_space>ranges<seq2seq4repair_space>(has" + "<seq2seq4repair_space>to<seq2seq4repair_space>be<seq2seq4repair_space>><seq2seq4repair_space>9.2)<seq2seq4repair_space>and<seq2seq4repair_space>doesn't<seq2seq4repair_space>have<seq2seq4repair_space>bioseg<seq2seq4repair_space>installed.<seq2seq4repair_space>Aborting." ) ) ) ; } } private boolean hasIndexAlready ( Connection con ) throws SQLException { } }

Fix:
String indexSql = ( ( ( ( "CREATE<seq2seq4repair_space>INDEX<seq2seq4repair_space>location__int4range<seq2seq4repair_space>" + "ON<seq2seq4repair_space>location<seq2seq4repair_space>USING<seq2seq4repair_space>" ) + indexType ) + "<seq2seq4repair_space>(" ) + ( CreateLocationOverlapIndex . RANGE_TYPE ) ) + "(intermine_start,<seq2seq4repair_space>intermine_end<seq2seq4repair_space>+<seq2seq4repair_space>1))" ;