Loading src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ public class DeviceDetectedController extends AbstractSubController{ phone.setFlashingProcess(DeviceHelper.loadFlashProcess(phone.getAdbDevice())); phone.setPrepProcess(DeviceHelper.loadPreparationProcess(phone.getAdbDevice())); }catch(IOException | NullPointerException | NumberFormatException | ParseException e){ logger.debug("Can't load Flashing Process from Yaml : {}", e.getMessage()); logger.debug("Can't load Flashing Process from Yaml : {}", e.getClass()); displayIncompatibleDeviceFound(model); return; } Loading src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +11 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,17 @@ public class DeviceHelper { public static PreparationProcess loadPreparationProcess(String adbDevice) throws IOException, ParseException, NumberFormatException, NullPointerException{ final HashMap yamlContent = loadYaml(adbDevice+"_preparation.yml"); final int stepsCount = (Integer) yamlContent.get("stepsCount"); final HashMap<String, IStep> steps = parseSteps( (HashMap) yamlContent.get("steps") ); final int stepsCount = (Integer) yamlContent.getOrDefault("stepsCount", 0); final HashMap<String, IStep> steps; if(yamlContent.containsKey("steps")) steps = parseSteps( (HashMap) yamlContent.get("steps") ); //What to do if null... else{ logger.debug("Preparation config file has no specific steps"); steps = new HashMap<>(); } if(!yamlContent.containsKey("sources")) throw new NullPointerException("Invalid prepration config file. Doesn't contains \"sources\" entry"); final HashMap<String, RomSource> sourcesToDownload = ConfigParser.parseSourcesToDownload( (HashMap) yamlContent.get("sources")); //@TODO: check if steps is null, etc. Loading Loading
src/main/java/ecorp/easy/installer/controllers/subcontrollers/DeviceDetectedController.java +1 −1 Original line number Diff line number Diff line Loading @@ -125,7 +125,7 @@ public class DeviceDetectedController extends AbstractSubController{ phone.setFlashingProcess(DeviceHelper.loadFlashProcess(phone.getAdbDevice())); phone.setPrepProcess(DeviceHelper.loadPreparationProcess(phone.getAdbDevice())); }catch(IOException | NullPointerException | NumberFormatException | ParseException e){ logger.debug("Can't load Flashing Process from Yaml : {}", e.getMessage()); logger.debug("Can't load Flashing Process from Yaml : {}", e.getClass()); displayIncompatibleDeviceFound(model); return; } Loading
src/main/java/ecorp/easy/installer/helpers/DeviceHelper.java +11 −2 Original line number Diff line number Diff line Loading @@ -119,8 +119,17 @@ public class DeviceHelper { public static PreparationProcess loadPreparationProcess(String adbDevice) throws IOException, ParseException, NumberFormatException, NullPointerException{ final HashMap yamlContent = loadYaml(adbDevice+"_preparation.yml"); final int stepsCount = (Integer) yamlContent.get("stepsCount"); final HashMap<String, IStep> steps = parseSteps( (HashMap) yamlContent.get("steps") ); final int stepsCount = (Integer) yamlContent.getOrDefault("stepsCount", 0); final HashMap<String, IStep> steps; if(yamlContent.containsKey("steps")) steps = parseSteps( (HashMap) yamlContent.get("steps") ); //What to do if null... else{ logger.debug("Preparation config file has no specific steps"); steps = new HashMap<>(); } if(!yamlContent.containsKey("sources")) throw new NullPointerException("Invalid prepration config file. Doesn't contains \"sources\" entry"); final HashMap<String, RomSource> sourcesToDownload = ConfigParser.parseSourcesToDownload( (HashMap) yamlContent.get("sources")); //@TODO: check if steps is null, etc. Loading