@@ -413,7 +413,7 @@ private synchronized IReaction getMapping(IReaction coreMappedReaction) throws I
413413 IAtomContainer eMolecule = mappedReaction .getReactants ().getAtomContainer (eMol );
414414 for (int eAtom = 0 ; eAtom < eMolecule .getAtomCount (); eAtom ++) {
415415 IAtom atom = mappedReaction .getReactants ().getAtomContainer (eMol ).getAtom (eAtom );
416- if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && atom .getID (). equalsIgnoreCase ( "-1" )) {
416+ if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && "-1" . equalsIgnoreCase ( atom .getID ())) {
417417 String atomLabel = Integer .toString (counter );
418418 atom .setID (atomLabel );
419419 atom .setFlag (MAPPED , false );
@@ -426,7 +426,7 @@ private synchronized IReaction getMapping(IReaction coreMappedReaction) throws I
426426 IAtomContainer pMolecule = mappedReaction .getProducts ().getAtomContainer (pMol );
427427 for (int pAtom = 0 ; pAtom < pMolecule .getAtomCount (); pAtom ++) {
428428 IAtom atom = mappedReaction .getProducts ().getAtomContainer (pMol ).getAtom (pAtom );
429- if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && atom .getID (). equalsIgnoreCase ( "-1" )) {
429+ if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && "-1" . equalsIgnoreCase ( atom .getID ())) {
430430 String atomLabel = Integer .toString (counter );
431431 atom .setID (atomLabel );
432432 atom .setFlag (MAPPED , false );
@@ -442,12 +442,12 @@ private synchronized IReaction getMapping(IReaction coreMappedReaction) throws I
442442 IAtomContainer eMolecule = mappedReaction .getReactants ().getAtomContainer (eMol );
443443 for (int eAtom = 0 ; eAtom < eMolecule .getAtomCount (); eAtom ++) {
444444 IAtom atom = mappedReaction .getReactants ().getAtomContainer (eMol ).getAtom (eAtom );
445- if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && !atom .getID (). equalsIgnoreCase ( "-1" )) {
445+ if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && !"-1" . equalsIgnoreCase ( atom .getID ())) {
446446 List <IAtom > eductConnAtoms = eMolecule .getConnectedAtomsList (atom );
447447 List <IAtom > productHAtoms = markHAroundCoreAtoms (atom .getID (), mappedReaction .getProducts ());
448448 for (IAtom eAtomH : eductConnAtoms ) {
449449 //Collect ummmarked H and map common ones
450- if (eAtomH .getID (). equalsIgnoreCase ( "-1" ) && eAtomH .getSymbol ().equalsIgnoreCase ("H" )) {
450+ if ("-1" . equalsIgnoreCase ( eAtomH .getID ()) && eAtomH .getSymbol ().equalsIgnoreCase ("H" )) {
451451 if (!productHAtoms .isEmpty ()) {
452452 String atomLabel = Integer .toString (counter );
453453 eAtomH .setID (atomLabel );
@@ -818,10 +818,10 @@ private synchronized List<IAtom> markHAroundCoreAtoms(String id, IAtomContainerS
818818 IAtomContainer pMolecule = molSet .getAtomContainer (pMol );
819819 for (int pAtom = 0 ; pAtom < pMolecule .getAtomCount (); pAtom ++) {
820820 IAtom atom = molSet .getAtomContainer (pMol ).getAtom (pAtom );
821- if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && !atom .getID (). equalsIgnoreCase ( "-1" )) {
822- if (atom .getID (). equalsIgnoreCase ( id )) {
821+ if (!atom .getSymbol ().equalsIgnoreCase ("H" ) && !"-1" . equalsIgnoreCase ( atom .getID ())) {
822+ if (id != null && id . equalsIgnoreCase ( atom .getID ())) {
823823 List <IAtom > conAtoms = pMolecule .getConnectedAtomsList (atom );
824- conAtoms .stream ().filter ((atomH ) -> (atomH .getID (). equalsIgnoreCase ( "-1" ) && atomH .getSymbol ().equalsIgnoreCase ("H" ))).forEach ((atomH ) -> {
824+ conAtoms .stream ().filter ((atomH ) -> ("-1" . equalsIgnoreCase ( atomH .getID ()) && atomH .getSymbol ().equalsIgnoreCase ("H" ))).forEach ((atomH ) -> {
825825 list .add (atomH );
826826 });
827827 }
@@ -845,7 +845,7 @@ private synchronized List<IAtom> collectUnMappedSingleHAtoms(IAtomContainerSet m
845845 IAtom atom = molSet .getAtomContainer (index ).getAtom (atomIndex );
846846 if (atom .getSymbol ().equalsIgnoreCase ("H" )
847847 && !atom .getFlag (MAPPED )
848- && atom .getID (). equalsIgnoreCase ( "-1" )) {
848+ && "-1" . equalsIgnoreCase ( atom .getID ())) {
849849 list .add (atom );
850850 }
851851 }
@@ -867,7 +867,7 @@ private synchronized List<IAtom> collectUnMappedHAtoms(IAtomContainerSet molSet)
867867 IAtom atom = molSet .getAtomContainer (index ).getAtom (atomIndex );
868868 if (atom .getSymbol ().equalsIgnoreCase ("H" )
869869 && !atom .getFlag (MAPPED )
870- && atom .getID (). equalsIgnoreCase ( "-1" )) {
870+ && "-1" . equalsIgnoreCase ( atom .getID ())) {
871871 list .add (atom );
872872 }
873873 }
@@ -893,7 +893,7 @@ private synchronized int markUnMappedHAtoms(IReaction mappedReaction, int counte
893893 for (int eAtom = 0 ; eAtom < eMolecule .getAtomCount (); eAtom ++) {
894894 IAtom atom = mappedReaction .getReactants ().getAtomContainer (eMol ).getAtom (eAtom );
895895 if (atom .getSymbol ().equalsIgnoreCase ("H" ) && !atom .getFlag (MAPPED )
896- && atom .getID (). equalsIgnoreCase ( "-1" )) {
896+ && "-1" . equalsIgnoreCase ( atom .getID ())) {
897897 String atomLabel = Integer .toString (localCounter );
898898 atom .setFlag (MAPPED , false );
899899 atom .setID (atomLabel );
@@ -907,7 +907,7 @@ private synchronized int markUnMappedHAtoms(IReaction mappedReaction, int counte
907907 for (int pAtom = 0 ; pAtom < pMolecule .getAtomCount (); pAtom ++) {
908908 IAtom atom = mappedReaction .getProducts ().getAtomContainer (pMol ).getAtom (pAtom );
909909 if (atom .getSymbol ().equalsIgnoreCase ("H" ) && !atom .getFlag (MAPPED )
910- && atom .getID (). equalsIgnoreCase ( "-1" )) {
910+ && "-1" . equalsIgnoreCase ( atom .getID ())) {
911911 String atomLabel = Integer .toString (localCounter );
912912 atom .setID (atomLabel );
913913 atom .setFlag (MAPPED , false );
@@ -940,9 +940,12 @@ private synchronized void setReactionBlastMolMapping(MoleculeMoleculeMapping rea
940940 }
941941
942942 private synchronized IAtom getContainerAtomByID (IAtomContainerSet products , String mappingID ) {
943+ if (mappingID == null ) {
944+ return null ;
945+ }
943946 for (IAtomContainer ac : products .atomContainers ()) {
944947 for (IAtom atom : ac .atoms ()) {
945- if (atom .getID (). equals ( mappingID )) {
948+ if (mappingID . equals ( atom .getID ())) {
946949 return atom ;
947950 }
948951 }
0 commit comments