X Tutup
Skip to content

Commit 082d860

Browse files
author
Mohamed Ezzat
committed
Cleanup - squid:S1858 - "toString()" should never be called on a String object
1 parent 59aaf8b commit 082d860

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

biojava-alignment/src/main/java/org/biojava/nbio/alignment/io/StockholmStructure.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ public List<AbstractSequence<? extends AbstractCompound>> getBioSequences(boolea
301301
private String[] splitSeqName(String sequenceName) {
302302
String[] result = new String[3];
303303

304-
String[] barSplit = sequenceName.toString().split("/");
304+
String[] barSplit = sequenceName.split("/");
305305
if (barSplit.length == 2) {
306306
result[0] = barSplit[0];
307307
String[] positions = barSplit[1].split("-");

biojava-core/src/main/java/org/biojava/nbio/core/sequence/TranscriptSequence.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public ArrayList<ProteinSequence> getProteinCDSSequences() {
181181

182182
DNASequence dnaCodingSequence = null;
183183
try {
184-
dnaCodingSequence = new DNASequence(codingSequence.toString().toUpperCase());
184+
dnaCodingSequence = new DNASequence(codingSequence.toUpperCase());
185185
} catch (CompoundNotFoundException e) {
186186
// if I understand this should not happen, please correct if I'm wrong - JD 2014-10-24
187187
logger.error("Could not create DNA coding sequence, {}. This is most likely a bug.", e.getMessage());

biojava-core/src/main/java/org/biojava/nbio/core/sequence/template/AbstractCompound.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ public boolean equalsIgnoreCase(Compound compound) {
126126
return false;
127127
}
128128
AbstractCompound them = (AbstractCompound) compound;
129-
return this.base.toString().equalsIgnoreCase(them.base.toString());
129+
return this.base.equalsIgnoreCase(them.base);
130130
}
131131
}

biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ public LocalPDBDirectory(String path) {
165165
if( path == null) {
166166
UserConfiguration config = new UserConfiguration();
167167
path = config.getPdbFilePath();
168-
logger.debug("Initialising from system property/environment variable to path: {}", path.toString());
168+
logger.debug("Initialising from system property/environment variable to path: {}", path);
169169
} else {
170170
path = FileDownloadUtils.expandUserHome(path);
171-
logger.debug("Initialising with path {}", path.toString());
171+
logger.debug("Initialising with path {}", path);
172172
}
173173
this.path = new File(path);
174174

biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/DownloadChemCompProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ private void writeID(String contents, String currentID) throws IOException{
224224

225225
try ( PrintWriter pw = new PrintWriter(new GZIPOutputStream(new FileOutputStream(localName))) ) {
226226

227-
pw.print(contents.toString());
227+
pw.print(contents);
228228
pw.flush();
229229
}
230230
}

biojava-survival/src/main/java/org/biojava/nbio/survival/cox/ResidualsCoxph.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static double[][] rowsum(double[][] rr, ArrayList<String> sets) throws E
153153
// Collections.sort(index);
154154

155155
for (int m = 0; m < index.size(); m++) {
156-
String key = index.get(m).toString();
156+
String key = index.get(m);
157157
sum[m][j] = sumMap.get(key);
158158
}
159159

0 commit comments

Comments
 (0)
X Tutup