Skip to content

Commit

Permalink
Merge pull request #214 from xtext/cd_javaDepr
Browse files Browse the repository at this point in the history
fixed some java deprecations
  • Loading branch information
cdietrich authored Feb 25, 2023
2 parents 55477c0 + 12f7c42 commit 13b3e6a
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 13b3e6a

Please sign in to comment.