@@ -61,13 +61,17 @@ private static boolean isTimeoutOptions(String op) {
6161 pos ++;
6262 while (pos < len && Character .isDigit (op .charAt (pos )))
6363 pos ++;
64- if (pos < len && op .charAt (pos ) == '.' )
64+ if (pos < len && ( op .charAt (pos ) == '.' || op . charAt ( pos ) == ',' ) )
6565 pos ++;
6666 while (pos < len && Character .isDigit (op .charAt (pos )))
6767 pos ++;
6868 return pos == len ;
6969 }
7070
71+ private static boolean isSubSecondTimeout (String op ) {
72+ return op .indexOf ('.' ) >= 0 || op .indexOf (',' ) >= 0 ;
73+ }
74+
7175 private static String checkOptions (final String ops ) throws JniInchiException {
7276 if (ops == null ) {
7377 throw new IllegalArgumentException ("Null options" );
@@ -92,7 +96,8 @@ private static String checkOptions(final String ops) throws JniInchiException {
9296 sbOptions .append (" " );
9397 }
9498 } else if (isTimeoutOptions (op )) {
95- if (op .contains ("." ) || op .contains ("," )) { // only reformat if we actually have a decimal
99+ // only reformat if we actually have a decimal
100+ if (isSubSecondTimeout (op )) {
96101 // because the JNI-InChI library is expecting an platform number, format it as such
97102 Double time = Double .parseDouble (op .substring (1 ));
98103 DecimalFormat format = new DecimalFormat ("#.##" );
@@ -132,7 +137,6 @@ else if ("KET".equals(op)) {
132137 return sbOptions .toString ();
133138 }
134139
135-
136140 private static String checkOptions (List <INCHI_OPTION > ops ) throws JniInchiException {
137141 if (ops == null ) {
138142 throw new IllegalArgumentException ("Null options" );
0 commit comments