Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: DozerMapper/dozer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: 1stdibs/dozer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
  • 10 commits
  • 9 files changed
  • 6 contributors

Commits on Aug 1, 2014

  1. Copy the full SHA
    a3cd02b View commit details
  2. chaning name to dibs

    vadim911 committed Aug 1, 2014
    Copy the full SHA
    e0fd9fb View commit details
  3. pointing to dibsnexus

    vadim911 committed Aug 1, 2014
    Copy the full SHA
    bd7ca20 View commit details

Commits on Sep 20, 2017

  1. Copy the full SHA
    804ce87 View commit details
  2. fix version

    Ryan Smith committed Sep 20, 2017
    Copy the full SHA
    f9d85b6 View commit details
  3. simplify

    Ryan Smith committed Sep 20, 2017
    Copy the full SHA
    c763da6 View commit details
  4. Merge pull request #1 from 1stdibs/dont-bomb-is-reinitialize-attempted

    dont throw exception a initialize attempted after already doing once
    vadim911 authored Sep 20, 2017
    Copy the full SHA
    8ec5fe3 View commit details

Commits on Jun 12, 2024

  1. SYSOPS-1425 - updating to nexus 3

    Geren White committed Jun 12, 2024
    Copy the full SHA
    7a50239 View commit details

Commits on Jun 13, 2024

  1. Merge pull request #2 from 1stdibs/feature-SYSOPS-1425

    SYSOPS-1425 - updating to nexus 3
    gtwhite authored Jun 13, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cff3ae0 View commit details

