This is an automated email from the ASF dual-hosted git repository.
edimitrova pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/trunk by this push:
new b61bd93e57 Upgrade ecj version to 3.33.0 Bump source and target
version to 11 for Java UDFs ICompilationUnit has new default methods
b61bd93e57 is described below
commit b61bd93e574503aff8c29f0efefbe9879d3b32eb
Author: Ekaterina Dimitrova <[email protected]>
AuthorDate: Tue Apr 11 13:31:08 2023 -0400
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
---
.build/cassandra-deps-template.xml | 2 +-
.build/parent-pom-template.xml | 2 +-
CHANGES.txt | 1 +
build.xml | 2 +-
.../cql3/functions/JavaBasedUDFunction.java | 30 ++++++++++++++++++++--
5 files changed, 32 insertions(+), 5 deletions(-)
diff --git a/.build/cassandra-deps-template.xml
b/.build/cassandra-deps-template.xml
index 4041a54195..4b69504b25 100644
--- a/.build/cassandra-deps-template.xml
+++ b/.build/cassandra-deps-template.xml
@@ -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>
diff --git a/.build/parent-pom-template.xml b/.build/parent-pom-template.xml
index 53120c260d..af4a32d455 100644
--- a/.build/parent-pom-template.xml
+++ b/.build/parent-pom-template.xml
@@ -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>
diff --git a/CHANGES.txt b/CHANGES.txt
index 2fc9df8995..8f45c74136 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -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)
diff --git a/build.xml b/build.xml
index eb221855ad..ef5910f85e 100644
--- a/build.xml
+++ b/build.xml
@@ -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). -->
diff --git
a/src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java
b/src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java
index 132721e986..c84ab5668b 100644
--- a/src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java
+++ b/src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java
@@ -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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]