From de46d4bfd369239f601aeffc6b858538df83a349 Mon Sep 17 00:00:00 2001 From: XenoAmess Date: Fri, 3 Jul 2020 18:25:11 +0800 Subject: [PATCH 1/2] Remove redundant bitwise operations See gh-22212 --- .../org/springframework/boot/devtools/livereload/Frame.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java index 0bbde2dbeb..c0acdb0ffc 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java @@ -72,12 +72,12 @@ class Frame { void write(OutputStream outputStream) throws IOException { outputStream.write(0x80 | this.type.code); if (this.payload.length < 126) { - outputStream.write(0x00 | (this.payload.length & 0x7F)); + outputStream.write(this.payload.length & 0x7F); } else { outputStream.write(0x7E); outputStream.write(this.payload.length >> 8 & 0xFF); - outputStream.write(this.payload.length >> 0 & 0xFF); + outputStream.write(this.payload.length & 0xFF); } outputStream.write(this.payload); outputStream.flush(); From 7864a7da52fe2e0c4b90e47c894cc08327c15b1f Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 7 Jul 2020 10:37:44 +0100 Subject: [PATCH 2/2] Polish "Remove redundant bitwise operations" See gh-22212 --- .../org/springframework/boot/devtools/livereload/Frame.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java index c0acdb0ffc..786a14c42f 100644 --- a/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java +++ b/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/livereload/Frame.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.