From: <mig...@us...> - 2008-09-18 07:16:59
|
Revision: 12339 http://cdk.svn.sourceforge.net/cdk/?rev=12339&view=rev Author: miguelrojasch Date: 2008-09-18 14:16:56 +0000 (Thu, 18 Sep 2008) Log Message: ----------- removed "throws CDKException" from method StructureResonanceGenerator.setReactions(List<IReactionProcess> newReactionsList). And depending methods as StabilizationCharges.calculatePositive. It was producing some incoherences: org.openscience.cdk.charges.StabilizationCharges row 83: Unreachable catch block for CDKException. This exception is never thrown from the try statement body. Modified Paths: -------------- cdk/trunk/src/main/org/openscience/cdk/charges/StabilizationCharges.java cdk/trunk/src/main/org/openscience/cdk/tools/StructureResonanceGenerator.java Modified: cdk/trunk/src/main/org/openscience/cdk/charges/StabilizationCharges.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/charges/StabilizationCharges.java 2008-09-18 12:45:19 UTC (rev 12338) +++ cdk/trunk/src/main/org/openscience/cdk/charges/StabilizationCharges.java 2008-09-18 14:16:56 UTC (rev 12339) @@ -76,14 +76,10 @@ // only must be generated all structures which stabilize the atom in question. StructureResonanceGenerator gRI = new StructureResonanceGenerator(); - try { - List<IReactionProcess> reactionList = gRI.getReactions(); - reactionList.add(new HyperconjugationReaction()); - gRI.setReactions(reactionList); - } catch (CDKException e) { - e.printStackTrace(); - } - IAtomContainerSet resonanceS = gRI.getStructures((IMolecule) atomContainer); + List<IReactionProcess> reactionList = gRI.getReactions(); + reactionList.add(new HyperconjugationReaction()); + gRI.setReactions(reactionList); + IAtomContainerSet resonanceS = gRI.getStructures((IMolecule) atomContainer); IAtomContainerSet containerS = gRI.getContainers((IMolecule) atomContainer); if(resonanceS.getAtomContainerCount() < 2)// meaning it was not find any resonance structure return 0.0; Modified: cdk/trunk/src/main/org/openscience/cdk/tools/StructureResonanceGenerator.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/tools/StructureResonanceGenerator.java 2008-09-18 12:45:19 UTC (rev 12338) +++ cdk/trunk/src/main/org/openscience/cdk/tools/StructureResonanceGenerator.java 2008-09-18 14:16:56 UTC (rev 12339) @@ -20,22 +20,32 @@ */ package org.openscience.cdk.tools; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; + import org.openscience.cdk.annotations.TestClass; import org.openscience.cdk.annotations.TestMethod; import org.openscience.cdk.aromaticity.CDKHueckelAromaticityDetector; import org.openscience.cdk.exception.CDKException; -import org.openscience.cdk.interfaces.*; +import org.openscience.cdk.interfaces.IAtom; +import org.openscience.cdk.interfaces.IAtomContainer; +import org.openscience.cdk.interfaces.IAtomContainerSet; +import org.openscience.cdk.interfaces.IBond; +import org.openscience.cdk.interfaces.IMolecule; +import org.openscience.cdk.interfaces.IMoleculeSet; +import org.openscience.cdk.interfaces.IReactionSet; import org.openscience.cdk.isomorphism.UniversalIsomorphismTester; import org.openscience.cdk.isomorphism.matchers.QueryAtomContainer; import org.openscience.cdk.isomorphism.matchers.QueryAtomContainerCreator; import org.openscience.cdk.reaction.IReactionProcess; -import org.openscience.cdk.reaction.type.*; +import org.openscience.cdk.reaction.type.PiBondingMovementReaction; +import org.openscience.cdk.reaction.type.RearrangementAnionReaction; +import org.openscience.cdk.reaction.type.RearrangementCationReaction; +import org.openscience.cdk.reaction.type.RearrangementLonePairReaction; +import org.openscience.cdk.reaction.type.RearrangementRadicalReaction; +import org.openscience.cdk.reaction.type.SharingLonePairReaction; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - /** * <p>This class try to generate resonance structure for a determinate molecule.</p> * <p>Make sure that the molecule has the corresponding lone pair electrons @@ -106,7 +116,7 @@ * @see IReactionProcess */ @TestMethod("testSetReactions_List") - public void setReactions(List<IReactionProcess> newReactionsList) throws CDKException { + public void setReactions(List<IReactionProcess> newReactionsList){ reactionsList = newReactionsList; } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |