Hi All,

I'm investigating a Jakarta EE TCK failure:

 - 
com/sun/ts/tests/jaxrs/ee/rs/beanparam/form/plain/JAXRSClient#formFieldParamEntityWithEncodedTest_from_standalone

This test posts a form and is checking to ensure the @Encoded annotation is 
being respected.  The code to respect that annotation is definitely 
implemented, however before that code is called we've already parsed, decoded 
and cached the form into the Message so the test fails.

 - 
https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java#L1033-L1054

Essentially, due to this caching the "decode" boolean is ignored after the 
first field of the bean is processed.  When you have a bean like the following 
where there are two fields, one results in 'decode=true' and the second in 
'decode=false', the second field's wishes will not happen as the first field 
caused the form to be decoded and cached.  The second field will then get a 
decoded value despite the @Encoded annotation.

    public class FormBeanParamEntity {
      @DefaultValue(Constants.DEFAULT_VALUE)
      @FormParam(Constants.PARAM_ENTITY_WITH_CONSTRUCTOR)
      public ParamEntityWithConstructor paramEntityWithConstructor;
    
      @Encoded
      @DefaultValue(Constants.DEFAULT_VALUE)
      @FormParam(Constants.PARAM_ENTITY_WITH_FROMSTRING)
      public ParamEntityWithFromString paramEntityWithFromString;


So essentially @Encoded will only work as the first parameter, field, etc.

Investigating fixes at the moment and will submit a PR.  Open to thoughts and 
preferences.  This is one of about 33 failures I'm hunting down.


-David

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to