diff --git a/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/oniguruma/OnigSearcher.java b/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/oniguruma/OnigSearcher.java index 4695b2795..696c38a8b 100644 --- a/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/oniguruma/OnigSearcher.java +++ b/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/oniguruma/OnigSearcher.java @@ -18,7 +18,6 @@ import java.util.Collection; import java.util.List; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; @@ -31,7 +30,7 @@ final class OnigSearcher { private final List regExps; OnigSearcher(final Collection regExps) { - this.regExps = regExps.stream().map(OnigRegExp::new).collect(Collectors.toList()); + this.regExps = regExps.stream().map(OnigRegExp::new).toList(); } @Nullable diff --git a/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/rule/RegExpSourceList.java b/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/rule/RegExpSourceList.java index 310ddb030..3c2ccb4fb 100644 --- a/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/rule/RegExpSourceList.java +++ b/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/rule/RegExpSourceList.java @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; @@ -74,7 +73,7 @@ void setSource(final int index, final String newSource) { CompiledRule compile() { var cached = this.cached; if (cached == null) { - final List regexps = items.stream().map(RegExpSource::getSource).collect(Collectors.toList()); + final List regexps = items.stream().map(RegExpSource::getSource).toList(); cached = this.cached = new CompiledRule(regexps, items.stream().map(e -> e.ruleId).toArray(RuleId[]::new)); } return cached; @@ -96,8 +95,7 @@ CompiledRule compileAG(final boolean allowA, final boolean allowG) { } private CompiledRule resolveAnchors(final boolean allowA, final boolean allowG) { - final List regexps = items.stream().map(e -> e.resolveAnchors(allowA, allowG)) - .collect(Collectors.toList()); + final List regexps = items.stream().map(e -> e.resolveAnchors(allowA, allowG)).toList(); return new CompiledRule(regexps, items.stream().map(e -> e.ruleId).toArray(RuleId[]::new)); } } diff --git a/org.eclipse.tm4e.core/src/test/java/org/eclipse/tm4e/core/grammar/GrammarTest.java b/org.eclipse.tm4e.core/src/test/java/org/eclipse/tm4e/core/grammar/GrammarTest.java index 4caa471d6..d0e6d1cdc 100644 --- a/org.eclipse.tm4e.core/src/test/java/org/eclipse/tm4e/core/grammar/GrammarTest.java +++ b/org.eclipse.tm4e.core/src/test/java/org/eclipse/tm4e/core/grammar/GrammarTest.java @@ -11,7 +11,6 @@ */ package org.eclipse.tm4e.core.grammar; -import static org.eclipse.tm4e.core.internal.utils.NullSafetyHelper.*; import static org.eclipse.tm4e.core.registry.IGrammarSource.*; import static org.junit.jupiter.api.Assertions.*; @@ -78,7 +77,7 @@ class GrammarTest { void testTokenizeSingleLineExpression() throws Exception { final var registry = new Registry(); final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); - final var lineTokens = castNonNull(grammar).tokenizeLine("function add(a,b) { return a+b; }"); + final var lineTokens = grammar.tokenizeLine("function add(a,b) { return a+b; }"); assertFalse(lineTokens.isStoppedEarly()); for (int i = 0; i < lineTokens.getTokens().length; i++) { final IToken token = lineTokens.getTokens()[i]; @@ -98,7 +97,7 @@ void testTokenizeMultilineExpression() throws Exception { int j = 0; final String[] lines = { "function add(a,b)", "{ return a+b; }" }; for (final String line : lines) { - final var lineTokens = castNonNull(grammar).tokenizeLine(line, ruleStack, null); + final var lineTokens = grammar.tokenizeLine(line, ruleStack, null); assertFalse(lineTokens.isStoppedEarly()); ruleStack = lineTokens.getRuleStack(); for (i = 0; i < lineTokens.getTokens().length; i++) { @@ -116,7 +115,7 @@ void testTokenize0Tokens() throws Exception { final var registry = new Registry(); final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); final String lineText = ""; - final var lineTokens = castNonNull(grammar).tokenizeLine(lineText); + final var lineTokens = grammar.tokenizeLine(lineText); assertFalse(lineTokens.isStoppedEarly()); final var endIndexOffset = 1; // IToken's end-indexes are exclusive @@ -132,7 +131,7 @@ void testTokenize1Token() throws Exception { final var registry = new Registry(); final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); final String lineText = "true"; - final var lineTokens = castNonNull(grammar).tokenizeLine(lineText); + final var lineTokens = grammar.tokenizeLine(lineText); assertFalse(lineTokens.isStoppedEarly()); final var endIndexOffset = 1; // IToken's end-indexes are exclusive @@ -148,7 +147,7 @@ void testTokenize1TokenWithNewLine() throws Exception { final var registry = new Registry(); final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); final String lineText = "true\n"; - final var lineTokens = castNonNull(grammar).tokenizeLine(lineText); + final var lineTokens = grammar.tokenizeLine(lineText); assertFalse(lineTokens.isStoppedEarly()); final var endIndexOffset = 1; // IToken's end-indexes are exclusive @@ -165,7 +164,7 @@ void testTokenize1IllegalToken() throws Exception { final var registry = new Registry(); final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); final String lineText = "@"; // Uncaught SyntaxError: illegal character U+0040 - final var lineTokens = castNonNull(grammar).tokenizeLine(lineText); + final var lineTokens = grammar.tokenizeLine(lineText); assertFalse(lineTokens.isStoppedEarly()); final var endIndexOffset = 1; // IToken's end-indexes are exclusive @@ -181,7 +180,7 @@ void testTokenize2Tokens() throws Exception { final IGrammar grammar = registry.addGrammar(fromResource(Data.class, "JavaScript.tmLanguage")); final String lineText = "{}"; - final var lineTokens = castNonNull(grammar).tokenizeLine(lineText); + final var lineTokens = grammar.tokenizeLine(lineText); assertFalse(lineTokens.isStoppedEarly()); final var endIndexOffset = 1; // IToken's end-indexes are exclusive @@ -215,8 +214,7 @@ void testTokenizeTypeScriptFile() throws Exception { final List expectedTokens; try (var resource = Data.class.getResourceAsStream("raytracer_tokens.txt")) { expectedTokens = new BufferedReader(new InputStreamReader(resource, StandardCharsets.UTF_8)) - .lines() - .collect(Collectors.toList()); + .lines().toList(); } IStateStack stateStack = null; diff --git a/org.eclipse.tm4e.languageconfiguration/META-INF/MANIFEST.MF b/org.eclipse.tm4e.languageconfiguration/META-INF/MANIFEST.MF index 1e643ed4f..62a971747 100644 --- a/org.eclipse.tm4e.languageconfiguration/META-INF/MANIFEST.MF +++ b/org.eclipse.tm4e.languageconfiguration/META-INF/MANIFEST.MF @@ -9,8 +9,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.jface.text, org.eclipse.ui.genericeditor, com.google.gson;bundle-version="2.9.0", - org.eclipse.tm4e.core;bundle-version="0.5.0", - org.eclipse.tm4e.ui;bundle-version="0.6.0", + org.eclipse.tm4e.core;bundle-version="0.5.1", + org.eclipse.tm4e.ui;bundle-version="0.6.1", org.eclipse.core.runtime, org.eclipse.core.resources, org.eclipse.ui, diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/preferences/LanguageConfigurationPreferencePage.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/preferences/LanguageConfigurationPreferencePage.java index fe7e1140e..0a2778311 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/preferences/LanguageConfigurationPreferencePage.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/preferences/LanguageConfigurationPreferencePage.java @@ -16,7 +16,6 @@ import java.util.Collection; import java.util.Collections; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.jface.dialogs.Dialog; @@ -265,7 +264,7 @@ private Collection getSelectedUserDefinitions( return Collections.emptyList(); } return ((Collection) selection.toList()).stream() - .filter(definition -> definition.getPluginId() == null).collect(Collectors.toList()); + .filter(definition -> definition.getPluginId() == null).toList(); } @Override diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/CharacterPairSupport.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/CharacterPairSupport.java index 4f6bc84b6..53c9c0c50 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/CharacterPairSupport.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/CharacterPairSupport.java @@ -19,7 +19,6 @@ import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.tm4e.languageconfiguration.internal.model.AutoClosingPair; @@ -50,11 +49,11 @@ public CharacterPairSupport(LanguageConfiguration config) { if (autoClosingPairs != null) { this.autoClosingPairs = autoClosingPairs.stream().filter(Objects::nonNull) .map(el -> new AutoClosingPairConditional(el.open, el.close, el.notIn)) - .collect(Collectors.toList()); + .toList(); } else if (brackets != null) { this.autoClosingPairs = brackets.stream().filter(Objects::nonNull) .map(el -> new AutoClosingPairConditional(el.open, el.close, Collections.emptyList())) - .collect(Collectors.toList()); + .toList(); } else { this.autoClosingPairs = Collections.emptyList(); } @@ -66,7 +65,7 @@ public CharacterPairSupport(LanguageConfiguration config) { final var surroundingPairs = config.getSurroundingPairs(); this.surroundingPairs = surroundingPairs != null - ? surroundingPairs.stream().filter(Objects::nonNull).collect(Collectors.toList()) + ? surroundingPairs.stream().filter(Objects::nonNull).toList() : (List) (List) this.autoClosingPairs; } diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/OnEnterSupport.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/OnEnterSupport.java index f20919487..b1b7a865f 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/OnEnterSupport.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/supports/OnEnterSupport.java @@ -15,7 +15,6 @@ import java.util.List; import java.util.Objects; import java.util.regex.Pattern; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.tm4e.languageconfiguration.internal.model.CharacterPair; @@ -45,7 +44,7 @@ public OnEnterSupport(@Nullable final List brackets, @Nullable fi .stream() .filter(Objects::nonNull) .map(ProcessedBracketPair::new) - .collect(Collectors.toList()); + .toList(); this.regExpRules = regExpRules != null ? regExpRules : Collections.emptyList(); } diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/utils/TextUtils.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/utils/TextUtils.java index 98069ba97..7d05514c0 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/utils/TextUtils.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/utils/TextUtils.java @@ -175,6 +175,7 @@ public static TabSpacesInfo getTabSpaces(@Nullable final ITextViewer viewer) { final TabsToSpacesConverter converter = ClassHelper.getFieldValue(viewer, "fTabsToSpacesConverter", //$NON-NLS-1$ TextViewer.class); if (converter != null) { + @SuppressWarnings("null") final int tabSize = ClassHelper.getFieldValue(converter, "fTabRatio", TabsToSpacesConverter.class); //$NON-NLS-1$ return new TabSpacesInfo(tabSize, true); } @@ -188,7 +189,7 @@ public static TabSpacesInfo getTabSpaces(@Nullable final ITextViewer viewer) { * @param document the document to search in * @param line zero-based document line number * - * @return true if all the characters of the specified document range are the whitespace + * @return true if all the characters of the specified document range are the whitespace * characters, otherwise returns false */ public static boolean isBlankLine(final IDocument document, int line) { diff --git a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/widgets/LanguageConfigurationInfoWidget.java b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/widgets/LanguageConfigurationInfoWidget.java index c250b8d81..db353bbbe 100644 --- a/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/widgets/LanguageConfigurationInfoWidget.java +++ b/org.eclipse.tm4e.languageconfiguration/src/main/java/org/eclipse/tm4e/languageconfiguration/internal/widgets/LanguageConfigurationInfoWidget.java @@ -15,7 +15,6 @@ import java.util.List; import java.util.Objects; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.NonNullByDefault; import org.eclipse.jdt.annotation.Nullable; @@ -152,7 +151,7 @@ private List removeNullElements(@Nullable final List list) { if (list == null) { return null; } - return list.stream().filter(Objects::nonNull).collect(Collectors.toList()); + return list.stream().filter(Objects::nonNull).toList(); } private void createCommentsTab(final TabFolder folder) { diff --git a/org.eclipse.tm4e.registry/META-INF/MANIFEST.MF b/org.eclipse.tm4e.registry/META-INF/MANIFEST.MF index 9be348740..ee6144469 100644 --- a/org.eclipse.tm4e.registry/META-INF/MANIFEST.MF +++ b/org.eclipse.tm4e.registry/META-INF/MANIFEST.MF @@ -3,9 +3,9 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Vendor: %providerName Bundle-SymbolicName: org.eclipse.tm4e.registry;singleton:=true -Bundle-Version: 0.6.1.qualifier +Bundle-Version: 0.6.2.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 -Require-Bundle: org.eclipse.tm4e.core;bundle-version="0.5.0", +Require-Bundle: org.eclipse.tm4e.core;bundle-version="0.5.1", org.eclipse.core.runtime, com.google.gson;bundle-version="2.9.0", com.google.guava;bundle-version="30.1.0", diff --git a/org.eclipse.tm4e.registry/pom.xml b/org.eclipse.tm4e.registry/pom.xml index 8e25e54e4..1d231511b 100644 --- a/org.eclipse.tm4e.registry/pom.xml +++ b/org.eclipse.tm4e.registry/pom.xml @@ -10,5 +10,5 @@ org.eclipse.tm4e.registry eclipse-plugin - 0.6.1-SNAPSHOT + 0.6.2-SNAPSHOT diff --git a/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/GrammarCache.java b/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/GrammarCache.java index 778810deb..55a7d0407 100644 --- a/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/GrammarCache.java +++ b/org.eclipse.tm4e.registry/src/main/java/org/eclipse/tm4e/registry/internal/GrammarCache.java @@ -18,7 +18,6 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import java.util.stream.Collectors; import org.eclipse.core.runtime.content.IContentType; import org.eclipse.jdt.annotation.Nullable; @@ -103,7 +102,7 @@ List getContentTypesForScope(@Nullable final String scopeName) { } return scopeNameBindings.entrySet().stream().filter(map -> scopeName.equals(map.getValue())) - .map(Entry::getKey).collect(Collectors.toList()); + .map(Entry::getKey).toList(); } void registerContentTypeBinding(final IContentType contentType, final String scopeName) { diff --git a/org.eclipse.tm4e.ui/META-INF/MANIFEST.MF b/org.eclipse.tm4e.ui/META-INF/MANIFEST.MF index fcab4d589..db5ef3687 100644 --- a/org.eclipse.tm4e.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.tm4e.ui/META-INF/MANIFEST.MF @@ -5,13 +5,13 @@ Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.tm4e.ui;singleton:=true Bundle-Version: 0.6.1.qualifier -Require-Bundle: org.eclipse.tm4e.core;bundle-version="0.5.0", +Require-Bundle: org.eclipse.tm4e.core;bundle-version="0.5.1", org.eclipse.jface.text, org.eclipse.core.runtime, org.eclipse.ui, org.eclipse.core.resources, org.eclipse.core.filesystem, - org.eclipse.tm4e.registry;bundle-version="0.6.0", + org.eclipse.tm4e.registry;bundle-version="0.6.2", org.eclipse.ui.ide;resolution:=optional, com.google.gson;bundle-version="2.9.0", com.google.guava, diff --git a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/text/TMPresentationReconcilerTestGenerator.java b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/text/TMPresentationReconcilerTestGenerator.java index 9f5909438..49f4e689e 100644 --- a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/text/TMPresentationReconcilerTestGenerator.java +++ b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/text/TMPresentationReconcilerTestGenerator.java @@ -26,11 +26,8 @@ public final class TMPresentationReconcilerTestGenerator implements ITMPresentationReconcilerListener, IDocumentListener, ITextListener { - @Nullable - private ITextViewer viewer; - - @Nullable - private IDocument document; + private ITextViewer viewer = lazyNonNull(); + private IDocument document = lazyNonNull(); private final StringBuilder code = new StringBuilder(); @@ -150,8 +147,8 @@ public void uninstall() { write("}"); System.err.println(code.toString()); - castNonNull(document).removeDocumentListener(this); - castNonNull(viewer).removeTextListener(this); + document.removeDocumentListener(this); + viewer.removeTextListener(this); // commands.clear(); } diff --git a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/AbstractThemeManager.java b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/AbstractThemeManager.java index d566bc4e0..80949f531 100644 --- a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/AbstractThemeManager.java +++ b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/AbstractThemeManager.java @@ -16,7 +16,6 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.swt.graphics.RGB; @@ -75,8 +74,7 @@ ITheme getDefaultTheme(final boolean dark) { @Override public ITheme[] getThemes(final boolean dark) { - return themes.values().stream().filter(theme -> theme.isDark() == dark) - .collect(Collectors.toList()).toArray(ITheme[]::new); + return themes.values().stream().filter(theme -> theme.isDark() == dark).toArray(ITheme[]::new); } @Override diff --git a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/BaseThemeAssociationRegistry.java b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/BaseThemeAssociationRegistry.java index 7622221bd..acd5686c4 100644 --- a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/BaseThemeAssociationRegistry.java +++ b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/BaseThemeAssociationRegistry.java @@ -15,7 +15,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; import org.eclipse.jdt.annotation.Nullable; import org.eclipse.tm4e.ui.themes.IThemeAssociation; @@ -85,8 +84,7 @@ IThemeAssociation getThemeAssociationFor(final String eclipseThemeId) { IThemeAssociation[] getThemeAssociations(final boolean isDefault) { /*if (isDefault) { - return getThemeAssociations().stream().filter(theme -> theme.isDefault()).collect(Collectors.toList()) - .toArray(IThemeAssociation[]::new); + return getThemeAssociations().stream().filter(theme -> theme.isDefault()).toArray(IThemeAssociation[]::new); }*/ return getThemeAssociations().toArray(IThemeAssociation[]::new); } @@ -98,7 +96,7 @@ IThemeAssociation getDefaultAssociation() { IThemeAssociation[] getThemeAssociationsForTheme(final String themeId) { return getThemeAssociations().stream().filter(themeAssociation -> themeId.equals(themeAssociation.getThemeId())) - .collect(Collectors.toList()).toArray(IThemeAssociation[]::new); + .toArray(IThemeAssociation[]::new); } boolean hasThemeAssociationsForTheme(final String themeId, final String eclipseThemeId) { diff --git a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeAssociationRegistry.java b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeAssociationRegistry.java index bb6eda273..f6b2feb7e 100644 --- a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeAssociationRegistry.java +++ b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeAssociationRegistry.java @@ -101,7 +101,7 @@ void unregister(final IThemeAssociation association) { // // Get the default associations (from plugin) // /*List defaultAssociations = // getThemeAssociations().stream() - // .filter().collect(Collectors.toList()); + // .filter().toList(); // // Add default association if user associations doesn't define it. // for (IThemeAssociation defaultAssociation : defaultAssociations) { // if (!(contains(userAssociations, defaultAssociation))) { diff --git a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeManager.java b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeManager.java index 6c4b8da99..dcaeeeee3 100644 --- a/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeManager.java +++ b/org.eclipse.tm4e.ui/src/main/java/org/eclipse/tm4e/ui/internal/themes/ThemeManager.java @@ -12,7 +12,6 @@ package org.eclipse.tm4e.ui.internal.themes; import java.util.Arrays; -import java.util.stream.Collectors; import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; @@ -135,7 +134,7 @@ public void save() throws BackingStoreException { // Save Theme associations in the // "${workspace_loc}/metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.tm4e.ui.prefs" final String json = PreferenceHelper.toJsonThemeAssociations(Arrays.stream(getAllThemeAssociations()) - .filter(t -> t.getPluginId() == null).collect(Collectors.toList())); + .filter(t -> t.getPluginId() == null).toList()); prefs.put(PreferenceConstants.THEME_ASSOCIATIONS, json); // Save preferences