-
Notifications
You must be signed in to change notification settings - Fork 33
Removing the manuell download links and replacing them with an automatic system #348
base: development
Are you sure you want to change the base?
Removing the manuell download links and replacing them with an automatic system #348
Conversation
DeepCode's analysis on #4e8f8e found:
Top issues
👉 View analysis in DeepCode’s Dashboard | Configure the bot |
HashMap<String, GetBukkitVersion> versionsMap = new HashMap<>(); | ||
for (GetBukkitVersion version : versions) | ||
versionsMap.put(version.getVersion(), version); | ||
|
||
while (true) { |
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.
Can you improve this loop based on the result of "test"
...dnet-setup/src/main/java/eu/cloudnetservice/cloudnet/v2/setup/spigot/SetupSpigotVersion.java
Show resolved
Hide resolved
URL url = version.getDownloadURL(); | ||
return download.test(url.toString()); | ||
} catch (IOException exception) { | ||
exception.printStackTrace(); |
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.
Handle the exception
short searchFor = 0; //0 -> "Version" Text; 1 -> Actual Version; 2 -> Download Link | ||
|
||
String line; | ||
while ((line = reader.readLine()) != null) { |
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.
make you condition right and you need no break!
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.
Whilst I appreciate your help, please give more constructive feedback.
What would be the correct condition to check for?
InputStream input = connection.getInputStream(); | ||
try (BufferedReader reader = new BufferedReader(new InputStreamReader(input))) { | ||
String line; | ||
while ((line = reader.readLine()) != null) { |
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.
Make the conndition right and move the return value into a temp variable
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.
Whilst I appreciate your help, please give more constructive feedback.
What would be the correct condition to check for?
This pull request includes:
Changes made to the repository:
I removed the manuell download links for GetBukkit.org and replaced them with a system that automaticaly gets all versions that can be downloaded from GetBukkit.org.
Documentation of test results:
Just tested if the funktion works as intended and if performance is okay (it worked and I improved performance after testing)
Related issues/discussions:
No related issues