Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8145518

MapExpressionHelper.SimpleChange.toString() missing space character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P5 P5
    • 9
    • 8u66
    • javafx
    • x86_64
    • windows_7

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      In the class com.sun.javafx.binding.MapExpressionHelper's inner class SimpleChange's toString() method, the message generated is missing a space character in the case where a put operation has been performed (addOp==true && removeOp==true). The first part of the message is generated with this code which does not add a space character before "by":

      builder.append("replaced ").append(old).append("by ").append(added);


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      javafx.beans.property.MapProperty<String,String> mp = new javafx.beans.property.SimpleMapProperty<>(javafx.collections.FXCollections.observableHashMap());
      mp.addListener(new javafx.collections.MapChangeListener<String, String>(){
      @Override
      public void onChanged(
      javafx.collections.MapChangeListener.Change<? extends String, ? extends String> change) {
      System.out.println(change);
      }}
      );
      mp.put("a", "b");
      mp.put("a", "c");
      ---------- END SOURCE ----------

            vadim Vadim Pakhnushev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: