You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2021/09/23 07:28:26 UTC

[GitHub] [bookkeeper] yuruguo opened a new pull request #2803: Use correct line separator instead of \n

yuruguo opened a new pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803


   ### Motivation
   Using `\n` can only pass on Linux and macOS but not on Windows.
   
   ### Changes
   use `System.lineSeparator()` instead of `\n`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo commented on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926252430


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] eolivelli commented on a change in pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
eolivelli commented on a change in pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#discussion_r722037941



##########
File path: bookkeeper-http/http-server/src/main/java/org/apache/bookkeeper/http/service/HeartbeatService.java
##########
@@ -27,7 +27,7 @@
  */
 public class HeartbeatService implements HttpEndpointService {
 
-    public static final String HEARTBEAT = "OK\n";
+    public static final String HEARTBEAT = "OK" + System.lineSeparator();

Review comment:
       This is not good, because here we are in the HTTP API, the result cannot depend on the OS that is running the bookie

##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/BookieImpl.java
##########
@@ -563,7 +563,7 @@ public static BookieSocketAddress getBookieAddress(ServerConfiguration conf)
             && !conf.getAllowLoopback()) {
             throw new UnknownHostException("Trying to listen on loopback address, "
                     + addr + " but this is forbidden by default "
-                    + "(see ServerConfiguration#getAllowLoopback()).\n"
+                    + "(see ServerConfiguration#getAllowLoopback())." + System.lineSeparator()

Review comment:
       why?
   This is an Exception message, probably it is better to remove the '\n' character

##########
File path: bookkeeper-server/src/main/java/org/apache/bookkeeper/bookie/Cookie.java
##########
@@ -164,17 +164,17 @@ public String toString() {
             builder.setInstanceId(instanceId);
         }
         StringBuilder b = new StringBuilder();
-        b.append(CURRENT_COOKIE_LAYOUT_VERSION).append("\n");
+        b.append(CURRENT_COOKIE_LAYOUT_VERSION).append(System.lineSeparator());

Review comment:
       This is a breaking change in the Cookie

##########
File path: bookkeeper-http/http-server/src/main/java/org/apache/bookkeeper/http/service/NullHttpService.java
##########
@@ -26,7 +26,7 @@
  * HttpEndpointService that return fixed content.
  */
 public class NullHttpService implements HttpEndpointService {
-    public static final String CONTENT = "NullHttpService\n";
+    public static final String CONTENT = "NullHttpService" + System.lineSeparator();

Review comment:
       the same here




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo commented on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926088028


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo removed a comment on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926088028


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo commented on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926257127


   > LGTM but:
   > 
   > * I do not run BK on windows
   > * AFAIK majority of the contributors don't use windows so it's easy to sneak `\n` later. You might want to try some checkstyle rule or some other code check to prevent these from happening in the future.
   > 
   > Just out of the curiosity, are you running BK on windows in production or this is strictly for the development?
   
   Thanks for you review.
   In fact, I don’t deploy it on windows. The reason for making this change is to maintain code compatibility (I found that pulsar can be deployed on windows, and corresponding BK components are also possible, although people rarely use it like this. )


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo commented on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-925571881


   @merlimat @eolivelli @dlg99 @lhotari PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo commented on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo commented on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926250896


   return failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo removed a comment on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926252430


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo edited a comment on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo edited a comment on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926250896


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [bookkeeper] yuruguo removed a comment on pull request #2803: Use correct line separator instead of \n

Posted by GitBox <gi...@apache.org>.
yuruguo removed a comment on pull request #2803:
URL: https://github.com/apache/bookkeeper/pull/2803#issuecomment-926250896


   rerun failure checks


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org