Skip to content

Commit

Permalink
Remove unnecessary synchronized code blocks [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sarxos committed Jan 10, 2013
1 parent 6d68885 commit e2b93b5
Showing 1 changed file with 6 additions and 9 deletions.
Expand Up @@ -439,18 +439,14 @@ public boolean addWebcamListener(WebcamListener l) {
if (l == null) {
throw new IllegalArgumentException("Webcam listener cannot be null!");
}
synchronized (listeners) {
return listeners.add(l);
}
return listeners.add(l);
}

/**
* @return All webcam listeners
*/
public WebcamListener[] getWebcamListeners() {
synchronized (listeners) {
return listeners.toArray(new WebcamListener[listeners.size()]);
}
return listeners.toArray(new WebcamListener[listeners.size()]);
}

/**
Expand All @@ -460,9 +456,7 @@ public WebcamListener[] getWebcamListeners() {
* @return True if listener has been removed, false otherwise
*/
public boolean removeWebcamListener(WebcamListener l) {
synchronized (listeners) {
return listeners.remove(l);
}
return listeners.remove(l);
}

/**
Expand Down Expand Up @@ -649,6 +643,9 @@ public static boolean isHandleTermSignal() {
* @return True, if listeners list size has been changed, false otherwise
*/
public static boolean addDiscoveryListener(WebcamDiscoveryListener l) {
if (l == null) {
throw new IllegalArgumentException("Webcam discovery listener cannot be null!");
}
return DISCOVERY_LISTENERS.add(l);
}

Expand Down

0 comments on commit e2b93b5

Please sign in to comment.