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

Error in String.replaceAll(String, String) for regex of "."

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 1.4.0
    • core-libs
    • x86
    • windows_2000



      Name: rmT116609 Date: 05/22/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Windows 2000 SP2

      A DESCRIPTION OF THE PROBLEM :
      The following command:

      String s;
      s = "test.help.kunde";
      System.out.println(s.replaceAll(".","_"));

      Results in:
      _______________

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1.javac Test.java
      2.java Test

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      Result should be (like in replace(char, char)):

      test_help_kunde

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      class Test {

      public static void main(String args[]) {

      String s = "test.help.kunde";
      System.out.println(s.replaceAll(".","_"));

      }
      }
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Use: replace(char, char)
      (Review ID: 146882)
      ======================================================================

            iris Iris Clark
            rmandalasunw Ranjith Mandala (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: