private void sawSwitch ( int pc ) { int [ ] offsets = getSwitchOffsets ( ) ; List < Integer > targets = new ArrayList <> ( offsets . length ) ; for ( int offset : offsets ) { targets . add ( Integer . valueOf ( offset + pc ) ) ; } Integer defOffset = Integer . valueOf ( getDefaultSwitchOffset ( ) + pc ) ; if ( ! targets . contains ( defOffset ) ) { targets . add ( defOffset ) ; } Collections . sort ( targets ) ; Integer lastTarget = targets . get ( 0 ) ; for ( int i = 1 ; i < targets . size ( ) ; i ++ ) { Integer nextTarget = targets . get ( i ) ; ScopeBlock sb = new ScopeBlock ( lastTarget . intValue ( ) , nextTarget . intValue ( ) ) ; sb . setCase ( ) ; rootScopeBlock . addChild ( sb ) ; lastTarget = nextTarget ; } for ( Integer target : targets ) { switchTargets . set ( target . intValue ( ) ) ; } }
creates a new scope block for each case statement