Permalink
Browse files

Used the new isAvailable() method

  • Loading branch information...
1 parent 302febc commit eb42a32b927dd5d5188ee98897e3d61def6f0f15 @egonw committed May 20, 2010
@@ -49,15 +49,10 @@ public void generate( IMolecule molecule,
throws Exception {
monitor.beginTask("Calculating InChI", IProgressMonitor.UNKNOWN);
// return early if InChI library could not be loaded
- if (loadingFailed) returner.completeReturn(InChI.FAILED_TO_CALCULATE);
+ if (!isAvailable()) returner.completeReturn(InChI.FAILED_TO_CALCULATE);
Object adapted = molecule.getAdapter(IAtomContainer.class);
if (adapted != null) {
- // ensure we can actually generate an InChI
- if (!isLoaded && !LOADING_SUCCESS.equals(load())) {
- returner.completeReturn(InChI.FAILED_TO_CALCULATE);
- }
-
IAtomContainer container = (IAtomContainer)adapted;
IAtomContainer clone = (IAtomContainer)container.clone();
// remove aromaticity flags

0 comments on commit eb42a32

Please sign in to comment.