Skip to content

Commit

Permalink
Allow "*" atoms to be created.
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmay committed Feb 16, 2017
1 parent fa43771 commit 4f384e7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions base/data/src/main/java/org/openscience/cdk/Atom.java
Expand Up @@ -536,6 +536,10 @@ private static boolean parseAtomSymbol(IAtom atom, String str) {
atom.setAtomicNumber(0);
atom.setSymbol("R");
return true;
} else if ("*".equals(str)) {
atom.setAtomicNumber(0);
atom.setSymbol("*");
return true;
} else if ("D".equals(str)) {
atom.setAtomicNumber(1);
atom.setMassNumber(2);
Expand Down
Expand Up @@ -513,7 +513,6 @@ private static boolean isDigit(char c) {
}

private static boolean parseAtomSymbol(IAtom atom, String str) {

Elements elem = Elements.ofString(str);
if (elem != Elements.Unknown) {
atom.setAtomicNumber(elem.number());
Expand All @@ -523,6 +522,10 @@ private static boolean parseAtomSymbol(IAtom atom, String str) {
atom.setAtomicNumber(0);
atom.setSymbol("R");
return true;
} else if ("*".equals(str)) {
atom.setAtomicNumber(0);
atom.setSymbol("*");
return true;
} else if ("D".equals(str)) {
atom.setAtomicNumber(1);
atom.setMassNumber(2);
Expand Down

0 comments on commit 4f384e7

Please sign in to comment.