Permalink
Browse files

Revert "automatically set atomic number when given an element symbol,…

… fixes bug/1296"

This reverts commit 2d80a80.
  • Loading branch information...
egonw committed Apr 20, 2013
1 parent e29adca commit 94f02e5ef83f5847bab6292c52613110305090ef
@@ -25,7 +25,6 @@
package org.openscience.cdk;
import org.openscience.cdk.interfaces.IElement;
import org.openscience.cdk.tools.periodictable.PeriodicTable;
import java.io.Serializable;
@@ -94,7 +93,8 @@ public Element(IElement element) {
* @param symbol The element symbol that this element should have.
*/
public Element(String symbol) {
this(symbol, PeriodicTable.getAtomicNumber(symbol));
this();
this.symbol = symbol;
}
/**
@@ -105,7 +105,7 @@ public Element(String symbol) {
* @param atomicNumber The atomicNumber of this element.
*/
public Element(String symbol, Integer atomicNumber) {
this.symbol = symbol;
this(symbol);
this.atomicNumber = atomicNumber;
}
@@ -23,7 +23,6 @@
import org.openscience.cdk.CDKConstants;
import org.openscience.cdk.interfaces.IElement;
import org.openscience.cdk.tools.periodictable.PeriodicTable;
/**
* Implements the idea of an element in the periodic table.
@@ -90,7 +89,8 @@ public Element(IElement element) {
* @param symbol The element symbol that this element should have.
*/
public Element(String symbol) {
this(symbol, PeriodicTable.getAtomicNumber(symbol));
this();
this.symbol = symbol;
}
/**
@@ -101,7 +101,7 @@ public Element(String symbol) {
* @param atomicNumber The atomicNumber of this element.
*/
public Element(String symbol, Integer atomicNumber) {
this.symbol = symbol;
this(symbol);
this.atomicNumber = atomicNumber;
}
@@ -1098,15 +1098,4 @@ public void testImplicitH() throws Exception {
Assert.assertEquals("C6H6", MolecularFormulaManipulator.getString(f));
}
/**
* @cdk.bug 1296
*/
@Test public void bug1296() {
IAtomContainer container = MolecularFormulaManipulator.getAtomContainer("C8H10N4O2",
DefaultChemObjectBuilder.getInstance());
for(IAtom a : container.atoms()){
Assert.assertNotNull(a.getAtomicNumber());
}
}
}

0 comments on commit 94f02e5

Please sign in to comment.