Skip to content
Snippets Groups Projects
Commit f249e092 authored by Savchuk Mykyta's avatar Savchuk Mykyta
Browse files

use @Lazy to resolve bean cycle in CrsConversionService

parent 930ce464
No related branches found
No related tags found
1 merge request!530Whitesource update vulnerable dependencies
Pipeline #142417 canceled
......@@ -417,6 +417,8 @@ The following software have components provided under the terms of this license:
- KeePassJava2 :: Simple (from https://repo1.maven.org/maven2/org/linguafranca/pwdb/KeePassJava2-simple)
- Kotlin Stdlib (from https://kotlinlang.org/, https://repo1.maven.org/maven2/org/jetbrains/kotlin/kotlin-stdlib)
- Kotlin Stdlib Common (from https://kotlinlang.org/)
- Kotlin Stdlib Jdk7 (from https://kotlinlang.org/)
- Kotlin Stdlib Jdk8 (from https://kotlinlang.org/)
- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/)
- MapStruct Core (from http://mapstruct.org/mapstruct/, https://repo1.maven.org/maven2/org/mapstruct/mapstruct)
- Metrics Core (from https://repo1.maven.org/maven2/io/dropwizard/metrics/metrics-core)
......@@ -440,6 +442,7 @@ The following software have components provided under the terms of this license:
- Netty/Common (from https://repo1.maven.org/maven2/io/netty/netty-common)
- Netty/Handler (from https://repo1.maven.org/maven2/io/netty/netty-handler)
- Netty/Handler/Proxy (from https://repo1.maven.org/maven2/io/netty/netty-handler-proxy)
- Netty/Incubator/Codec/Classes/Quic (from https://repo1.maven.org/maven2/io/netty/incubator/netty-incubator-codec-classes-quic)
- Netty/Resolver (from https://repo1.maven.org/maven2/io/netty/netty-resolver)
- Netty/Resolver/DNS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns)
- Netty/Resolver/DNS/Classes/MacOS (from https://repo1.maven.org/maven2/io/netty/netty-resolver-dns-classes-macos)
......@@ -776,6 +779,7 @@ The following software have components provided under the terms of this license:
- Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core)
- Logback Contrib :: Jackson (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-jackson)
- Logback Core Module (from http://logback.qos.ch, https://repo1.maven.org/maven2/ch/qos/logback/logback-core)
- Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java)
......@@ -888,8 +892,6 @@ The following software have components provided under the terms of this license:
========================================================================
JSON
========================================================================
The following software have components provided under the terms of this license:
- JSON in Java (from https://github.com/douglascrockford/JSON-java)
========================================================================
......@@ -910,6 +912,7 @@ The following software have components provided under the terms of this license:
- Logback Contrib :: JSON :: Core (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-json-core)
- Logback Contrib :: Jackson (from https://repo1.maven.org/maven2/ch/qos/logback/contrib/logback-jackson)
- Logback Core Module (from http://logback.qos.ch, https://repo1.maven.org/maven2/ch/qos/logback/logback-core)
- Microsoft Application Insights Java SDK Core (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Spring Boot starter (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Java SDK Web Module (from https://github.com/Microsoft/ApplicationInsights-Java)
- Microsoft Application Insights Log4j 2 Appender (from https://github.com/Microsoft/ApplicationInsights-Java)
......
......@@ -29,6 +29,7 @@ import org.opengroup.osdu.core.common.crs.ICrsConverterFactory;
import org.opengroup.osdu.core.common.crs.ICrsConverterService;
import org.opengroup.osdu.core.common.crs.CrsConversionServiceErrorMessages;
import org.opengroup.osdu.core.common.util.IServiceAccountJwtClient;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
......@@ -52,6 +53,10 @@ public class CrsConversionService {
@Autowired
private CrsPropertySet crsPropertySet;
@Autowired
@Lazy
private DpsConversionService dpsConversionService;
@Autowired
private ICrsConverterFactory crsConverterFactory;
......@@ -135,7 +140,7 @@ public class CrsConversionService {
String recordId = this.getRecordId(recordJsonObject);
ConversionStatus.ConversionStatusBuilder statusBuilder = this.getConversionStatusBuilderFromList(recordId, conversionStatuses);
List<String> validationErrors = new ArrayList<>();
JsonObject filteredObjects = DpsConversionService.filterDataFields(recordJsonObject, validationErrors);
JsonObject filteredObjects = this.dpsConversionService.filterDataFields(recordJsonObject, validationErrors);
Iterator<String> keys = filteredObjects.keySet().iterator();
while(keys.hasNext()) {
String attributeName = keys.next();
......
......@@ -108,7 +108,7 @@ public class DpsConversionService {
}
private boolean isAsIngestedCoordinatesPresent(JsonObject record, List<String> validationErrors) {
JsonObject filteredObject = filterDataFields(record, validationErrors);
JsonObject filteredObject = this.filterDataFields(record, validationErrors);
return ((filteredObject != null) && (filteredObject.size() > 0));
}
......@@ -198,7 +198,7 @@ public class DpsConversionService {
}
}
public static JsonObject filterDataFields(JsonObject record, List<String> validationErrors) {
public JsonObject filterDataFields(JsonObject record, List<String> validationErrors) {
JsonObject dataObject = record.get(Constants.DATA).getAsJsonObject();
JsonObject filteredData = new JsonObject();
Iterator var = validAttributes.iterator();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment