Skip to content

Commit

Permalink
Patch cast Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Bencor29 committed Oct 9, 2018
1 parent bd37627 commit 73dc06f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions fr/bencor29/datatransfer/DTMaster.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public abstract class DTMaster {
private ArrayList<TransferListener> tl;

public DTMaster() {
tl = new ArrayList<>();
tl = new ArrayList<TransferListener>();
}

/**
Expand All @@ -26,7 +26,10 @@ public void addListener(TransferListener tl) {
* @return The TransferListener's list
*/
public TransferListener[] getListeners() {
return (TransferListener[]) this.tl.toArray();
TransferListener[] listeners = new TransferListener[this.tl.size()];
for(int i = 0; i < this.tl.size(); i++)
listeners[i] = this.tl.get(i);
return listeners;
}

/**
Expand Down

0 comments on commit 73dc06f

Please sign in to comment.