1 Replies Last post: May 2, 2012 4:22 PM by Maxim Mossienko  
HamsterofDeath  Apprentice 690 posts since
Jan 19, 2004
Currently Being Moderated

Apr 30, 2012 2:12 PM

how to find all while(iterator.hasNext) loops which remove elements?

my template looks like:

 

$TYPE$ $iterator$ = $getIter$;
$statements$;
while ($iterator$.hasNext()) {
     $statements$;
     $iterator$.remove();
     $statements$;
}
 
 

 

 

the problem is this only matches "flat code" like

 

while () {

 

....

iterator.remove();

....

}

 

if there is a switch/if/any block around the remove, it won't match. how can i tell idea to ignore the block depth?

Maxim Mossienko JetBrains 1,513 posts since
Sep 5, 2002
Currently Being Moderated
May 2, 2012 4:22 PM in response to: HamsterofDeath
Re: how to find all while(iterator.hasNext) loops which remove elements?

This is not currently possible

More Like This

  • Retrieving data ...