From dfb23736c7fce77e8dddcd7ae7d7133b0c4bdf99 Mon Sep 17 00:00:00 2001 From: davor Date: Fri, 26 Apr 2013 11:48:48 +0300 Subject: Fixed java compiling error. CdkDescriptors.java:43: cannot find symbol > symbol : variable molecule --- java/CdkDescriptors.java | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/java/CdkDescriptors.java b/java/CdkDescriptors.java index 69c27a8..50f6379 100644 --- a/java/CdkDescriptors.java +++ b/java/CdkDescriptors.java @@ -34,36 +34,36 @@ class CdkDescriptors { try { IMolecule molecule = (IMolecule)reader.next(); engine.process(molecule); - } - catch (Exception e) { - yaml.println("- {}"); - e.printStackTrace(); - continue; - } - Iterator it = molecule.getProperties().values().iterator(); - Boolean first = true; - while (it.hasNext()) { - try { - DescriptorValue value = (DescriptorValue)it.next(); - int size = value.getValue().length(); - if (size == 1) { - if (first) { yaml.print("- "); } - else { yaml.print(" "); } - yaml.println(":"+value.getNames()[0].toString() + ": " + value.getValue()); - first = false; - } - else { - String[] values = value.getValue().toString().split(","); - for (int i = 0; i < size; i++) { + Iterator it = molecule.getProperties().values().iterator(); + Boolean first = true; + while (it.hasNext()) { + try { + DescriptorValue value = (DescriptorValue)it.next(); + int size = value.getValue().length(); + if (size == 1) { if (first) { yaml.print("- "); } else { yaml.print(" "); } - yaml.println(":"+value.getNames()[i].toString() + ": " + values[i]); + yaml.println(":"+value.getNames()[0].toString() + ": " + value.getValue()); first = false; } + else { + String[] values = value.getValue().toString().split(","); + for (int i = 0; i < size; i++) { + if (first) { yaml.print("- "); } + else { yaml.print(" "); } + yaml.println(":"+value.getNames()[i].toString() + ": " + values[i]); + first = false; + } + } } + catch (ClassCastException e) { } // sdf properties are stored as molecules properties (strings), ignore them + catch (Exception e) { e.printStackTrace(); } // output nothing to yaml } - catch (ClassCastException e) { } // sdf properties are stored as molecules properties (strings), ignore them - catch (Exception e) { e.printStackTrace(); } // output nothing to yaml + } + catch (Exception e) { + yaml.println("- {}"); + e.printStackTrace(); + continue; } } yaml.close(); -- cgit v1.2.3