mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
parent
507ec1b384
commit
5fbc86d92f
@ -461,16 +461,6 @@ public class MethodRetrievalProcessor implements ModelElementProcessor<Void, Lis
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( parameterType.isEnumType() && !( resultType.isEnumType() || resultType.isString() ) ) {
|
||||
messager.printMessage( method, Message.RETRIEVAL_ENUM_TO_NON_ENUM );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !( parameterType.isEnumType() || parameterType.isString() ) && resultType.isEnumType() ) {
|
||||
messager.printMessage( method, Message.RETRIEVAL_NON_ENUM_TO_ENUM );
|
||||
return false;
|
||||
}
|
||||
|
||||
for ( Type typeParameter : resultType.getTypeParameters() ) {
|
||||
if ( typeParameter.isTypeVar() ) {
|
||||
messager.printMessage( method, Message.RETRIEVAL_TYPE_VAR_RESULT );
|
||||
|
@ -129,8 +129,6 @@ public enum Message {
|
||||
RETRIEVAL_NON_ITERABLE_TO_ITERABLE( "Can't generate mapping method from non-iterable type to iterable type." ),
|
||||
RETRIEVAL_PRIMITIVE_PARAMETER( "Can't generate mapping method with primitive parameter type." ),
|
||||
RETRIEVAL_PRIMITIVE_RETURN( "Can't generate mapping method with primitive return type." ),
|
||||
RETRIEVAL_ENUM_TO_NON_ENUM( "Can't generate mapping method from enum type to non-enum type." ),
|
||||
RETRIEVAL_NON_ENUM_TO_ENUM( "Can't generate mapping method from non-enum type to enum type." ),
|
||||
RETRIEVAL_TYPE_VAR_SOURCE( "Can't generate mapping method for a generic type variable source." ),
|
||||
RETRIEVAL_TYPE_VAR_RESULT( "Can't generate mapping method for a generic type variable target." ),
|
||||
RETRIEVAL_WILDCARD_SUPER_BOUND_SOURCE( "Can't generate mapping method for a wildcard super bound source." ),
|
||||
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright MapStruct Authors.
|
||||
*
|
||||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
package org.mapstruct.ap.test.bugs._1788;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
|
||||
@Mapper
|
||||
public interface Issue1788Mapper {
|
||||
|
||||
Container toContainer(Container.Type type);
|
||||
|
||||
class Container {
|
||||
public enum Type {
|
||||
ONE, TWO
|
||||
}
|
||||
|
||||
//CHECKSTYLE:OFF
|
||||
public Type type;
|
||||
//CHECKSTYLE:ON
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* Copyright MapStruct Authors.
|
||||
*
|
||||
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
package org.mapstruct.ap.test.bugs._1788;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.mapstruct.ap.testutil.IssueKey;
|
||||
import org.mapstruct.ap.testutil.WithClasses;
|
||||
import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner;
|
||||
|
||||
@IssueKey( "1788" )
|
||||
@RunWith(AnnotationProcessorTestRunner.class)
|
||||
@WithClasses(
|
||||
Issue1788Mapper.class
|
||||
)
|
||||
public class Issue1788Test {
|
||||
|
||||
@Test
|
||||
public void shouldCompile() {
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user