Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion build-config/src/main/resources/build-config/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@
<module name="ImportControl">
<property name="file" value="${basedir}/../build-config/src/main/resources/build-config/import-control.xml" />
</module>
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STATIC"/>
<property name="standardPackageRegExp" value="^(java|javax)\."/>
<property name="specialImportsRegExp" value="^org\.hibernate\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="true"/>
</module>


<!-- Checks for Size Violations. -->
Expand All @@ -141,7 +149,7 @@
<module name="NoWhitespaceBefore"/>
<!-- <module name="OperatorWrap"/> -->
<module name="ParenPad">
<property name="tokens" value="CTOR_CALL, METHOD_CALL, SUPER_CTOR_CALL"/>
<property name="tokens" value="CTOR_CALL, LITERAL_CATCH, LITERAL_DO, LITERAL_FOR, LITERAL_IF, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_WHILE, METHOD_CALL, SUPER_CTOR_CALL"/>
<property name="option" value="space"/>
</module>
<module name="TypecastParenPad"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;


/**
* Controls which means of mapping are considered between the source and the target in mappings.
*
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/org/mapstruct/factory/Mappers.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ private static <T> T doGetMapper(Class<T> clazz, ClassLoader classLoader) throws

return constructor.newInstance();
}
catch (ClassNotFoundException e) {
catch ( ClassNotFoundException e ) {
return getMapperFromServiceLoader( clazz, classLoader );
}
catch ( InstantiationException | InvocationTargetException | IllegalAccessException e) {
catch ( InstantiationException | InvocationTargetException | IllegalAccessException e ) {
throw new RuntimeException( e );
}
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/test/java/org/mapstruct/factory/MappersTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/
package org.mapstruct.factory;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.test.model.Foo;
import org.mapstruct.test.model.SomeClass;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Unit test for {@link Mappers}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
package org.mapstruct.itest.cdi;

import org.mapstruct.DecoratedWith;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.DecoratedWith;
import org.mapstruct.itest.cdi.other.DateMapper;

@Mapper( componentModel = MappingConstants.ComponentModel.CDI, uses = DateMapper.class )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
package org.mapstruct.itest.cdi;

import static org.assertj.core.api.Assertions.assertThat;

import javax.inject.Inject;

import org.jboss.arquillian.container.test.api.Deployment;
Expand All @@ -18,6 +16,8 @@
import org.junit.jupiter.api.extension.ExtendWith;
import org.mapstruct.itest.cdi.other.DateMapper;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for generation of CDI-based mapper implementations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class TextBlocksTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
*/
package org.mapstruct.itest.externalbeanjar;

import org.mapstruct.itest.externalbeanjar.Source;
import org.mapstruct.itest.externalbeanjar.Target;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;
import org.mapstruct.itest.externalbeanjar.Source;
import org.mapstruct.itest.externalbeanjar.Target;

/**
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
package org.mapstruct.itest.simple;

import java.math.BigDecimal;
import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.externalbeanjar.Source;
import org.mapstruct.itest.externalbeanjar.Issue1121Mapper;
import org.mapstruct.itest.externalbeanjar.Source;
import org.mapstruct.itest.externalbeanjar.Target;

import static org.assertj.core.api.Assertions.assertThat;

class ConversionTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
*/
package org.mapstruct.ap.test.ignore;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import org.mapstruct.ap.test.ignore.AnimalMapper;
import org.mapstruct.ap.test.ignore.Animal;
import org.mapstruct.ap.test.ignore.AnimalDto;
import org.mapstruct.ap.test.ignore.AnimalMapper;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for ignoring properties during the mapping.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

import org.mapstruct.itest.gradle.model.Target;
import org.mapstruct.itest.gradle.model.Source;
import org.mapstruct.itest.gradle.model.Target;

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TestMapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.mapstruct.itest.jakarta.jaxb.xsd.test2.ShippingAddressType;
import org.mapstruct.itest.jakarta.jaxb.xsd.underscores.SubType;


