FindBugs 'Maintainability' fixes
This commit is contained in:
parent
05cbf1c8c0
commit
3253fc216b
|
|
@ -208,6 +208,7 @@ public class FastaSequenceIndexBuilder {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
in.close();
|
||||||
return sequenceIndex;
|
return sequenceIndex;
|
||||||
}
|
}
|
||||||
catch (IOException e) {
|
catch (IOException e) {
|
||||||
|
|
|
||||||
|
|
@ -264,7 +264,7 @@ class SampleStatistics {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// different contigs
|
// different contigs
|
||||||
if (read.getMateReferenceIndex() != read.getReferenceIndex())
|
if (!read.getMateReferenceIndex().equals(read.getReferenceIndex()))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// unmapped
|
// unmapped
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,9 @@ public class BAMDiffableReader implements DiffableReader {
|
||||||
InputStream fstream = new BufferedInputStream(new FileInputStream(file));
|
InputStream fstream = new BufferedInputStream(new FileInputStream(file));
|
||||||
if ( !BlockCompressedInputStream.isValidFile(fstream) )
|
if ( !BlockCompressedInputStream.isValidFile(fstream) )
|
||||||
return false;
|
return false;
|
||||||
new BlockCompressedInputStream(fstream).read(buffer, 0, BAM_MAGIC.length);
|
final BlockCompressedInputStream BCIS = new BlockCompressedInputStream(fstream);
|
||||||
|
BCIS.read(buffer, 0, BAM_MAGIC.length);
|
||||||
|
BCIS.close();
|
||||||
return Arrays.equals(buffer, BAM_MAGIC);
|
return Arrays.equals(buffer, BAM_MAGIC);
|
||||||
} catch ( IOException e ) {
|
} catch ( IOException e ) {
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,10 @@ public class GATKReportDiffableReader implements DiffableReader {
|
||||||
public boolean canRead(File file) {
|
public boolean canRead(File file) {
|
||||||
try {
|
try {
|
||||||
final String HEADER = GATKReport.GATKREPORT_HEADER_PREFIX;
|
final String HEADER = GATKReport.GATKREPORT_HEADER_PREFIX;
|
||||||
char[] buff = new char[HEADER.length()];
|
final char[] buff = new char[HEADER.length()];
|
||||||
new FileReader(file).read(buff, 0, HEADER.length());
|
final FileReader FR = new FileReader(file);
|
||||||
|
FR.read(buff, 0, HEADER.length());
|
||||||
|
FR.close();
|
||||||
String firstLine = new String(buff);
|
String firstLine = new String(buff);
|
||||||
return firstLine.startsWith(HEADER);
|
return firstLine.startsWith(HEADER);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
|
|
||||||
|
|
@ -305,7 +305,7 @@ public class ConstrainedMateFixingManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean iSizeTooBigToMove(SAMRecord read, int maxInsertSizeForMovingReadPairs) {
|
public static boolean iSizeTooBigToMove(SAMRecord read, int maxInsertSizeForMovingReadPairs) {
|
||||||
return ( read.getReadPairedFlag() && ! read.getMateUnmappedFlag() && read.getReferenceName() != read.getMateReferenceName() ) // maps to different chromosomes
|
return ( read.getReadPairedFlag() && ! read.getMateUnmappedFlag() && !read.getReferenceName().equals(read.getMateReferenceName()) ) // maps to different chromosomes
|
||||||
|| Math.abs(read.getInferredInsertSize()) > maxInsertSizeForMovingReadPairs; // we won't try to move such a read
|
|| Math.abs(read.getInferredInsertSize()) > maxInsertSizeForMovingReadPairs; // we won't try to move such a read
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -177,6 +177,7 @@ public class TrancheManager {
|
||||||
double runningValue = metric.getRunningMetric(i);
|
double runningValue = metric.getRunningMetric(i);
|
||||||
out.printf("%.4f %d %.4f%n", d.lod, score, runningValue);
|
out.printf("%.4f %d %.4f%n", d.lod, score, runningValue);
|
||||||
}
|
}
|
||||||
|
out.close();
|
||||||
} catch (FileNotFoundException e) {
|
} catch (FileNotFoundException e) {
|
||||||
throw new UserException.CouldNotCreateOutputFile(f, e);
|
throw new UserException.CouldNotCreateOutputFile(f, e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,7 @@ public class VariantsToBinaryPed extends RodWalker<Integer,Integer> {
|
||||||
inStream.read(readGenotypes);
|
inStream.read(readGenotypes);
|
||||||
outBed.write(readGenotypes);
|
outBed.write(readGenotypes);
|
||||||
}
|
}
|
||||||
|
inStream.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new ReviewedStingException("Error reading form temp file for input.",e);
|
throw new ReviewedStingException("Error reading form temp file for input.",e);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ public class ForumAPIUtils {
|
||||||
System.out.println(line);
|
System.out.println(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
br.close();
|
||||||
httpClient.getConnectionManager().shutdown();
|
httpClient.getConnectionManager().shutdown();
|
||||||
return output;
|
return output;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue