From 1ac29b3fae37ab43b2316ea1c9901de33620c978 Mon Sep 17 00:00:00 2001 From: jlerbsc Date: Tue, 5 Mar 2024 08:59:21 +0100 Subject: [PATCH] fix sonar issue 2629 Logging arguments should not require evaluation --- .../nbio/core/util/FileDownloadUtils.java | 2 +- .../core/util/SingleLinkageClusterer.java | 8 +- .../genome/util/ChromosomeMappingTools.java | 16 +-- .../org/biojava/nbio/structure/ChainImpl.java | 9 +- .../nbio/structure/StructureTools.java | 5 +- .../structure/align/StructurePairAligner.java | 4 +- .../align/pairwise/FragmentJoiner.java | 4 +- .../align/seq/SmithWaterman3Daligner.java | 2 +- .../structure/cluster/SubunitExtractor.java | 2 +- .../contact/StructureInterfaceList.java | 4 +- .../structure/domain/SerializableCache.java | 2 +- .../structure/geometry/SuperPositionQCP.java | 4 +- .../nbio/structure/io/EntityFinder.java | 2 +- .../nbio/structure/io/LocalPDBDirectory.java | 4 +- .../nbio/structure/io/PDBFileParser.java | 97 ++++++++----------- .../nbio/structure/io/SeqRes2AtomAligner.java | 6 +- .../io/cif/CifStructureConsumerImpl.java | 11 +-- .../io/sifts/SiftsMappingProvider.java | 2 +- .../structure/io/sifts/SiftsXMLParser.java | 4 +- .../biojava/nbio/structure/scop/Astral.java | 2 +- .../structure/symmetry/core/HelixSolver.java | 14 +-- .../structure/symmetry/internal/CeSymm.java | 2 +- .../symmetry/internal/CeSymmIterative.java | 3 +- .../nbio/structure/xtal/CrystalBuilder.java | 16 +-- 24 files changed, 100 insertions(+), 125 deletions(-) diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java b/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java index 8c3a691e0f..beabccb2b0 100644 --- a/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java +++ b/biojava-core/src/main/java/org/biojava/nbio/core/util/FileDownloadUtils.java @@ -212,7 +212,7 @@ public static void createValidationFiles(URLConnection resourceUrlConnection, Fi if(size == -1) { logger.warn("could not find expected file size for resource {}.", resourceUrlConnection.getURL()); } else { - logger.debug("Content-Length: " + size); + logger.debug("Content-Length: {}", size); File sizeFile = new File(localDestination.getParentFile(), localDestination.getName() + SIZE_EXT); try (PrintStream sizePrintStream = new PrintStream(sizeFile)) { sizePrintStream.print(size); diff --git a/biojava-core/src/main/java/org/biojava/nbio/core/util/SingleLinkageClusterer.java b/biojava-core/src/main/java/org/biojava/nbio/core/util/SingleLinkageClusterer.java index 7c4b15f65a..eef144080a 100644 --- a/biojava-core/src/main/java/org/biojava/nbio/core/util/SingleLinkageClusterer.java +++ b/biojava-core/src/main/java/org/biojava/nbio/core/util/SingleLinkageClusterer.java @@ -135,7 +135,7 @@ private void clusterIt() { dendrogram = new LinkedPair[numItems-1]; - logger.debug("Initial matrix: \n"+matrixToString()); + logger.debug("Initial matrix: \n{}", matrixToString()); for (int m=0;m> getClusters(double cutoff) { } } - logger.debug("Within cutoff: "+dendrogram[i]); + logger.debug("Within cutoff: {}", dendrogram[i]); } else { - logger.debug("Not within cutoff: "+dendrogram[i]); + logger.debug("Not within cutoff: {}", dendrogram[i]); } } @@ -344,7 +344,7 @@ public Map> getClusters(double cutoff) { } - logger.debug("Clusters: \n"+clustersToString(finalClusters)); + logger.debug("Clusters: \n{}", clustersToString(finalClusters)); return finalClusters; } diff --git a/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java b/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java index 8d7030f3d4..b19de4657b 100644 --- a/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java +++ b/biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java @@ -231,12 +231,12 @@ public static int getCDSLength(GeneChromosomePosition chromPos) { */ public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) { - logger.debug(" ? Checking chromosome position for CDS position " + cdsNucleotidePosition); + logger.debug(" ? Checking chromosome position for CDS position {}", cdsNucleotidePosition); List exonStarts = chromPos.getExonStarts(); List exonEnds = chromPos.getExonEnds(); - logger.debug(" Exons:" + exonStarts.size()); + logger.debug(" Exons:{}", exonStarts.size()); int cdsStart = chromPos.getCdsStart(); int cdsEnd = chromPos.getCdsEnd(); @@ -378,7 +378,7 @@ public static ChromPos getChromPosReverse(int cdsPos, List exonStarts, if ( tmp > (end - start ) ) { tmp = (end - start ); - logger.debug("changing tmp to " + tmp); + logger.debug("changing tmp to {}", tmp); } logger.debug(" " + cdsPos + " " + codingLength + " | " + (cdsPos - codingLength) + " | " + (end -start) + " | " + tmp); logger.debug(" Exon : " + format(start+1) + " - " + format(end) + " | " + format(end - start) + " | " + codingLength + " | " + (codingLength % 3)); @@ -397,7 +397,7 @@ public static ChromPos getChromPosReverse(int cdsPos, List exonStarts, logger.debug(" coding length: " + codingLength + "(phase:" + (codingLength % 3) + ") CDS POS trying to map:" + cdsPos); } - logger.debug("length exons: " + lengthExons); + logger.debug("length exons: {}", lengthExons); // could not map, or map over the full length?? return new ChromPos(-1,-1); @@ -811,11 +811,11 @@ public static int getCDSPosForward(int chromPos, List exonStarts, List< // the genetic coordinate is not in a coding region if ( (chromPos < (cdsStart+base) ) || ( chromPos > (cdsEnd+base) ) ) { - logger.debug("The "+format(chromPos)+" position is not in a coding region"); + logger.debug("The {} position is not in a coding region", format(chromPos)); return -1; } - logger.debug("looking for CDS position for " +format(chromPos)); + logger.debug("looking for CDS position for {}", format(chromPos)); // map the genetic coordinates of coding region on a stretch of a reverse strand List> cdsRegions = getCDSRegions(exonStarts, exonEnds, cdsStart, cdsEnd); @@ -858,11 +858,11 @@ public static int getCDSPosReverse(int chromPos, List exonStarts, List< // the genetic coordinate is not in a coding region if ( (chromPos < (cdsStart+base)) || ( chromPos > (cdsEnd+base) ) ) { - logger.debug("The "+format(chromPos)+" position is not in a coding region"); + logger.debug("The {} position is not in a coding region", format(chromPos)); return -1; } - logger.debug("looking for CDS position for " +format(chromPos)); + logger.debug("looking for CDS position for {}", format(chromPos)); // map the genetic coordinate on a stretch of a reverse strand List> cdsRegions = getCDSRegions(exonStarts, exonEnds, cdsStart, cdsEnd); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java index f0e1f02c61..7c30badc02 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java @@ -597,14 +597,7 @@ public GroupType getPredominantGroupType(){ max = GroupType.HETATM; } } - logger.debug( - "Ratio of residues to total for chain with asym_id {} is below {}. Assuming it is a {} chain. " - + "Counts: # aa residues: {}, # nuc residues: {}, # non-water het residues: {}, # waters: {}, " - + "ratio aa/total: {}, ratio nuc/total: {}", - getId(), ratioResiduesToTotal, max, sizeAminos, - sizeNucleotides, sizeHetatomsWithoutWater, sizeWaters, - (double) sizeAminos / (double) fullSize, - (double) sizeNucleotides / (double) fullSize); + logger.debug("Ratio of residues to total for chain with asym_id {} is below {}. Assuming it is a {} chain. Counts: # aa residues: {}, # nuc residues: {}, # non-water het residues: {}, # waters: {}, ratio aa/total: {}, ratio nuc/total: {}{}{}{}{}", getId(), ratioResiduesToTotal, max, sizeAminos, sizeNucleotides, sizeHetatomsWithoutWater, sizeWaters, (double) sizeAminos, (double) fullSize, (double) sizeNucleotides, (double) fullSize); return max; } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java index af5f7ab80f..b2b6e88e6b 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/StructureTools.java @@ -834,10 +834,7 @@ public static Atom[] getAtomArray(Chain c, String[] atomNames) { for (String atomName : atomNames) { Atom a = g.getAtom(atomName); if (a == null) { - logger.debug("Group " + g.getResidueNumber() + " (" - + g.getPDBName() - + ") does not have the required atom '" + atomName - + "'"); + logger.debug("Group {} ({}) does not have the required atom '{}'", g.getResidueNumber(), g.getPDBName(), atomName); // this group does not have a required atom, skip it... thisGroupAllAtoms = false; break; diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java index d47dc52502..906e79e70a 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/StructurePairAligner.java @@ -407,8 +407,8 @@ public void align(Atom[] ca1, Atom[] ca2, StrucAligParameters params) // step 1 get all Diagonals of length X that are similar between both // structures - logger.debug(" length atoms1:" + ca1.length); - logger.debug(" length atoms2:" + ca2.length); + logger.debug(" length atoms1:{}", ca1.length); + logger.debug(" length atoms2:{}", ca2.length); logger.debug("step 1 - get fragments with similar intramolecular distances "); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java index ac8fdaa563..cb9b870111 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/pairwise/FragmentJoiner.java @@ -375,10 +375,10 @@ public JointFragments[] frag_pairwise_compat(FragmentPair[] fraglst, int angleDi List fll = new ArrayList(); double adiff = angleDiff * Math.PI / 180d; - logger.debug("addiff" + adiff); + logger.debug("addiff{}", adiff); //distance between two unit vectors with angle adiff double ddiff = Math.sqrt(2.0-2.0*Math.cos(adiff)); - logger.debug("ddiff" + ddiff); + logger.debug("ddiff{}", ddiff); // the fpairs in the flist have to be sorted with respect to their positions diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/seq/SmithWaterman3Daligner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/seq/SmithWaterman3Daligner.java index 1a0597fd07..a9d9569cc1 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/align/seq/SmithWaterman3Daligner.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/align/seq/SmithWaterman3Daligner.java @@ -140,7 +140,7 @@ public AFPChain align(Atom[] ca1, Atom[] ca2, Object parameters) throw new StructureException("Empty alignment for sequences "+s1+" and "+s2); } - logger.debug("Smith-Waterman alignment is: "+pair.toString(100)); + logger.debug("Smith-Waterman alignment is: {}", pair.toString(100)); // convert to a 3D alignment... afpChain = convert(ca1,ca2,pair, smithWaterman); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java index 7060037bfc..487a51b564 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/cluster/SubunitExtractor.java @@ -82,7 +82,7 @@ public static List extractSubunits(Structure structure, // Calculate the minimum length of a Subunit int adjustedMinLen = calcAdjustedMinimumSequenceLength(subunits, absMinLen, fraction, minLen); - logger.debug("Adjusted minimum sequence length: " + adjustedMinLen); + logger.debug("Adjusted minimum sequence length: {}", adjustedMinLen); // Filter out short Subunits for (int s = subunits.size() - 1; s >= 0; s--) { diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java index eb9901bd38..5af5a61bc3 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java @@ -468,13 +468,13 @@ public String toString() { public static StructureInterfaceList calculateInterfaces(Structure struc) { CrystalBuilder builder = new CrystalBuilder(struc); StructureInterfaceList interfaces = builder.getUniqueInterfaces(); - logger.debug("Calculating ASA for "+interfaces.size()+" potential interfaces"); + logger.debug("Calculating ASA for {} potential interfaces", interfaces.size()); interfaces.calcAsas(StructureInterfaceList.DEFAULT_ASA_SPHERE_POINTS, //fewer for performance Runtime.getRuntime().availableProcessors(), StructureInterfaceList.DEFAULT_MIN_COFACTOR_SIZE); interfaces.removeInterfacesBelowArea(); interfaces.getClusters(); - logger.debug("Found "+interfaces.size()+" interfaces"); + logger.debug("Found {} interfaces", interfaces.size()); return interfaces; } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/SerializableCache.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/SerializableCache.java index b653b73d52..0f03a5a31c 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/SerializableCache.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/domain/SerializableCache.java @@ -127,7 +127,7 @@ public Map reloadFromFile() { try{ - logger.debug("Reloading from cache " + f.getAbsolutePath()); + logger.debug("Reloading from cache {}", f.getAbsolutePath()); FileInputStream fis = new FileInputStream(f); ObjectInputStream ois = new ObjectInputStream(fis); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java index a3d5728f19..bfb029bbe1 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/geometry/SuperPositionQCP.java @@ -261,13 +261,13 @@ private void calcRmsd(Point3d[] x, Point3d[] y) { // translate to origin xref = CalcPoint.clonePoint3dArray(x); xtrans = CalcPoint.centroid(xref); - logger.debug("x centroid: " + xtrans); + logger.debug("x centroid: {}", xtrans); xtrans.negate(); CalcPoint.translate(new Vector3d(xtrans), xref); yref = CalcPoint.clonePoint3dArray(y); ytrans = CalcPoint.centroid(yref); - logger.debug("y centroid: " + ytrans); + logger.debug("y centroid: {}", ytrans); ytrans.negate(); CalcPoint.translate(new Vector3d(ytrans), yref); innerProduct(yref, xref); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java index 1fc2b185c2..d5c47fdf92 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/EntityFinder.java @@ -297,7 +297,7 @@ private static TreeMap findEntitiesFromAlignment(List IDENTITY_THRESHOLD && gapCov1" + line + "<"); + logger.debug("LINE: >{}<", line); String[] fieldList = line.split("\\s+"); @@ -1216,12 +1206,11 @@ private void pdb_SOURCE_Handler(String line) { if (previousContinuationField.equals(continuationField) && sourceFieldValues.contains(continuationField)) { - logger.debug("Still in field " + continuationField); + logger.debug("Still in field {}", continuationField); continuationString = continuationString.concat(token + " "); - logger.debug("continuationString = " - + continuationString); + logger.debug("continuationString = {}", continuationString); } if (!continuationField.equals(previousContinuationField)) { @@ -2174,7 +2163,7 @@ private void pdb_TER_Handler() { */ private void pdb_DBREF_Handler(String line){ - logger.debug("Parsing DBREF " + line); + logger.debug("Parsing DBREF {}", line); DBRef dbref = new DBRef(); String idCode = line.substring(7,11); @@ -2385,7 +2374,7 @@ private void pdb_SITE_Handler(String line){ // make a map of: SiteId to List - logger.debug("Site Line:"+line); + logger.debug("Site Line:{}", line); String siteID = line.substring(11, 14); @@ -2398,7 +2387,7 @@ private void pdb_SITE_Handler(String line){ siteToResidueMap.put(siteID.trim(), siteResidues); logger.debug(String.format("New Site made: %s %s", siteID, siteResidues)); - logger.debug("Now made " + siteMap.size() + " sites"); + logger.debug("Now made {} sites", siteMap.size()); } @@ -2414,7 +2403,7 @@ private void pdb_SITE_Handler(String line){ while (!" ".equals((groupString = line.substring(0, 10)))) { //groupstring: 'ARG H 221A' - logger.debug("groupString: '" + groupString + "'"); + logger.debug("groupString: '{}'", groupString); //set the residue name //residueName = 'ARG' @@ -2444,7 +2433,7 @@ private void pdb_SITE_Handler(String line){ ResidueNumber residueNumber = new ResidueNumber(); - logger.debug("pdbCode: '" + resNum + insCode + "'"); + logger.debug("pdbCode: '{}{}'", resNum, insCode); residueNumber.setChainName(chainId); residueNumber.setSeqNum(resNum); @@ -2457,7 +2446,7 @@ private void pdb_SITE_Handler(String line){ line = line.substring(11); } - logger.debug("Current SiteMap (contains "+ siteToResidueMap.keySet().size() + " sites):"); + logger.debug("Current SiteMap (contains {} sites):", siteToResidueMap.keySet().size()); for (String key : siteToResidueMap.keySet()) { logger.debug(key + " : " + siteToResidueMap.get(key)); } @@ -2481,7 +2470,7 @@ private void pdb_REMARK_800_Handler(String line){ // remark800Counter++; String siteID = fields[1].trim(); - logger.debug("siteID: '" + siteID +"'"); + logger.debug("siteID: '{}'", siteID); //fetch the siteResidues from the map site = siteMap.get(siteID); @@ -2491,8 +2480,8 @@ private void pdb_REMARK_800_Handler(String line){ site = new Site(siteID, new ArrayList()); siteMap.put(site.getSiteID(), site); - logger.debug("New Site made: " + site); - logger.debug("Now made " + siteMap.size() + " sites"); + logger.debug("New Site made: {}", site); + logger.debug("Now made {} sites", siteMap.size()); } } @@ -2500,7 +2489,7 @@ private void pdb_REMARK_800_Handler(String line){ // remark800Counter++; String evCode = fields[1].trim(); - logger.debug("evCode: '" + evCode +"'"); + logger.debug("evCode: '{}'", evCode); //fetch the siteResidues from the map site.setEvCode(evCode); @@ -2509,12 +2498,12 @@ private void pdb_REMARK_800_Handler(String line){ // remark800Counter++; String desc = fields[1].trim(); - logger.debug("desc: '" + desc +"'"); + logger.debug("desc: '{}'", desc); //fetch the siteResidues from the map site.setDescription(desc); - logger.debug("Finished making REMARK 800 for site " + site.getSiteID()); + logger.debug("Finished making REMARK 800 for site {}", site.getSiteID()); logger.debug(site.remark800toPDB()); } @@ -3417,7 +3406,7 @@ private void buildjournalArticle() { if ("AUTH".equals(subField)) { auth.append(line.substring(19, line.length()).trim()); - logger.debug("AUTH '" + auth.toString() + "'"); + logger.debug("AUTH '{}'", auth.toString()); } if ("TITL".equals(subField)) { @@ -3425,26 +3414,26 @@ private void buildjournalArticle() { //words on the join won't be concatenated titl.append(line.substring(19, line.length()).trim()).append(" "); - logger.debug("TITL '" + titl.toString() + "'"); + logger.debug("TITL '{}'", titl.toString()); } if ("EDIT".equals(subField)) { edit.append(line.substring(19, line.length()).trim()); - logger.debug("EDIT '" + edit.toString() + "'"); + logger.debug("EDIT '{}'", edit.toString()); } // JRNL REF NAT.IMMUNOL. V. 8 430 2007 if ("REF ".equals(subField)) { ref.append(line.substring(19, line.length()).trim()).append(" "); - logger.debug("REF '" + ref.toString() + "'"); + logger.debug("REF '{}'", ref.toString()); } if ("PUBL".equals(subField)) { publ.append(line.substring(19, line.length()).trim()).append(" "); - logger.debug("PUBL '" + publ.toString() + "'"); + logger.debug("PUBL '{}'", publ.toString()); } // JRNL REFN ISSN 1529-2908 @@ -3455,21 +3444,21 @@ private void buildjournalArticle() { } refn.append(line.substring(35, line.length()).trim()); - logger.debug("REFN '" + refn.toString() + "'"); + logger.debug("REFN '{}'", refn.toString()); } // JRNL PMID 17351618 if ("PMID".equals(subField)) { pmid.append(line.substring(19, line.length()).trim()); - logger.debug("PMID '" + pmid.toString() + "'"); + logger.debug("PMID '{}'", pmid.toString()); } // JRNL DOI 10.1038/NI1450 if ("DOI ".equals(subField)) { doi.append(line.substring(19, line.length()).trim()); - logger.debug("DOI '" + doi.toString() + "'"); + logger.debug("DOI '{}'", doi.toString()); } } @@ -3509,7 +3498,7 @@ private class JournalParser { public JournalParser(String ref) { - logger.debug("JournalParser init '" + ref + "'"); + logger.debug("JournalParser init '{}'", ref); if ("TO BE PUBLISHED ".equals(ref)) { @@ -3599,7 +3588,7 @@ public JournalParser(String ref) { if (!" ".equals(journalString)) { journalName = journalString; - logger.debug("JournalParser set journalName " + journalName); + logger.debug("JournalParser set journalName {}", journalName); } } @@ -3649,14 +3638,14 @@ private List authorBuilder(String authorString) { Author author = new Author(); author.setSurname(authors[0]); - logger.debug("Set consortium author name " + author.getSurname()); + logger.debug("Set consortium author name {}", author.getSurname()); authorList.add(author); } else { for (int i = 0; i < authors.length; i++) { String authorFullName = authors[i]; - logger.debug("Building author " + authorFullName); + logger.debug("Building author {}", authorFullName); Author author = new Author(); String regex = "\\."; @@ -3679,7 +3668,7 @@ private List authorBuilder(String authorString) { else if (authorNames.length == 1) { author.setSurname(authorNames[0]); - logger.debug("Set consortium author name in multiple author block " + author.getSurname + logger.debug("Set consortium author name in multiple author block {}", author.getSurname ()); } else { @@ -3693,14 +3682,14 @@ else if (authorNames.length == 1) { initials += initial + "."; } - logger.debug("built initials '" + initials + "'"); + logger.debug("built initials '{}'", initials); author.setInitials(initials); //surname is always last int lastName = authorNames.length - 1; String surname = authorNames[lastName]; - logger.debug("built author surname " + surname); + logger.debug("built author surname {}", surname); author.setSurname(surname); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java index 5d8c5b7ffb..a5854efe08 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/SeqRes2AtomAligner.java @@ -312,7 +312,7 @@ private List trySimpleMatch(List seqResGroups,List atmResGr // } if ( seqResPos >= seqResGroups.size()){ - logger.debug("seqres groups don't match atom indices " + seqResPos); + logger.debug("seqres groups don't match atom indices {}", seqResPos); if ( atomResGroup instanceof AminoAcid ) return null; else @@ -521,7 +521,7 @@ private boolean alignNucleotideGroups(List seqRes, List atomRes) { - logger.debug("Alignment:\n"+pair.toString(100)); + logger.debug("Alignment:\n{}", pair.toString(100)); boolean noMatchFound = mapDNAChains(seqRes,atomRes,pair,seqresIndexPosition, atomIndexPosition ); @@ -617,7 +617,7 @@ private boolean alignProteinChains(List seqRes, List atomRes) { } - logger.debug("Alignment:\n"+pair.toString(100)); + logger.debug("Alignment:\n{}", pair.toString(100)); boolean noMatchFound = mapChains(seqRes,atomRes,pair,seqresIndexPosition, atomIndexPosition ); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java index 2f91dab7ee..b3be41bad0 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/cif/CifStructureConsumerImpl.java @@ -560,8 +560,7 @@ public void consumeCell(Cell cell) { // If the entry describes a structure determined by a technique other than X-ray crystallography, // cell is (sometimes!) a = b = c = 1.0, alpha = beta = gamma = 90 degrees // if so we don't add and CrystalCell will be null - logger.debug("The crystal cell read from file does not have reasonable dimensions (at least one " + - "dimension is below {}), discarding it.", CrystalCell.MIN_VALID_CELL_SIZE); + logger.debug("The crystal cell read from file does not have reasonable dimensions (at least one dimension is below {}), discarding it.", CrystalCell.MIN_VALID_CELL_SIZE); return; } @@ -617,7 +616,7 @@ private Date convert(LocalDate localDate) { @Override public void consumeDatabasePDBRev(DatabasePDBRev databasePDBrev) { - logger.debug("got a database revision:" + databasePDBrev); + logger.debug("got a database revision:{}", databasePDBrev); Date modDate = null; for (int rowIndex = 0; rowIndex < databasePDBrev.getRowCount(); rowIndex++) { @@ -715,8 +714,7 @@ public void consumeEntityPolySeq(EntityPolySeq entityPolySeq) { // the group is actually a nucleotide group... g = new NucleotideImpl(); } else { - logger.debug("Residue {} {} is not a standard aminoacid or nucleotide, will create a het group " + - "for it", entityPolySeq.getNum().get(rowIndex), entityPolySeq.getMonId().get(rowIndex)); + logger.debug("Residue {} {} is not a standard aminoacid or nucleotide, will create a het group for it", entityPolySeq.getNum().get(rowIndex), entityPolySeq.getMonId().get(rowIndex)); g = new HetatomImpl(); } } @@ -1595,8 +1593,7 @@ private static Chain removeSeqResHeterogeneity(Chain c) { if (lastResNum == null || !lastResNum.equals(currentResNum)) { trimmedChain.addGroup(g); } else { - logger.debug("Removing seqres group because it seems to be repeated in entity_poly_seq, most likely " + - "has hetero='y': {}", g); + logger.debug("Removing seqres group because it seems to be repeated in entity_poly_seq, most likely has hetero='y': {}", g); } lastResNum = currentResNum; diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsMappingProvider.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsMappingProvider.java index f386140cdf..13e038cadd 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsMappingProvider.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsMappingProvider.java @@ -81,7 +81,7 @@ public static List getSiftsMapping(String pdbId) throws IOException } File dest = new File( hashDir, pdbId + ".sifts.xml.gz"); - logger.debug("testing SIFTS file " + dest.getAbsolutePath()); + logger.debug("testing SIFTS file {}", dest.getAbsolutePath()); if ( ! dest.exists()){ diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java index 9f0789976c..e566550df2 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/sifts/SiftsXMLParser.java @@ -131,13 +131,13 @@ private SiftsEntity getSiftsEntity(Element empEl) { SiftsSegment s = getSiftsSegment(el); - logger.debug("new segment: " + s); + logger.debug("new segment: {}", s); entity.addSegment(s); } } - logger.debug("new SIFTS entity: " + entity); + logger.debug("new SIFTS entity: {}", entity); return entity; } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java index d7c1ebe5d5..da1f82221f 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/scop/Astral.java @@ -222,7 +222,7 @@ private void init(Reader reader) { String scopId = line.split("\\s")[0].substring(1); names.add(scopId); if (i % 1000 == 0) { - logger.debug("Reading ASTRAL line for " + scopId); + logger.debug("Reading ASTRAL line for {}", scopId); } i++; } catch (RuntimeException e) { diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java index 361522fbd4..a2d002280c 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/core/HelixSolver.java @@ -87,7 +87,7 @@ private void solve() { for (Entry entry : interactionMap.entrySet()) { Integer[] pair = entry.getKey(); - logger.debug("HelixSolver: pair: " + Arrays.toString(pair)); + logger.debug("HelixSolver: pair: {}", Arrays.toString(pair)); int contacts = entry.getValue(); Point3d[] h1 = CalcPoint.clonePoint3dArray(repeatUnits.get(pair[0])); @@ -125,7 +125,7 @@ private void solve() { continue; } permutations.add(permutation); - logger.debug("Permutation: " + permutation); + logger.debug("Permutation: {}", permutation); // keep track of which subunits are permuted @@ -238,10 +238,10 @@ private void solve() { repeatUnitCenters.get(pair[1])); angle = getAngle(transformation); - logger.debug("Trace rmsd: " + traceRmsd); - logger.debug("Trace rise: " + rise); - logger.debug("Trace angle: " + Math.toDegrees(angle)); - logger.debug("Permutation: " + permutation); + logger.debug("Trace rmsd: {}", traceRmsd); + logger.debug("Trace rise: {}", rise); + logger.debug("Trace angle: {}", Math.toDegrees(angle)); + logger.debug("Permutation: {}", permutation); if (traceRmsd > parameters.getRmsdThreshold()) { continue; @@ -280,7 +280,7 @@ private void solve() { helix.setFold(fold); helix.setContacts(contacts); helix.setRepeatUnits(unit.getRepeatUnitIndices()); - logger.debug("Layerlines: " + helix.getLayerLines()); + logger.debug("Layerlines: {}", helix.getLayerLines()); for (List line : helix.getLayerLines()) { maxLayerLineLength = Math.max(maxLayerLineLength, line.size()); diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java index 641242a0bf..66626ef3f0 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymm.java @@ -431,7 +431,7 @@ public static CeSymmResult analyzeLevel(Atom[] atoms, msa = optimizer.optimize(); result.setMultipleAlignment(msa); } catch (RefinerFailedException e) { - logger.debug("Optimization failed:" + e.getMessage()); + logger.debug("Optimization failed:{}", e.getMessage()); } } } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmIterative.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmIterative.java index 66df0f2658..f1e50b756d 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmIterative.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/CeSymmIterative.java @@ -128,8 +128,7 @@ private void iterate(Atom[] atoms) throws StructureException { if ((atoms.length <= params.getWinSize() || atoms.length <= params.getMinCoreLength()) && !levels.isEmpty()) { - logger.debug("Aborting iteration due to insufficient Atom " - + "array length: %d", atoms.length); + logger.debug("Aborting iteration due to insufficient Atom array length: %d", atoms.length); return; } diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java index 2bc6806b77..4b5975cbaa 100644 --- a/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java +++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/xtal/CrystalBuilder.java @@ -280,12 +280,12 @@ private void calcInterfacesCrystal(StructureInterfaceList set, double cutoff) { int neighbors = (2*numCells+1)*(2*numCells+1)*(2*numCells+1)-1; int auTrials = (numPolyChainsAu*(numPolyChainsAu-1))/2; int trials = numPolyChainsAu*numOperatorsSg*numPolyChainsAu*neighbors; - logger.debug("Chain clash trials within original AU: "+auTrials); + logger.debug("Chain clash trials within original AU: {}", auTrials); logger.debug( "Chain clash trials between the original AU and the neighbouring "+neighbors+ " whole unit cells ("+numCells+" neighbours)" + "(2x"+numPolyChainsAu+"chains x "+numOperatorsSg+"AUs x "+neighbors+"cells) : "+trials); - logger.debug("Total trials: "+(auTrials+trials)); + logger.debug("Total trials: {}", (auTrials+trials)); } List polyChains = structure.getPolyChains(); @@ -404,12 +404,12 @@ else if (selfEquivalent) } end = System.currentTimeMillis(); - logger.debug("\n"+trialCount+" chain-chain clash trials done. Time "+(end-start)/1000+"s"); - logger.debug(" skipped (not overlapping AUs) : "+skippedAUsNoOverlap); - logger.debug(" skipped (not overlapping chains) : "+skippedChainsNoOverlap); - logger.debug(" skipped (sym redundant op pairs) : "+skippedRedundant); - logger.debug(" skipped (sym redundant self op) : "+skippedSelfEquivalent); - logger.debug("Found "+set.size()+" interfaces."); + logger.debug("\n{} chain-chain clash trials done. Time {}{}s", trialCount, (end-start), 1000); + logger.debug(" skipped (not overlapping AUs) : {}", skippedAUsNoOverlap); + logger.debug(" skipped (not overlapping chains) : {}", skippedChainsNoOverlap); + logger.debug(" skipped (sym redundant op pairs) : {}", skippedRedundant); + logger.debug(" skipped (sym redundant self op) : {}", skippedSelfEquivalent); + logger.debug("Found {} interfaces.", set.size()); }