Buggy code:
public class NTriplesToJsonLd implements Tool { private static final int NODES = 4 ; private static final int SLOTS = 8 ; private static final String NEWLINE = "\n" ; static final String INDEX_NAME = "index.name" ; static final String INDEX_TYPE = "index.type" ; private static final Logger LOG = LoggerFactory . getLogger ( NTriplesToJsonLd . class ) ; private Configuration conf ; private String indexName ; private Client client = NTriplesToJsonLd . CLIENT ; private String aliasSuffix = "-testing" ; private boolean update = false ; private static final String ES_NODE = "193.30.112.171" ; private static final InetSocketTransportAddress NODE_1 = new InetSocketTransportAddress ( NTriplesToJsonLd . ES_NODE , 9300 ) ; private static final InetSocketTransportAddress NODE_2 = new InetSocketTransportAddress ( "193.30.112.172" , 9300 ) ; private static final TransportClient TC = new TransportClient ( ImmutableSettings . settingsBuilder ( ) . put ( "cluster.name" , "quaoar" ) . put ( "client.transport.sniff" , false ) . put ( "client.transport.ping_timeout" , 20 , TimeUnit . SECONDS ) . build ( ) ) ; private static final Client CLIENT = NTriplesToJsonLd . TC . addTransportAddress ( NTriplesToJsonLd . NODE_1 ) . addTransportAddress ( NTriplesToJsonLd . NODE_2 ) ; public static final String INTERNAL_PARENT = "internal_parent" ; public static final String INTERNAL_ID = "internal_id" ; public static void main ( final String [ ] args ) { } @ Override public int run ( String [ ] args ) throws Exception { } private void getNewestIndex ( ) { } private void createIndex ( ) { } private static String config ( ) { } private void setIndexRefreshInterval ( Client client , String setting ) { } private void updateAliases ( final String name , final String suffix ) { final SortedSetMultimap < String , String > indices = groupByIndexCollection ( ) ; for ( String prefix : indices . keySet ( ) ) { final SortedSet < String > indicesForPrefix = indices . get ( prefix ) ; final String newIndex = indicesForPrefix . last ( ) ; final String newAlias = prefix + suffix ; NTriplesToJsonLd . LOG . info ( String . format ( "Prefix<seq2seq4repair_space>'%s',<seq2seq4repair_space>newest<seq2seq4repair_space>index:<seq2seq4repair_space>%s" , prefix , newIndex ) ) ; removeOldAliases ( indicesForPrefix , newAlias ) ; <START_BUG> if ( ! ( newIndex . equals ( indicesForPrefix ) ) ) <END_BUG> createNewAlias ( newIndex , newAlias ) ; deleteOldIndices ( name , indicesForPrefix ) ; } } private SortedSetMultimap < String , String > groupByIndexCollection ( ) { } private void removeOldAliases ( final SortedSet < String > indicesForPrefix , final String newAlias ) { } private void createNewAlias ( final String newIndex , final String newAlias ) { } private void deleteOldIndices ( final String name , final SortedSet < String > allIndices ) { } private Set < String > aliases ( final String name ) { } static final class NTriplesToJsonLdMapper extends Mapper < LongWritable , Text , Text , Text > { private Reader reader ; private String prefix ; private Set < String > predicates ; @ Override protected void setup ( Context context ) throws IOException , InterruptedException { } private static URI findMapFile ( final URI [ ] localCacheFiles , final String rawMapFileName ) { } private void initMapFileReader ( final Path mapFilePath ) throws FileNotFoundException , IOException { } @ Override public void map ( final LongWritable key , final Text value , final Context context ) throws IOException , InterruptedException { } private void mapSubjectsToTheirTriples ( final Text value , final Context context , final String val , final Triple triple ) throws IOException , InterruptedException { } private boolean subjectIsUriToBeCollected ( final Triple triple ) { } private static boolean objectIsUnresolvedBlankNode ( final Triple triple ) { } private void writeAdditionalSubjects ( final String subject , final Text value , final Context context ) throws IOException , InterruptedException { } private static String wrapped ( final String string ) { } } static final class NTriplesToJsonLdReducer extends Reducer < Text , Text , Text , Text > { @ Override public void reduce ( final Text key , final Iterable < Text > values , final Context context ) throws IOException , InterruptedException { } private static String concatTriples ( final Iterable < Text > values ) { } private static void validate ( final String val ) { } private static String fixInvalidUriLiterals ( Text value ) { } } @ Override public Configuration getConf ( ) { } @ Override public void setConf ( Configuration conf ) { } }

Fix:
if ( ! ( name . equals ( newAlias ) ) )