bval-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <j...@apache.org>
Subject [jira] [Created] (BVAL-157) method named get() blows up with illegal param name
Date Sat, 09 Jun 2018 08:05:00 GMT
Mark Struberg created BVAL-157:
----------------------------------

             Summary: method named get() blows up with illegal param name
                 Key: BVAL-157
                 URL: https://issues.apache.org/jira/browse/BVAL-157
             Project: BVal
          Issue Type: Bug
          Components: jsr303
    Affects Versions: 2.0.0
            Reporter: Mark Struberg
             Fix For: 2.0.0


In TomEE with have the following JAX-RS class:

{code}
@Path("test")
public static class Endpoint {
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Payload get() {
        return new Payload();
    }
{code}

This leads to the following exception because it obviously fails to extract a param name from
get():
{noformat}
java.util.MissingFormatArgumentException: Format specifier '%s'
	at java.util.Formatter.format(Formatter.java:2519)
	at java.util.Formatter.format(Formatter.java:2455)
	at java.lang.String.format(String.java:2940)
	at org.apache.bval.util.Exceptions.lambda$create$0(Exceptions.java:44)
	at org.apache.bval.util.Exceptions.create(Exceptions.java:53)
	at org.apache.bval.util.Exceptions.create(Exceptions.java:44)
	at org.apache.bval.util.Exceptions.raise(Exceptions.java:63)
	at org.apache.bval.util.Exceptions.raiseIf(Exceptions.java:69)
	at org.apache.bval.util.Exceptions.raiseUnless(Exceptions.java:75)
	at org.apache.bval.util.Validate.isTrue(Validate.java:43)
	at org.apache.bval.jsr.util.Methods.propertyName(Methods.java:54)
	at org.apache.bval.jsr.util.Methods.propertyName(Methods.java:50)
	at org.apache.bval.jsr.metadata.ReflectionBuilder$ForBean.getGetters(ReflectionBuilder.java:104)
	at org.apache.bval.jsr.descriptor.MetadataReader$ForBean.getProperties(MetadataReader.java:151)
	at org.apache.bval.jsr.descriptor.BeanD.<init>(BeanD.java:53)
	at org.apache.bval.jsr.descriptor.DescriptorManager.getBeanDescriptor(DescriptorManager.java:75)
	at org.apache.bval.jsr.job.ValidateParameters$ForMethod.describe(ValidateParameters.java:66)
	at org.apache.bval.jsr.job.ValidateParameters.hasWork(ValidateParameters.java:188)
	at org.apache.bval.jsr.job.ValidationJob.getResults(ValidationJob.java:554)
	at org.apache.bval.jsr.ValidatorImpl.validateParameters(ValidatorImpl.java:76)
	at org.apache.cxf.validation.BeanValidationProvider.validateParameters(BeanValidationProvider.java:116)
	at org.apache.cxf.validation.AbstractBeanValidationInterceptor.handleValidation(AbstractBeanValidationInterceptor.java:55)
{noformat}





--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message