-
-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cleanup. #525
Cleanup. #525
Conversation
Any real reason for the imports being modified? |
that's just automatic in my ide is there a issue with it? |
@@ -45,8 +46,8 @@ public void downloadAndConnect() { | |||
try { | |||
Files.copy(new URL(DATABASE_URL).openStream(), tempFile.toPath(), StandardCopyOption.REPLACE_EXISTING); | |||
} catch (IOException e) { | |||
Files.copy(Database.class.getResource("/database.db").openStream(), tempFile.toPath(), | |||
StandardCopyOption.REPLACE_EXISTING); | |||
Files.copy(Objects.requireNonNull(Database.class.getResource("/database.db")).openStream(), tempFile.toPath(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one's not needed actually. It'll throw an error if it doesn't exist either way, however it'll just be an IOException.
@@ -44,8 +45,8 @@ public LinuxNotifSender() { | |||
libNotify = new DefaultJLibnotifyLoader().load(); | |||
libNotify.init("AntiMalware"); | |||
notificationImage = File.createTempFile("notificationImage", "").toPath(); | |||
Files.copy(Main.class.getResource("/index.jpg").openStream(), notificationImage, | |||
StandardCopyOption.REPLACE_EXISTING); | |||
Files.copy(Objects.requireNonNull(Main.class.getResource("/index.jpg")).openStream(), notificationImage, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will always exist, so checking if it's null doesn't make sense. I can't really think of a reason it wouldn't.
@@ -128,7 +128,7 @@ private void scanZip(Path zippedFile) { | |||
try ( PrintWriter pw = new PrintWriter(file)) { | |||
pw.write(zippedFile.toString()); | |||
} | |||
for (File foundDir : destination.listFiles()) { | |||
for (File foundDir : Objects.requireNonNull(Objects.requireNonNull(destination.listFiles()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really see why this is needed? The destination folder is always created and iirc if there's no files in the directory nothing will happen
Yh I realized after I had to go so couldn't commit fix in time |
I'm against the requireNonNull movement.
sorta fixes #446