Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2491#discussion_r246075935
  
    --- Diff: 
artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTSession.java
 ---
    @@ -117,14 +118,11 @@ boolean getStopped() {
        }
     
        boolean isClean() {
    -      return isClean;
    +      return clean;
        }
     
    -   void setIsClean(boolean isClean) throws Exception {
    -      this.isClean = isClean;
    -      if (isClean) {
    -         clean();
    -      }
    +   void setClean(boolean clean) throws Exception {
    +      this.clean = clean;
    --- End diff --
    
    The expectation of a "setter" method is simply to _set_ a variable and 
nothing more. The additional logic in the `setClean` method is not intuitive 
which is why I removed it and put it in the `getSessionState` method.


---

Reply via email to