Buggy code:
public class SensorDataProducerImpl extends DefaultDataProducer implements SensorDataProducer , DeviceReader , TickListener { private static final Logger logger = Logger . getLogger ( SensorDataProducerImpl . class . getCanonicalName ( ) ) ; public int startTimer = 0 ; protected Ticker ticker = null ; protected UserMessageHandler messageHandler ; protected float [ ] processedData ; private static final int DEFAULT_BUFFERED_SAMPLE_NUM = 1000 ; int timeWithoutData = 0 ; protected String [ ] okOptions ; protected String [ ] continueOptions ; public static final int DATA_TIME_OUT = 20 ; private boolean inDeviceRead ; private int totalDataRead ; private SensorDevice device ; private ExperimentConfig experimentConfig = null ; protected float dataTimeOffset ; public SensorDataProducerImpl ( SensorDevice device , Ticker t , UserMessageHandler h ) { } public void tick ( ) { } public void tickStopped ( ) { } public int flushData ( int numSamples ) { } protected int getBufferedSampleNum ( ) { } public ExperimentConfig configure ( ExperimentRequest request ) { } protected String getFullDeviceName ( ) { } protected void sendWrongSensorAttachedMessage ( ExperimentRequest request , ExperimentConfig actualConfig ) { SensorRequest [ ] sensorRequests = request . getSensorRequests ( ) ; SensorConfig [ ] sensorConfigs = actualConfig . getSensorConfigs ( ) ; if ( ! ( device . canDetectSensors ( ) ) ) { messageHandler . showMessage ( ( ( "Device<seq2seq4repair_space>Error:<seq2seq4repair_space>The<seq2seq4repair_space>" + ( getFullDeviceName ( ) ) ) + "<seq2seq4repair_space>can't<seq2seq4repair_space>identify<seq2seq4repair_space>sensors<seq2seq4repair_space>and<seq2seq4repair_space>rejected<seq2seq4repair_space>the<seq2seq4repair_space>requested<seq2seq4repair_space>sensors" ) , "Device<seq2seq4repair_space>Error" ) ; return ; } if ( ( sensorRequests == null ) || ( ( sensorRequests . length ) == 0 ) ) { String body = "Configuration<seq2seq4repair_space>Error:<seq2seq4repair_space>No<seq2seq4repair_space>sensors<seq2seq4repair_space>types<seq2seq4repair_space>were<seq2seq4repair_space>specified." ; String deviceError = device . getErrorMessage ( 0 ) ; if ( deviceError != null ) { body += "\n" + deviceError ; } String invalidReason = experimentConfig . getInvalidReason ( ) ; if ( invalidReason != null ) { body += "\n" + invalidReason ; } messageHandler . showMessage ( body , "Configuration<seq2seq4repair_space>Error" ) ; return ; } if ( ( sensorConfigs == null ) || ( ( sensorConfigs . length ) == 0 ) ) { String body = ( "The<seq2seq4repair_space>" + ( getFullDeviceName ( ) ) ) + "<seq2seq4repair_space>reported<seq2seq4repair_space>no<seq2seq4repair_space>valid<seq2seq4repair_space>sensors<seq2seq4repair_space>are<seq2seq4repair_space>attached\n" ; body += "Check<seq2seq4repair_space>if<seq2seq4repair_space>the<seq2seq4repair_space>sensors<seq2seq4repair_space>attached<seq2seq4repair_space>correctly" ; String title = "No<seq2seq4repair_space>sensors<seq2seq4repair_space>attached" ; if ( ( messageHandler ) instanceof UserMessageHandlerExt1 ) { ( ( UserMessageHandlerExt1 ) ( messageHandler ) ) . showMessage ( body , title , SensorUtilJava . experimentRequestToString ( request ) ) ; } else { messageHandler . showMessage ( body , title ) ; } return ; } if ( ( ( sensorConfigs . length ) == 1 ) && ( ( sensorRequests . length ) == 1 ) ) { SensorConfig sensorConfig = sensorConfigs [ 0 ] ; SensorRequest sensorRequest = sensorRequests [ 0 ] ; float sensorTypeScore = SensorUtilJava . scoreSensorType ( sensorConfig , sensorRequest ) ; float valueRangeScore = SensorUtilJava . scoreValueRange ( sensorConfig , sensorRequest ) ; float stepSizeScore = SensorUtilJava . scoreStepSize ( sensorConfig , sensorRequest ) ; String title = null ; String body = null ; if ( sensorTypeScore < 0.1F ) { title = "Wrong<seq2seq4repair_space>Sensor<seq2seq4repair_space>Attached" ; body = ( "This<seq2seq4repair_space>data<seq2seq4repair_space>collection<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>" + ( SensorUtilJava . getTypeConstantName ( sensorRequest . getType ( ) ) ) ) + "<seq2seq4repair_space>sensor.\n" ; <START_BUG> body += ( "However<seq2seq4repair_space>a<seq2seq4repair_space>" + ( sensorConfig . getName ( ) ) ) + "<seq2seq4repair_space>is<seq2seq4repair_space>attached" ; <END_BUG> } else if ( valueRangeScore < 0.6F ) { title = "Wrong<seq2seq4repair_space>Sensor<seq2seq4repair_space>Range" ; body = ( "This<seq2seq4repair_space>data<seq2seq4repair_space>collection<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>sensor<seq2seq4repair_space>that<seq2seq4repair_space>can<seq2seq4repair_space>measure<seq2seq4repair_space>up<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( sensorRequest . getRequiredMax ( ) ) ) + "\n" ; if ( sensorConfig instanceof SensorConfigImpl ) { body += ( "<seq2seq4repair_space>However<seq2seq4repair_space>the<seq2seq4repair_space>attached<seq2seq4repair_space>sensor<seq2seq4repair_space>can<seq2seq4repair_space>only<seq2seq4repair_space>measure<seq2seq4repair_space>up<seq2seq4repair_space>to:<seq2seq4repair_space>" + ( ( ( SensorConfigImpl ) ( sensorConfig ) ) . getValueRange ( ) . maximum ) ) + "\n" ; } body += "\n" ; body += "If<seq2seq4repair_space>the<seq2seq4repair_space>sensor<seq2seq4repair_space>has<seq2seq4repair_space>ranges<seq2seq4repair_space>switch,<seq2seq4repair_space>try<seq2seq4repair_space>another<seq2seq4repair_space>setting." ; } else if ( stepSizeScore < 0.1F ) { title = "Wrong<seq2seq4repair_space>Sensor<seq2seq4repair_space>Accuracy" ; body = "This<seq2seq4repair_space>data<seq2seq4repair_space>collection<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>more<seq2seq4repair_space>accurate<seq2seq4repair_space>sensor.\n" ; body += "\n" ; body += "If<seq2seq4repair_space>the<seq2seq4repair_space>sensor<seq2seq4repair_space>has<seq2seq4repair_space>a<seq2seq4repair_space>range<seq2seq4repair_space>switch,<seq2seq4repair_space>try<seq2seq4repair_space>another<seq2seq4repair_space>setting." ; } else { title = "Wrong<seq2seq4repair_space>Sensor<seq2seq4repair_space>Attached" ; body = "The<seq2seq4repair_space>attached<seq2seq4repair_space>sensor<seq2seq4repair_space>cannot<seq2seq4repair_space>be<seq2seq4repair_space>used<seq2seq4repair_space>by<seq2seq4repair_space>this<seq2seq4repair_space>data<seq2seq4repair_space>collection." ; } if ( ( messageHandler ) instanceof UserMessageHandlerExt1 ) { String details = SensorUtilJava . experimentRequestToString ( request ) ; details += "\n\n" ; details += SensorUtilJava . experimentConfigToString ( actualConfig ) ; ( ( UserMessageHandlerExt1 ) ( messageHandler ) ) . showMessage ( body , title , details ) ; } else { messageHandler . showMessage ( body , title ) ; } return ; } String title = "Wrong<seq2seq4repair_space>Sensor(s)<seq2seq4repair_space>Attached" ; String body = "The<seq2seq4repair_space>data<seq2seq4repair_space>collection<seq2seq4repair_space>requires<seq2seq4repair_space>a<seq2seq4repair_space>different<seq2seq4repair_space>set<seq2seq4repair_space>of<seq2seq4repair_space>sensors.\n" ; body += "<seq2seq4repair_space>see<seq2seq4repair_space>the<seq2seq4repair_space>details<seq2seq4repair_space>for<seq2seq4repair_space>more<seq2seq4repair_space>information" ; if ( ( messageHandler ) instanceof UserMessageHandlerExt1 ) { String details = SensorUtilJava . experimentRequestToString ( request ) ; details += "\n\n" ; details += SensorUtilJava . experimentConfigToString ( actualConfig ) ; ( ( UserMessageHandlerExt1 ) ( messageHandler ) ) . showMessage ( body , title , details ) ; } else { messageHandler . showMessage ( body , title ) ; } } public final void start ( ) { } public final void reset ( ) { } public final void stop ( ) { } protected void deviceStop ( boolean ticking ) { } public boolean isAttached ( ) { } @ Override public boolean isRunning ( ) { } @ Override public boolean isInInitialState ( ) { } public boolean canDetectSensors ( ) { } public ExperimentConfig getCurrentConfig ( ) { } public void close ( ) { } @ Override protected void notifyDataReceived ( ) { } }

Fix:
body += ( "Currently<seq2seq4repair_space>a<seq2seq4repair_space>" + ( sensorConfig . getName ( ) ) ) + "<seq2seq4repair_space>sensor<seq2seq4repair_space>is<seq2seq4repair_space>attached" ;