You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2026/04/17 14:21:09 UTC
(ofbiz-plugins) branch trunk updated (31d50a981 -> fe14e0b33)
This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a change to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
from 31d50a981 FIXED: Issue on canceling an item from multi item order ecommerce order view page by customer. (#203)
new 4444ea2dc Fixed: Replace TopScoreDocCollector with TopDocs in LuceneTests to resolve compilation warnings
new fe14e0b33 Fixed: Refactor JacksonConfig to use JsonMapper to suppress waarnings
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/org/apache/ofbiz/content/test/LuceneTests.java | 7 +++----
.../org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java | 14 ++++++++------
2 files changed, 11 insertions(+), 10 deletions(-)
(ofbiz-plugins) 02/02: Fixed: Refactor JacksonConfig to use JsonMapper to suppress waarnings
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
commit fe14e0b33fb627572ee7392fb882908bddf0dd01
Author: Jacopo Cappellato <ja...@gmail.com>
AuthorDate: Fri Apr 17 10:57:44 2026 +0200
Fixed: Refactor JacksonConfig to use JsonMapper to suppress waarnings
---
.../org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/rest-api/src/main/java/org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java b/rest-api/src/main/java/org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java
index ccd5515c4..bbe4b1150 100644
--- a/rest-api/src/main/java/org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java
+++ b/rest-api/src/main/java/org/apache/ofbiz/ws/rs/spi/impl/JacksonConfig.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.json.JsonMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.fasterxml.jackson.databind.module.SimpleModule;
@@ -36,12 +37,13 @@ public class JacksonConfig implements ContextResolver<ObjectMapper> {
private final ObjectMapper objectMapper;
public JacksonConfig() {
- objectMapper = new ObjectMapper();
- objectMapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- objectMapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- objectMapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
- objectMapper.setVisibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY);
- objectMapper.enable(SerializationFeature.INDENT_OUTPUT);
+ objectMapper = JsonMapper.builder()
+ .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS)
+ .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES)
+ .defaultPropertyInclusion(JsonInclude.Value.construct(JsonInclude.Include.NON_NULL, JsonInclude.Include.NON_NULL))
+ .visibility(PropertyAccessor.ALL, JsonAutoDetect.Visibility.ANY)
+ .enable(SerializationFeature.INDENT_OUTPUT)
+ .build();
SimpleModule simpleModule = new SimpleModule();
simpleModule.addSerializer(Link.class, new LinkSerializer());
objectMapper.registerModule(simpleModule);
(ofbiz-plugins) 01/02: Fixed: Replace TopScoreDocCollector with TopDocs in LuceneTests to resolve compilation warnings
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jacopoc pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
commit 4444ea2dc2e629cb4e04efbf9e257093a9b219e1
Author: Jacopo Cappellato <ja...@gmail.com>
AuthorDate: Fri Apr 17 10:56:58 2026 +0200
Fixed: Replace TopScoreDocCollector with TopDocs in LuceneTests to resolve compilation warnings
---
.../src/main/java/org/apache/ofbiz/content/test/LuceneTests.java | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
index 1dbdff12d..1026d3138 100644
--- a/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
+++ b/lucene/src/main/java/org/apache/ofbiz/content/test/LuceneTests.java
@@ -31,7 +31,7 @@ import org.apache.lucene.search.BooleanClause;
import org.apache.lucene.search.BooleanQuery;
import org.apache.lucene.search.IndexSearcher;
import org.apache.lucene.search.Query;
-import org.apache.lucene.search.TopScoreDocCollector;
+import org.apache.lucene.search.TopDocs;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.FSDirectory;
import org.apache.ofbiz.base.util.Debug;
@@ -92,9 +92,8 @@ public class LuceneTests extends OFBizTestCase {
combQueryBuilder.add(query, BooleanClause.Occur.MUST);
BooleanQuery combQuery = combQueryBuilder.build();
- TopScoreDocCollector collector = TopScoreDocCollector.create(10, 10);
- searcher.search(combQuery, collector);
+ TopDocs topDocs = searcher.search(combQuery, 10);
- assertEquals("Only 1 result expected from the testdata", 1, collector.getTotalHits());
+ assertEquals("Only 1 result expected from the testdata", 1, (int) topDocs.totalHits.value);
}
}