@Test public void testProcessNullTerminatedString() { String value = SQLUtils.processNullTerminatedString("\0"); assertEquals("null", value); value = SQLUtils.processNullTerminatedString("value\0"); assertEquals("value", value); value = SQLUtils.processNullTerminatedString("value"); assertEquals("value", value); value = SQLUtils.processNullTerminatedString(null); assertEquals("null", value); value = SQLUtils.processNullTerminatedString(""); assertEquals("null", value); }
public static String processNullTerminatedString(final String value) { if (isEmpty(value)) { return "null"; } char[] charArray = value.toCharArray(); if (charArray.length == 1 && (int) charArray[0] <= 0) { return "null"; } else { if ((int) charArray[charArray.length - 1] <= 0) { return value.substring(0, value.length() - 1); } } return value; }
SQLUtils { public static String processNullTerminatedString(final String value) { if (isEmpty(value)) { return "null"; } char[] charArray = value.toCharArray(); if (charArray.length == 1 && (int) charArray[0] <= 0) { return "null"; } else { if ((int) charArray[charArray.length - 1] <= 0) { return value.substring(0, value.length() - 1); } } return value; } }
SQLUtils { public static String processNullTerminatedString(final String value) { if (isEmpty(value)) { return "null"; } char[] charArray = value.toCharArray(); if (charArray.length == 1 && (int) charArray[0] <= 0) { return "null"; } else { if ((int) charArray[charArray.length - 1] <= 0) { return value.substring(0, value.length() - 1); } } return value; }  }
SQLUtils { public static String processNullTerminatedString(final String value) { if (isEmpty(value)) { return "null"; } char[] charArray = value.toCharArray(); if (charArray.length == 1 && (int) charArray[0] <= 0) { return "null"; } else { if ((int) charArray[charArray.length - 1] <= 0) { return value.substring(0, value.length() - 1); } } return value; }  static void loadClassForName(@NotNull final String className); static String processNullTerminatedString(final String value); static String getIPv4OrIPv6WithSquareBracketsHost(String dbServer); static String exceptionToString(Throwable e); static String toString(SQLException e); @NotNull static String computeSessionId(@NotNull final String aString); static String processDumpException(SQLException sqlException); static String processLoadException(SQLException e); static List<String> readFromFile(String fileName); @NotNull static List<String> getRowsFromGlobalSessionMap(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String aKey); @NotNull static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol); }
SQLUtils { public static String processNullTerminatedString(final String value) { if (isEmpty(value)) { return "null"; } char[] charArray = value.toCharArray(); if (charArray.length == 1 && (int) charArray[0] <= 0) { return "null"; } else { if ((int) charArray[charArray.length - 1] <= 0) { return value.substring(0, value.length() - 1); } } return value; }  static void loadClassForName(@NotNull final String className); static String processNullTerminatedString(final String value); static String getIPv4OrIPv6WithSquareBracketsHost(String dbServer); static String exceptionToString(Throwable e); static String toString(SQLException e); @NotNull static String computeSessionId(@NotNull final String aString); static String processDumpException(SQLException sqlException); static String processLoadException(SQLException e); static List<String> readFromFile(String fileName); @NotNull static List<String> getRowsFromGlobalSessionMap(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String aKey); @NotNull static String getStrColumns(@NotNull final GlobalSessionObject<Map<String, Object>> globalSessionObject, @NotNull final String strKeyCol);  }