Buggy code:
public class IndexPoiCreator extends AbstractIndexPartCreator { private static final Log log = LogFactory . getLog ( IndexPoiCreator . class ) ; private Connection poiConnection ; private File poiIndexFile ; private PreparedStatement poiPreparedStatement ; private static final int ZOOM_TO_SAVE_END = 16 ; private static final int ZOOM_TO_SAVE_START = 6 ; private static final int ZOOM_TO_WRITE_CATEGORIES_START = 12 ; private static final int ZOOM_TO_WRITE_CATEGORIES_END = 16 ; private static final int CHARACTERS_TO_BUILD = 4 ; private boolean useInMemoryCreator = true ; private List < Amenity > tempAmenityList = new ArrayList < Amenity > ( ) ; private Map < EntityId , Map < String , String > > propogatedTags = new LinkedHashMap < Entity . EntityId , Map < String , String > > ( ) ; private final MapRenderingTypes renderingTypes ; public IndexPoiCreator ( MapRenderingTypes renderingTypes ) { } public void iterateEntity ( Entity e , OsmDbAccessorContext ctx ) throws SQLException { } public void iterateRelation ( Relation e , OsmDbAccessorContext ctx ) throws SQLException { } public void commitAndClosePoiFile ( Long lastModifiedDate ) throws SQLException { } public void removePoiFile ( ) { } public void checkEntity ( Entity e ) { } private void insertAmenityIntoPoi ( Amenity amenity ) throws SQLException { } private static final char SPECIAL_CHAR = ( ( char ) ( - 1 ) ) ; private String encodeAdditionalInfo ( Map < String , String > tempNames , String name , String nameEn ) { if ( ! ( Algorithms . isEmpty ( name ) ) ) { tempNames . put ( "name" , name ) ; } if ( ( ! ( Algorithms . isEmpty ( nameEn ) ) ) && ( ! ( Algorithms . objectEquals ( name , nameEn ) ) ) ) { tempNames . put ( "name:en" , nameEn ) ; } StringBuilder b = new StringBuilder ( ) ; for ( Map . Entry < String , String > e : tempNames . entrySet ( ) ) { MapRulType rulType = renderingTypes . getAmenityRuleType ( e . getKey ( ) , e . getValue ( ) ) ; if ( rulType == null ) { throw new IllegalStateException ( ( ( ( "Can't<seq2seq4repair_space>retrieve<seq2seq4repair_space>amenity<seq2seq4repair_space>rule<seq2seq4repair_space>type<seq2seq4repair_space>" + ( e . getKey ( ) ) ) + "<seq2seq4repair_space>" ) + ( e . getValue ( ) ) ) ) ; } if ( ( ! ( rulType . isText ( ) ) ) || ( ! ( Algorithms . isEmpty ( e . getValue ( ) ) ) ) ) { if ( ( b . length ( ) ) > 0 ) { b . append ( IndexPoiCreator . SPECIAL_CHAR ) ; } if ( ( rulType . isAdditional ( ) ) && ( ( rulType . getValue ( ) ) == null ) ) { throw new IllegalStateException ( ( ( ( ( "Additional<seq2seq4repair_space>rule<seq2seq4repair_space>type<seq2seq4repair_space>'" + ( rulType . getTag ( ) ) ) + "'<seq2seq4repair_space>should<seq2seq4repair_space>be<seq2seq4repair_space>encoded<seq2seq4repair_space>with<seq2seq4repair_space>value<seq2seq4repair_space>'" ) + ( e . getValue ( ) ) ) + "'" ) ) ; } <START_BUG> b . append ( ( ( ( char ) ( rulType . getInternalId ( ) ) ) + 1 ) ) . append ( e . getValue ( ) ) ; <END_BUG> } } return b . toString ( ) ; } private Map < MapRulType , String > decodeAdditionalInfo ( String name , Map < MapRulType , String > tempNames ) { } public void createDatabaseStructure ( File poiIndexFile ) throws SQLException { } private class IntBbox { int minX = Integer . MAX_VALUE ; int maxX = 0 ; int minY = Integer . MAX_VALUE ; int maxY = 0 ; } public static class PoiCreatorCategories { Map < String , Set < String > > categories = new HashMap < String , Set < String > > ( ) ; Set < MapRulType > additionalAttributes = new HashSet < MapRenderingTypes . MapRulType > ( ) ; Map < String , Integer > catIndexes ; Map < String , Integer > subcatIndexes ; TIntArrayList cachedCategoriesIds ; TIntArrayList cachedAdditionalIds ; TIntArrayList singleThreadVarTypes = new TIntArrayList ( ) ; private String [ ] split ( String subCat ) { } private boolean toSplit ( String subCat ) { } public void addCategory ( String cat , String subCat , Map < MapRulType , String > additionalTags ) { } public TIntArrayList buildTypeIds ( String category , String subcategory ) { } private void internalBuildType ( String category , String subcategory , TIntArrayList types ) { } public void buildCategoriesToWrite ( IndexPoiCreator . PoiCreatorCategories globalCategories ) { } public void setSubcategoryIndex ( String cat , String sub , int j ) { } public void setCategoryIndex ( String cat , int i ) { } } public void writeBinaryPoiIndex ( BinaryMapIndexWriter writer , String regionName , IProgress progress ) throws IOException , SQLException { } private void processPOIIntoTree ( Map < String , Set < IndexPoiCreator . PoiTileBox > > namesIndex , int zoomToStart , IndexPoiCreator . IntBbox bbox , IndexPoiCreator . Tree < IndexPoiCreator . PoiTileBox > rootZoomsTree ) throws SQLException { } public void addNamePrefix ( String name , String nameEn , IndexPoiCreator . PoiTileBox data , Map < String , Set < IndexPoiCreator . PoiTileBox > > poiData ) { } private void parsePrefix ( String name , IndexPoiCreator . PoiTileBox data , Map < String , Set < IndexPoiCreator . PoiTileBox > > poiData ) { } private void writePoiBoxes ( BinaryMapIndexWriter writer , IndexPoiCreator . Tree < IndexPoiCreator . PoiTileBox > tree , long startFpPoiIndex , Map < IndexPoiCreator . PoiTileBox , List < BinaryFileReference > > fpToWriteSeeks , IndexPoiCreator . PoiCreatorCategories globalCategories ) throws IOException , SQLException { } private static class PoiData { int x ; int y ; String type ; String subtype ; long id ; Map < MapRulType , String > additionalTags = new HashMap < MapRulType , String > ( ) ; } public static class PoiTileBox { int x ; int y ; int zoom ;

Fix:
b . append ( ( ( char ) ( ( rulType . getInternalId ( ) ) + 1 ) ) ) . append ( e . getValue ( ) ) ;