Skip to content

Commit

Permalink
Correct addition of atoms to a list. Unlike Vector, a List does not l…
Browse files Browse the repository at this point in the history
…et you use set(int, Obj) unless that index already has an item.

Change-Id: I96004873d392e572efebb94f34f040fb79112238
Signed-off-by: Egon Willighagen <egonw@users.sourceforge.net>
  • Loading branch information
johnmay authored and egonw committed Jun 5, 2013
1 parent 14219a7 commit 939f03f
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -218,10 +218,10 @@ private IRing getRing(IAtom rootNode, IAtomContainer molecule)
List<List<IAtom>> path = new ArrayList<List<IAtom>>(OKatoms);
List<IAtom> intersection = new ArrayList<IAtom>();
List<IAtom> ring = new ArrayList<IAtom>();
for (int f = 0; f < OKatoms; f++)
for (final IAtom atom : molecule.atoms())
{
path.set(f, new ArrayList<IAtom>());
((List<IAtom>)molecule.getAtom(f).getProperty(PATH)).clear();
path.add(new ArrayList<IAtom>());
atom.getProperty(PATH, List.class).clear();
}
// Initialize the queue with nodes attached to rootNode
neighbors = molecule.getConnectedAtomsList(rootNode);
Expand Down

0 comments on commit 939f03f

Please sign in to comment.