Source:
private void checkProfilesConsistency() { for (ProfileConfig profile : profilesByName.values()) { if (!encodingManager.hasEncoder(profile.getVehicle())) { throw new IllegalArgumentException("Unknown vehicle '" + profile.getVehicle() + "' in profile: " + profile + ". Make sure all vehicles used in 'profiles' exist in 'graph.flag_encoders'"); } FlagEncoder encoder = encodingManager.getEncoder(profile.getVehicle()); if (profile.isTurnCosts() && !encoder.supportsTurnCosts()) { throw new IllegalArgumentException("The profile '" + profile.getName() + "' was configured with " + "'turn_costs=true', but the corresponding vehicle '" + profile.getVehicle() + "' does not support turn costs." + "\nYou need to add `|turn_costs=true` to the vehicle in `graph.flag_encoders`"); } try { createWeighting(profile, new PMap()); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("The profile '" + profile.getName() + "' was configured with an unknown weighting '" + profile.getWeighting() + "'"); } } Set<String> chProfileSet = new LinkedHashSet<>(chPreparationHandler.getCHProfileConfigs().size()); for (CHProfileConfig chConfig : chPreparationHandler.getCHProfileConfigs()) { boolean added = chProfileSet.add(chConfig.getProfile()); if (!added) { throw new IllegalArgumentException("Duplicate CH reference to profile '" + chConfig.getProfile() + "'"); } if (!profilesByName.containsKey(chConfig.getProfile())) { throw new IllegalArgumentException("CH profile references unknown profile '" + chConfig.getProfile() + "'"); } } Set<String> lmProfileSet = new LinkedHashSet<>(lmPreparationHandler.getLMProfileConfigs().size()); for (LMProfileConfig lmConfig : lmPreparationHandler.getLMProfileConfigs()) { boolean added = lmProfileSet.add(lmConfig.getProfile()); if (!added) { throw new IllegalArgumentException("Duplicate LM reference to profile '" + lmConfig.getProfile() + "'"); } if (!profilesByName.containsKey(lmConfig.getProfile())) { throw new IllegalArgumentException("LM profile references unknown profile '" + lmConfig.getProfile() + "'"); } } }

Target:
private void checkProfilesConsistency() { for (ProfileConfig profile : profilesByName.values()) { if (!encodingManager.hasEncoder(profile.getVehicle())) { throw new IllegalArgumentException("Unknown vehicle '" + profile.getVehicle() + "' in profile: " + profile + ". Make sure all vehicles used in 'profiles' exist in 'graph.flag_encoders'"); } FlagEncoder encoder = encodingManager.getEncoder(profile.getVehicle()); if (profile.isTurnCosts() && !encoder.supportsTurnCosts()) { throw new IllegalArgumentException("The profile '" + profile.getName() + "' was configured with " + "'turn_costs=true', but the corresponding vehicle '" + profile.getVehicle() + "' does not support turn costs." + "\nYou need to add `|turn_costs=true` to the vehicle in `graph.flag_encoders`"); } try { createWeighting(profile, new PMap()); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Could not create weighting for profile: '" + profile.getName() + "'.\n" + "Profile: " + profile + "\n" + "Error: " + e.getMessage()); } } Set<String> chProfileSet = new LinkedHashSet<>(chPreparationHandler.getCHProfileConfigs().size()); for (CHProfileConfig chConfig : chPreparationHandler.getCHProfileConfigs()) { boolean added = chProfileSet.add(chConfig.getProfile()); if (!added) { throw new IllegalArgumentException("Duplicate CH reference to profile '" + chConfig.getProfile() + "'"); } if (!profilesByName.containsKey(chConfig.getProfile())) { throw new IllegalArgumentException("CH profile references unknown profile '" + chConfig.getProfile() + "'"); } } Set<String> lmProfileSet = new LinkedHashSet<>(lmPreparationHandler.getLMProfileConfigs().size()); for (LMProfileConfig lmConfig : lmPreparationHandler.getLMProfileConfigs()) { boolean added = lmProfileSet.add(lmConfig.getProfile()); if (!added) { throw new IllegalArgumentException("Duplicate LM reference to profile '" + lmConfig.getProfile() + "'"); } if (!profilesByName.containsKey(lmConfig.getProfile())) { throw new IllegalArgumentException("LM profile references unknown profile '" + lmConfig.getProfile() + "'"); } } }