Upgrade ecj version to 3.33.0

Bump source and target version to 11 for Java UDFs
ICompilationUnit has new default methods

patch by Ekaterina Dimitrova; reviewed by Andres de la Pena and Berenguer Blasi for CASSANRA-18190
This commit is contained in:
Ekaterina Dimitrova 2023-04-11 13:31:08 -04:00
parent fe8a6eb70f
commit b61bd93e57
5 changed files with 32 additions and 5 deletions

View File

@ -244,7 +244,7 @@
<artifactId>sigar</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
</dependency>
<dependency>

View File

@ -829,7 +829,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.eclipse.jdt.core.compiler</groupId>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>${ecj.version}</version>
</dependency>

View File

@ -1,4 +1,5 @@
5.0
* Upgrade ECJ to version 3.33.0 (CASSANDRA-18190)
* Fix ClassCastException from jdk GaloisCounterMode when using JDK17 provider (CASSANDRA-18180)
* Drop JDK8, add JDK17 (CASSANDRA-18255)
* Remove WaitingOnFreeMemtableSpace and DroppedMutations metrics (CASSANDRA-18298)

View File

@ -143,7 +143,7 @@
<property name="jflex.version" value="1.8.2"/>
<property name="jamm.version" value="0.4.0"/>
<property name="ecj.version" value="4.6.1"/>
<property name="ecj.version" value="3.33.0"/>
<!-- When updating ASM, please, do consider whether you might need to update also FBUtilities#ASM_BYTECODE_VERSION
and the simulator InterceptClasses#BYTECODE_VERSION, in particular if we are looking to provide Cassandra support
for newer JDKs (CASSANDRA-17873). -->

View File

@ -59,6 +59,8 @@ import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;
import org.eclipse.jdt.internal.compiler.lookup.ModuleBinding;
import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory;
public final class JavaBasedUDFunction extends UDFunction
@ -138,9 +140,9 @@ public final class JavaBasedUDFunction extends UDFunction
settings.put(CompilerOptions.OPTION_ReportDeprecation,
CompilerOptions.IGNORE);
settings.put(CompilerOptions.OPTION_Source,
CompilerOptions.VERSION_1_8);
CompilerOptions.VERSION_11);
settings.put(CompilerOptions.OPTION_TargetPlatform,
CompilerOptions.VERSION_1_8);
CompilerOptions.VERSION_11);
compilerOptions = new CompilerOptions(settings);
compilerOptions.parseLiteralExpressionsAsConstants = true;
@ -538,6 +540,30 @@ public final class JavaBasedUDFunction extends UDFunction
return false;
}
@Override
public ModuleBinding module(LookupEnvironment environment)
{
return environment.getModule(this.getModuleName());
}
@Override
public char[] getModuleName()
{
return null;
}
@Override
public String getDestinationPath()
{
return null;
}
@Override
public String getExternalAnnotationPath(String qualifiedTypeName)
{
return null;
}
// ICompilerRequestor
@Override