/**
* @author Sjaak Derksen
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
*/
package org.mapstruct.itest.jakarta.jaxb;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.ByteArrayOutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
Expand All @@ -17,12 +15,13 @@
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.Marshaller;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.jakarta.jaxb.xsd.test1.ObjectFactory;
import org.mapstruct.itest.jakarta.jaxb.xsd.test1.OrderType;
import org.mapstruct.itest.jakarta.jaxb.xsd.underscores.SubType;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for generation of Jakarta JAXB based mapper implementations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/
package org.mapstruct.itest.java8;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for generation of Java8 based mapper implementations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.mapstruct.itest.jaxb.xsd.test2.ShippingAddressType;
import org.mapstruct.itest.jaxb.xsd.underscores.SubType;


/**
* @author Sjaak Derksen
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@
*/
package org.mapstruct.itest.jaxb;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.ByteArrayOutputStream;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
Expand All @@ -23,6 +20,8 @@
import org.mapstruct.itest.jaxb.xsd.test1.OrderType;
import org.mapstruct.itest.jaxb.xsd.underscores.SubType;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for generation of JAXB based mapper implementations.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
package org.mapstruct.itest.jsr330;

import org.mapstruct.DecoratedWith;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.DecoratedWith;
import org.mapstruct.itest.jsr330.other.DateMapper;

@Mapper(componentModel = MappingConstants.ComponentModel.JSR330, uses = DateMapper.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
package org.mapstruct.itest.jsr330;

import org.mapstruct.DecoratedWith;
import org.mapstruct.Mapper;
import org.mapstruct.MappingConstants;
import org.mapstruct.DecoratedWith;
import org.mapstruct.itest.jsr330.other.DateMapper;

@Mapper(componentModel = MappingConstants.ComponentModel.JSR330, uses = DateMapper.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mapstruct.itest.jsr330.Jsr330BasedMapperTest.SpringTestConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
package org.mapstruct.itest.kotlin.data;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.kotlin.data.CustomerDto;
import org.mapstruct.itest.kotlin.data.CustomerEntity;
import org.mapstruct.itest.kotlin.data.CustomerMapper;

import static org.assertj.core.api.Assertions.assertThat;

class KotlinDataTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
package org.mapstruct.itest.modules;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.modules.CustomerDto;
import org.mapstruct.itest.modules.CustomerEntity;
import org.mapstruct.itest.modules.CustomerMapper;

import static org.assertj.core.api.Assertions.assertThat;

class ModulesTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
package org.mapstruct.itest.naming;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.naming.GolfPlayer;
import org.mapstruct.itest.naming.GolfPlayerDto;
import org.mapstruct.itest.naming.GolfPlayerMapper;

import static org.assertj.core.api.Assertions.assertThat;

/**
* Test for using a custom naming strategy.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
package org.mapstruct.itest.records.module2;

import org.mapstruct.itest.records.module1.SourceRootRecord;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;
import org.mapstruct.itest.records.module1.SourceRootRecord;

@Mapper
public interface RecordInterfaceIssueMapper {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/
package org.mapstruct.itest.records.module2;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.records.module1.SourceRootRecord;
import org.mapstruct.itest.records.module1.SourceNestedRecord;
import org.mapstruct.itest.records.module1.SourceRootRecord;

import static org.assertj.core.api.Assertions.assertThat;

class RecordsTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
*/
package org.mapstruct.itest.records.mapper;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.records.api.CustomerDto;
import org.mapstruct.itest.records.mapper.CustomerEntity;
import org.mapstruct.itest.records.mapper.CustomerMapper;

import static org.assertj.core.api.Assertions.assertThat;

class RecordsTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;
import org.mapstruct.itest.records.CustomerDto;
import org.mapstruct.itest.records.CustomerEntity;
import org.mapstruct.itest.records.CustomerMapper;

import static org.assertj.core.api.Assertions.assertThat;

class RecordsTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

import java.util.Arrays;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class NestedRecordsTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
*/
package org.mapstruct.itest.sealedsubclass;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;

class SealedSubclassTest {

@Test
Expand Down
Loading
Loading