Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Replace manual activateProxyService() with declarative Require-Capability on IProxyService?

Đang mở
#3,932 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
desktop

Hướng nghiên cứu

Read IDEWorkbenchAdvisor in org.eclipse.ui.ide.application and its META-INF/MANIFEST.MF. Compare the EventAdmin Require-Capability declarations in org.eclipse.e4.ui.workbench and org.eclipse.e4.ui.services, then check the relevant startup tests. Done means the imperative activation method and call are removed, the manifest declares IProxyService, and startup still resolves correctly.

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

Mô tả

enhancement

IDEWorkbenchAdvisor.activateProxyService() (in org.eclipse.ui.ide.application) eagerly fetches IProxyService via OSGi BundleContext.getService(...) purely to force activation of org.eclipse.core.net.

The returned service is never used; the variable exists only to trigger the side effect.
If the lookup fails, the result is a logged warning that is easy to miss.

The same activation can be expressed declaratively in META-INF/MANIFEST.MF:

  Require-Capability: osgi.service;                                                                                                                                                                                                             
    filter:="(objectClass=org.eclipse.core.net.proxy.IProxyService)";
    effective:="active"                                                                                                                                                                                                                         

This is the modern OSGi pattern and is already used in this repository for EventAdmin in org.eclipse.e4.ui.workbench and org.eclipse.e4.ui.services.
Benefits

  • Removes ~15 lines of imperative activation code (activateProxyService() and its call site in postStartup()), including the awkward Object proxyService assigned-but-unused variable.
  • Dependency becomes visible in the manifest alongside other declared capabilities.
  • A missing IProxyService provider becomes a hard resolution failure at startup instead of a runtime log line, which is the more useful failure mode for the IDE.
  • No measurable runtime cost change — both paths end up activating org.eclipse.core.net in the same way.
Ngôn ngữ chính
Java
Star
124
Fork
269
Merge trung bình
2 ngày 2 giờ
Pull request đã merge (30 ngày)
70

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của eclipse-platform/eclipse.platform.ui

Tất cả issue của eclipse-platform/eclipse.platform.ui

Issue tương tự

Thêm issue về Java

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.