Skip to content

Commit 0ac6a36

Browse files
committed
Remove now-unused createParser that uses BytesReference (#28926)
This removes `BytesReference` use from XContent and all subclasses. Relates to #28504
1 parent 6ab93f3 commit 0ac6a36

File tree

5 files changed

+0
-38
lines changed

5 files changed

+0
-38
lines changed

server/src/main/java/org/elasticsearch/common/xcontent/XContent.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
package org.elasticsearch.common.xcontent;
2121

2222
import org.elasticsearch.common.Booleans;
23-
import org.elasticsearch.common.bytes.BytesReference;
2423

2524
import java.io.IOException;
2625
import java.io.InputStream;
@@ -104,15 +103,6 @@ XContentParser createParser(NamedXContentRegistry xContentRegistry,
104103
XContentParser createParser(NamedXContentRegistry xContentRegistry,
105104
DeprecationHandler deprecationHandler, byte[] data, int offset, int length) throws IOException;
106105

107-
/**
108-
* Creates a parser over the provided bytes.
109-
* @deprecated use {@link #createParser(NamedXContentRegistry, DeprecationHandler, InputStream)} instead,
110-
* the BytesReference coupling in this class will be removed in a future commit
111-
*/
112-
@Deprecated
113-
XContentParser createParser(NamedXContentRegistry xContentRegistry,
114-
DeprecationHandler deprecationHandler, BytesReference bytes) throws IOException;
115-
116106
/**
117107
* Creates a parser over the provided reader.
118108
*/

server/src/main/java/org/elasticsearch/common/xcontent/cbor/CborXContent.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.fasterxml.jackson.core.JsonParser;
2525
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
2626
import org.elasticsearch.ElasticsearchParseException;
27-
import org.elasticsearch.common.bytes.BytesReference;
2827
import org.elasticsearch.common.io.FastStringReader;
2928
import org.elasticsearch.common.xcontent.DeprecationHandler;
3029
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -103,12 +102,6 @@ public XContentParser createParser(NamedXContentRegistry xContentRegistry,
103102
return new CborXContentParser(xContentRegistry, deprecationHandler, cborFactory.createParser(data, offset, length));
104103
}
105104

106-
@Override
107-
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
108-
DeprecationHandler deprecationHandler, BytesReference bytes) throws IOException {
109-
return createParser(xContentRegistry, deprecationHandler, bytes.streamInput());
110-
}
111-
112105
@Override
113106
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
114107
DeprecationHandler deprecationHandler, Reader reader) throws IOException {

server/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContent.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.fasterxml.jackson.core.JsonFactory;
2424
import com.fasterxml.jackson.core.JsonGenerator;
2525
import com.fasterxml.jackson.core.JsonParser;
26-
import org.elasticsearch.common.bytes.BytesReference;
2726
import org.elasticsearch.common.io.FastStringReader;
2827
import org.elasticsearch.common.xcontent.DeprecationHandler;
2928
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -104,12 +103,6 @@ public XContentParser createParser(NamedXContentRegistry xContentRegistry,
104103
return new JsonXContentParser(xContentRegistry, deprecationHandler, jsonFactory.createParser(data, offset, length));
105104
}
106105

107-
@Override
108-
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
109-
DeprecationHandler deprecationHandler, BytesReference bytes) throws IOException {
110-
return createParser(xContentRegistry, deprecationHandler, bytes.streamInput());
111-
}
112-
113106
@Override
114107
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
115108
DeprecationHandler deprecationHandler, Reader reader) throws IOException {

server/src/main/java/org/elasticsearch/common/xcontent/smile/SmileXContent.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import com.fasterxml.jackson.core.JsonParser;
2525
import com.fasterxml.jackson.dataformat.smile.SmileFactory;
2626
import com.fasterxml.jackson.dataformat.smile.SmileGenerator;
27-
import org.elasticsearch.common.bytes.BytesReference;
2827
import org.elasticsearch.common.io.FastStringReader;
2928
import org.elasticsearch.common.xcontent.DeprecationHandler;
3029
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -104,12 +103,6 @@ public XContentParser createParser(NamedXContentRegistry xContentRegistry,
104103
return new SmileXContentParser(xContentRegistry, deprecationHandler, smileFactory.createParser(data, offset, length));
105104
}
106105

107-
@Override
108-
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
109-
DeprecationHandler deprecationHandler, BytesReference bytes) throws IOException {
110-
return createParser(xContentRegistry, deprecationHandler, bytes.streamInput());
111-
}
112-
113106
@Override
114107
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
115108
DeprecationHandler deprecationHandler, Reader reader) throws IOException {

server/src/main/java/org/elasticsearch/common/xcontent/yaml/YamlXContent.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
import com.fasterxml.jackson.core.JsonParser;
2424
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
2525
import org.elasticsearch.ElasticsearchParseException;
26-
import org.elasticsearch.common.bytes.BytesReference;
2726
import org.elasticsearch.common.io.FastStringReader;
2827
import org.elasticsearch.common.xcontent.DeprecationHandler;
2928
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -99,12 +98,6 @@ public XContentParser createParser(NamedXContentRegistry xContentRegistry,
9998
return new YamlXContentParser(xContentRegistry, deprecationHandler, yamlFactory.createParser(data, offset, length));
10099
}
101100

102-
@Override
103-
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
104-
DeprecationHandler deprecationHandler, BytesReference bytes) throws IOException {
105-
return createParser(xContentRegistry, deprecationHandler, bytes.streamInput());
106-
}
107-
108101
@Override
109102
public XContentParser createParser(NamedXContentRegistry xContentRegistry,
110103
DeprecationHandler deprecationHandler, Reader reader) throws IOException {

0 commit comments

Comments
 (0)