aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf <thomas.wolf@paranor.ch>2020-11-19 13:23:05 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2020-11-20 23:30:24 +0100
commit9f3616dcb43246b883f9943af0de7cf67836c443 (patch)
treeca506b682634af6466dd213781101c9588db2fa0
parentb5ba23755906b1caa48031db7ec8dfcd68971fdb (diff)
downloadjgit-9f3616dcb43246b883f9943af0de7cf67836c443.tar.gz
jgit-9f3616dcb43246b883f9943af0de7cf67836c443.zip
PacketLineIn: ensure that END != DELIM
Just allocate the two string objects directly. The previously used new StringBuilder(0).toString() returns the same object for both END and DELIM when run on Java 15, which breaks the wire protocol since then END and DELIM cannot be distinguished anymore. Bug: 568950 Change-Id: I9d54d7bf484948c24b51a094256bd9d38b085f35 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch> (cherry picked from commit 7da0f0a8f37e35e9c3108588f1e6f7a7381d8f77)
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
index 52a5576e43..350311ecc8 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PacketLineIn.java
@@ -1,7 +1,7 @@
/*
- * Copyright (C) 2008-2010, Google Inc.
- * Copyright (C) 2008-2009, Robin Rosenberg <robin.rosenberg@dewire.com>
- * Copyright (C) 2008, Shawn O. Pearce <spearce@spearce.org> and others
+ * Copyright (C) 2008, 2010 Google Inc.
+ * Copyright (C) 2008, 2009 Robin Rosenberg <robin.rosenberg@dewire.com>
+ * Copyright (C) 2008, 2020 Shawn O. Pearce <spearce@spearce.org> and others
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0 which is available at
@@ -50,7 +50,7 @@ public class PacketLineIn {
* strings in the input stream until the marker is reached.
*/
@Deprecated
- public static final String END = new StringBuilder(0).toString(); /* must not string pool */
+ public static final String END = new String(); /* must not string pool */
/**
* Magic return from {@link #readString()} when a delim packet is found.
@@ -60,7 +60,7 @@ public class PacketLineIn {
* string is the delimiter.
*/
@Deprecated
- public static final String DELIM = new StringBuilder(0).toString(); /* must not string pool */
+ public static final String DELIM = new String(); /* must not string pool */
enum AckNackResult {
/** NAK */