mirror of
https://github.com/jlengrand/quarkus.git
synced 2026-03-10 08:41:22 +00:00
Ensure that generated exceptions mappers don't collide
This could happen if multiple exceptions with the same simple name but different package names were used
This commit is contained in:
committed by
Guillaume Smet
parent
4fbbeba236
commit
7382ac641f
@@ -11,6 +11,7 @@ import org.jboss.jandex.AnnotationInstance;
|
||||
import org.jboss.jandex.AnnotationValue;
|
||||
import org.jboss.jandex.DotName;
|
||||
|
||||
import io.quarkus.deployment.util.HashUtil;
|
||||
import io.quarkus.gizmo.ClassCreator;
|
||||
import io.quarkus.gizmo.ClassOutput;
|
||||
import io.quarkus.gizmo.MethodCreator;
|
||||
@@ -33,9 +34,10 @@ abstract class AbstractExceptionMapperGenerator {
|
||||
abstract void generateMethodBody(MethodCreator toResponse);
|
||||
|
||||
String generate() {
|
||||
String generatedClassName = "io.quarkus.spring.web.mappers." + exceptionDotName.withoutPackagePrefix() + "Mapper";
|
||||
String generatedClassName = "io.quarkus.spring.web.mappers." + exceptionDotName.withoutPackagePrefix() + "_Mapper_"
|
||||
+ HashUtil.sha1(exceptionDotName.toString());
|
||||
String generatedSubtypeClassName = "io.quarkus.spring.web.mappers.Subtype" + exceptionDotName.withoutPackagePrefix()
|
||||
+ "Mapper";
|
||||
+ "Mapper_" + HashUtil.sha1(exceptionDotName.toString());
|
||||
String exceptionClassName = exceptionDotName.toString();
|
||||
|
||||
try (ClassCreator cc = ClassCreator.builder()
|
||||
|
||||
Reference in New Issue
Block a user