You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by gg...@apache.org on 2021/10/11 14:40:18 UTC
[httpcomponents-core] branch master updated: Use compact array
initialization syntax.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-core.git
The following commit(s) were added to refs/heads/master by this push:
new be8dece Use compact array initialization syntax.
be8dece is described below
commit be8dece67fc5eb602e9f62db3d47935886e8f993
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Mon Oct 11 10:40:16 2021 -0400
Use compact array initialization syntax.
---
httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java | 2 +-
.../java/org/apache/hc/core5/http/impl/io/ChunkedInputStream.java | 2 +-
.../java/org/apache/hc/core5/http/message/BasicHeaderElement.java | 2 +-
.../java/org/apache/hc/core5/http/message/BasicHeaderValueParser.java | 4 ++--
.../main/java/org/apache/hc/core5/http/message/MessageSupport.java | 2 +-
httpcore5/src/main/java/org/apache/hc/core5/util/VersionInfo.java | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java b/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java
index 08da33f..490a743 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/ContentType.java
@@ -181,7 +181,7 @@ public final class ContentType implements Serializable {
/**
* An empty immutable {@code NameValuePair} array.
*/
- private static final NameValuePair[] EMPTY_NAME_VALUE_PAIR_ARRAY = new NameValuePair[0];
+ private static final NameValuePair[] EMPTY_NAME_VALUE_PAIR_ARRAY = {};
/**
* @deprecated To be removed in 6.0
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/ChunkedInputStream.java b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/ChunkedInputStream.java
index 81ad0ee..96a32e4 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/ChunkedInputStream.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/impl/io/ChunkedInputStream.java
@@ -64,7 +64,7 @@ public class ChunkedInputStream extends InputStream {
}
private static final int BUFFER_SIZE = 2048;
- private static final Header[] EMPTY_FOOTERS = new Header[0];
+ private static final Header[] EMPTY_FOOTERS = {};
/** The session input buffer */
private final SessionInputBuffer buffer;
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderElement.java b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderElement.java
index 3dafac5..d353247 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderElement.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderElement.java
@@ -38,7 +38,7 @@ import org.apache.hc.core5.util.Args;
*/
public class BasicHeaderElement implements HeaderElement {
- private static final NameValuePair[] EMPTY_NAME_VALUE_PAIR_ARRAY = new NameValuePair[0];
+ private static final NameValuePair[] EMPTY_NAME_VALUE_PAIR_ARRAY = {};
private final String name;
private final String value;
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderValueParser.java b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderValueParser.java
index 4dcb3f8..70b8fc2 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderValueParser.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/message/BasicHeaderValueParser.java
@@ -65,12 +65,12 @@ public class BasicHeaderValueParser implements HeaderValueParser {
/**
* An empty immutable {@code HeaderElement} array.
*/
- private static final HeaderElement[] EMPTY_HEADER_ELEMENT_ARRAY = new HeaderElement[0];
+ private static final HeaderElement[] EMPTY_HEADER_ELEMENT_ARRAY = {};
/**
* An empty immutable {@code NameValuePair} array.
*/
- private static final NameValuePair[] EMPTY_NAME_VALUE_ARRAY = new NameValuePair[0];
+ private static final NameValuePair[] EMPTY_NAME_VALUE_ARRAY = {};
@Override
public HeaderElement[] parseElements(final CharSequence buffer, final ParserCursor cursor) {
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/http/message/MessageSupport.java b/httpcore5/src/main/java/org/apache/hc/core5/http/message/MessageSupport.java
index 85c0e58..aad640e 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/http/message/MessageSupport.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/http/message/MessageSupport.java
@@ -57,7 +57,7 @@ public class MessageSupport {
/**
* An empty immutable {@code String} array.
*/
- private static final String[] EMPTY_STRING_ARRAY = new String[0];
+ private static final String[] EMPTY_STRING_ARRAY = {};
private MessageSupport() {
// Do not allow utility class to be instantiated.
diff --git a/httpcore5/src/main/java/org/apache/hc/core5/util/VersionInfo.java b/httpcore5/src/main/java/org/apache/hc/core5/util/VersionInfo.java
index f438d2c..7801efb 100644
--- a/httpcore5/src/main/java/org/apache/hc/core5/util/VersionInfo.java
+++ b/httpcore5/src/main/java/org/apache/hc/core5/util/VersionInfo.java
@@ -83,7 +83,7 @@ public class VersionInfo {
/**
* An empty immutable {@code VersionInfo} array.
*/
- private static final VersionInfo[] EMPTY_VERSION_INFO_ARRAY = new VersionInfo[0];
+ private static final VersionInfo[] EMPTY_VERSION_INFO_ARRAY = {};
/**