MCPcopy Index your code
hub / github.com/java-native-access/jna / parseVersion

Method parseVersion

src/com/sun/jna/NativeLibrary.java:878–903  ·  view source on GitHub ↗
(String ver)

Source from the content-addressed store, hash-verified

876 }
877
878 static double parseVersion(String ver) {
879 double v = 0;
880 double divisor = 1;
881 int dot = ver.indexOf(".");
882 while (ver != null) {
883 String num;
884 if (dot != -1) {
885 num = ver.substring(0, dot);
886 ver = ver.substring(dot + 1);
887 dot = ver.indexOf(".");
888 }
889 else {
890 num = ver;
891 ver = null;
892 }
893 try {
894 v += Integer.parseInt(num) / divisor;
895 }
896 catch(NumberFormatException e) {
897 return 0;
898 }
899 divisor *= 100;
900 }
901
902 return v;
903 }
904
905 static {
906 String webstartPath = Native.getWebStartLibraryPath("jnidispatch");

Callers 2

testParseVersionMethod · 0.95
matchLibraryMethod · 0.95

Calls 1

indexOfMethod · 0.45

Tested by 1

testParseVersionMethod · 0.76