From 446ac56ae29f02c5079ae6a28bc72158189210fe Mon Sep 17 00:00:00 2001 From: Enrique Gonzalez Martinez Date: Tue, 16 Jul 2024 17:04:53 +0200 Subject: [PATCH] fix formatting --- .../api/marshalling/json/JSONMarshaller.java | 30 +++++++++---------- .../json/JSONMarshallerExtensionTest.java | 6 ++-- .../marshalling/objects/FreeFormItemType.java | 16 ++++++++++ .../api/marshalling/objects/ItemsType.java | 16 ++++++++++ .../marshalling/objects/StandardItemType.java | 16 ++++++++++ 5 files changed, 65 insertions(+), 19 deletions(-) diff --git a/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/json/JSONMarshaller.java b/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/json/JSONMarshaller.java index 9620bf05ae..44d711cb7c 100644 --- a/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/json/JSONMarshaller.java +++ b/kie-server-parent/kie-server-api/src/main/java/org/kie/server/api/marshalling/json/JSONMarshaller.java @@ -45,20 +45,6 @@ import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters; -import org.drools.core.xml.jaxb.util.JaxbListAdapter; -import org.drools.core.xml.jaxb.util.JaxbListWrapper; -import org.drools.core.xml.jaxb.util.JaxbUnknownAdapter; -import org.kie.server.api.KieServerConstants; -import org.kie.server.api.marshalling.Marshaller; -import org.kie.server.api.marshalling.MarshallingException; -import org.kie.server.api.marshalling.MarshallingFormat; -import org.kie.server.api.marshalling.ModelWrapper; -import org.kie.server.api.model.Wrapped; -import org.kie.server.api.model.definition.QueryParam; -import org.kie.server.api.model.type.JaxbByteArray; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.core.JsonGenerator; @@ -96,6 +82,19 @@ import com.fasterxml.jackson.databind.util.ClassUtil; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector; +import org.drools.core.xml.jaxb.util.JaxbListAdapter; +import org.drools.core.xml.jaxb.util.JaxbListWrapper; +import org.drools.core.xml.jaxb.util.JaxbUnknownAdapter; +import org.kie.server.api.KieServerConstants; +import org.kie.server.api.marshalling.Marshaller; +import org.kie.server.api.marshalling.MarshallingException; +import org.kie.server.api.marshalling.MarshallingFormat; +import org.kie.server.api.marshalling.ModelWrapper; +import org.kie.server.api.model.Wrapped; +import org.kie.server.api.model.definition.QueryParam; +import org.kie.server.api.model.type.JaxbByteArray; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class JSONMarshaller implements Marshaller { @@ -520,8 +519,9 @@ public List findSubtypes(Annotated a) { continue; } String name = elem.name(); - if (MARKER_FOR_DEFAULT.equals(name)) + if (MARKER_FOR_DEFAULT.equals(name)) { name = null; + } complete.add(new NamedType(elem.type(), name)); } } else { diff --git a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/json/JSONMarshallerExtensionTest.java b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/json/JSONMarshallerExtensionTest.java index 30903e5897..4c1918c3d5 100644 --- a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/json/JSONMarshallerExtensionTest.java +++ b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/json/JSONMarshallerExtensionTest.java @@ -18,7 +18,6 @@ import java.io.IOException; import java.io.InputStream; -import java.io.Serializable; import java.net.URL; import java.text.DateFormat; import java.text.SimpleDateFormat; @@ -27,6 +26,8 @@ import java.util.HashSet; import java.util.Set; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; import org.assertj.core.api.Assertions; import org.drools.core.command.runtime.BatchExecutionCommandImpl; import org.drools.core.command.runtime.rule.InsertObjectCommand; @@ -43,9 +44,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; - import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; diff --git a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/FreeFormItemType.java b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/FreeFormItemType.java index 8833d19c8c..cd6ede718f 100644 --- a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/FreeFormItemType.java +++ b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/FreeFormItemType.java @@ -1,6 +1,22 @@ +/* + * Copyright 2024 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.kie.server.api.marshalling.objects; import java.io.Serializable; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; diff --git a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/ItemsType.java b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/ItemsType.java index 7748486e9d..5da19affa8 100644 --- a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/ItemsType.java +++ b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/ItemsType.java @@ -1,8 +1,24 @@ +/* + * Copyright 2024 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.kie.server.api.marshalling.objects; import java.io.Serializable; import java.util.ArrayList; import java.util.List; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; diff --git a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/StandardItemType.java b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/StandardItemType.java index 39db3583c9..240fef2f8a 100644 --- a/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/StandardItemType.java +++ b/kie-server-parent/kie-server-api/src/test/java/org/kie/server/api/marshalling/objects/StandardItemType.java @@ -1,6 +1,22 @@ +/* + * Copyright 2024 Red Hat, Inc. and/or its affiliates. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.kie.server.api.marshalling.objects; import java.io.Serializable; + import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlType;