updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / cdk / parse_atom_charge.patch
blobdb48ef526c5305fa72c6d2195c0a98660a002d58
1 diff --git PDBReader.java PDBReader.java
2 index 71cdac7..178cebe 100644
3 --- PDBReader.java
4 +++ PDBReader.java
5 @@ -673,7 +673,12 @@ public class PDBReader extends DefaultChemObjectReader {
6 if (lineLength >= 79) {
7 String frag = cLine.substring(78, 80).trim();
8 if (frag.length() > 0) {
9 - oAtom.setCharge(Double.parseDouble(frag));
10 + // see Format_v33_A4.pdf, p. 178
11 + try {
12 + oAtom.setCharge(Double.parseDouble(frag));
13 + } catch (NumberFormatException e) {
14 + oAtom.setCharge(Double.parseDouble(new StringBuilder(frag).reverse().toString()));
15 + }