{@code * ClassDeclaration: * NormalClassDeclaration * EnumDeclaration + * RecordDeclaration * NormalClassDeclaration: * {ClassModifier} class TypeIdentifier [TypeParameters] [Superclass] [Superinterfaces] ClassBody * }@@ -1417,11 +1418,11 @@ ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(ModifierHolder modifier) } /** - * https://openjdk.java.net/jeps/395#Java-grammar + * https://docs.oracle.com/javase/specs/jls/se17/html/jls-8.html#jls-8.10 *
{@code * RecordDeclaration: * {ClassModifier} `record` TypeIdentifier [TypeParameters] - * RecordHeader [SuperInterfaces] RecordBody + * RecordHeader [ClassImplements] RecordBody * * RecordHeader: * `(` [RecordComponentList] `)` @@ -1430,11 +1431,15 @@ ClassOrInterfaceDeclaration ClassOrInterfaceDeclaration(ModifierHolder modifier) * RecordComponent { `,` RecordComponent} * * RecordComponent: - * {Annotation} UnannType Identifier + * {RecordComponentModifier} UnannType Identifier * VariableArityRecordComponent * * VariableArityRecordComponent: * {Annotation} UnannType {Annotation} `...` Identifier + * {RecordComponentModifier} UnannType {Annotation} `...` Identifier + * + * RecordComponentModifier: + * Annotation * * RecordBody: * `{` {RecordBodyDeclaration} `}` @@ -1859,6 +1864,9 @@ BodyDeclaration> RecordBodyDeclaration(): | LOOKAHEAD("enum") ret = EnumDeclaration(modifiers) + | + LOOKAHEAD("record") + ret = RecordDeclaration(modifiers) | LOOKAHEAD("@" "interface") ret = AnnotationTypeDeclaration(modifiers) @@ -3365,13 +3373,15 @@ Expression EqualityExpression(): */ PatternExpr PatternExpression(): { + ModifierHolder modifier; ReferenceType type; SimpleName name; } { - type = AnnotatedReferenceType() + modifier = Modifiers() + type = ReferenceType(modifier.annotations) name = SimpleName() - { return new PatternExpr(range(type, token()), type, name); } + { return new PatternExpr(range(type, token()), modifier.modifiers, type, name); } } @@ -4527,6 +4537,11 @@ Statement BlockStatement(): LOOKAHEAD( Modifiers() "record" SimpleName() [ TypeParameters() ] Parameters() ) modifier = Modifiers() recordDeclaration = RecordDeclaration(modifier) { ret = new LocalRecordDeclarationStmt(range(recordDeclaration, token()), recordDeclaration); } + | + // try yield statement separate from more general Statement() because yield is not a keyword but + // just a restricted identifier and a yield statement can be confused with VariableDeclarationExpression sometimes + LOOKAHEAD( YieldStatement() ) + ret = YieldStatement() | LOOKAHEAD( VariableDeclarationExpression() ) expr = VariableDeclarationExpression() diff --git a/drools-model/pom.xml b/drools-model/pom.xml index 5f3fd288d89..3ae4e95ca82 100644 --- a/drools-model/pom.xml +++ b/drools-model/pom.xml @@ -6,7 +6,7 @@diff --git a/drools-mvel/pom.xml b/drools-mvel/pom.xml index 41f9883e52c..4478fb5313c 100644 --- a/drools-mvel/pom.xml +++ b/drools-mvel/pom.xml @@ -6,7 +6,7 @@ org.kie drools-build-parent -8.42.0-SNAPSHOT +9.42.0-SNAPSHOT ../build-parent/pom.xml @@ -70,9 +70,10 @@ org.kie drools-build-parent -8.42.0-SNAPSHOT +9.42.0-SNAPSHOT ../build-parent/pom.xml provided
ObjectModel
that provides unique name for the object model
diff --git a/kie-internal/src/main/java/org/kie/internal/runtime/conf/ObjectModel.java b/kie-internal/src/main/java/org/kie/internal/runtime/conf/ObjectModel.java
index 5d8ffe81348..2ae91cff15a 100644
--- a/kie-internal/src/main/java/org/kie/internal/runtime/conf/ObjectModel.java
+++ b/kie-internal/src/main/java/org/kie/internal/runtime/conf/ObjectModel.java
@@ -21,12 +21,12 @@
import java.util.Arrays;
import java.util.List;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlElementWrapper;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlSchemaType;
/**
* Object model that defines how and of what type the object instance should be created.ObjectModelResolver
diff --git a/kie-internal/src/main/java/org/kie/internal/runtime/conf/RuntimeStrategy.java b/kie-internal/src/main/java/org/kie/internal/runtime/conf/RuntimeStrategy.java
index a70f3100d0c..415a2c53884 100644
--- a/kie-internal/src/main/java/org/kie/internal/runtime/conf/RuntimeStrategy.java
+++ b/kie-internal/src/main/java/org/kie/internal/runtime/conf/RuntimeStrategy.java
@@ -15,7 +15,7 @@
package org.kie.internal.runtime.conf;
-import javax.xml.bind.annotation.XmlType;
+import jakarta.xml.bind.annotation.XmlType;
@XmlType
public enum RuntimeStrategy {
diff --git a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java
index aeeef037973..cb31932264e 100644
--- a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java
+++ b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorIO.java
@@ -21,10 +21,10 @@
import java.net.URL;
import javax.xml.XMLConstants;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.Marshaller;
+import jakarta.xml.bind.Unmarshaller;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
diff --git a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorImpl.java b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorImpl.java
index c2907e3a7e9..a8d8dd299eb 100644
--- a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorImpl.java
+++ b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/DeploymentDescriptorImpl.java
@@ -27,13 +27,13 @@
import java.util.Map;
import java.util.Set;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlElementWrapper;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlSchemaType;
-import javax.xml.bind.annotation.XmlTransient;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlElementWrapper;
+import jakarta.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlSchemaType;
+import jakarta.xml.bind.annotation.XmlTransient;
import org.kie.internal.runtime.conf.AuditMode;
import org.kie.internal.runtime.conf.BuilderHandler;
diff --git a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/TransientObjectModel.java b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/TransientObjectModel.java
index eb2e3dcbf92..89d6b93d317 100644
--- a/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/TransientObjectModel.java
+++ b/kie-internal/src/main/java/org/kie/internal/runtime/manager/deploy/TransientObjectModel.java
@@ -16,7 +16,7 @@
package org.kie.internal.runtime.manager.deploy;
-import javax.xml.bind.annotation.XmlTransient;
+import jakarta.xml.bind.annotation.XmlTransient;
import org.kie.internal.runtime.conf.ObjectModel;
diff --git a/kie-internal/src/main/java/org/kie/internal/task/api/model/AccessType.java b/kie-internal/src/main/java/org/kie/internal/task/api/model/AccessType.java
index e892aba698d..12420b0f79b 100644
--- a/kie-internal/src/main/java/org/kie/internal/task/api/model/AccessType.java
+++ b/kie-internal/src/main/java/org/kie/internal/task/api/model/AccessType.java
@@ -19,7 +19,7 @@
*/
package org.kie.internal.task.api.model;
-import javax.xml.bind.annotation.XmlType;
+import jakarta.xml.bind.annotation.XmlType;
@XmlType
public enum AccessType {
diff --git a/kie-internal/src/main/java/org/kie/internal/task/api/model/SubTasksStrategy.java b/kie-internal/src/main/java/org/kie/internal/task/api/model/SubTasksStrategy.java
index 86cf39d1960..982920d369f 100644
--- a/kie-internal/src/main/java/org/kie/internal/task/api/model/SubTasksStrategy.java
+++ b/kie-internal/src/main/java/org/kie/internal/task/api/model/SubTasksStrategy.java
@@ -16,7 +16,7 @@
package org.kie.internal.task.api.model;
-import javax.xml.bind.annotation.XmlType;
+import jakarta.xml.bind.annotation.XmlType;
@XmlType
public enum SubTasksStrategy{
diff --git a/kie-internal/src/test/java/org/kie/internal/runtime/manager/deploy/JaxbMarshalingTest.java b/kie-internal/src/test/java/org/kie/internal/runtime/manager/deploy/JaxbMarshalingTest.java
index 29f8b7e2f8b..65e66814a9e 100644
--- a/kie-internal/src/test/java/org/kie/internal/runtime/manager/deploy/JaxbMarshalingTest.java
+++ b/kie-internal/src/test/java/org/kie/internal/runtime/manager/deploy/JaxbMarshalingTest.java
@@ -18,9 +18,9 @@
import java.io.StringWriter;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.Marshaller;
import org.junit.Test;
import org.kie.internal.runtime.conf.DeploymentDescriptor;
diff --git a/kie-maven-plugin/pom.xml b/kie-maven-plugin/pom.xml
index bd3247a0113..edeacea4c25 100644
--- a/kie-maven-plugin/pom.xml
+++ b/kie-maven-plugin/pom.xml
@@ -7,7 +7,7 @@