Skip to content

Commit

Permalink
Also double check the single electron counts (fixes bug #1382)
Browse files Browse the repository at this point in the history
  • Loading branch information
egonw committed Aug 10, 2016
1 parent b06df5a commit 1f8cd45
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2518,6 +2518,13 @@ private boolean isAcceptable(IAtom atom, IAtomContainer container, IAtomType typ
if (atom.getFormalCharge() != CDKConstants.UNSET && !atom.getFormalCharge().equals(type.getFormalCharge()))
return false;

// confirm single electron count
if (type.getProperty(CDKConstants.SINGLE_ELECTRON_COUNT) != null) {
int count = countSingleElectrons(container, atom);
if (count != type.getProperty(CDKConstants.SINGLE_ELECTRON_COUNT, Integer.class).intValue())
return false;
}

return true;
}

Expand Down

0 comments on commit 1f8cd45

Please sign in to comment.