Hi all,

here a review request, for this patch already applied to master, but
it may be beneficial for CDK 1.4.x too:

https://github.com/cdk/cdk/commit/6e6cf8e3db24261dd75470cb1765668a50494b7f

What is does is introduce generics into the iterating readers, causing
the next() method to now not return IChemObject but IAtomContainer or
IChemObject depending on the type of iterating reader (most read an
IAtomContainer)...

That means that for using code, the API changes slightly. Existing
code will still be working, but you can simplify your code and remove
a casting to IAtomContainer. For example, instead of:

while (iterReader.hasNext()) {
  IAtomContainer molecule = (IAtomContainer)iterReader.next();
}

... the new code would allow you to just do:

while (iterReader.hasNext()) {
  IAtomContainer molecule = iterReader.next();
}

Of course, the added value is that type checking now happens on
compile time, and there is no risk of a ClassCastException anymore.

What's your opinion? Should I backport this patch to CDK 1.4.x?

If so, please review the patch linked to on GitHub (see this post [0],
and either leave a comment there, or reply to this message.

Egon

0.http://chem-bla-ics.blogspot.com/2010/05/how-to-use-github-for-cdkbioclipse-code.html

-- 
Dr E.L. Willighagen
Postdoctoral Researcher
Institutet för miljömedicin
Karolinska Institutet (http://ki.se/imm)
Homepage: http://egonw.github.com/
LinkedIn: http://se.linkedin.com/in/egonw
Blog: http://chem-bla-ics.blogspot.com/
PubList: http://www.citeulike.org/user/egonw/tag/papers

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user

Reply via email to