static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(toLowerCase(encoderList))) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<>(); for (String entry : entries) { entry = toLowerCase(entry.trim()); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(encoderList.toLowerCase())) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<FlagEncoder>(); for (String entry : entries) { entry = entry.trim().toLowerCase(); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
if (fe.getVersion() != configuration.getInt("version", -1)) + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion());
static List<FlagEncoder> parseEncoderString(FlagEncoderFactory factory, String encoderList) { if (encoderList.contains(":")) throw new IllegalArgumentException("EncodingManager does no longer use reflection instantiate encoders directly."); if (!encoderList.equals(toLowerCase(encoderList))) throw new IllegalArgumentException("Since 0.7 EncodingManager does no longer accept upper case profiles: " + encoderList); String[] entries = encoderList.split(","); List<FlagEncoder> resultEncoders = new ArrayList<>(); for (String entry : entries) { entry = toLowerCase(entry.trim()); if (entry.isEmpty()) continue; String entryVal = ""; if (entry.contains("|")) { entryVal = entry; entry = entry.split("\\|")[0]; } PMap configuration = new PMap(entryVal); FlagEncoder fe = factory.createFlagEncoder(entry, configuration); if (configuration.has("version") && fe.getVersion() != configuration.getInt("version", -1)) throw new IllegalArgumentException("Encoder " + entry + " was used in version " + configuration.getLong("version", -1) + ", but current version is " + fe.getVersion()); resultEncoders.add(fe); } return resultEncoders; }
if (propertiesMap.has("version") && encoder.getVersion()!=propertiesMap.getInt("version", -1)){ properties.close(); throw new RuntimeException("Graph was built with wrong encoder version - probably built using an older version of the graphhopper library?");