Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-14871

Better formatter of toString method for StateTransition

    XMLWordPrintableJSON

Details

    Description

      The toString method in StateTransition does not have a good format. 

      @Override
      	public String toString() {
      		return new StringBuilder()
      				.append("StateTransition(")
      				.append(action).append(", ")
      				.append("from ").append(sourceState.getName())
      				.append("to ").append(targetState.getName())
      				.append(condition != null ? ", with condition)" : ")")
      				.toString();
      	}
      

      The problem is there's no separator between `sourceState.getName()` and "to " which leads to a bad format like the attachment showing.

      A blank space is more friendly.

      @Override
      	public String toString() {
      		return new StringBuilder()
      				.append("StateTransition(")
      				.append(action).append(", ")
      				.append("from ").append(sourceState.getName())
      				.append(" to ").append(targetState.getName())
      				.append(condition != null ? ", with condition)" : ")")
      				.toString();
      	}
      

      Attachments

        Issue Links

          Activity

            People

              chaiyq chaiyongqiang
              chaiyq chaiyongqiang
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m