diff --git a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/UnicodeAwarePostProcessorTest.java b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/UnicodeAwarePostProcessorTest.java index ab4c79c9c3a..d7c86506be3 100644 --- a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/UnicodeAwarePostProcessorTest.java +++ b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/UnicodeAwarePostProcessorTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2016 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2013, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -8,6 +8,7 @@ *******************************************************************************/ package org.eclipse.xtend.core.tests.compiler; +import java.nio.charset.StandardCharsets; import java.util.Collections; import java.util.Set; @@ -28,7 +29,6 @@ import org.junit.Test; import org.junit.runner.RunWith; -import com.google.common.base.Charsets; import com.google.inject.Inject; /** @@ -43,19 +43,19 @@ public class UnicodeAwarePostProcessorTest extends Assert implements IJvmModelAs @Test public void testUTF8_plain() { - CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), "\u03b1\u03c1\u03b5\u03c4\u03b7", Charsets.UTF_8); + CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), "\u03b1\u03c1\u03b5\u03c4\u03b7", StandardCharsets.UTF_8); assertEquals("\u03b1\u03c1\u03b5\u03c4\u03b7", result.toString()); } @Test public void testISO_8859_1_plain() { - CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), "\u03b1\u03c1\u03b5\u03c4\u03b7", Charsets.ISO_8859_1); + CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), "\u03b1\u03c1\u03b5\u03c4\u03b7", StandardCharsets.ISO_8859_1); assertEquals("\\u03b1\\u03c1\\u03b5\\u03c4\\u03b7", result.toString()); } @Test public void testOnlyJavaEscaped() { - CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.notJava"), "\u03b1\u03c1\u03b5\u03c4\u03b7", Charsets.ISO_8859_1); + CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.notJava"), "\u03b1\u03c1\u03b5\u03c4\u03b7", StandardCharsets.ISO_8859_1); assertEquals("\u03b1\u03c1\u03b5\u03c4\u03b7", result.toString()); } @@ -63,7 +63,7 @@ public void testOnlyJavaEscaped() { public void testUTF8_tree() { TreeAppendable treeAppendable = new TreeAppendable(null, null, this, this, EcoreFactory.eINSTANCE.createEObject(), " ", "\n"); treeAppendable.append("\u03b1\u03c1\u03b5\u03c4\u03b7"); - CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), treeAppendable, Charsets.UTF_8); + CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), treeAppendable, StandardCharsets.UTF_8); assertSame(treeAppendable, result); assertEquals("\u03b1\u03c1\u03b5\u03c4\u03b7", result.toString()); } @@ -72,7 +72,7 @@ public void testUTF8_tree() { public void testISO_8859_1_tree() { TreeAppendable treeAppendable = new TreeAppendable(null, null, this, this, EcoreFactory.eINSTANCE.createEObject(), " ", "\n"); treeAppendable.append("\u03b1\u03c1\u03b5\u03c4\u03b7"); - CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), treeAppendable, Charsets.ISO_8859_1); + CharSequence result = postProcessor.postProcess(URI.createFileURI("com/acme/MyFile.java"), treeAppendable, StandardCharsets.ISO_8859_1); assertSame(treeAppendable, result); assertEquals("\\u03b1\\u03c1\\u03b5\\u03c4\\u03b7", result.toString()); } diff --git a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.xtend b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.xtend index 61a2cd59ffe..f884c822d6e 100644 --- a/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.xtend +++ b/org.eclipse.xtend.core.tests/src/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.xtend @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2022 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2012, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -8,7 +8,6 @@ *******************************************************************************/ package org.eclipse.xtend.core.tests.compiler.batch -import com.google.common.base.Charsets import com.google.common.io.Files import com.google.inject.Inject import java.io.File @@ -29,6 +28,7 @@ import org.junit.runner.RunWith import static org.eclipse.xtext.util.Files.* import static org.junit.Assert.* +import java.nio.charset.StandardCharsets /** * Batch compiler tests. @@ -466,7 +466,8 @@ class BatchCompilerTest { } def private String getContents(String fileName) { - Files.asCharSource(new File(fileName), Charsets.UTF_8).read() + Files.asCharSource(new File(fileName), StandardCharsets.UTF_8 + ).read() } @Test diff --git a/org.eclipse.xtend.core.tests/xtend-gen/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.java b/org.eclipse.xtend.core.tests/xtend-gen/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.java index 1f60f2ffd93..8a70317d65d 100644 --- a/org.eclipse.xtend.core.tests/xtend-gen/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.java +++ b/org.eclipse.xtend.core.tests/xtend-gen/org/eclipse/xtend/core/tests/compiler/batch/BatchCompilerTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2012, 2022 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2012, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -8,11 +8,11 @@ */ package org.eclipse.xtend.core.tests.compiler.batch; -import com.google.common.base.Charsets; import com.google.inject.Inject; import java.io.File; import java.io.FilenameFilter; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Set; import java.util.function.Consumer; @@ -696,7 +696,7 @@ private boolean isSymlink(final File file) { private String getContents(final String fileName) { try { File _file = new File(fileName); - return com.google.common.io.Files.asCharSource(_file, Charsets.UTF_8).read(); + return com.google.common.io.Files.asCharSource(_file, StandardCharsets.UTF_8).read(); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } diff --git a/org.eclipse.xtend.examples/projects/xtend-annotation-examples-client/META-INF/MANIFEST.MF b/org.eclipse.xtend.examples/projects/xtend-annotation-examples-client/META-INF/MANIFEST.MF index a7d5bf88bf1..ac74c189fbd 100644 --- a/org.eclipse.xtend.examples/projects/xtend-annotation-examples-client/META-INF/MANIFEST.MF +++ b/org.eclipse.xtend.examples/projects/xtend-annotation-examples-client/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-SymbolicName: xtend-annotation-examples-client Bundle-Version: 2.38.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.xtend.lib, - com.google.guava;bundle-version="[33.3.1,34.0.0)", + com.google.guava;bundle-version="[33.4.0,34.0.0)", org.eclipse.xtext.xbase.lib;bundle-version="2.38.0", xtend-annotation-examples;bundle-version="2.4.3" Bundle-Vendor: Eclipse Xtext diff --git a/org.eclipse.xtend.examples/projects/xtend-annotation-examples/META-INF/MANIFEST.MF b/org.eclipse.xtend.examples/projects/xtend-annotation-examples/META-INF/MANIFEST.MF index 4e7169fab1d..b273fcc6be5 100644 --- a/org.eclipse.xtend.examples/projects/xtend-annotation-examples/META-INF/MANIFEST.MF +++ b/org.eclipse.xtend.examples/projects/xtend-annotation-examples/META-INF/MANIFEST.MF @@ -5,7 +5,7 @@ Bundle-SymbolicName: xtend-annotation-examples Bundle-Version: 2.38.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.xtend.lib, - com.google.guava;bundle-version="[33.3.1,34.0.0)", + com.google.guava;bundle-version="[33.4.0,34.0.0)", org.eclipse.xtext.xbase.lib;bundle-version="2.38.0", org.junit;bundle-version="4.13.2", org.eclipse.xtend.core, diff --git a/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.xtend b/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.xtend index 0601d68a183..94e1e4a0e6f 100644 --- a/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.xtend +++ b/org.eclipse.xtend.ide.tests/src/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.xtend @@ -8,10 +8,10 @@ *******************************************************************************/ package org.eclipse.xtend.ide.tests.compiler -import com.google.common.base.Charsets import com.google.common.io.CharStreams import com.google.inject.Inject import java.io.InputStreamReader +import java.nio.charset.StandardCharsets import org.eclipse.core.resources.IFile import org.eclipse.core.resources.IMarker import org.eclipse.core.resources.IProject @@ -20,6 +20,7 @@ import org.eclipse.ui.texteditor.MarkerUtilities import org.eclipse.xtend.ide.internal.XtendActivator import org.eclipse.xtend.ide.tests.WorkbenchTestHelper import org.eclipse.xtext.ui.testing.util.IResourcesSetupUtil +import org.eclipse.xtext.ui.testing.util.TargetPlatformUtil import org.eclipse.xtext.util.JavaVersion import org.junit.After import org.junit.AfterClass @@ -29,7 +30,6 @@ import org.junit.BeforeClass import org.junit.Test import static org.eclipse.xtext.ui.testing.util.IResourcesSetupUtil.* -import org.eclipse.xtext.ui.testing.util.TargetPlatformUtil /** * @author Miro Spoenemann - Initial contribution and API @@ -84,7 +84,7 @@ class JavaVersionSettingTest extends Assert { assertTrue("Generated Java file does not exist.", javaFile.exists) assertNoErrors(javaFile) val javaFileStream = javaFile.contents - val content = CharStreams.toString(new InputStreamReader(javaFileStream, Charsets.UTF_8)) + val content = CharStreams.toString(new InputStreamReader(javaFileStream, StandardCharsets.UTF_8)) javaFileStream.close return content } diff --git a/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.java b/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.java index fbc3d915d24..b0f8ffdd9b0 100644 --- a/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.java +++ b/org.eclipse.xtend.ide.tests/xtend-gen/org/eclipse/xtend/ide/tests/compiler/JavaVersionSettingTest.java @@ -8,11 +8,11 @@ */ package org.eclipse.xtend.ide.tests.compiler; -import com.google.common.base.Charsets; import com.google.common.io.CharStreams; import com.google.inject.Inject; import java.io.InputStream; import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; @@ -106,7 +106,7 @@ private String getJavaFileContent(final String fileName, final IProject project) Assert.assertTrue("Generated Java file does not exist.", javaFile.exists()); this.assertNoErrors(javaFile); final InputStream javaFileStream = javaFile.getContents(); - InputStreamReader _inputStreamReader = new InputStreamReader(javaFileStream, Charsets.UTF_8); + InputStreamReader _inputStreamReader = new InputStreamReader(javaFileStream, StandardCharsets.UTF_8); final String content = CharStreams.toString(_inputStreamReader); javaFileStream.close(); return content; diff --git a/org.eclipse.xtend.sdk.feature/feature.xml b/org.eclipse.xtend.sdk.feature/feature.xml index 988dfc5a821..afcd6501fce 100644 --- a/org.eclipse.xtend.sdk.feature/feature.xml +++ b/org.eclipse.xtend.sdk.feature/feature.xml @@ -33,7 +33,7 @@ SPDX-License-Identifier: EPL-2.0 - + diff --git a/org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/ui/trace/TraceForTypeRootProvider.java b/org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/ui/trace/TraceForTypeRootProvider.java index 8589b5236fe..ca4ac94c993 100644 --- a/org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/ui/trace/TraceForTypeRootProvider.java +++ b/org.eclipse.xtext.common.types.ui/src/org/eclipse/xtext/common/types/ui/trace/TraceForTypeRootProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2017 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2012, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import org.apache.log4j.Logger; import org.eclipse.core.resources.IProject; @@ -43,7 +44,6 @@ import org.eclipse.xtext.util.Pair; import org.eclipse.xtext.util.Tuples; -import com.google.common.base.Charsets; import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; @@ -155,7 +155,7 @@ protected Charset getSourceEncoding(final ITypeRoot derivedJavaType) { return Charset.forName(ResourcesPlugin.getWorkspace().getRoot().getDefaultCharset()); } catch (CoreException e) { log.error("Error determining encoding for source file for " + derivedJavaType.getElementName(), e); - return Charsets.UTF_8; + return StandardCharsets.UTF_8; } } diff --git a/org.eclipse.xtext.dev-bom/pom.xml b/org.eclipse.xtext.dev-bom/pom.xml index 717cef202ec..7bf71f779d3 100644 --- a/org.eclipse.xtext.dev-bom/pom.xml +++ b/org.eclipse.xtext.dev-bom/pom.xml @@ -158,17 +158,17 @@ com.google.guava guava-gwt - 33.3.1-jre + 33.4.0-jre com.google.guava guava-testlib - 33.3.1-jre + 33.4.0-jre com.google.guava guava - 33.3.1-jre + 33.4.0-jre com.google.inject diff --git a/org.eclipse.xtext.ide.tests/src/org/eclipse/xtext/ide/tests/server/WorkspaceFoldersTest.java b/org.eclipse.xtext.ide.tests/src/org/eclipse/xtext/ide/tests/server/WorkspaceFoldersTest.java index fc1ef8428c0..87ab3bb1424 100644 --- a/org.eclipse.xtext.ide.tests/src/org/eclipse/xtext/ide/tests/server/WorkspaceFoldersTest.java +++ b/org.eclipse.xtext.ide.tests/src/org/eclipse/xtext/ide/tests/server/WorkspaceFoldersTest.java @@ -17,7 +17,6 @@ import org.eclipse.lsp4j.DidChangeWorkspaceFoldersParams; import org.eclipse.lsp4j.InitializeParams; import org.eclipse.lsp4j.InitializeResult; -import org.eclipse.lsp4j.NotebookDocumentChangeEvent; import org.eclipse.lsp4j.WorkspaceClientCapabilities; import org.eclipse.lsp4j.WorkspaceFolder; import org.eclipse.lsp4j.WorkspaceFoldersChangeEvent; diff --git a/org.eclipse.xtext.p2repository/category.xml b/org.eclipse.xtext.p2repository/category.xml index cb6a43640ea..df3ebb6b8b8 100644 --- a/org.eclipse.xtext.p2repository/category.xml +++ b/org.eclipse.xtext.p2repository/category.xml @@ -10,8 +10,8 @@ - - + + diff --git a/org.eclipse.xtext.redist.feature/feature.xml b/org.eclipse.xtext.redist.feature/feature.xml index 1efc831b60f..f24acec30bf 100644 --- a/org.eclipse.xtext.redist.feature/feature.xml +++ b/org.eclipse.xtext.redist.feature/feature.xml @@ -28,7 +28,7 @@ SPDX-License-Identifier: EPL-2.0 version="0.0.0"/> - + diff --git a/org.eclipse.xtext.runtime.feature/feature.xml b/org.eclipse.xtext.runtime.feature/feature.xml index 742849e829e..a27dfb50271 100644 --- a/org.eclipse.xtext.runtime.feature/feature.xml +++ b/org.eclipse.xtext.runtime.feature/feature.xml @@ -24,7 +24,7 @@ SPDX-License-Identifier: EPL-2.0 %license - + diff --git a/org.eclipse.xtext.tests/src/org/eclipse/xtext/xtext/wizard/cli/CliWizardIntegrationTest.java b/org.eclipse.xtext.tests/src/org/eclipse/xtext/xtext/wizard/cli/CliWizardIntegrationTest.java index 871cd8eb7ef..30417f06c28 100644 --- a/org.eclipse.xtext.tests/src/org/eclipse/xtext/xtext/wizard/cli/CliWizardIntegrationTest.java +++ b/org.eclipse.xtext.tests/src/org/eclipse/xtext/xtext/wizard/cli/CliWizardIntegrationTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015, 2020 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2015, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -11,6 +11,7 @@ import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Comparator; import java.util.List; @@ -43,7 +44,6 @@ import org.junit.runner.RunWith; import org.junit.runners.Parameterized; -import com.google.common.base.Charsets; import com.google.common.collect.Lists; import com.google.common.collect.Sets; @@ -288,7 +288,7 @@ public String toString() { } }; result.setXtextVersion(new XtextVersion("unspecified")); - result.setEncoding(Charsets.UTF_8); + result.setEncoding(StandardCharsets.UTF_8); result.setLineDelimiter(LineDelimiter.UNIX.getValue()); result.getLanguage().setName("mydsl.MyDsl"); result.getLanguage().setFileExtensions(LanguageDescriptor.FileExtensions.fromString("mydsl")); diff --git a/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/XtextEditor.java b/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/XtextEditor.java index c1fd4b599e8..29325c6c9ce 100755 --- a/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/XtextEditor.java +++ b/org.eclipse.xtext.ui/src/org/eclipse/xtext/ui/editor/XtextEditor.java @@ -76,8 +76,6 @@ import org.eclipse.ui.PlatformUI; import org.eclipse.ui.editors.text.TextEditor; import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess; -import org.eclipse.ui.texteditor.IDocumentProvider; -import org.eclipse.ui.texteditor.IDocumentProviderExtension3; import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditorActionConstants; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; diff --git a/org.eclipse.xtext.util/META-INF/MANIFEST.MF b/org.eclipse.xtext.util/META-INF/MANIFEST.MF index 2d58519fd1f..62724adffe0 100644 --- a/org.eclipse.xtext.util/META-INF/MANIFEST.MF +++ b/org.eclipse.xtext.util/META-INF/MANIFEST.MF @@ -46,7 +46,7 @@ Export-Package: org.eclipse.xtext.util;version="2.38.0"; org.eclipse.xtext.xbase, org.eclipse.xtext.xbase.tests" Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.36.0", - com.google.guava;bundle-version="[33.3.1,34.0.0)";visibility:=reexport, + com.google.guava;bundle-version="[33.4.0,34.0.0)";visibility:=reexport, com.google.inject;bundle-version="7.0.0";visibility:=reexport, com.google.guava.failureaccess;bundle-version="[1.0.2,2.0.0)";visibility:=reexport, jakarta.inject.jakarta.inject-api;bundle-version="2.0.1";resolution:=optional;visibility:=reexport;x-installation:=greedy, diff --git a/org.eclipse.xtext.web/src/test/java/org/eclipse/xtext/web/server/test/ResourcePersistenceTest.java b/org.eclipse.xtext.web/src/test/java/org/eclipse/xtext/web/server/test/ResourcePersistenceTest.java index 15f976b2870..5c03db3056c 100644 --- a/org.eclipse.xtext.web/src/test/java/org/eclipse/xtext/web/server/test/ResourcePersistenceTest.java +++ b/org.eclipse.xtext.web/src/test/java/org/eclipse/xtext/web/server/test/ResourcePersistenceTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2015, 2020 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2015, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -9,13 +9,13 @@ package org.eclipse.xtext.web.server.test; import java.io.File; +import java.nio.charset.StandardCharsets; import org.eclipse.xtext.web.server.XtextServiceDispatcher; import org.eclipse.xtext.web.server.persistence.ResourceContentResult; import org.junit.Assert; import org.junit.Test; -import com.google.common.base.Charsets; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap.Builder; import com.google.common.io.Files; @@ -88,7 +88,7 @@ public void testSaveFile() throws Exception { nb().put("serviceType", "save").put("resource", file.getName()).build(), session); Assert.assertTrue(save.isHasSideEffects()); save.getService().apply(); - String resourceContent = Files.asCharSource(file, Charsets.UTF_8).read(); + String resourceContent = Files.asCharSource(file, StandardCharsets.UTF_8).read(); assertEquals("state bar end", resourceContent); } diff --git a/org.eclipse.xtext.xbase.lib.gwt/META-INF/MANIFEST.MF b/org.eclipse.xtext.xbase.lib.gwt/META-INF/MANIFEST.MF index 7656b4953fb..af1446a3dc0 100644 --- a/org.eclipse.xtext.xbase.lib.gwt/META-INF/MANIFEST.MF +++ b/org.eclipse.xtext.xbase.lib.gwt/META-INF/MANIFEST.MF @@ -6,7 +6,7 @@ Bundle-Version: 2.38.0.qualifier Export-Package: org.eclipse.xtend2.lib;version="2.38.0", org.eclipse.xtext.xbase.lib;version="2.38.0" Bundle-RequiredExecutionEnvironment: JavaSE-17 -Require-Bundle: com.google.guava;bundle-version="[33.3.1,34.0.0)" +Require-Bundle: com.google.guava;bundle-version="[33.4.0,34.0.0)" Bundle-Vendor: %Vendor-Name Automatic-Module-Name: org.eclipse.xtext.xbase.lib.gwt Eclipse-SourceReferences: eclipseSourceReferences diff --git a/org.eclipse.xtext.xbase.lib/META-INF/MANIFEST.MF b/org.eclipse.xtext.xbase.lib/META-INF/MANIFEST.MF index d9e67747889..b188a2b63de 100644 --- a/org.eclipse.xtext.xbase.lib/META-INF/MANIFEST.MF +++ b/org.eclipse.xtext.xbase.lib/META-INF/MANIFEST.MF @@ -8,7 +8,7 @@ Export-Package: org.eclipse.xtend2.lib;version="2.38.0", org.eclipse.xtext.xbase.lib;version="2.38.0", org.eclipse.xtext.xbase.lib.internal;version="2.38.0";x-internal:="true", org.eclipse.xtext.xbase.lib.util;version="2.38.0" -Require-Bundle: com.google.guava;bundle-version="[33.3.1,34.0.0)";visibility:=reexport +Require-Bundle: com.google.guava;bundle-version="[33.4.0,34.0.0)";visibility:=reexport Bundle-Vendor: Eclipse Xtext Automatic-Module-Name: org.eclipse.xtext.xbase.lib Eclipse-SourceReferences: eclipseSourceReferences diff --git a/org.eclipse.xtext.xtext.ui.tests/generator/org/eclipse/xtext/xtext/ui/ecore2xtext/Ecore2XtextGenerator.java b/org.eclipse.xtext.xtext.ui.tests/generator/org/eclipse/xtext/xtext/ui/ecore2xtext/Ecore2XtextGenerator.java index 1748e8220a6..bd1fd30f576 100644 --- a/org.eclipse.xtext.xtext.ui.tests/generator/org/eclipse/xtext/xtext/ui/ecore2xtext/Ecore2XtextGenerator.java +++ b/org.eclipse.xtext.xtext.ui.tests/generator/org/eclipse/xtext/xtext/ui/ecore2xtext/Ecore2XtextGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2010, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -10,6 +10,7 @@ import java.io.File; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -30,7 +31,6 @@ import org.eclipse.xtext.xtext.ui.wizard.project.XtextProjectInfo; import org.eclipse.xtext.xtext.wizard.EPackageInfo; -import com.google.common.base.Charsets; import com.google.common.io.Files; /** @@ -82,7 +82,7 @@ protected void invokeInternal(final WorkflowContext ctx, ProgressMonitor monitor createXtextProjectInfo(issues); CharSequence grammar = xtextProjectInfo.getRuntimeProject().grammar(); try { - Files.asCharSink(new File(genPath, xtextProjectInfo.getRuntimeProject().getGrammarFilePath()), Charsets.ISO_8859_1).write(grammar); + Files.asCharSink(new File(genPath, xtextProjectInfo.getRuntimeProject().getGrammarFilePath()), StandardCharsets.ISO_8859_1).write(grammar); } catch (IOException e) { String message = "Can't create grammar file"; log.error(message, e); diff --git a/org.eclipse.xtext.xtext.ui.tests/src/org/eclipse/xtext/xtext/ui/XtextLocationInFileProviderTest.java b/org.eclipse.xtext.xtext.ui.tests/src/org/eclipse/xtext/xtext/ui/XtextLocationInFileProviderTest.java index 448cdf88626..cce4b895bc3 100644 --- a/org.eclipse.xtext.xtext.ui.tests/src/org/eclipse/xtext/xtext/ui/XtextLocationInFileProviderTest.java +++ b/org.eclipse.xtext.xtext.ui.tests/src/org/eclipse/xtext/xtext/ui/XtextLocationInFileProviderTest.java @@ -8,8 +8,6 @@ *******************************************************************************/ package org.eclipse.xtext.xtext.ui; -import static org.junit.Assert.*; - import org.eclipse.xtext.AbstractElement; import org.eclipse.xtext.AbstractMetamodelDeclaration; import org.eclipse.xtext.Grammar; diff --git a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.xtend b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.xtend index 655e79a6ac0..a172cc7812a 100644 --- a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.xtend +++ b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.xtend @@ -8,8 +8,8 @@ *******************************************************************************/ package org.eclipse.xtext.xtext.wizard -import com.google.common.base.Charsets import com.google.common.io.Resources +import java.nio.charset.StandardCharsets import org.eclipse.xtend.lib.annotations.FinalFieldsConstructor @FinalFieldsConstructor @@ -73,7 +73,7 @@ class ParentProjectDescriptor extends ProjectDescriptor { } def private CharSequence loadResource(String resourcePath) { - Resources.toString(class.classLoader.getResource(resourcePath), Charsets.ISO_8859_1) + Resources.toString(class.classLoader.getResource(resourcePath), StandardCharsets.ISO_8859_1) } override buildGradle() { diff --git a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/cli/CliProjectsCreatorMain.java b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/cli/CliProjectsCreatorMain.java index 0b8fc8a2813..fa351c8b620 100644 --- a/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/cli/CliProjectsCreatorMain.java +++ b/org.eclipse.xtext.xtext.wizard/src/org/eclipse/xtext/xtext/wizard/cli/CliProjectsCreatorMain.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2022 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2018, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -10,6 +10,7 @@ import java.io.File; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.List; import org.apache.log4j.Logger; @@ -28,8 +29,6 @@ import org.kohsuke.args4j.CmdLineParser; import org.kohsuke.args4j.Option; -import com.google.common.base.Charsets; - /** * * @author Karsten Thoms (karsten.thoms@itemis.de) @@ -60,7 +59,7 @@ public enum ProjectType { private String fileExtension; @Option(name = "-encoding", usage = "File encoding") - private String encoding = Charsets.UTF_8.name(); + private String encoding = StandardCharsets.UTF_8.name(); @Option(name = "-xtextVersion", usage = "Xtext Version (for code header comments)") private String xtextVersion = "unspecified"; diff --git a/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.java b/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.java index 41d9202cf9a..731d28c38e7 100644 --- a/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.java +++ b/org.eclipse.xtext.xtext.wizard/xtend-gen/org/eclipse/xtext/xtext/wizard/ParentProjectDescriptor.java @@ -8,10 +8,10 @@ */ package org.eclipse.xtext.xtext.wizard; -import com.google.common.base.Charsets; import com.google.common.collect.Iterables; import com.google.common.io.Resources; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collections; import java.util.Objects; @@ -110,7 +110,7 @@ public String getTychoVersion() { private CharSequence loadResource(final String resourcePath) { try { - return Resources.toString(this.getClass().getClassLoader().getResource(resourcePath), Charsets.ISO_8859_1); + return Resources.toString(this.getClass().getClassLoader().getResource(resourcePath), StandardCharsets.ISO_8859_1); } catch (Throwable _e) { throw Exceptions.sneakyThrow(_e); } diff --git a/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java b/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java index 0cd59a7368f..b5a94089c97 100644 --- a/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java +++ b/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/internal/ConflictingRegionsException.java @@ -11,7 +11,6 @@ import java.util.Collection; import org.eclipse.xtext.formatting2.debug.TextRegionsWithTitleToString; -import org.eclipse.xtext.util.Exceptions; /** * @author Moritz Eysholdt - Initial contribution and API diff --git a/org.eclipse.xtext/src/org/eclipse/xtext/resource/ExternalContentSupport.java b/org.eclipse.xtext/src/org/eclipse/xtext/resource/ExternalContentSupport.java index b50fd60b52b..d8ef2846062 100644 --- a/org.eclipse.xtext/src/org/eclipse/xtext/resource/ExternalContentSupport.java +++ b/org.eclipse.xtext/src/org/eclipse/xtext/resource/ExternalContentSupport.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009 itemis AG (http://www.itemis.eu) and others. + * Copyright (c) 2009, 2024 itemis AG (http://www.itemis.eu) and others. * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.ListIterator; import java.util.Map; @@ -21,8 +22,6 @@ import org.eclipse.emf.ecore.resource.URIHandler; import org.eclipse.xtext.util.LazyStringInputStream; -import com.google.common.base.Charsets; - /** * @author Sebastian Zarnekow - Initial contribution and API */ @@ -70,7 +69,7 @@ public boolean canHandle(URI uri) { public InputStream createInputStream(URI uri, Map options) throws IOException { String content = contentProvider.getContent(uri); if (content != null) { - return new LazyStringInputStream(content, Charsets.UTF_8); + return new LazyStringInputStream(content, StandardCharsets.UTF_8); } return delegate.createInputStream(uri, options); }