Skip to content

Commit 1041d62

Browse files
Remove unused canUseUnsafe() protected method from GeneratedMessage
This was briefly used by generated code internally as part of the experimental parser/runtime work. This method was never used by protoc generated code otherwise. We don't consider removal of protected methods for the gencode base classes to be a breaking change if they were never called by any released generated code, as it would only break someone who subclassed GeneratedMessage by hand and wrote code who called this which is not supported. In this case there's essentially no reason for someone to have been interested in calling this anyway. PiperOrigin-RevId: 843318803
1 parent 5b116fe commit 1041d62

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

java/core/src/main/java/com/google/protobuf/GeneratedMessage.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,6 @@ protected static <M extends Message> M parseDelimitedWithIOException(
371371
}
372372
}
373373

374-
protected static boolean canUseUnsafe() {
375-
return UnsafeUtil.hasUnsafeArrayOperations() && UnsafeUtil.hasUnsafeByteBufferOperations();
376-
}
377-
378374
protected static IntList emptyIntList() {
379375
return IntArrayList.emptyList();
380376
}

0 commit comments

Comments
 (0)