<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=alex_sv" rel="nofollow">Alexander Shabanov</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-9828?redirect=false" rel="nofollow">SPR-9828</a></strong> and commented</p>
<p dir="auto">The proposed improvement is to modify signature for each org.springframework.util.Assert.* method so that it will return the checked value to let programmer to make check and assignment in "one turn".</p>
<p dir="auto">This would improve readability of the initializers that uses spring's Assert and minimize the code, e.g. instead of having to write</p>
<p dir="auto">notNull(foo, "Foo can't be null"); // static import omitted for clarity<br>
hasText(bar, "Bar can't be empty");<br>
this.foo = foo;<br>
this.bar = bar;</p>
<p dir="auto">someone can write</p>
<p dir="auto">this.foo = notNull(foo, "Foo can't be null");<br>
this.bar = hasText(bar, "Bar can't be empty");</p>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.1.2</p>
<p dir="auto"><strong>Reference URL:</strong> <a href="http://forum.springsource.org/showthread.php?130499-Assert-*-methods-that-return-values&amp;p=425647" rel="nofollow">http://forum.springsource.org/showthread.php?130499-Assert-*-methods-that-return-values&amp;p=425647</a></p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398109198" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12473" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12473/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12473">#12473</a> Make Assert.something() return value checked instead of "void", allow to chain the assert call (<em><strong>"is duplicated by"</strong></em>)</li>
</ul>
<p dir="auto"><strong><a href="https://jira.spring.io/secure/ViewProfile.jspa?name=jecuendet" rel="nofollow">Jean-Eric</a></strong> opened <strong><a href="https://jira.spring.io/browse/SPR-7650?redirect=false" rel="nofollow">SPR-7650</a></strong> and commented</p>
<p dir="auto">In the class AbstractPollingMessageListenerContainer used by DefaultMessageListenerContainer, if no message is received, the commit is called (this was added in 3.0.4)<br>
But the session passed to<br>
commitIfNecessary(session, message);<br>
is the wrong one.<br>
Instead, the variable sessionToUse should be passed:<br>
commitIfNecessary(sessionToUse, message);</p>
<p dir="auto">This is the diff.</p>
<p dir="auto">--- 3.0.4/AbstractPollingMessageListenerContainer.java       2010-08-18 13:41:34.000000000 +0200<br>
+++ 3.0.5/AbstractPollingMessageListenerContainer.java        2010-10-13 10:12:38.505882405 +0200<br>
@@ -351,7 +351,7 @@<br>
}<br>
noMessageReceived(invoker, sessionToUse);<br>
// Nevertheless call commit, in order to reset the transaction timeout (if any).</p>
<hr>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="commitIfNecessary(session, message);"><pre class="notranslate"><code class="notranslate">commitIfNecessary(session, message);
</code></pre></div>
<ul dir="auto">
<li></li>
</ul>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="          commitIfNecessary(sessionToUse, message);
          // Indicate that no message has been received.
          return false;
  }"><pre class="notranslate"><code class="notranslate">          commitIfNecessary(sessionToUse, message);
          // Indicate that no message has been received.
          return false;
  }
</code></pre></div>
<hr>
<p dir="auto"><strong>Affects:</strong> 3.0.4</p>
<p dir="auto"><strong>Issue Links:</strong></p>
<ul dir="auto">
<li><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="398106931" data-permission-text="Title is private" data-url="https://github.com/spring-projects/spring-framework/issues/12136" data-hovercard-type="issue" data-hovercard-url="/spring-projects/spring-framework/issues/12136/hovercard" href="https://github.com/spring-projects/spring-framework/issues/12136">#12136</a> Setup of JMS message listener invoker failed for destination when upgrading from 3.0.2 to 3.0.4 (<em><strong>"duplicates"</strong></em>)</li>
</ul>