This PR removes the usage of a class loader for downcasting LanguageExtesnion to JavaExtension and ScalaExtension. Previously, the client JVM would attempt to determine the appropriate sub-interface type using a class loader.
Changes:
Introduced new methods in the LanguageExtension interface:
isJavaExtension() and isScalaExtension(): Checks if the current implementation is a specific sub-interface type.
getAsJavaExtension() and getAsScalaExtension(): Returns the instance as the specific sub-interface type if applicable.
Moved the conversion logic from the client JVM to the Gradle daemon JVM, where the actual implementation of the LanguageExtension interface resides. This ensures correct type information is available for downcasting.
Updated respective test cases to reflect the new approach.
This PR removes the usage of a class loader for downcasting
LanguageExtesnion
toJavaExtension
andScalaExtension
. Previously, the client JVM would attempt to determine the appropriate sub-interface type using a class loader.Changes:
LanguageExtension
interface:isJavaExtension()
andisScalaExtension()
: Checks if the current implementation is a specific sub-interface type.getAsJavaExtension()
andgetAsScalaExtension()
: Returns the instance as the specific sub-interface type if applicable.LanguageExtension
interface resides. This ensures correct type information is available for downcasting.