Skip to content

Commit

Permalink
fixed some java deprecations
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Dietrich <[email protected]>
  • Loading branch information
cdietrich committed Feb 25, 2023
1 parent 55477c0 commit 12f7c42
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 12f7c42

Please sign in to comment.