Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

AmqpMessage.reject() throws "Can't release non-received message." (copy-paste from release())

オープン 初心者向け
#2,623 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
95/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java
領域
testing-qa

調査の方向性

activemq-amqp/src/test/java/org/apache/activemq/transport/amqp/client/AmqpMessage.java を開き、release()、accept()、modify() と併せて reject() のガードを確認してください。Issue にある receiver がないシナリオを再現し、reject() が reject 操作を報告すること、またそれ以外では既存の IllegalStateException の動作が変わらないことを確認してください。

索引モデルが issue の本文から書いたものです。

説明

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:

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.

主要言語
Java
スター
2.5k
フォーク
1.5k
平均マージ
1日 10時間
マージ済み PR(30日)
54

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

apache/activemq のほかの issue

apache/activemq の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。