Skip to content

Conversation

@pishguy
Copy link

@pishguy pishguy commented Nov 30, 2016

FIX BUG: get exception when task size is less than downloadPerTime

Get ```IndexOutOfBoundsException``` error
Add some code to help user to how can we use download multiple task
this.listener = downloadManagerListener;
this.downloadTaskPerTime = downloadPerTime;

if (tasks.size() < downloadPerTime) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe It's better to write something like this

 this.downloadTaskPerTime = downloadPerTime;
 if (tasks.size() < downloadPerTime) {
       this.downloadTaskPerTime = tasks.size();
}

But why?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes you have right, its better than my code


downloaderList =
new HashMap<Integer, Thread>(downloadTaskPerTime);
downloaderList =new HashMap<>(downloadTaskPerTime);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

downloadTaskPerTime variable still final ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alamusitl are you familiar with this library?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not much

Add DeleteAllUncompletedsDownloads from database and files
add allUnCompleteds function
Fix latest commit for downloadTaskPerTime
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants