From: <eg...@us...> - 2008-07-23 10:26:20
|
Revision: 11714 http://cdk.svn.sourceforge.net/cdk/?rev=11714&view=rev Author: egonw Date: 2008-07-23 10:26:14 +0000 (Wed, 23 Jul 2008) Log Message: ----------- Ported patch r11713: Use system's line.separator instead of hardcoded '\n' Modified Paths: -------------- cdk/trunk/src/main/org/openscience/cdk/io/CDKSourceCodeWriter.java cdk/trunk/src/main/org/openscience/cdk/io/CrystClustWriter.java cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNReader.java cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV2000Reader.java cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV3000Reader.java cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNWriter.java cdk/trunk/src/main/org/openscience/cdk/io/MDLReader.java cdk/trunk/src/main/org/openscience/cdk/io/MDLV2000Reader.java cdk/trunk/src/main/org/openscience/cdk/io/Mol2Writer.java cdk/trunk/src/main/org/openscience/cdk/io/PDBReader.java cdk/trunk/src/main/org/openscience/cdk/io/PDBWriter.java cdk/trunk/src/main/org/openscience/cdk/io/ShelXWriter.java cdk/trunk/src/main/org/openscience/cdk/io/ZMatrixReader.java cdk/trunk/src/main/org/openscience/cdk/io/cml/PMPConvention.java cdk/trunk/src/main/org/openscience/cdk/io/iterator/IteratingMDLReader.java cdk/trunk/src/main/org/openscience/cdk/io/program/GaussianInputWriter.java Modified: cdk/trunk/src/main/org/openscience/cdk/io/CDKSourceCodeWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/CDKSourceCodeWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/CDKSourceCodeWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -160,7 +160,8 @@ while (atoms.hasNext()) { IAtom atom = (IAtom)atoms.next(); writeAtom(atom); - writer.write(" mol.addAtom(" + atom.getID() + ");\n"); + writer.write(" mol.addAtom(" + atom.getID() + ");"); + writer.newLine(); } } @@ -169,50 +170,63 @@ while (bonds.hasNext()) { IBond bond = (IBond) bonds.next(); writeBond(bond); - writer.write(" mol.addBond(" + bond.getID() + ");\n"); + writer.write(" mol.addBond(" + bond.getID() + ");"); + writer.newLine(); } } public void writeMolecule(IMolecule molecule) throws Exception { - writer.write("{\n"); - writer.write(" IMolecule mol = new Molecule();\n"); + writer.write("{"); + writer.newLine(); + writer.write(" IMolecule mol = new Molecule();"); + writer.newLine(); IDCreator.createIDs(molecule); writeAtoms(molecule); writeBonds(molecule); - writer.write("}\n"); + writer.write("}"); + writer.newLine(); } public void writeAtomContainer(IAtomContainer molecule) throws Exception { - writer.write("{\n"); - writer.write(" IAtomContainer mol = new AtomContainer();\n"); + writer.write("{"); + writer.newLine(); + writer.write(" IAtomContainer mol = new AtomContainer();"); + writer.newLine(); IDCreator.createIDs(molecule); writeAtoms(molecule); writeBonds(molecule); - writer.write("}\n"); + writer.write("}"); + writer.newLine(); } public void writeAtom(IAtom atom) throws Exception { if (atom instanceof IPseudoAtom) { - writer.write(" IPseudoAtom " + atom.getID() + " = mol.getBuilder().newPseudoAtom();\n"); - writer.write(" atom.setLabel(\"" + ((IPseudoAtom)atom).getLabel() + "\");\n"); + writer.write(" IPseudoAtom " + atom.getID() + " = mol.getBuilder().newPseudoAtom();"); + writer.newLine(); + writer.write(" atom.setLabel(\"" + ((IPseudoAtom)atom).getLabel() + "\");"); + writer.newLine(); } else { writer.write(" IAtom " + atom.getID() + " = mol.getBuilder().newAtom(\"" + atom.getSymbol() + - "\");\n"); + "\");"); + writer.newLine(); } if (atom.getFormalCharge() != null) { - writer.write(" " + atom.getID() + ".setFormalCharge(" + atom.getFormalCharge() + ");\n"); + writer.write(" " + atom.getID() + ".setFormalCharge(" + atom.getFormalCharge() + ");"); + writer.newLine(); } if (write2DCoordinates.isSet() && atom.getPoint2d() != null) { Point2d p2d = atom.getPoint2d(); writer.write(" " + atom.getID() + ".setPoint2d(new Point2d(" + - p2d.x + ", " + p2d.y + "));\n"); + p2d.x + ", " + p2d.y + "));"); + writer.newLine(); } if (write3DCoordinates.isSet() && atom.getPoint3d() != null) { Point3d p3d = atom.getPoint3d(); writer.write(" " + atom.getID() + ".setPoint3d(new Point3d(" + - p3d.x + ", " + p3d.y + ", " + p3d.z + "));\n"); + p3d.x + ", " + p3d.y + ", " + p3d.z + "));"); + writer.newLine(); } } @@ -220,7 +234,8 @@ writer.write(" IBond " + bond.getID() + " = mol.getBuilder().newBond(" + bond.getAtom(0).getID() + ", " + bond.getAtom(1).getID() + ", IBond.Order." + - bond.getOrder() + ");\n"); + bond.getOrder() + ");"); + writer.newLine(); } public int getSupportedDataFeatures() { Modified: cdk/trunk/src/main/org/openscience/cdk/io/CrystClustWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/CrystClustWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/CrystClustWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -132,7 +132,7 @@ private void writeChemSequence(IChemSequence cs) throws UnsupportedChemObjectException { int count = cs.getChemModelCount(); for (int i=0; i < count; i++) { - write("frame: " + (i+1) + "\n"); + writeln("frame: " + (i+1)); writeCrystal(cs.getChemModel(i).getCrystal()); } } @@ -161,9 +161,9 @@ String sg = crystal.getSpaceGroup(); if ("P 2_1 2_1 2_1".equals(sg)) { - write("P 21 21 21 (1)\n"); + writeln("P 21 21 21 (1)"); } else { - write("P 1 (1)\n"); + writeln("P 1 (1)"); } // output unit cell axes @@ -174,14 +174,14 @@ // output number of atoms int noatoms = crystal.getAtomCount(); write(new Integer(noatoms).toString()); - write("\n"); + writeln(""); // output number of asym. units (Z) if (sg.equals("P1")) { - write("1\n"); + writeln("1"); } else { // duno - write("1\n"); + writeln("1"); } // output atoms @@ -191,11 +191,11 @@ write(atom.getSymbol()); write(":"); // output atom charge - write(new Double(atom.getCharge()).toString() + "\n"); + writeln(new Double(atom.getCharge()).toString()); // output coordinates - write(new Double(atom.getPoint3d().x).toString() + "\n"); - write(new Double(atom.getPoint3d().y).toString() + "\n"); - write(new Double(atom.getPoint3d().z).toString() + "\n"); + writeln(new Double(atom.getPoint3d().x).toString()); + writeln(new Double(atom.getPoint3d().y).toString()); + writeln(new Double(atom.getPoint3d().z).toString()); } } @@ -205,17 +205,27 @@ writer.write(s); } catch (IOException e) { System.err.println("CMLWriter IOException while printing \"" + - s + "\":\n" + e.toString()); + s + "\":" + e.toString()); } } + private void writeln(String s) { + try { + writer.write(s); + writer.newLine(); + } catch (IOException e) { + System.err.println("CMLWriter IOException while printing \"" + + s + "\":" + e.toString()); + } + } + private void writeVector3d(Vector3d vector) { write(new Double(vector.x).toString()); - write("\n"); + writeln(""); write(new Double(vector.y).toString()); - write("\n"); + writeln(""); write(new Double(vector.z).toString()); - write("\n"); + writeln(""); } } Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNReader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNReader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNReader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -251,7 +251,7 @@ data += line; // preserve newlines, unless the line is exactly 80 chars; in that case it // is assumed to continue on the next line. See MDL documentation. - if (line.length() < 80) data += "\n"; + if (line.length() < 80) data += System.getProperty("line.separator"); } if (fieldName != null) { logger.info("fieldName, data: ", fieldName, ", ", data); @@ -324,7 +324,7 @@ do { molFileLine = input.readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); } while (!molFileLine.equals("M END")); // read MDL molfile content @@ -354,7 +354,7 @@ do { molFileLine = input.readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); } while (!molFileLine.equals("M END")); // read MDL molfile content Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV2000Reader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV2000Reader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV2000Reader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -217,7 +217,7 @@ do { molFileLine = input.readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); } while (!molFileLine.equals("M END")); // read MDL molfile content @@ -250,7 +250,7 @@ do { molFileLine = input.readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); } while (!molFileLine.equals("M END")); // read MDL molfile content Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV3000Reader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV3000Reader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNV3000Reader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -206,7 +206,7 @@ while (!molFileLine.endsWith("END REACTANT")) { molFileLine = readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); }; try { @@ -241,7 +241,7 @@ while (!molFileLine.endsWith("END PRODUCT")) { molFileLine = readLine(); molFile.append(molFileLine); - molFile.append("\n"); + molFile.append(System.getProperty("line.separator")); }; try { Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLRXNWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -210,24 +210,28 @@ writer.newLine(); } - writer.write("$RXN\n"); + writer.write("$RXN"); + writer.newLine(); // reaction name String line = (String)reaction.getProperty(CDKConstants.TITLE); if(line == null) line = ""; if(line.length() > 80) line = line.substring(0,80); - writer.write(line + "\n"); + writer.write(line); + writer.newLine(); // user/program/date&time/reaction registry no. line writer.newLine(); // comment line line = (String)reaction.getProperty(CDKConstants.REMARK); if(line == null) line = ""; if(line.length() > 80) line = line.substring(0,80); - writer.write(line + "\n"); + writer.write(line); + writer.newLine(); line = ""; line += formatMDLInt(reactantCount, 3); line += formatMDLInt(productCount, 3); - writer.write(line + "\n"); + writer.write(line); + writer.newLine(); writeMoleculeSet(reaction.getReactants()); writeMoleculeSet(reaction.getProducts()); @@ -271,7 +275,8 @@ IMolecule mol = som.getMolecule(i); for (int j = 0; j < som.getMultiplier(i); j++) { StringWriter sw = new StringWriter(); - writer.write("$MOL\n"); + writer.write("$MOL"); + writer.newLine(); MDLWriter mdlwriter = null; try { mdlwriter = new MDLWriter(sw); Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLReader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLReader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLReader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -257,7 +257,7 @@ data += line; // preserve newlines, unless the line is exactly 80 chars; in that case it // is assumed to continue on the next line. See MDL documentation. - if (line.length() < 80) data += "\n"; + if (line.length() < 80) data += System.getProperty("line.separator"); } if (fieldName != null) { logger.info("fieldName, data: ", fieldName, ", ", data); Modified: cdk/trunk/src/main/org/openscience/cdk/io/MDLV2000Reader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/MDLV2000Reader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/MDLV2000Reader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -251,7 +251,7 @@ data += line; // preserve newlines, unless the line is exactly 80 chars; in that case it // is assumed to continue on the next line. See MDL documentation. - if (line.length() < 80) data += "\n"; + if (line.length() < 80) data += System.getProperty("line.separator"); } if (fieldName != null) { logger.info("fieldName, data: ", fieldName, ", ", data); Modified: cdk/trunk/src/main/org/openscience/cdk/io/Mol2Writer.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/Mol2Writer.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/Mol2Writer.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -135,7 +135,8 @@ logger.debug("Writing header..."); if (mol.getProperty(CDKConstants.TITLE) != null) { - writer.write("# Name: " + mol.getProperty(CDKConstants.TITLE) + "\n"); + writer.write("# Name: " + mol.getProperty(CDKConstants.TITLE)); + writer.newLine(); } // FIXME: add other types of meta data writer.newLine(); @@ -149,13 +150,17 @@ */ logger.debug("Writing molecule block..."); - writer.write("@<TRIPOS>MOLECULE\n"); - writer.write(mol.getID() + "\n"); + writer.write("@<TRIPOS>MOLECULE"); + writer.newLine(); + writer.write(mol.getID()); + writer.newLine(); writer.write(mol.getAtomCount() + " " + - mol.getBondCount() + - "\n"); // that's the minimum amount of info required the format - writer.write("SMALL\n"); // no biopolymer - writer.write("NO CHARGES\n"); // other options include Gasteiger charges + mol.getBondCount()); // that's the minimum amount of info required the format + writer.newLine(); + writer.write("SMALL"); // no biopolymer + writer.newLine(); + writer.write("NO CHARGES"); // other options include Gasteiger charges + writer.newLine(); /* @<TRIPOS>ATOM @@ -175,7 +180,8 @@ // write atom block logger.debug("Writing atom block..."); - writer.write("@<TRIPOS>ATOM\n"); + writer.write("@<TRIPOS>ATOM"); + writer.newLine(); for (int i = 0; i < mol.getAtomCount(); i++) { IAtom atom = mol.getAtom(i); writer.write(i + " " + @@ -191,7 +197,8 @@ } else { writer.write("0.000 0.000 0.000 "); } - writer.write(atom.getSymbol()+ "\n"); // FIXME: should use perceived Mol2 Atom Types! + writer.write(atom.getSymbol()); // FIXME: should use perceived Mol2 Atom Types! + writer.newLine(); } /* @@ -212,7 +219,8 @@ // write bond block logger.debug("Writing bond block..."); - writer.write("@<TRIPOS>BOND\n"); + writer.write("@<TRIPOS>BOND"); + writer.newLine(); int counter = 0; Iterator bonds = mol.bonds(); @@ -221,8 +229,8 @@ writer.write(counter + " " + mol.getAtomNumber(bond.getAtom(0)) + " " + mol.getAtomNumber(bond.getAtom(1)) + " " + - ((int)bond.getOrder().ordinal()) + - "\n"); + ((int)bond.getOrder().ordinal())); + writer.newLine(); counter++; } Modified: cdk/trunk/src/main/org/openscience/cdk/io/PDBReader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/PDBReader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/PDBReader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -355,7 +355,7 @@ comment = ""; } if (lineLength >12) { - comment = comment.toString() + cRead.substring(11).trim() + "\n"; + comment = comment.toString() + cRead.substring(11).trim() + System.getProperty("line.separator"); oFile.setProperty(CDKConstants.COMMENT, comment); } else { logger.warn("REMARK line found without any comment!"); @@ -465,7 +465,7 @@ } } while (_oInput.ready() && (cRead != null)); } catch (Exception e) { - logger.error("Found a problem at line:\n"); + logger.error("Found a problem at line:"); logger.error(cRead); logger.error("01234567890123456789012345678901234567890123456789012345678901234567890123456789"); logger.error(" 1 2 3 4 5 6 7 "); Modified: cdk/trunk/src/main/org/openscience/cdk/io/PDBWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/PDBWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/PDBWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -192,7 +192,8 @@ public void writeCrystal(ICrystal crystal) throws CDKException { try { - writer.write("HEADER created with the CDK (http://cdk.sf.net/)\n"); + writer.write("HEADER created with the CDK (http://cdk.sf.net/)"); + writer.newLine(); Vector3d a = crystal.getA(); Vector3d b = crystal.getB(); Vector3d c = crystal.getC(); Modified: cdk/trunk/src/main/org/openscience/cdk/io/ShelXWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/ShelXWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/ShelXWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -139,9 +139,9 @@ Object title = crystal.getProperty(CDKConstants.TITLE); if (title != null && title.toString().trim().length() > 0) { - write("TITL " + title.toString().trim() + "\n"); + writeln("TITL " + title.toString().trim()); } else { - write("TITL Produced with CDK (http://cdk.sf.net/)\n"); + writeln("TITL Produced with CDK (http://cdk.sf.net/)"); } Vector3d a = crystal.getA(); Vector3d b = crystal.getB(); @@ -159,17 +159,17 @@ write(format.reset("%8.5f").format(clength) + " "); write(format.reset("%8.4f").format(alpha) + " "); write(format.reset("%8.4f").format(beta) + " "); - write(format.reset("%8.4f").format(gamma) + "\n"); - write("ZERR " + format.reset("%1.5f").format((double)crystal.getZ()) + - " 0.01000 0.01000 0.01000 0.0100 0.0100 0.0100\n"); + writeln(format.reset("%8.4f").format(gamma) + ""); + writeln("ZERR " + format.reset("%1.5f").format((double)crystal.getZ()) + + " 0.01000 0.01000 0.01000 0.0100 0.0100 0.0100"); String spaceGroup = crystal.getSpaceGroup(); if ("P1".equals(spaceGroup)) { - write("LATT -1\n"); + writeln("LATT -1"); } else if ("P 2_1 2_1 2_1".equals(spaceGroup)) { - write("LATT -1\n"); - write("SYMM 1/2+X , 1/2-Y , -Z\n"); - write("SYMM -X , 1/2+Y , 1/2-Z\n"); - write("SYMM 1/2-X , -Y , 1/2+Z\n"); + writeln("LATT -1"); + writeln("SYMM 1/2+X , 1/2-Y , -Z"); + writeln("SYMM -X , 1/2+Y , 1/2-Z"); + writeln("SYMM 1/2-X , -Y , 1/2+Z"); } // MFAnalyser mfa = new MFAnalyser(crystal); String elemNames = ""; @@ -184,8 +184,8 @@ String countS = new Integer(MolecularFormulaManipulator.getElementCount(formula, element)).toString(); elemCounts += countS + " ".substring(countS.length()); } - write("SFAC " + elemNames + "\n"); - write("UNIT " + elemCounts + "\n"); + writeln("SFAC " + elemNames); + writeln("UNIT " + elemCounts); /* write atoms */ for (int i = 0; i < crystal.getAtomCount(); i++) { IAtom atom = crystal.getAtom(i); @@ -203,9 +203,9 @@ write(" ".substring(elemID.length())); write(format.reset("%7.5f").format(fracCoord.x) + " "); write(format.reset("%7.5f").format(fracCoord.y) + " "); - write(format.reset("%7.5f").format(fracCoord.z) + " 11.00000 0.05000\n"); + writeln(format.reset("%7.5f").format(fracCoord.z) + " 11.00000 0.05000"); } - write("END\n"); + writeln("END"); } private void write(String s) { @@ -213,8 +213,18 @@ writer.write(s); } catch (IOException e) { System.err.println("CMLWriter IOException while printing \"" + - s + "\":\n" + e.toString()); + s + "\":" + e.toString()); } } + private void writeln(String s) { + try { + writer.write(s); + writer.newLine(); + } catch (IOException e) { + System.err.println("CMLWriter IOException while printing \"" + + s + "\":" + e.toString()); + } + } + } Modified: cdk/trunk/src/main/org/openscience/cdk/io/ZMatrixReader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/ZMatrixReader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/ZMatrixReader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -226,7 +226,7 @@ m.addAtom(file.getBuilder().newAtom(types[i], cartCoords[i])); } -// logger.debug("molecule:\n"+m); +// logger.debug("molecule:"+m); setOfMolecules.addMolecule(m); chemModel.setMoleculeSet(setOfMolecules); Modified: cdk/trunk/src/main/org/openscience/cdk/io/cml/PMPConvention.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/cml/PMPConvention.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/cml/PMPConvention.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -109,7 +109,7 @@ ); } } else { - logger.debug("PMP Convention error: incorrect number of cell axis fractions!\n"); + logger.debug("PMP Convention error: incorrect number of cell axis fractions!"); } // cdo.endObject(axis); } else { Modified: cdk/trunk/src/main/org/openscience/cdk/io/iterator/IteratingMDLReader.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/iterator/IteratingMDLReader.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/iterator/IteratingMDLReader.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -130,7 +130,7 @@ while (currentLine != null && !currentLine.equals("M END")) { // still in a molecule buffer.append(currentLine); - buffer.append("\n"); + buffer.append(System.getProperty("line.separator")); if (input.ready()) { currentLine = input.readLine(); } else { @@ -144,7 +144,7 @@ } } buffer.append(currentLine); - buffer.append("\n"); + buffer.append(System.getProperty("line.separator")); logger.debug("MDL file part read: ", buffer); ISimpleChemObjectReader reader = factory.createReader(currentFormat); reader.setReader(new StringReader(buffer.toString())); Modified: cdk/trunk/src/main/org/openscience/cdk/io/program/GaussianInputWriter.java =================================================================== --- cdk/trunk/src/main/org/openscience/cdk/io/program/GaussianInputWriter.java 2008-07-23 10:03:11 UTC (rev 11713) +++ cdk/trunk/src/main/org/openscience/cdk/io/program/GaussianInputWriter.java 2008-07-23 10:26:14 UTC (rev 11714) @@ -180,7 +180,8 @@ writer.newLine(); // next line is comment - writer.write(comment.getSetting() + "\n"); + writer.write(comment.getSetting()); + writer.newLine(); // next line is empty writer.newLine(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |