private static IAtomContainer roundUpIfNeeded ( IAtomContainer anon ) { IChemObjectBuilder bldr = anon . getBuilder ( ) ; if ( ( anon . getAtomCount ( ) & 0x1 ) != 0 ) { IBond bond = anon . removeBond ( anon . getBondCount ( ) - 1 ) ; IAtom dummy = bldr . newInstance ( IAtom . class , "C" ) ; anon . addAtom ( dummy ) ; anon . addBond ( bldr . newInstance ( IBond . class , bond . getBegin ( ) , dummy , IBond . Order . SINGLE ) ) ; anon . addBond ( bldr . newInstance ( IBond . class , dummy , bond . getEnd ( ) , IBond . Order . SINGLE ) ) ; } return anon ; }
Make a ring one atom bigger if it s of an odd size .