@Test void checkVersionNokEmpty() { boolean result = ClientVersionUtil.checkVersion("", "2.4.0-rc.14"); Assertions.assertFalse(result); }
public static boolean checkVersion(String server, String client) { try { if (isSnapshot(client)) { return true; } String[] serverParts = removeStartingV(server).split("\\."); String[] clientParts = removeStartingV(client).split("\\."); if (serverParts[0].equals(clientParts[0]) && serverParts[1].equals(clientParts[1])) { return true; } } catch (ArrayIndexOutOfBoundsException | NullPointerException ignore) { } return false; }
ClientVersionUtil { public static boolean checkVersion(String server, String client) { try { if (isSnapshot(client)) { return true; } String[] serverParts = removeStartingV(server).split("\\."); String[] clientParts = removeStartingV(client).split("\\."); if (serverParts[0].equals(clientParts[0]) && serverParts[1].equals(clientParts[1])) { return true; } } catch (ArrayIndexOutOfBoundsException | NullPointerException ignore) { } return false; } }
ClientVersionUtil { public static boolean checkVersion(String server, String client) { try { if (isSnapshot(client)) { return true; } String[] serverParts = removeStartingV(server).split("\\."); String[] clientParts = removeStartingV(client).split("\\."); if (serverParts[0].equals(clientParts[0]) && serverParts[1].equals(clientParts[1])) { return true; } } catch (ArrayIndexOutOfBoundsException | NullPointerException ignore) { } return false; } private  ClientVersionUtil(); }
ClientVersionUtil { public static boolean checkVersion(String server, String client) { try { if (isSnapshot(client)) { return true; } String[] serverParts = removeStartingV(server).split("\\."); String[] clientParts = removeStartingV(client).split("\\."); if (serverParts[0].equals(clientParts[0]) && serverParts[1].equals(clientParts[1])) { return true; } } catch (ArrayIndexOutOfBoundsException | NullPointerException ignore) { } return false; } private  ClientVersionUtil(); static VersionCheckResult checkClientVersion(String apiVersion, String clientVersion); static boolean checkVersion(String server, String client); }
ClientVersionUtil { public static boolean checkVersion(String server, String client) { try { if (isSnapshot(client)) { return true; } String[] serverParts = removeStartingV(server).split("\\."); String[] clientParts = removeStartingV(client).split("\\."); if (serverParts[0].equals(clientParts[0]) && serverParts[1].equals(clientParts[1])) { return true; } } catch (ArrayIndexOutOfBoundsException | NullPointerException ignore) { } return false; } private  ClientVersionUtil(); static VersionCheckResult checkClientVersion(String apiVersion, String clientVersion); static boolean checkVersion(String server, String client);  }