Skip to content

Commit d0f29ab

Browse files
eclipse-platform-botlaeubi
authored andcommitted
Perform clean code of terminal/bundles/org.eclipse.terminal.view.core
1 parent e6a93da commit d0f29ab

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

terminal/bundles/org.eclipse.terminal.view.core/src/org/eclipse/terminal/view/core/internal/PropertyTester.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public boolean test(Object receiver, String property, Object[] args, Object expe
2424
// "hasContextPropertiesProvider": Checks if a context properties provider is available for the given receiver.
2525
if ("hasContextPropertiesProvider".equals(property)) { //$NON-NLS-1$
2626
boolean hasProvider = TerminalContextPropertiesProviderFactory.getProvider(receiver) != null;
27-
return expectedValue instanceof Boolean ? ((Boolean) expectedValue).equals(Boolean.valueOf(hasProvider))
27+
return expectedValue instanceof Boolean b ? b.equals(Boolean.valueOf(hasProvider))
2828
: hasProvider;
2929
}
3030

terminal/bundles/org.eclipse.terminal.view.core/src/org/eclipse/terminal/view/core/preferences/ScopedEclipsePreferences.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,9 @@ protected void firePreferenceEvent(IEclipsePreferences node, String key, String
429429
Assert.isNotNull(key);
430430

431431
// If no listener is registered, we are done here
432-
if (listeners.isEmpty())
432+
if (listeners.isEmpty()) {
433433
return;
434+
}
434435

435436
// Create the preference change event
436437
final PreferenceChangeEvent event = new PreferenceChangeEvent(node, key, oldValue, newValue);

terminal/bundles/org.eclipse.terminal.view.core/src/org/eclipse/terminal/view/core/utils/Env.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,16 @@ public static String[] getEnvironment(String[] envp, boolean terminal) {
6363
}
6464
}
6565
// Set the TERM environment variable if in terminal mode
66-
if (terminal)
66+
if (terminal) {
6767
environmentVariables.put("TERM", "xterm");//$NON-NLS-1$ //$NON-NLS-2$
68+
}
6869

6970
// Convert into an array of strings
7071
List<String> keys = new ArrayList<>(environmentVariables.stringPropertyNames());
7172
// On Windows hosts, sort the environment keys
72-
if (Platform.OS_WIN32.equals(Platform.getOS()))
73+
if (Platform.OS_WIN32.equals(Platform.getOS())) {
7374
Collections.sort(keys);
75+
}
7476
List<String> strings = new ArrayList<>(keys.size());
7577
for (String key : keys) {
7678
String value = environmentVariables.getProperty(key);

0 commit comments

Comments
 (0)