Skip to content

Commit c4510cf

Browse files
committed
core: Undo some changes to Opaque
to reduce the amount of changes in dCache#162 Signed-off-by: Christian Kohlschütter <[email protected]>
1 parent 5d2e843 commit c4510cf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

core/src/main/java/org/dcache/nfs/util/Opaque.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ default void putBytes(ByteBuffer buf) {
199199
public class OpaqueImpl implements Opaque {
200200
final byte[] _opaque;
201201

202-
protected OpaqueImpl(byte[] opaque) {
202+
OpaqueImpl(byte[] opaque) {
203203
_opaque = opaque;
204204
}
205205

@@ -392,13 +392,7 @@ public boolean equals(Object o) {
392392
}
393393
return true;
394394
} else {
395-
Opaque other = (Opaque) o;
396-
for (int i = index, n = index + length, oi = 0; i < n; i++, oi++) {
397-
if (buf.get(i) != other.byteAt(oi)) {
398-
return false;
399-
}
400-
}
401-
return true;
395+
return toImmutableOpaque().equals(o);
402396
}
403397
}
404398

0 commit comments

Comments
 (0)