Source:
<code>public MolecularFormulaGenerator(final IChemObjectBuilder builder, final double minMass, final double maxMass, final MolecularFormulaRange mfRange) throws CDKException { logger.info("Initiate MolecularFormulaGenerator, mass range " + minMass <START> + "-" + maxMass); <END> if ((minMass < 0.0) || (maxMass < 0.0)) { throw (new CDKException( "The minimum and maximum mass values must be >=0")); } if ((minMass > maxMass)) { throw (new CDKException("Minimum mass must be <= maximum mass")); } if ((mfRange == null) || (mfRange.getIsotopeCount() == 0)) { throw (new CDKException( "The MolecularFormulaRange parameter must be non-null and must contain at least one isotope")); } this.builder = builder; this.minMass = minMass; this.maxMass = maxMass; final TreeSet<IIsotope> isotopesSet = new TreeSet<IIsotope>( new IIsotopeSorterByMass()); for (IIsotope isotope : mfRange.isotopes()) { if (isotope.getExactMass() == null) throw new CDKException("The exact mass value of isotope " + isotope + " is not set"); isotopesSet.add(isotope); } isotopes = isotopesSet.toArray(new IIsotope[isotopesSet.size()]); minCounts = new int[isotopes.length]; maxCounts = new int[isotopes.length]; for (int i = 0; i < isotopes.length; i++) { minCounts[i] = mfRange.getIsotopeCountMin(isotopes[i]); maxCounts[i] = mfRange.getIsotopeCountMax(isotopes[i]); int maxCountAccordingToMass = (int) Math.floor(maxMass / isotopes[i].getExactMass()); if (maxCounts[i] > maxCountAccordingToMass) maxCounts[i] = maxCountAccordingToMass; } currentCounts = Arrays.copyOf(minCounts, minCounts.length); }</code><technical_language>comma's instead of '+'... advantage logging is enabled, create multiple String objects (and is faster): logger.info("...", minMass, "-", maxMass);</technical_language>

Target:
public MolecularFormulaGenerator(final IChemObjectBuilder builder, final double minMass, final double maxMass, final MolecularFormulaRange mfRange) throws CDKException { logger.info("Initiate MolecularFormulaGenerator, mass range ", minMass, "-", maxMass); if ((minMass < 0.0) || (maxMass < 0.0)) { throw (new CDKException( "The minimum and maximum mass values must be >=0")); } if ((minMass > maxMass)) { throw (new CDKException("Minimum mass must be <= maximum mass")); } if ((mfRange == null) || (mfRange.getIsotopeCount() == 0)) { throw (new CDKException( "The MolecularFormulaRange parameter must be non-null and must contain at least one isotope")); } this.builder = builder; this.minMass = minMass; this.maxMass = maxMass; final TreeSet<IIsotope> isotopesSet = new TreeSet<IIsotope>( new IIsotopeSorterByMass()); for (IIsotope isotope : mfRange.isotopes()) { if (isotope.getExactMass() == null) throw new CDKException("The exact mass value of isotope " + isotope + " is not set"); isotopesSet.add(isotope); } isotopes = isotopesSet.toArray(new IIsotope[isotopesSet.size()]); minCounts = new int[isotopes.length]; maxCounts = new int[isotopes.length]; for (int i = 0; i < isotopes.length; i++) { minCounts[i] = mfRange.getIsotopeCountMin(isotopes[i]); maxCounts[i] = mfRange.getIsotopeCountMax(isotopes[i]); int maxCountAccordingToMass = (int) Math.floor(maxMass / isotopes[i].getExactMass()); if (maxCounts[i] > maxCountAccordingToMass) maxCounts[i] = maxCountAccordingToMass; } currentCounts = Arrays.copyOf(minCounts, minCounts.length); }