Make readNamedWriteable and writeNamedWriteable public

Now anyone can read or write whatever, whenever.

Closes #17682
This commit is contained in:
Nik Everett 2016-04-18 14:30:07 -04:00
parent 40b84d2ef6
commit 68b4371bd9
3 changed files with 3 additions and 3 deletions

View File

@ -34,7 +34,7 @@ public class NamedWriteableAwareStreamInput extends FilterStreamInput {
}
@Override
<C extends NamedWriteable<?>> C readNamedWriteable(Class<C> categoryClass) throws IOException {
public <C extends NamedWriteable<?>> C readNamedWriteable(Class<C> categoryClass) throws IOException {
String name = readString();
Writeable.Reader<? extends C> reader = namedWriteableRegistry.getReader(categoryClass, name);
C c = reader.read(this);

View File

@ -725,7 +725,7 @@ public abstract class StreamInput extends InputStream {
* Default implementation throws {@link UnsupportedOperationException} as StreamInput doesn't hold a registry.
* Use {@link FilterInputStream} instead which wraps a stream and supports a {@link NamedWriteableRegistry} too.
*/
<C extends NamedWriteable<?>> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass) throws IOException {
public <C extends NamedWriteable<?>> C readNamedWriteable(@SuppressWarnings("unused") Class<C> categoryClass) throws IOException {
throw new UnsupportedOperationException("can't read named writeable from StreamInput");
}

View File

@ -687,7 +687,7 @@ public abstract class StreamOutput extends OutputStream {
/**
* Writes a {@link NamedWriteable} to the current stream, by first writing its name and then the object itself
*/
void writeNamedWriteable(NamedWriteable<?> namedWriteable) throws IOException {
public void writeNamedWriteable(NamedWriteable<?> namedWriteable) throws IOException {
writeString(namedWriteable.getWriteableName());
namedWriteable.writeTo(this);
}