Lint cleanups.

This commit is contained in:
akwizgran
2018-11-26 11:40:39 +00:00
parent 98633f5e7c
commit 56ac755e96
11 changed files with 39 additions and 39 deletions

View File

@@ -282,6 +282,8 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
InputStream in = null;
OutputStream out = null;
try {
// The done file may already exist from a previous installation
//noinspection ResultOfMethodCallIgnored
doneFile.delete();
// Unzip the Tor binary to the filesystem
in = getTorInputStream();
@@ -303,7 +305,8 @@ abstract class TorPlugin implements DuplexPlugin, EventHandler, EventListener {
in = getConfigInputStream();
out = new FileOutputStream(configFile);
copyAndClose(in, out);
doneFile.createNewFile();
if (!doneFile.createNewFile())
LOG.warning("Failed to create done file");
} catch (IOException e) {
IoUtils.tryToClose(in, LOG, WARNING);
IoUtils.tryToClose(out, LOG, WARNING);

View File

@@ -318,6 +318,8 @@ public class AccountManagerImplTest extends BrambleMockTestCase {
}
private void storeDatabaseKey(File f, String hex) throws IOException {
// Create parent directory if it doesn't already exist
//noinspection ResultOfMethodCallIgnored
f.getParentFile().mkdirs();
FileOutputStream out = new FileOutputStream(f);
out.write(hex.getBytes("UTF-8"));

View File

@@ -1393,7 +1393,6 @@ public class DatabaseComponentImplTest extends BrambleMockTestCase {
}
@Test
@SuppressWarnings("unchecked")
public void testMessageDependencies() throws Exception {
int shutdownHandle = 12345;
MessageId messageId2 = new MessageId(getRandomId());