Buggy code:
public class OIndexManagerShared extends OIndexManagerAbstract implements OIndexManager { private static final long serialVersionUID = 1L ; protected volatile Thread recreateIndexesThread = null ; private volatile boolean rebuildCompleted = false ; public OIndexManagerShared ( final ODatabaseDocument iDatabase ) { } public OIndex < ? > getIndexInternal ( final String name ) { } public OIndex < ? > createIndex ( final String iName , final String iType , final OIndexDefinition indexDefinition , final int [ ] clusterIdsToIndex , OProgressListener progressListener , ODocument metadata ) { } public OIndex < ? > createIndex ( final String iName , final String iType , final OIndexDefinition indexDefinition , final int [ ] clusterIdsToIndex , OProgressListener progressListener , ODocument metadata , String algorithm ) { if ( getDatabase ( ) . getTransaction ( ) . isActive ( ) ) throw new IllegalStateException ( "Cannot<seq2seq4repair_space>create<seq2seq4repair_space>a<seq2seq4repair_space>new<seq2seq4repair_space>index<seq2seq4repair_space>inside<seq2seq4repair_space>a<seq2seq4repair_space>transaction" ) ; <START_BUG> final Character c = OSchemaShared . checkClassNameIfValid ( iName ) ; <END_BUG> if ( c != null ) throw new IllegalArgumentException ( ( ( ( ( "Invalid<seq2seq4repair_space>index<seq2seq4repair_space>name<seq2seq4repair_space>'" + iName ) + "'.<seq2seq4repair_space>Character<seq2seq4repair_space>'" ) + c ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>invalid" ) ) ; ODatabaseInternal database = getDatabase ( ) ; OStorage storage = database . getStorage ( ) ; algorithm = chooseTreeAlgorithm ( algorithm ) ; final String valueContainerAlgorithm = chooseContainerAlgorithm ( iType ) ; final OIndexInternal < ? > index ; acquireExclusiveLock ( ) ; try { if ( indexes . containsKey ( iName . toLowerCase ( ) ) ) throw new OIndexException ( ( ( "Index<seq2seq4repair_space>with<seq2seq4repair_space>name<seq2seq4repair_space>" + ( iName . toLowerCase ( ) ) ) + "<seq2seq4repair_space>already<seq2seq4repair_space>exists." ) ) ; if ( ( clusterIdsToIndex == null ) || ( ( clusterIdsToIndex . length ) == 0 ) ) { if ( metadata == null ) metadata = new ODocument ( ) ; Object durable = metadata . field ( "durableInNonTxMode" ) ; if ( ! ( durable instanceof Boolean ) ) metadata . field ( "durableInNonTxMode" , true ) ; if ( ( metadata . field ( "trackMode" ) ) == null ) metadata . field ( "trackMode" , "FULL" ) ; } index = OIndexes . createIndex ( getDatabase ( ) , iType , algorithm , valueContainerAlgorithm , metadata ) ; final String clusterName = ( ( indexDefinition != null ) && ( ( indexDefinition . getClassName ( ) ) != null ) ) ? defaultClusterName : manualClusterName ; if ( progressListener == null ) progressListener = new OIndexRebuildOutputListener ( index ) ; final Set < String > clustersToIndex = findClustersByIds ( clusterIdsToIndex , database ) ; if ( ( ( metadata != null ) && ( Boolean . FALSE . equals ( metadata . field ( "ignoreNullValues" ) ) ) ) && ( indexDefinition != null ) ) indexDefinition . setNullValuesIgnored ( false ) ; index . create ( iName , indexDefinition , clusterName , clustersToIndex , true , progressListener ) ; addIndexInternal ( index ) ; if ( metadata != null ) { final ODocument config = index . getConfiguration ( ) ; config . field ( "metadata" , metadata , EMBEDDED ) ; } setDirty ( ) ; save ( ) ; } finally { releaseExclusiveLock ( ) ; } if ( INDEX_FLUSH_AFTER_CREATE . getValueAsBoolean ( ) ) storage . synch ( ) ; return preProcessBeforeReturn ( index ) ; } private Set < String > findClustersByIds ( int [ ] clusterIdsToIndex , ODatabase database ) { } private String chooseContainerAlgorithm ( String type ) { } private String chooseTreeAlgorithm ( String algorithm ) { } public OIndexManager dropIndex ( final String iIndexName ) { } @ Override public ODocument toStream ( ) { } @ Override public void recreateIndexes ( ) { } @ Override public void waitTillIndexRestore ( ) { } public boolean autoRecreateIndexesAfterCrash ( ) { } @ Override protected void fromStream ( ) { } public void removeClassPropertyIndex ( final OIndex < ? > idx ) { } private class RecreateIndexesTask implements Runnable { private final ODatabaseDocumentTx newDb ; private final ODocument doc ; private int ok ; private int errors ; public RecreateIndexesTask ( ODatabaseDocumentTx newDb , ODocument doc ) { } @ Override public void run ( ) { } private void recreateIndexes ( Collection < ODocument > idxs ) { } private void recreateIndex ( ODocument idx ) { } private void createAutomaticIndex ( ODocument idx , OIndexInternal < ? > index , OIndexInternal . IndexMetadata indexMetadata , OIndexDefinition indexDefinition ) { } private void addIndexAsIs ( ODocument idx , OIndexInternal < ? > index , OIndexInternal . IndexMetadata indexMetadata ) { } private OIndexInternal < ? > createIndex ( ODocument idx ) { } private Collection < ODocument > getConfiguration ( ) { } private void setUpDatabase ( ) { } } }

Fix:
final Character c = OSchemaShared . checkFieldNameIfValid ( iName ) ;