Buggy code:
public synchronized String [ ] getCSVColumnNames ( String csvFile ) throws RemoteException { } public synchronized String [ ] listDBFFileColumns ( String dbfFileName ) throws RemoteException { } private synchronized String correctFileNameCase ( String fileName ) { } private List < String > getSortedUniqueValues ( List < String > values , boolean moveEmptyStringToEnd ) { } public void uploadFile ( String fileName , InputStream content ) throws RemoteException { } public synchronized List < String > getUploadedFileNames ( ) throws RemoteException { } private boolean valueIsInt ( String value ) { } private boolean valueIsDouble ( String value ) { } private boolean valueHasLeadingZero ( String value ) { } public synchronized String importCSV ( String connectionName , String password , String csvFile , String csvKeyColumn , String csvSecondaryKeyColumn , String sqlSchema , String sqlTable , boolean sqlOverwrite , String configDataTableName , boolean configOverwrite , String configGeometryCollectionName , String configKeyType , String [ ] nullValues , String [ ] filterColumnNames ) throws RemoteException { } public synchronized String addConfigDataTableFromDatabase ( String connectionName , String password , String schemaName , String tableName , String keyColumnName , String secondaryKeyColumnName , String configDataTableName , boolean configOverwrite , String geometryCollectionName , String keyType , String [ ] filterColumnNames ) throws RemoteException { } private synchronized String addConfigDataTable ( ISQLConfig config , boolean configOverwrite , String configDataTableName , String connectionName , String geometryCollectionName , String keyType , String keyColumnName , String secondarySqlKeyColumn , String [ ] configColumnNames , String [ ] sqlColumnNames , String sqlSchema , String sqlTable , boolean ignoreKeyColumnQueries , String [ ] filterColumnNames ) throws RemoteException { } private String testQueryAndGetDataType ( Connection conn , String query ) throws RemoteException { } private String buildFilteredColumnTitle ( String columnName , SQLResult filteredValues , int filteredValueRow ) { } private String buildFilteredQuery ( Connection conn , String unfilteredQuery , SQLResult filteredValues , int filteredValueRow ) throws IllegalArgumentException , SQLException { } public synchronized String convertShapefileToSQLStream ( String configConnectionName , String password , String [ ] fileNameWithoutExtension , String [ ] keyColumns , String sqlSchema , String sqlTablePrefix , boolean sqlOverwrite , String configGeometryCollectionName , boolean configOverwrite , String configKeyType , String projectionSRS , String [ ] nullValues ) throws RemoteException { sqlTablePrefix = sqlTablePrefix . toLowerCase ( ) ; ISQLConfig config = checkPasswordAndGetConfig ( configConnectionName , password ) ; ConnectionInfo connInfo = config . getConnectionInfo ( configConnectionName ) ; if ( sqlOverwrite && ( ! ( connInfo . is_superuser ) ) ) throw new RemoteException ( String . format ( "User<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>permission<seq2seq4repair_space>to<seq2seq4repair_space>overwrite<seq2seq4repair_space>SQL<seq2seq4repair_space>tables." , configConnectionName ) ) ; if ( ! ( SQLConfigUtils . userCanModifyGeometryCollection ( config , configConnectionName , configGeometryCollectionName ) ) ) throw new RemoteException ( String . format ( "User<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>have<seq2seq4repair_space>permission<seq2seq4repair_space>to<seq2seq4repair_space>overwrite<seq2seq4repair_space>GeometryCollection<seq2seq4repair_space>\"%s\"." , configConnectionName , configGeometryCollectionName ) ) ; if ( ! configOverwrite ) { if ( ( ListUtils . findIgnoreCase ( configGeometryCollectionName , config . getGeometryCollectionNames ( null ) ) ) >= 0 ) throw new RemoteException ( String . format ( "Shapes<seq2seq4repair_space>not<seq2seq4repair_space>imported.<seq2seq4repair_space>SQLConfig<seq2seq4repair_space>geometryCollection<seq2seq4repair_space>\"%s\"<seq2seq4repair_space>already<seq2seq4repair_space>exists." , configGeometryCollectionName ) ) ; } String dbfTableName = sqlTablePrefix + "_dbfdata" ; Connection conn = null ; try { conn = SQLConfigUtils . getConnection ( config , configConnectionName ) ; storeDBFDataToDatabase ( configConnectionName , password , fileNameWithoutExtension , sqlSchema , dbfTableName , sqlOverwrite , nullValues ) ; GeometryStreamConverter converter = new GeometryStreamConverter ( new SQLGeometryStreamDestination ( conn , sqlSchema , sqlTablePrefix , sqlOverwrite ) ) ; for ( String file : fileNameWithoutExtension ) { String shpfile = ( ( uploadPath ) + file ) + ".shp" ; SHPGeometryStreamUtils . convertShapefile ( converter , shpfile , Arrays . asList ( keyColumns ) ) ; } converter . flushAndCommitAll ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new RemoteException ( "Shapefile<seq2seq4repair_space>import<seq2seq4repair_space>failed" , e ) ; } finally { SQLUtils . cleanup ( conn ) ; } String fileList = Arrays . asList ( fileNameWithoutExtension ) . toString ( ) ; if ( ( fileList . length ( ) ) > 103 ) fileList = ( ( fileList . substring ( 0 , 50 ) ) + "..." ) + ( fileList . substring ( ( ( fileList . length ( ) ) - 50 ) ) ) ; <START_BUG> String importNotes = String . format ( "file:<seq2seq4repair_space>%s,<seq2seq4repair_space>keyColumns:<seq2seq4repair_space>%s" , fileList , keyColumns ) ; <END_BUG> String keyColumnsString ; if ( ( keyColumns . length ) == 1 ) { keyColumnsString = keyColumns [ 0 ] ; } else { keyColumnsString = "CONCAT(" ; for ( int i = 0 ; i < ( keyColumns . length ) ; i ++ ) { if ( i > 0 ) keyColumnsString += "," ; keyColumnsString += ( "CAST(" + ( keyColumns [ i ] ) ) + "<seq2seq4repair_space>AS<seq2seq4repair_space>CHAR)" ; } keyColumnsString += ")" ; } String [ ] columnNames = getColumnsList ( configConnectionName , sqlSchema , dbfTableName ) . toArray ( new String [ 0 ] ) ; String resultAddSQL = addConfigDataTable ( config , configOverwrite , configGeometryCollectionName , configConnectionName , configGeometryCollectionName , configKeyType , keyColumnsString , null , columnNames , columnNames , sqlSchema , dbfTableName , false , null ) ; return ( resultAddSQL + "\n\n" ) + ( addConfigGeometryCollection ( configOverwrite , configConnectionName , password , configGeometryCollectionName , configKeyType , sqlSchema , sqlTablePrefix , projectionSRS , importNotes ) ) ; } public synchronized String storeDBFDataToDatabase ( String configConnectionName , String password , String [ ] fileNameWithoutExtension , String sqlSchema , String sqlTableName , boolean sqlOverwrite , String [ ] nullValues ) throws RemoteException { } public synchronized String addConfigGeometryCollection ( boolean configOverwrite , String configConnectionName , String password , String configGeometryCollectionName , String configKeyType , String sqlSchema , String sqlTablePrefix , String projectionSRS , String importNotes ) throws RemoteException { } public synchronized void addDCElements ( String connectionName , String password , String dataTableName , Map < String , Object > elements ) throws RemoteException { } public synchronized DublinCoreElement [ ] listDCElements ( String connectionName , String password , String dataTableName ) throws RemoteException { }

Fix:
String importNotes = String . format ( "file:<seq2seq4repair_space>%s,<seq2seq4repair_space>keyColumns:<seq2seq4repair_space>%s" , fileList , Arrays . asList ( keyColumns ) ) ;