Skip to content

Commit

Permalink
synchronize GroovyLogManager.manager operations #877
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Brooks authored and fvgh committed Jun 15, 2021
1 parent 5e8c3b8 commit b123f17
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ public GroovyErrorListener() {
errors = Collections.synchronizedList(new ArrayList<String>());
ILog groovyLogger = GroovyCoreActivator.getDefault().getLog();
groovyLogger.addLogListener(this);
GroovyLogManager.manager.addLogger(this);
synchronized(GroovyLogManager.manager) {
GroovyLogManager.manager.addLogger(this);
}
}

@Override
Expand All @@ -117,7 +119,9 @@ public void logging(final IStatus status, final String plugin) {
public boolean errorsDetected() {
ILog groovyLogger = GroovyCoreActivator.getDefault().getLog();
groovyLogger.removeLogListener(this);
GroovyLogManager.manager.removeLogger(this);
synchronized(GroovyLogManager.manager) {
GroovyLogManager.manager.removeLogger(this);
}
return 0 != errors.size();
}

Expand Down

0 comments on commit b123f17

Please sign in to comment.