Skip to content

Commit 385e6f1

Browse files
committed
Revert "Add missing @Override annotations" as agreed with Nate
This reverts commit 9786d7b
1 parent bdb84cc commit 385e6f1

File tree

69 files changed

+0
-668
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+0
-668
lines changed

src/com/esotericsoftware/kryo/KryoException.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ public KryoException (Throwable cause) {
4040
super(cause);
4141
}
4242

43-
@Override
4443
public String getMessage () {
4544
if (trace == null) return super.getMessage();
4645
StringBuffer buffer = new StringBuffer(512);

src/com/esotericsoftware/kryo/SerializerFactory.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public interface SerializerFactory<T extends Serializer> {
4343

4444
/** A serializer factory which always returns true for {@link #isSupported(Class)}. */
4545
public abstract static class BaseSerializerFactory<T extends Serializer> implements SerializerFactory<T> {
46-
@Override
4746
public boolean isSupported (Class type) {
4847
return true;
4948
}
@@ -61,7 +60,6 @@ public ReflectionSerializerFactory (Class<T> serializerClass) {
6160
this.serializerClass = serializerClass;
6261
}
6362

64-
@Override
6563
public T newSerializer (Kryo kryo, Class type) {
6664
return newSerializer(kryo, serializerClass, type);
6765
}
@@ -100,7 +98,6 @@ public SingletonSerializerFactory (T serializer) {
10098
this.serializer = serializer;
10199
}
102100

103-
@Override
104101
public T newSerializer (Kryo kryo, Class type) {
105102
return serializer;
106103
}
@@ -123,7 +120,6 @@ public FieldSerializerConfig getConfig () {
123120
return config;
124121
}
125122

126-
@Override
127123
public FieldSerializer newSerializer (Kryo kryo, Class type) {
128124
return new FieldSerializer(kryo, type, config.clone());
129125
}
@@ -146,7 +142,6 @@ public TaggedFieldSerializerConfig getConfig () {
146142
return config;
147143
}
148144

149-
@Override
150145
public TaggedFieldSerializer newSerializer (Kryo kryo, Class type) {
151146
return new TaggedFieldSerializer(kryo, type, config.clone());
152147
}
@@ -169,7 +164,6 @@ public VersionFieldSerializerConfig getConfig () {
169164
return config;
170165
}
171166

172-
@Override
173167
public VersionFieldSerializer newSerializer (Kryo kryo, Class type) {
174168
return new VersionFieldSerializer(kryo, type, config.clone());
175169
}
@@ -192,7 +186,6 @@ public CompatibleFieldSerializerConfig getConfig () {
192186
return config;
193187
}
194188

195-
@Override
196189
public CompatibleFieldSerializer newSerializer (Kryo kryo, Class type) {
197190
return new CompatibleFieldSerializer(kryo, type, config.clone());
198191
}

src/com/esotericsoftware/kryo/io/ByteBufferInput.java

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -89,23 +89,20 @@ public ByteBufferInput (InputStream inputStream, int bufferSize) {
8989
/** Throws {@link UnsupportedOperationException} because this input uses a ByteBuffer, not a byte[].
9090
* @deprecated
9191
* @see #getByteBuffer() */
92-
@Override
9392
public byte[] getBuffer () {
9493
throw new UnsupportedOperationException("This input does not used a byte[], see #getByteBuffer().");
9594
}
9695

9796
/** Throws {@link UnsupportedOperationException} because this input uses a ByteBuffer, not a byte[].
9897
* @deprecated
9998
* @see #setBuffer(ByteBuffer) */
100-
@Override
10199
public void setBuffer (byte[] bytes) {
102100
throw new UnsupportedOperationException("This input does not used a byte[], see #setByteBuffer(ByteBuffer).");
103101
}
104102

105103
/** Throws {@link UnsupportedOperationException} because this input uses a ByteBuffer, not a byte[].
106104
* @deprecated
107105
* @see #setBuffer(ByteBuffer) */
108-
@Override
109106
public void setBuffer (byte[] bytes, int offset, int count) {
110107
throw new UnsupportedOperationException("This input does not used a byte[], see #setByteBufferByteBuffer().");
111108
}
@@ -127,14 +124,12 @@ public ByteBuffer getByteBuffer () {
127124
return byteBuffer;
128125
}
129126

130-
@Override
131127
public void setInputStream (InputStream inputStream) {
132128
this.inputStream = inputStream;
133129
limit = 0;
134130
reset();
135131
}
136132

137-
@Override
138133
public void reset () {
139134
super.reset();
140135
setBufferPosition(byteBuffer, 0);
@@ -164,7 +159,6 @@ protected int fill (ByteBuffer buffer, int offset, int count) throws KryoExcepti
164159
}
165160
}
166161

167-
@Override
168162
protected int require (int required) throws KryoException {
169163
int remaining = limit - position;
170164
if (remaining >= required) return remaining;
@@ -208,7 +202,6 @@ protected int require (int required) throws KryoException {
208202
* @param optional Must be > 0.
209203
* @return the number of bytes remaining, but not more than optional, or -1 if {@link #fill(ByteBuffer, int, int)} is unable to
210204
* provide more bytes. */
211-
@Override
212205
protected int optional (int optional) throws KryoException {
213206
int remaining = limit - position;
214207
if (remaining >= optional) return optional;
@@ -243,19 +236,16 @@ protected int optional (int optional) throws KryoException {
243236

244237
// InputStream:
245238

246-
@Override
247239
public int read () throws KryoException {
248240
if (optional(1) <= 0) return -1;
249241
position++;
250242
return byteBuffer.get() & 0xFF;
251243
}
252244

253-
@Override
254245
public int read (byte[] bytes) throws KryoException {
255246
return read(bytes, 0, bytes.length);
256247
}
257248

258-
@Override
259249
public int read (byte[] bytes, int offset, int count) throws KryoException {
260250
if (bytes == null) throw new IllegalArgumentException("bytes cannot be null.");
261251
int startingCount = count;
@@ -277,25 +267,21 @@ public int read (byte[] bytes, int offset, int count) throws KryoException {
277267
return startingCount - count;
278268
}
279269

280-
@Override
281270
public void setPosition (int position) {
282271
this.position = position;
283272
setBufferPosition(byteBuffer, position);
284273
}
285274

286-
@Override
287275
public void setLimit (int limit) {
288276
this.limit = limit;
289277
setBufferLimit(byteBuffer, limit);
290278
}
291279

292-
@Override
293280
public void skip (int count) throws KryoException {
294281
super.skip(count);
295282
setBufferPosition(byteBuffer, position);
296283
}
297284

298-
@Override
299285
public long skip (long count) throws KryoException {
300286
long remaining = count;
301287
while (remaining > 0) {
@@ -306,7 +292,6 @@ public long skip (long count) throws KryoException {
306292
return count;
307293
}
308294

309-
@Override
310295
public void close () throws KryoException {
311296
if (inputStream != null) {
312297
try {
@@ -334,28 +319,24 @@ private void flipBuffer (Buffer buffer) {
334319

335320
// byte:
336321

337-
@Override
338322
public byte readByte () throws KryoException {
339323
if (position == limit) require(1);
340324
position++;
341325
return byteBuffer.get();
342326
}
343327

344-
@Override
345328
public int readByteUnsigned () throws KryoException {
346329
if (position == limit) require(1);
347330
position++;
348331
return byteBuffer.get() & 0xFF;
349332
}
350333

351-
@Override
352334
public byte[] readBytes (int length) throws KryoException {
353335
byte[] bytes = new byte[length];
354336
readBytes(bytes, 0, length);
355337
return bytes;
356338
}
357339

358-
@Override
359340
public void readBytes (byte[] bytes, int offset, int count) throws KryoException {
360341
if (bytes == null) throw new IllegalArgumentException("bytes cannot be null.");
361342
int copyCount = Math.min(limit - position, count);
@@ -372,7 +353,6 @@ public void readBytes (byte[] bytes, int offset, int count) throws KryoException
372353

373354
// int:
374355

375-
@Override
376356
public int readInt () throws KryoException {
377357
require(4);
378358
position += 4;
@@ -383,7 +363,6 @@ public int readInt () throws KryoException {
383363
| (byteBuffer.get() & 0xFF) << 24;
384364
}
385365

386-
@Override
387366
public int readVarInt (boolean optimizePositive) throws KryoException {
388367
if (require(1) < 5) return readVarInt_slow(optimizePositive);
389368
int b = byteBuffer.get();
@@ -442,7 +421,6 @@ private int readVarInt_slow (boolean optimizePositive) {
442421
return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));
443422
}
444423

445-
@Override
446424
public boolean canReadVarInt () throws KryoException {
447425
if (limit - position >= 5) return true;
448426
if (optional(5) <= 0) return false;
@@ -461,15 +439,13 @@ public boolean canReadVarInt () throws KryoException {
461439

462440
/** Reads the boolean part of a varint flag. The position is not advanced, {@link #readVarIntFlag(boolean)} should be used to
463441
* advance the position. */
464-
@Override
465442
public boolean readVarIntFlag () {
466443
if (position == limit) require(1);
467444
return (byteBuffer.get(position) & 0x80) != 0;
468445
}
469446

470447
/** Reads the 1-5 byte int part of a varint flag. The position is advanced so if the boolean part is needed it should be read
471448
* first with {@link #readVarIntFlag()}. */
472-
@Override
473449
public int readVarIntFlag (boolean optimizePositive) {
474450
if (require(1) < 5) return readVarIntFlag_slow(optimizePositive);
475451
int b = byteBuffer.get();
@@ -530,7 +506,6 @@ private int readVarIntFlag_slow (boolean optimizePositive) {
530506

531507
// long:
532508

533-
@Override
534509
public long readLong () throws KryoException {
535510
require(8);
536511
position += 8;
@@ -545,7 +520,6 @@ public long readLong () throws KryoException {
545520
| (long)byteBuffer.get() << 56;
546521
}
547522

548-
@Override
549523
public long readVarLong (boolean optimizePositive) throws KryoException {
550524
if (require(1) < 9) return readVarLong_slow(optimizePositive);
551525
int b = byteBuffer.get();
@@ -644,7 +618,6 @@ private long readVarLong_slow (boolean optimizePositive) {
644618
return optimizePositive ? result : ((result >>> 1) ^ -(result & 1));
645619
}
646620

647-
@Override
648621
public boolean canReadVarLong () throws KryoException {
649622
if (limit - position >= 9) return true;
650623
if (optional(5) <= 0) return false;
@@ -671,7 +644,6 @@ public boolean canReadVarLong () throws KryoException {
671644

672645
// float:
673646

674-
@Override
675647
public float readFloat () throws KryoException {
676648
require(4);
677649
ByteBuffer byteBuffer = this.byteBuffer;
@@ -685,7 +657,6 @@ public float readFloat () throws KryoException {
685657

686658
// double:
687659

688-
@Override
689660
public double readDouble () throws KryoException {
690661
require(8);
691662
ByteBuffer byteBuffer = this.byteBuffer;
@@ -703,7 +674,6 @@ public double readDouble () throws KryoException {
703674

704675
// boolean:
705676

706-
@Override
707677
public boolean readBoolean () throws KryoException {
708678
if (position == limit) require(1);
709679
position++;
@@ -712,14 +682,12 @@ public boolean readBoolean () throws KryoException {
712682

713683
// short:
714684

715-
@Override
716685
public short readShort () throws KryoException {
717686
require(2);
718687
position += 2;
719688
return (short)((byteBuffer.get() & 0xFF) | ((byteBuffer.get() & 0xFF) << 8));
720689
}
721690

722-
@Override
723691
public int readShortUnsigned () throws KryoException {
724692
require(2);
725693
position += 2;
@@ -728,7 +696,6 @@ public int readShortUnsigned () throws KryoException {
728696

729697
// char:
730698

731-
@Override
732699
public char readChar () throws KryoException {
733700
require(2);
734701
position += 2;
@@ -737,7 +704,6 @@ public char readChar () throws KryoException {
737704

738705
// String:
739706

740-
@Override
741707
public String readString () {
742708
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
743709
// Null, empty, or UTF8.
@@ -753,7 +719,6 @@ public String readString () {
753719
return new String(chars, 0, charCount);
754720
}
755721

756-
@Override
757722
public StringBuilder readStringBuilder () {
758723
if (!readVarIntFlag()) return new StringBuilder(readAsciiString()); // ASCII.
759724
// Null, empty, or UTF8.
@@ -867,7 +832,6 @@ private String readAscii_slow (int charCount) {
867832

868833
// Primitive arrays:
869834

870-
@Override
871835
public int[] readInts (int length) throws KryoException {
872836
int[] array = new int[length];
873837
if (optional(length << 2) == length << 2) {
@@ -886,7 +850,6 @@ public int[] readInts (int length) throws KryoException {
886850
return array;
887851
}
888852

889-
@Override
890853
public long[] readLongs (int length) throws KryoException {
891854
long[] array = new long[length];
892855
if (optional(length << 3) == length << 3) {
@@ -909,7 +872,6 @@ public long[] readLongs (int length) throws KryoException {
909872
return array;
910873
}
911874

912-
@Override
913875
public float[] readFloats (int length) throws KryoException {
914876
float[] array = new float[length];
915877
if (optional(length << 2) == length << 2) {
@@ -928,7 +890,6 @@ public float[] readFloats (int length) throws KryoException {
928890
return array;
929891
}
930892

931-
@Override
932893
public double[] readDoubles (int length) throws KryoException {
933894
double[] array = new double[length];
934895
if (optional(length << 3) == length << 3) {
@@ -951,7 +912,6 @@ public double[] readDoubles (int length) throws KryoException {
951912
return array;
952913
}
953914

954-
@Override
955915
public short[] readShorts (int length) throws KryoException {
956916
short[] array = new short[length];
957917
if (optional(length << 1) == length << 1) {
@@ -966,7 +926,6 @@ public short[] readShorts (int length) throws KryoException {
966926
return array;
967927
}
968928

969-
@Override
970929
public char[] readChars (int length) throws KryoException {
971930
char[] array = new char[length];
972931
if (optional(length << 1) == length << 1) {
@@ -981,7 +940,6 @@ public char[] readChars (int length) throws KryoException {
981940
return array;
982941
}
983942

984-
@Override
985943
public boolean[] readBooleans (int length) throws KryoException {
986944
boolean[] array = new boolean[length];
987945
if (optional(length) == length) {

0 commit comments

Comments
 (0)