Skip to content

Commit c7a5d84

Browse files
committed
added javadoc
1 parent c4463a6 commit c7a5d84

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

storage/inchi/src/main/java/org/openscience/cdk/inchi/InChIToStructure.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,13 @@ public class InChIToStructure {
9898

9999
// magic number - indicates isotope mass is relative
100100
private static final int ISOTOPIC_SHIFT_FLAG = 10000;
101-
102-
private static final int ISOTOPIC_SHIFT_RANGE = ISOTOPIC_SHIFT_FLAG - 100;
101+
/**
102+
* JNI-Inchi uses the magic number {#link ISOTOPIC_SHIFT_FLAG} plus the
103+
* (possibly negative) relative mass. So any isotope value
104+
* coming back from jni-inchi greater than this threshold value
105+
* should be treated as a relative mass.
106+
*/
107+
private static final int ISOTOPIC_SHIFT_THRESHOLD = ISOTOPIC_SHIFT_FLAG - 100;
103108

104109
/**
105110
* Constructor. Generates CDK AtomContainer from InChI.
@@ -183,7 +188,7 @@ protected void generateAtomContainerFromInchi(IChemObjectBuilder builder) throws
183188
int isotopicMass = iAt.getIsotopicMass();
184189

185190
if (isotopicMass != 0) {
186-
if (isotopicMass > ISOTOPIC_SHIFT_RANGE) {
191+
if (isotopicMass > ISOTOPIC_SHIFT_THRESHOLD) {
187192
try {
188193
int massNumber = Isotopes.getInstance().getMajorIsotope(cAt.getAtomicNumber()).getMassNumber();
189194
cAt.setMassNumber(massNumber + (isotopicMass - ISOTOPIC_SHIFT_FLAG));

0 commit comments

Comments
 (0)