Skip to content

Commit 072c8b0

Browse files
eclipse-platform-botakurtakov
authored andcommitted
Perform clean code of bundles/org.eclipse.e4.ui.services
1 parent 9b9d575 commit 072c8b0

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/internal/services/ContextContextService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public class ContextContextService implements EContextService {
2727
static final String LOCAL_CONTEXTS = "localContexts";
2828
static final String DEFERRED_UPDATES = "localContexts.updates";
2929

30-
private IEclipseContext eclipseContext;
31-
private ContextManager contextManager;
30+
private final IEclipseContext eclipseContext;
31+
private final ContextManager contextManager;
3232

3333
private boolean deferUpdates;
3434

bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/EventBroker.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
public class EventBroker implements IEventBroker {
3939

4040
// TBD synchronization
41-
private Map<EventHandler, Collection<ServiceRegistration<?>>> registrations = new HashMap<>();
41+
private final Map<EventHandler, Collection<ServiceRegistration<?>>> registrations = new HashMap<>();
4242

4343
@Inject
4444
@Optional
@@ -139,8 +139,9 @@ public boolean subscribe(String topic, String filter, EventHandler eventHandler,
139139
@Override
140140
public boolean unsubscribe(EventHandler eventHandler) {
141141
Collection<ServiceRegistration<?>> handled = registrations.remove(eventHandler);
142-
if (handled == null || handled.isEmpty())
142+
if (handled == null || handled.isEmpty()) {
143143
return false;
144+
}
144145
for (ServiceRegistration<?> r : handled) {
145146
r.unregister();
146147
}

bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/internal/events/UIEventHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ public UIEventHandler(EventHandler eventHandler, UISynchronize uiSync) {
3232

3333
@Override
3434
public void handleEvent(final Event event) {
35-
if (uiSync == null)
35+
if (uiSync == null) {
3636
eventHandler.handleEvent(event);
37-
else {
37+
} else {
3838
uiSync.syncExec(() -> eventHandler.handleEvent(event));
3939
}
4040
}

0 commit comments

Comments
 (0)