AmqpMessage.reject() throws "Can't release non-received message." (copy-paste from release())
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 95/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- java
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Mở activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java và đọc guard của reject() cùng với release(), accept() và modify(). Tái hiện kịch bản không có receiver trong issue, sau đó xác minh rằng reject() báo cáo thao tác reject và hành vi hiện có của IllegalStateException vẫn không thay đổi trong các trường hợp khác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Component: activemq-amqp — AMQP test client (src/test/java)
Version: present on main as of 2026-09-28, commit c339114e
Environment: not applicable — the defect is a compile-time string constant, independent of JVM, container and configuration.
Description
In AmqpMessage.java, the guard in reject() throws an IllegalStateException whose message names
the wrong operation. It is identical to the one thrown by release() directly above it:
- line 208,
release()—"Can't release non-received message."(correct) - line 221,
reject()—"Can't release non-received message."(should say "reject")
The sibling guards each name their own operation, so the intended text is unambiguous:
148
and 177
"Can't accept non-received message.",
195
"Can't modify non-received message.".
git blame traces the line to f71e0ee15b2c456dac28cf456deafb764221afa6 (2016-10-11), the commit
that added reject(), so the wording appears to be a copy-paste from release() rather than a
later regression.
Impact
Test-only and minor. This is the AMQP test client, not broker code, so there is no runtime effect on
users. The cost is diagnostic: a test that calls reject() on a message that was never received
reports a release failure, pointing whoever debugs it at the wrong method.
Steps to reproduce
AmqpMessage msg = new AmqpMessage(); // no receiver
try {
msg.reject();
fail("expected IllegalStateException");
} catch (IllegalStateException e) {
// actual: "Can't release non-received message."
// expected: "Can't reject non-received message."
}
Proposed fix
--- a/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java
+++ b/activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java
@@ (reject(), line 221)
public void reject() throws Exception {
if (receiver == null) {
- throw new IllegalStateException("Can't release non-received message.");
+ throw new IllegalStateException("Can't reject non-received message.");
}
I searched the open and closed GitHub issues and the AMQ JIRA project and did not find an existing
report. Happy to open a PR with this if it is welcome.
Provenance
This was found during an academic study of LLM-assisted code review at Jeonbuk National University, Jeonju, South Korea. An
automated LLM-based reviewer produced the initial analysis, and I verified it by reading the source at
c339114e. I am disclosing the origin in line with project norms on AI-assisted reports. I believe
it is a genuine, if trivial, defect and will respect your triage either way.
- Ngôn ngữ chính
- Java
- Star
- 2.5k
- Fork
- 1.5k
- Merge trung bình
- 23 giờ 10 phút
- Pull request đã merge (30 ngày)
- 81
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của apache/activemq
-
Docker entrypoint exits right after forwarding SIGTERM, so the broker is killed before it finishes shutting downCó thể đã có người làm @tjololo đã nhận 5 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
HttpMaxFrameSizeTest.sendOversizedMessageTest() passes silently when maxFrameSize is not enforcedCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
apache/activemq#2706 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Treat socketBufferSize=0 as OS default without logging a warningCó thể đã có người làm @mwashburn2 đã nhận 15 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ServerSessionImpl gets stuck if the WorkManager encounteres a RejectedExecutionExceptionCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
apache/activemq#2647 · 5 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
apache/activemq#2558 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của apache/activemq
Issue tương tự
-
5.0.x backport enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 63/100
spring-cloud/spring-cloud-function#1507 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-driven-fuzzing bug claude Minor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
linagora/twake-calendar-side-service#1417 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
line/armeria#7109 · 3 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
a2aproject/a2a-java#1275 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
module/ftp Type/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
ballerina-platform/ballerina-library#9476 ·
Maintainer thường phản hồi trong vòng 1 ngày