Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,11 @@ private IChemFile readChemFile(IChemFile oFile) {
logger.warn("REMARK line found without any comment!");
}
} else if ("COMPND".equalsIgnoreCase(cCol)) {
String title = cRead.substring(10).trim();
oFile.setProperty(CDKConstants.TITLE, title);
if (cRead.length() > 10) {
String title = cRead.substring(10).trim();
if (!title.isEmpty())
oFile.setProperty(CDKConstants.TITLE, title);
}
}

/* ***********************************************************
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,24 @@ public void oldFormatNewFormatTest() throws Exception {
Assert.assertEquals("H", acNew.getAtom(0).getSymbol());
}

@Test
public void emptyFields() throws Exception {
String data = "HEADER\n" +
"TITLE\n" +
"COMPND\n" +
"KEYWDS\n" +
"EXPDTA\n" +
"AUTHOR\n" +
"REVDAT\n" +
"HET 1 13\n" +
"HETNAM\n" +
"FORMUL\n" +
"END\n";
IChemFile chemFile = getChemFileFromString(data);
IAtomContainer atomContainer = getFirstAtomContainer(chemFile, 1, 1, 1);
}


@Test
public void testAccepts() {
PDBReader reader = new PDBReader();
Expand Down