Author: kkolinko Date: Fri Dec 11 18:40:44 2015 New Revision: 1719488 URL: http://svn.apache.org/viewvc?rev=1719488&view=rev Log: Simplify. No need for "+=" as this is the initial value. Replace binary number (0bNN) with a hexadecimal one to allow this code to be backported to Tomcat 7 / Java 6.
Modified: tomcat/trunk/test/org/apache/tomcat/websocket/server/TesterWsCloseClient.java Modified: tomcat/trunk/test/org/apache/tomcat/websocket/server/TesterWsCloseClient.java URL: http://svn.apache.org/viewvc/tomcat/trunk/test/org/apache/tomcat/websocket/server/TesterWsCloseClient.java?rev=1719488&r1=1719487&r2=1719488&view=diff ============================================================================== --- tomcat/trunk/test/org/apache/tomcat/websocket/server/TesterWsCloseClient.java (original) +++ tomcat/trunk/test/org/apache/tomcat/websocket/server/TesterWsCloseClient.java Fri Dec 11 18:40:44 2015 @@ -110,8 +110,8 @@ public class TesterWsCloseClient { private static byte[] createFrame(boolean fin, int opCode, byte[] payload) { byte[] frame = new byte[6 + payload.length]; - frame[0] = (byte) (opCode + (fin ? 1 << 7 : 0)); - frame[1] += 0b10000000 + payload.length; + frame[0] = (byte) (opCode | (fin ? 1 << 7 : 0)); + frame[1] = (byte) (0x80 | payload.length); frame[2] = maskingKey[0]; frame[3] = maskingKey[1]; --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org