mirror of
https://github.com/mapstruct/mapstruct.git
synced 2025-07-12 00:00:08 +08:00
#2704 Fix broken reference to constants within nested enums
This commit is contained in:
parent
0a7b8134d4
commit
42cfa05c40
@ -6,4 +6,4 @@
|
||||
|
||||
-->
|
||||
<#-- @ftlvariable name="" type="org.mapstruct.ap.internal.model.assignment.EnumConstantWrapper" -->
|
||||
${ext.targetType.name}.${assignment}
|
||||
${ext.targetType.createReferenceName()}.${assignment}
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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._2704;
|
||||
|
||||
import org.mapstruct.ap.testutil.IssueKey;
|
||||
import org.mapstruct.ap.testutil.ProcessorTest;
|
||||
import org.mapstruct.ap.testutil.WithClasses;
|
||||
|
||||
/**
|
||||
* @author Valentin Kulesh
|
||||
*/
|
||||
@IssueKey("2704")
|
||||
@WithClasses({ TestMapper.class, TopLevel.class })
|
||||
public class Issue2704Test {
|
||||
@ProcessorTest
|
||||
public void shouldCompile() {
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
/*
|
||||
* 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._2704;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.mapstruct.ap.test.bugs._2704.TopLevel.Target;
|
||||
|
||||
/**
|
||||
* @author Valentin Kulesh
|
||||
*/
|
||||
@Mapper(implementationPackage = "")
|
||||
public interface TestMapper {
|
||||
@Mapping(target = "e", constant = "VALUE1")
|
||||
Target test(Object unused);
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* 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._2704;
|
||||
|
||||
/**
|
||||
* @author Valentin Kulesh
|
||||
*/
|
||||
public interface TopLevel {
|
||||
enum InnerEnum {
|
||||
VALUE1,
|
||||
VALUE2,
|
||||
}
|
||||
|
||||
class Target {
|
||||
public void setE(@SuppressWarnings("unused") InnerEnum e) {
|
||||
}
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user