firebase / firebase/firebase-admin-java

Deprecation warnings with Java OpenJDK 24 - sun.misc.Unsafe usage in Firebase Admin SDK

Đang mở
#1,100 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
api: core
Ngôn ngữ chính
Java
Star
620
Fork
305
Merge trung bình
3 giờ 23 phút
Pull request đã merge (30 ngày)
1

Mô tả

### [READ] Step 1: Are you in the right place?

* For issues or feature requests related to __the code in this repository__
file a Github issue.
* If this is a __feature request__ make sure the issue title starts with "FR:".
* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
with the firebase tag.
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
google group.
* For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
[Firebase support channel](https://firebase.google.com/support/).

### [REQUIRED] Step 2: Describe your environment

* Operating System version: macOS Sequoia 15.5
* Firebase SDK version: 9.5.0
* Library version: 9.5.0
* Firebase Product: Firebase Admin
* Java version: OpenJDK 24

### [REQUIRED] Step 3: Describe the problem

Create a Java application using Firebase Admin Authentication
Use Java OpenJDK 24 as the runtime
Run the application
Observe deprecation warnings in the console output

What happened?
When running a Firebase Admin Authentication application with Java OpenJDK 24, the following deprecation warnings are displayed:
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
This appears to be related to the Firebase Admin SDK's dependency on Guava's AbstractFuture$UnsafeAtomicHelper class, which uses the deprecated sun.misc.Unsafe::objectFieldOffset method.
Expected behavior:
The Firebase Admin SDK should work without deprecation warnings on supported Java versions, or provide guidance on compatible Java versions.
Relevant Code:
java// Basic Firebase Admin initialization that triggers the warnings
FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.getApplicationDefault())
.build();

FirebaseApp.initializeApp(options);

// Any subsequent Firebase Admin operations will show the warnings
Additional context:

The warnings appear to be coming from the Guava library dependency used by Firebase Admin SDK
This may impact future compatibility when Java removes the deprecated sun.misc.Unsafe methods
The application functions correctly despite the warnings

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện việc khởi tạo Firebase Admin Authentication với OpenJDK 24 và kiểm tra dependency Guava AbstractFuture$UnsafeAtomicHelper được nêu trong báo cáo. Xác định xem cảnh báo có thể được giải quyết thông qua dependency của SDK hay cần hướng dẫn về khả năng tương thích; được xem là hoàn tất khi thiết lập được hỗ trợ đã được ghi lại hoặc các cảnh báo không còn xuất hiện.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java
Lĩnh vực
authentication, backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.