File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed
storage/ioformats/src/main/java/org/openscience/cdk/io/formats Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -76,22 +76,22 @@ public String getWriterClassName() {
7676 /** {@inheritDoc} */
7777 @ Override
7878 public boolean matches (int lineNumber , String line ) {
79- if (lineNumber == 4 && line .length () > 7 && (line .indexOf ("2000" ) == -1 ) && // MDL Mol V2000 format
80- (line .indexOf ("3000" ) == -1 )) // MDL Mol V3000 format
79+ if (lineNumber == 4
80+ && line .length () > 7
81+ && (!line .contains ("2000" )) && // MDL Mol V2000 format
82+ (!line .contains ("3000" ))) // MDL Mol V3000 format
8183 {
8284 // possibly a MDL mol file
8385 try {
8486 String atomCountString = line .substring (0 , 3 ).trim ();
8587 String bondCountString = line .substring (3 , 6 ).trim ();
8688 Integer .valueOf (atomCountString );
8789 Integer .valueOf (bondCountString );
88- if (line .length () > 6 ) {
89- String remainder = line .substring (6 ).trim ();
90- for (int i = 0 ; i < remainder .length (); ++i ) {
91- char c = remainder .charAt (i );
92- if (!(Character .isDigit (c ) || Character .isWhitespace (c ))) {
93- return false ;
94- }
90+ String remainder = line .substring (6 ).trim ();
91+ for (int i = 0 ; i < remainder .length (); ++i ) {
92+ char c = remainder .charAt (i );
93+ if (!(Character .isDigit (c ) || Character .isWhitespace (c ))) {
94+ return false ;
9595 }
9696 }
9797 } catch (NumberFormatException nfe ) {
You can’t perform that action at this time.
0 commit comments