Permalink
Browse files
Cleanup - pmd:UseIndexOfChar - Use Index Of Char (#585)
- Loading branch information...
|
|
@@ -103,15 +103,15 @@ protected int doWork() { |
|
|
final String baseFileName;
|
|
|
if (inputUrl != null) {
|
|
|
final String path = inputUrl.getPath();
|
|
|
- final int lastSlash = path.lastIndexOf("/");
|
|
|
+ final int lastSlash = path.lastIndexOf('/');
|
|
|
baseFileName = path.substring(lastSlash + 1, path.length());
|
|
|
} else {
|
|
|
baseFileName = inputFile.getAbsolutePath();
|
|
|
}
|
|
|
|
|
|
if (baseFileName.endsWith(BamFileIoUtils.BAM_FILE_EXTENSION)) {
|
|
|
|
|
|
- final int index = baseFileName.lastIndexOf(".");
|
|
|
+ final int index = baseFileName.lastIndexOf('.');
|
|
|
OUTPUT = new File(baseFileName.substring(0, index) + BAMIndex.BAMIndexSuffix);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
@@ -461,7 +461,7 @@ String getBaseName(final String readName1, final String readName2, final FastqRe |
|
|
private String [] getReadNameTokens(final String readName, final int pairNum, final FastqReader freader) {
|
|
|
if(readName.equals("")) throw new PicardException(error(freader,"Pair read name "+pairNum+" cannot be empty: "+readName));
|
|
|
|
|
|
- final int idx = readName.lastIndexOf("/");
|
|
|
+ final int idx = readName.lastIndexOf('/');
|
|
|
final String[] result = new String[2];
|
|
|
|
|
|
if (idx == -1) {
|
|
|
@@ -489,7 +489,7 @@ private String error(final FastqReader freader, final String str) { |
|
|
|
|
|
// Read names cannot contain blanks
|
|
|
private String getReadName(final String fastqHeader, final boolean paired) {
|
|
|
- final int idx = fastqHeader.indexOf(" ");
|
|
|
+ final int idx = fastqHeader.indexOf(' ');
|
|
|
String readName = (idx == -1) ? fastqHeader : fastqHeader.substring(0,idx);
|
|
|
|
|
|
// NOTE: the while loop isn't necessarily the most efficient way to handle this but we don't
|
|
|
|
0 comments on commit
1ecf3d4