orika-mapper / orika

Simpler, better and faster Java bean mapping framework
http://orika-mapper.github.io/orika-docs/
Apache License 2.0
1.29k stars 268 forks source link

Merge changes from master #311

Closed 123Haynes closed 5 years ago

123Haynes commented 5 years ago

This PR merges the changes from the master branch and fixes a few errors related to the hamcrest update. Junit 4.12 still uses hamcrest 1.3, so I updated Junit to Junit 5 and excluded hamcrest there.

Please note that the Test for Issue 46 always fails locally for me. I'm not sure if this is because of my setup or if there really is an error.

the trace is:

java.lang.AssertionError: Failed to process graph. failed after 7 transforms, exception = ma.glasnost.orika.MappingException: While attempting the following mapping:
sourceClass = class ma.glasnost.orika.test.community.Issue46TestCase$Two
sourceType = ma.glasnost.orika.test.community.Issue46TestCase.Two
destinationType = ma.glasnost.orika.test.community.Issue46TestCase.Two
resolvedStrategy = InstantiateAndUseCustomMapperStrategy<Two, Two> {customMapper: GeneratedMapper<Two, Two> {usedConverters: [], usedMappers: [], usedMapperFacades: [], usedTypes: [] }, unenhancer: ma.glasnost.orika.unenhance.BaseUnenhancer@1800c1e3, objectFactory: ma.glasnost.orika.test.community.Two_Two_ObjectFactory731207897156700731208176335400$4@3b8b4846}
Error occurred: java.lang.ArrayIndexOutOfBoundsException: Index 10 out of bounds for length 3
    at ma.glasnost.orika.test.community.Issue46TestCase.test(Issue46TestCase.java:71)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
    at org.junit.vintage.engine.execution.RunnerExecutor.execute(RunnerExecutor.java:40)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:195)
    at java.base/java.util.Iterator.forEachRemaining(Iterator.java:133)
    at java.base/java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
    at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
    at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
    at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
    at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:497)
    at org.junit.vintage.engine.VintageTestEngine.executeAllChildren(VintageTestEngine.java:80)
    at org.junit.vintage.engine.VintageTestEngine.execute(VintageTestEngine.java:71)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:220)
    at org.junit.platform.launcher.core.DefaultLauncher.lambda$execute$6(DefaultLauncher.java:188)
    at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:202)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:181)
    at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:128)
    at org.eclipse.jdt.internal.junit5.runner.JUnit5TestReference.run(JUnit5TestReference.java:89)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
123Haynes commented 5 years ago

I get the same error with the 1.6.x branch without any changes so I assume it's my setup.

The new dependency graph looks like this:

ma.glasnost.orika:orika-core:jar:1.6.0-SNAPSHOT 
+- com.thoughtworks.paranamer:paranamer:jar:2.8:compile
+- org.slf4j:slf4j-api:jar:1.7.26:compile
+- org.codehaus.janino:janino:jar:3.0.12:compile
\|  \- org.codehaus.janino:commons-compiler:jar:3.0.12:compile
+- org.junit.jupiter:junit-jupiter-api:jar:5.4.0:test
\|  +- org.apiguardian:apiguardian-api:jar:1.0.0:test 
\|  +- org.opentest4j:opentest4j:jar:1.1.1:test
\|  \- org.junit.platform:junit-platform-commons:jar:1.4.0:test
+- org.junit.vintage:junit-vintage-engine:jar:5.4.0:test
\|  +- org.junit.platform:junit-platform-engine:jar:1.4.0:test
\|  \- junit:junit:jar:4.12:test
+- org.hamcrest:hamcrest:jar:2.1:test
+- org.easymock:easymock:jar:4.0.2:test
\|  \- org.objenesis:objenesis:jar:3.0.1:test
+- org.hibernate.common:hibernate-commons-annotations:jar:5.1.0.Final:test
\|  \- org.jboss.logging:jboss-logging:jar:3.3.2.Final:test
+- org.hibernate:hibernate-core:jar:5.4.1.Final:test
\|  +- javax.persistence:javax.persistence-api:jar:2.2:test
\|  +- net.bytebuddy:byte-buddy:jar:1.9.5:test 
\|  +- antlr:antlr:jar:2.7.7:test 
\|  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:test 
\|  +- org.jboss:jandex:jar:2.0.5.Final:test 
\|  +- com.fasterxml:classmate:jar:1.3.4:test
\|  +- javax.activation:javax.activation-api:jar:1.2.0:test
\|  +- org.dom4j:dom4j:jar:2.1.1:test
\|  \- org.glassfish.jaxb:jaxb-runtime:jar:2.3.1:test
\|     +- org.glassfish.jaxb:txw2:jar:2.3.1:test 
\|     +- com.sun.istack:istack-commons-runtime:jar:3.0.7:test
\|     +- org.jvnet.staxex:stax-ex:jar:1.8:test
\|     \- com.sun.xml.fastinfoset:FastInfoset:jar:1.2.15:test
+- com.h2database:h2:jar:1.4.197:test 
+- ch.qos.logback:logback-core:jar:1.2.3:provided 
+- ch.qos.logback:logback-classic:jar:1.2.3:provided        
+- org.springframework:spring-tx:jar:5.1.5.RELEASE:test   
\|  +- org.springframework:spring-beans:jar:5.1.5.RELEASE:test          
\|  \- org.springframework:spring-core:jar:5.1.5.RELEASE:test   
\|     \- org.springframework:spring-jcl:jar:5.1.5.RELEASE:test    
+- org.springframework:spring-context:jar:5.1.5.RELEASE:test           
\|  +- org.springframework:spring-aop:jar:5.1.5.RELEASE:test          
\|  \- org.springframework:spring-expression:jar:5.1.5.RELEASE:test             
+- org.springframework:spring-test:jar:5.1.5.RELEASE:test         
+- org.springframework:spring-orm:jar:5.1.5.RELEASE:test          
\|  \- org.springframework:spring-jdbc:jar:5.1.5.RELEASE:test         
+- com.sun.xml.bind:jaxb-impl:jar:2.3.2:test                               
+- javax.xml.bind:jaxb-api:jar:2.3.1:test                                   
\- org.javassist:javassist:jar:3.24.1-GA:test