From 12f7c421615c2110a8f8386d29d18f92784046eb Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Sat, 25 Feb 2023 19:49:37 +0100 Subject: [PATCH] fixed some java deprecations Signed-off-by: Christian Dietrich --- .../java/org/xtext/gradle/builder/XtextGradleBuilder.xtend | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend b/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend index d76394d..69242ee 100644 --- a/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend +++ b/xtext-gradle-builder/src/main/java/org/xtext/gradle/builder/XtextGradleBuilder.xtend @@ -56,7 +56,7 @@ class XtextGradleBuilder implements IncrementalXtextBuilder { System.setProperty("org.eclipse.emf.common.util.ReferenceClearingQueue", "false") for (setupName : setupNames) { val setupClass = class.classLoader.loadClass(setupName) - val setup = setupClass.newInstance as ISetup + val setup = setupClass.getConstructor().newInstance as ISetup val injector = setup.createInjectorAndDoEMFRegistration injector.getInstance(IEncodingProvider.Runtime).setDefaultEncoding(encoding) } @@ -263,7 +263,7 @@ class XtextGradleBuilder implements IncrementalXtextBuilder { private def attachJavaConfig(XtextResourceSet resourceSet, GradleBuildRequest gradleRequest) { try { val configClass = Class.forName("org.eclipse.xtext.java.resource.JavaConfig") - val javaConfig = configClass.newInstance + val javaConfig = configClass.getConstructor().newInstance val javaVersion = JavaVersion.fromQualifier(gradleRequest.generatorConfigsByLanguage.values.head.javaSourceLevel.toString) configClass.getMethod("attachToEmfObject", Notifier).invoke(javaConfig, resourceSet) configClass.getMethod("setJavaSourceLevel", JavaVersion).invoke(javaConfig, javaVersion)