Buggy code:
@ SuppressWarnings ( "unused" ) public class AWSDeviceFarmRecorder extends Recorder { public String projectName ; public String devicePoolName ; public String appArtifact ; public String runName ; public String testToRun ; public Boolean storeResults ; public Boolean isRunUnmetered ; public String eventCount ; public String eventThrottle ; public String seed ; public String username ; public String password ; public String appiumJavaJUnitTest ; public String appiumJavaTestNGTest ; public String appiumPythonTest ; public String calabashFeatures ; public String calabashTags ; public String calabashProfile ; public String junitArtifact ; public String junitFilter ; public String uiautomatorArtifact ; public String uiautomatorFilter ; public String uiautomationArtifact ; public String xctestArtifact ; public String xctestUiArtifact ; public PrintStream log ; public Boolean ignoreRunError ; @ DataBoundConstructor @ SuppressWarnings ( "unused" ) public AWSDeviceFarmRecorder ( String projectName , String devicePoolName , String appArtifact , String runName , String testToRun , Boolean storeResults , Boolean isRunUnmetered , String eventCount , String eventThrottle , String seed , String username , String password , String appiumJavaJUnitTest , String appiumJavaTestNGTest , String appiumPythonTest , String calabashFeatures , String calabashTags , String calabashProfile , String junitArtifact , String junitFilter , String uiautomatorArtifact , String uiautomatorFilter , String uiautomationArtifact , String xctestArtifact , String xctestUiArtifact , Boolean ignoreRunError ) { } private TestType stringToTestType ( String testTypeName ) { } public String isTestType ( String testTypeName ) { } @ Override public boolean perform ( AbstractBuild build , Launcher launcher , BuildListener listener ) throws IOException , InterruptedException { } private ScheduleRunConfiguration getScheduleRunConfiguration ( Boolean isRunUnmetered ) { } private Map < String , FilePath > getSuites ( AWSDeviceFarm adf , ScheduleRunResult run , Map < String , FilePath > jobs ) throws IOException , InterruptedException { } private Map < String , FilePath > getTests ( AWSDeviceFarm adf , ScheduleRunResult run , Map < String , FilePath > suites ) throws IOException , InterruptedException { } private Map < String , FilePath > getJobs ( AWSDeviceFarm adf , ScheduleRunResult run , FilePath resultsDir ) throws IOException , InterruptedException { Map < String , FilePath > jobs = new HashMap < String , FilePath > ( ) ; ListJobsResult result = adf . listJobs ( run . getRun ( ) . getArn ( ) ) ; for ( Job job : result . getJobs ( ) ) { String arn = job . getArn ( ) . split ( ":" ) [ 6 ] ; String jobId = arn . substring ( ( ( arn . lastIndexOf ( "//" ) ) + 1 ) ) ; String osVersion = null ; if ( ( job . getDevice ( ) ) != null ) { osVersion = job . getDevice ( ) . getOs ( ) ; } <START_BUG> jobs . put ( arn , new FilePath ( resultsDir , ( ( ( ( job . getName ( ) ) + "-" ) + osVersion ) != null ? osVersion : jobId ) ) ) ; <END_BUG> jobs . get ( arn ) . mkdirs ( ) ; } return jobs ; } private ScheduleRunTest getScheduleRunTest ( EnvVars env , AWSDeviceFarm adf , Project project ) throws IOException , InterruptedException , AWSDeviceFarmException { } private boolean validateConfiguration ( ) { } private boolean validateTestConfiguration ( ) { } private void writeToLog ( String msg ) { } public String getRoleArn ( ) { } public String getAkid ( ) { } public String getSkid ( ) { } public AWSDeviceFarm getAWSDeviceFarm ( ) { } @ Override public AWSDeviceFarmRecorder . DescriptorImpl getDescriptor ( ) { } @ Override public Collection < Action > getProjectActions ( AbstractProject < ? , ? > project ) { } public BuildStepMonitor getRequiredMonitorService ( ) { } @ Extension public static final class DescriptorImpl extends BuildStepDescriptor < Publisher > { public String roleArn ; public String akid ; public String skid ; private List < String > projectsCache = new ArrayList < String > ( ) ; private Map < String , List < String > > poolsCache = new HashMap < String , List < String > > ( ) ; public DescriptorImpl ( ) { } public AWSDeviceFarm getAWSDeviceFarm ( ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckRoleArn ( @ QueryParameter String roleArn ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckAkid ( @ QueryParameter String akid ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckSkid ( @ QueryParameter String skid ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckProjectName ( @ QueryParameter String projectName ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckDevicePoolName ( @ QueryParameter String devicePoolName ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckAppArtifact ( @ QueryParameter String appArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckAppiumJavaJUnitTest ( @ QueryParameter String appiumJavaJUnitTest ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckAppiumJavaTestNGTest ( @ QueryParameter String appiumJavaTestNGTest ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckAppiumPythonTest ( @ QueryParameter String appiumPythonTest ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckCalabashFeatures ( @ QueryParameter String calabashFeatures ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckJunitArtifact ( @ QueryParameter String junitArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckUiautomatorArtifact ( @ QueryParameter String uiautomatorArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckXctestArtifact ( @ QueryParameter String xctestArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckXctestUiArtifact ( @ QueryParameter String xctestUiArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doCheckIsRunUnmetered ( @ QueryParameter Boolean isRunUnmetered , @ QueryParameter String appArtifact ) { } @ SuppressWarnings ( "unused" ) public FormValidation doRefresh ( ) { } @ SuppressWarnings ( "unused" ) public ListBoxModel doFillProjectNameItems ( @ QueryParameter String currentProjectName ) { } @ SuppressWarnings ( "unused" ) public ListBoxModel doFillDevicePoolNameItems ( @ QueryParameter String projectName , @ QueryParameter String currentDevicePoolName ) { }

Fix:
jobs . put ( arn , new FilePath ( resultsDir , ( ( ( job . getName ( ) ) + "-" ) + ( osVersion != null ? osVersion : jobId ) ) ) ) ;