Skip to content

Commit

Permalink
Warnings fixed; Repository URLs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
amaembo committed Apr 6, 2020
1 parent 0d858c0 commit ff7150d
Showing 1 changed file with 10 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,9 @@ public static void publishAnalysisStarted(@NotNull final Project project) {

public static void publishAnalysisStartedToEDT(@NotNull final Project project) {
EventDispatchThreadHelper.checkNotEDT();
EventDispatchThreadHelper.invokeLater(new Runnable() {
@Override
public void run() {
FindBugsState.set(project, FindBugsState.Started);
publish(project, AnalysisStartedListener.TOPIC).analysisStarted();
}
EventDispatchThreadHelper.invokeLater(() -> {
FindBugsState.set(project, FindBugsState.Started);
publish(project, AnalysisStartedListener.TOPIC).analysisStarted();
});
}

Expand All @@ -107,28 +104,22 @@ public static void publishAnalysisAborting(@NotNull final Project project) {

public static void publishAnalysisAbortedToEDT(@NotNull final Project project) {
EventDispatchThreadHelper.checkNotEDT();
EventDispatchThreadHelper.invokeLater(new Runnable() {
@Override
public void run() {
FindBugsState.set(project, FindBugsState.Aborted);
publish(project, AnalysisAbortedListener.TOPIC).analysisAborted();
}
EventDispatchThreadHelper.invokeLater(() -> {
FindBugsState.set(project, FindBugsState.Aborted);
publish(project, AnalysisAbortedListener.TOPIC).analysisAborted();
});
}

public static void publishAnalysisFinishedToEDT(@NotNull final Project project, @NotNull final FindBugsResult result, @Nullable final Throwable error) {
EventDispatchThreadHelper.checkNotEDT();
/**
/*
* Guarantee thread visibility *one* time.
*/
final AtomicReference<FindBugsResult> resultRef = New.atomicRef(result);
final AtomicReference<Throwable> errorRef = New.atomicRef(error);
EventDispatchThreadHelper.invokeLater(new Runnable() {
@Override
public void run() {
FindBugsState.set(project, FindBugsState.Finished);
publish(project, AnalysisFinishedListener.TOPIC).analysisFinished(resultRef.get(), errorRef.get());
}
EventDispatchThreadHelper.invokeLater(() -> {
FindBugsState.set(project, FindBugsState.Finished);
publish(project, AnalysisFinishedListener.TOPIC).analysisFinished(resultRef.get(), errorRef.get());
});
}

Expand Down

0 comments on commit ff7150d

Please sign in to comment.