Commits on Jul 8, 2024

  1. BI-3923: expose initialize function (#3)

    * BI-3923: expose initialize function
    
    ---------
    
    Co-authored-by: Yanrong Wo <[email protected]>
    YanrongWo and Yanrong Wo authored Jul 8, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    aa36568 View commit details
Showing with 81 additions and 50 deletions.
  1. +5 −0 README.md
  2. +3 −2 core/pom.xml
  3. +33 −27 core/src/main/java/org/dozer/DozerBeanMapper.java
  4. +11 −7 core/src/main/java/org/dozer/propertydescriptor/JavaBeanPropertyDescriptor.java
  5. +2 −2 osgi-test/pom.xml
  6. +3 −3 osgi/pom.xml
  7. +18 −3 pom.xml
  8. +3 −3 proto/pom.xml
  9. +3 −3 spring/pom.xml
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Dibs Build Notes

* built with: `mvn clean install -DskipTests -Dmaven.javadoc.skip=true`
* [xmlBeans dependency must be built with Java 8](https://github.com/ethercis/openehr-java-libs/issues/1), so make sure you have some version of Java 8 installed

<a href="http://dozer.sf.net"><img src="http://dozer.sourceforge.net/images/dozer.png" alt="Dozer" width="58" height="42"></a>

[![Build Status](https://api.travis-ci.org/DozerMapper/dozer.png)](https://travis-ci.org/DozerMapper/dozer)
5 changes: 3 additions & 2 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
</parent>

<artifactId>dozer</artifactId>
@@ -271,6 +271,7 @@
<configuration>
<schemaDirectory>src/test/xsd/xmlbeans</schemaDirectory>
<sourceGenerationDirectory>target/xmlbeans-sources</sourceGenerationDirectory>
<javaSource>1.8</javaSource>
</configuration>
</plugin>
<plugin>
60 changes: 33 additions & 27 deletions core/src/main/java/org/dozer/DozerBeanMapper.java
Original file line number Diff line number Diff line change
@@ -145,20 +145,23 @@ public List<String> getMappingFiles() {
* @see java.net.URL
*/
public void setMappingFiles(List<String> mappingFileUrls) {
checkIfInitialized();
this.mappingFiles.clear();
this.mappingFiles.addAll(mappingFileUrls);
if (!isInitialized()) {
this.mappingFiles.clear();
this.mappingFiles.addAll(mappingFileUrls);
}
}

public void setFactories(Map<String, BeanFactory> factories) {
checkIfInitialized();
DestBeanCreator.setStoredFactories(factories);
if (!isInitialized()) {
DestBeanCreator.setStoredFactories(factories);
}
}

public void setCustomConverters(List<CustomConverter> customConverters) {
checkIfInitialized();
this.customConverters.clear();
this.customConverters.addAll(customConverters);
if (!isInitialized()) {
this.customConverters.clear();
this.customConverters.addAll(customConverters);
}
}

public List<CustomConverter> getCustomConverters() {
@@ -242,10 +245,11 @@ private List<MappingFileData> loadFromFiles(List<String> mappingFiles) {
* @param xmlStream Dozer mapping XML InputStream
*/
public void addMapping(InputStream xmlStream) {
checkIfInitialized();
MappingStreamReader fileReader = new MappingStreamReader(XMLParserFactory.getInstance());
MappingFileData mappingFileData = fileReader.read(xmlStream);
builderMappings.add(mappingFileData);
if (!isInitialized()) {
MappingStreamReader fileReader = new MappingStreamReader(XMLParserFactory.getInstance());
MappingFileData mappingFileData = fileReader.read(xmlStream);
builderMappings.add(mappingFileData);
}
}

/**
@@ -254,28 +258,31 @@ public void addMapping(InputStream xmlStream) {
* @param mappingBuilder mappings to be added
*/
public void addMapping(BeanMappingBuilder mappingBuilder) {
checkIfInitialized();
MappingFileData mappingFileData = mappingBuilder.build();
builderMappings.add(mappingFileData);
if (!isInitialized()) {
MappingFileData mappingFileData = mappingBuilder.build();
builderMappings.add(mappingFileData);
}
}

public List<? extends DozerEventListener> getEventListeners() {
return Collections.unmodifiableList(eventListeners);
}

public void setEventListeners(List<? extends DozerEventListener> eventListeners) {
checkIfInitialized();
this.eventListeners.clear();
this.eventListeners.addAll(eventListeners);
if (!isInitialized()) {
this.eventListeners.clear();
this.eventListeners.addAll(eventListeners);
}
}

public CustomFieldMapper getCustomFieldMapper() {
return customFieldMapper;
}

public void setCustomFieldMapper(CustomFieldMapper customFieldMapper) {
checkIfInitialized();
this.customFieldMapper = customFieldMapper;
if (!isInitialized()) {
this.customFieldMapper = customFieldMapper;
}
}

/**
@@ -298,15 +305,14 @@ public MappingMetadata getMappingMetadata() {
* @param customConvertersWithId converter id to converter instance map
*/
public void setCustomConvertersWithId(Map<String, CustomConverter> customConvertersWithId) {
checkIfInitialized();
this.customConvertersWithId.clear();
this.customConvertersWithId.putAll(customConvertersWithId);
if (!isInitialized()) {
this.customConvertersWithId.clear();
this.customConvertersWithId.putAll(customConvertersWithId);
}
}

private void checkIfInitialized() {
if (ready.getCount() == 0) {
throw new MappingException("Dozer Bean Mapper is already initialized! Modify settings before calling map()");
}
public boolean isInitialized() {
return ready.getCount() == 0;
}

private void initMappings() {
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2005-2013 Dozer Project
/*
* Copyright 2005-2010 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,6 +33,7 @@
*/
public class JavaBeanPropertyDescriptor extends GetterSetterPropertyDescriptor {
private PropertyDescriptor pd;
private Method writeMethod;

public JavaBeanPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIndexed, int index,
HintContainer srcDeepIndexHintContainer, HintContainer destDeepIndexHintContainer) {
@@ -41,12 +42,15 @@ public JavaBeanPropertyDescriptor(Class<?> clazz, String fieldName, boolean isIn

@Override
public Method getWriteMethod() throws NoSuchMethodException {
Method result = getPropertyDescriptor(destDeepIndexHintContainer).getWriteMethod();
result = result == null ? ReflectionUtils.getNonVoidSetter(clazz, fieldName) : result;
if (result == null) {
throw new NoSuchMethodException("Unable to determine write method for Field: '" + fieldName + "' in Class: " + clazz);
// Store writeMethod internally as {@code PropertyDescriptor} stores it as {@code SoftReference}. This may be lost during GC.
if (writeMethod == null) {
writeMethod = getPropertyDescriptor(destDeepIndexHintContainer).getWriteMethod();
writeMethod = writeMethod == null ? ReflectionUtils.getNonVoidSetter(clazz, fieldName) : writeMethod;
if (writeMethod == null) {
throw new NoSuchMethodException("Unable to determine write method for Field: '" + fieldName + "' in Class: " + clazz);
}
}
return result;
return writeMethod;
}

@Override
4 changes: 2 additions & 2 deletions osgi-test/pom.xml
Original file line number Diff line number Diff line change
@@ -22,9 +22,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
</parent>

<artifactId>dozer-osgi-test</artifactId>
6 changes: 3 additions & 3 deletions osgi/pom.xml
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
</parent>

<artifactId>dozer-osgi</artifactId>
@@ -127,7 +127,7 @@

<dependencies>
<dependency>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
21 changes: 18 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -20,10 +20,10 @@

<modelVersion>4.0.0</modelVersion>

<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<packaging>pom</packaging>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
<url>http://dozer.sourceforge.net</url>
<name>Dozer Parent Project</name>
<description>Dozer is a powerful Java Bean to Java Bean mapper that recursively copies data from one object to
@@ -350,7 +350,21 @@
<system>GitHub</system>
<url>https://github.com/DozerMapper/dozer/issues</url>
</issueManagement>

<distributionManagement>
<repository>
<!-- Where to put released artifacts -->
<id>1stdibs-release</id>
<name>Nexus release artifact deployment repository</name>
<url>http://dibsnexus3.utils.1stdibs.com:8081/repository/releases</url>
</repository>
<snapshotRepository>
<!-- Where to put snapshot artifacts -->
<id>1stdibs-snapshot</id>
<name>Nexus snapshot artifact deployment repository</name>
<url>http://dibsnexus3.utils.1stdibs.com:8081/repository/snapshots</url>
</snapshotRepository>
</distributionManagement>
<!--
<distributionManagement>
<site>
<id>dozer.sf.net</id>
@@ -368,6 +382,7 @@
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>
</distributionManagement>
-->

<scm>
<connection>scm:git:https//github.com/DozerMapper/dozer</connection>
6 changes: 3 additions & 3 deletions proto/pom.xml
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
</parent>

<artifactId>dozer-proto</artifactId>
@@ -36,7 +36,7 @@

<dependencies>
<dependency>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer</artifactId>
<version>${project.version}</version>
</dependency>
6 changes: 3 additions & 3 deletions spring/pom.xml
Original file line number Diff line number Diff line change
@@ -21,9 +21,9 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer-parent</artifactId>
<version>5.5.1</version>
<version>5.5.2-PDFIX.2</version>
</parent>

<artifactId>dozer-spring</artifactId>
@@ -36,7 +36,7 @@

<dependencies>
<dependency>
<groupId>net.sf.dozer</groupId>
<groupId>com.dibs</groupId>
<artifactId>dozer</artifactId>
<version>${project.version}</version>
<scope>provided</scope>