Buggy code:
public class SedStackerStacker { private SherpaClient client ; private SAMPController controller ; private static String STACK_MTYPE = "stack.stack" ; public SedStackerStacker ( SAMPController controller ) { } public ExtSed stack ( SedStack stack ) throws Exception { } public ExtSed stack ( SedStack stack , StackConfiguration stackConfig ) throws Exception { if ( stack . getSeds ( ) . isEmpty ( ) ) { <START_BUG> NarrowOptionPane . showMessageDialog ( null , "Stack<seq2seq4repair_space>is<seq2seq4repair_space>empty.<seq2seq4repair_space>Please<seq2seq4repair_space>add<seq2seq4repair_space>SEDs<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>stack<seq2seq4repair_space>to<seq2seq4repair_space>normalize." , "Empty<seq2seq4repair_space>Stack" , ERROR_MESSAGE ) ; <END_BUG> throw new SedNoDataException ( ) ; } try { client . findSherpa ( ) ; } catch ( SampException ex ) { NarrowOptionPane . showMessageDialog ( null , ( "Error<seq2seq4repair_space>stacking:<seq2seq4repair_space>" + "Iris<seq2seq4repair_space>could<seq2seq4repair_space>not<seq2seq4repair_space>find<seq2seq4repair_space>the<seq2seq4repair_space>Sherpa<seq2seq4repair_space>process<seq2seq4repair_space>running<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>background.<seq2seq4repair_space>Please<seq2seq4repair_space>check<seq2seq4repair_space>the<seq2seq4repair_space>Troubleshooting<seq2seq4repair_space>section<seq2seq4repair_space>in<seq2seq4repair_space>the<seq2seq4repair_space>Iris<seq2seq4repair_space>documentation." ) , "Cannot<seq2seq4repair_space>connect<seq2seq4repair_space>to<seq2seq4repair_space>Sherpa" , ERROR_MESSAGE ) ; throw new Exception ( "Sherpa<seq2seq4repair_space>not<seq2seq4repair_space>found" ) ; } convertUnits ( stack , stackConfig . getBinsizeUnit ( ) , stackConfig . getYUnits ( ) ) ; int numOfBins = calculateNumberOfBins ( stack , stack . getConf ( ) . getStackConfiguration ( ) . isLogbin ( ) ) ; if ( numOfBins > 500000 ) { NarrowOptionPane . showMessageDialog ( null , ( ( ( "Too<seq2seq4repair_space>many<seq2seq4repair_space>bins<seq2seq4repair_space>(number<seq2seq4repair_space>of<seq2seq4repair_space>bins<seq2seq4repair_space>calculated:<seq2seq4repair_space>" + numOfBins ) + ").<seq2seq4repair_space>" ) + "Make<seq2seq4repair_space>the<seq2seq4repair_space>binsize<seq2seq4repair_space>smaller,<seq2seq4repair_space>or<seq2seq4repair_space>use<seq2seq4repair_space>logarithmic<seq2seq4repair_space>binning." ) , "ERROR" , JOptionPane . ERROR_MESSAGE ) ; throw new StackException ( ( ( "Too<seq2seq4repair_space>many<seq2seq4repair_space>bins<seq2seq4repair_space>(number<seq2seq4repair_space>of<seq2seq4repair_space>bins<seq2seq4repair_space>calculated:<seq2seq4repair_space>" + numOfBins ) + ").<seq2seq4repair_space>Make<seq2seq4repair_space>the<seq2seq4repair_space>binsize<seq2seq4repair_space>smaller<seq2seq4repair_space>or<seq2seq4repair_space>use<seq2seq4repair_space>log<seq2seq4repair_space>binning." ) ) ; } SedStackerStackPayload payload = ( ( SedStackerStackPayload ) ( SAMPFactory . get ( SedStackerStackPayload . class ) ) ) ; for ( int i = 0 ; i < ( stack . getSeds ( ) . size ( ) ) ; i ++ ) { SegmentPayload segment = ( ( SegmentPayload ) ( SAMPFactory . get ( SegmentPayload . class ) ) ) ; segment . setX ( stack . getSed ( i ) . getSegment ( 0 ) . getSpectralAxisValues ( ) ) ; segment . setY ( stack . getSed ( i ) . getSegment ( 0 ) . getFluxAxisValues ( ) ) ; segment . setYerr ( ( ( double [ ] ) ( stack . getSed ( i ) . getSegment ( 0 ) . getDataValues ( E_UTYPE ) ) ) ) ; payload . addSegment ( segment ) ; } if ( stackConfig . getStatistic ( ) . equals ( "Average" ) ) { payload . setStatistic ( "avg" ) ; } else if ( stackConfig . getStatistic ( ) . equals ( "Weighted<seq2seq4repair_space>Avg" ) ) { payload . setStatistic ( "wavg" ) ; } else if ( stackConfig . getStatistic ( ) . equals ( "Sum" ) ) { payload . setStatistic ( "sum" ) ; } else { payload . setStatistic ( "avg" ) ; } payload . setBinsize ( stackConfig . getBinsize ( ) ) ; payload . setLogBin ( stackConfig . isLogbin ( ) ) ; payload . setSmooth ( stackConfig . isSmooth ( ) ) ; payload . setSmoothBinsize ( stackConfig . getSmoothBinsize ( ) ) ; SAMPMessage message = SAMPFactory . createMessage ( SedStackerStacker . STACK_MTYPE , payload , SedStackerStackPayload . class ) ; Response rspns = controller . callAndWait ( client . findSherpa ( ) , message . get ( ) , 10 ) ; if ( client . isException ( rspns ) ) { Exception ex = client . getException ( rspns ) ; NarrowOptionPane . showMessageDialog ( null , "A<seq2seq4repair_space>stacking<seq2seq4repair_space>error<seq2seq4repair_space>has<seq2seq4repair_space>occured.<seq2seq4repair_space>Please<seq2seq4repair_space>check<seq2seq4repair_space>the<seq2seq4repair_space>Iris<seq2seq4repair_space>documentation." , "ERROR" , JOptionPane . ERROR_MESSAGE ) ; throw ex ; } SedStackerStackPayload response = ( ( SedStackerStackPayload ) ( SAMPFactory . get ( rspns . getResult ( ) , SedStackerStackPayload . class ) ) ) ; SegmentPayload segment = response . getSegments ( ) . get ( 0 ) ; Segment seg = new Segment ( ) ; seg . setFluxAxisValues ( segment . getY ( ) ) ; seg . setSpectralAxisValues ( segment . getX ( ) ) ; seg . setDataValues ( segment . getYerr ( ) , E_UTYPE ) ; seg . setFluxAxisUnits ( stackConfig . getYUnits ( ) ) ; seg . setSpectralAxisUnits ( stackConfig . getBinsizeUnit ( ) ) ; ExtSed stackedSed = new ExtSed ( ( ( ( stack . getName ( ) ) + "_stacked_" ) + ( stackConfig . getStatistic ( ) ) ) ) ; stackedSed . addSegment ( seg ) ; stackedSed . addAttachment ( SedStackerAttachments . COUNTS , segment . getCounts ( ) ) ; return stackedSed ; } private void convertUnits ( SedStack stack , String xUnits , String yUnits ) throws SedException , UnitsException { } private void convertUnits ( SedStack stack , List < String > xUnits , List < String > yUnits ) throws SedException , UnitsException { } private static double [ ] convertXValues ( double [ ] values , String fromUnits , String toUnits ) throws UnitsException { } private int calculateNumberOfBins ( SedStack stack , Boolean log ) throws SedNoDataException { } No newline ; at end ; of file ; }

Fix:
NarrowOptionPane . showMessageDialog ( null , "Stack<seq2seq4repair_space>is<seq2seq4repair_space>empty.<seq2seq4repair_space>Please<seq2seq4repair_space>add<seq2seq4repair_space>SEDs<seq2seq4repair_space>to<seq2seq4repair_space>the<seq2seq4repair_space>stack<seq2seq4repair_space>to<seq2seq4repair_space>stack." , "Empty<seq2seq4repair_space>Stack" , ERROR_MESSAGE ) ;