tyrus
  1. tyrus
  2. TYRUS-215

TextDecoder is used no matter that willDecode() returns false

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None

      Description

      public class StringBean {
      	private String value;
      
      	public String get() {
      		return value;
      	}
      
      	public void set(String value) {
      		this.value = value;
      	}
      	
      	@Override
      	public String toString() {
      		return "StringBean. To get a value, use rather #get() method.";
      	}
      
      	public StringBean(String value) {
      		super();
      		this.value = value;
      	}
      }
      
      public class WillDecodeFirstTextDecoder implements Text<StringBean> {
          public void init(EndpointConfig config) {}
      
          public void destroy() {}
      
      	@Override
      	public StringBean decode(String s) throws DecodeException {
                      System.out.println("first"); //or break point or whatever
      		return new StringBean(s);
      	};
      
      	@Override
      	public boolean willDecode(String s) {
      		return false;
      	}	
      }
      
      public class WillDecodeSecondTextDecoder implements Text<StringBean>  {
          public void init(EndpointConfig config) {}
      
          public void destroy() {}
      
      	
      	@Override
      	public StringBean decode(String s) throws DecodeException {
      		return new StringBean(s);
      	};
      
      	@Override
      	public boolean willDecode(String s) {
      		return true;
      	}	
      }
      
      @ServerEndpoint(value = "/textwilldecode", decoders = {
      		WillDecodeFirstTextDecoder.class, WillDecodeSecondTextDecoder.class })
      public class WSWillDecodeTextDecoderServer {
      	@OnMessage
      	public String echo(StringBean bean) {
      		return bean.get();
      	}
      }
      

      WillDecodeFirstTextDecoder is decoding!

        Issue Links

          Activity

          Hide
          Pavel Bucek added a comment -

          fixed in the trunk, rev 727

          Show
          Pavel Bucek added a comment - fixed in the trunk, rev 727
          Hide
          Pavel Bucek added a comment -

          1.1 is not affected; this regression was introduced by TYRUS-210.

          Show
          Pavel Bucek added a comment - 1.1 is not affected; this regression was introduced by TYRUS-210 .

            People

            • Assignee:
              Pavel Bucek
              Reporter:
              jan.supol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: