Uploaded image for project: 'Harmony'
  1. Harmony
  2. HARMONY-6006

[classlib] [luni] Cannot process platform paths using backslash

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.0M7
    • 5.0M9
    • Classlib
    • None
    • Unknown

    Description

      Defect Reproduce Steps:
      1. Make folders like /ffs0/niagara/bin
      2. Make a symbolic prefix link "/niagara" using the command:
      ln -s /ffs0/niagara /niagara
      3. Run CanonicalPathTest [1] using the command:
      java CanonicalPathTest /niagara /ffs0/niagara /niagara/bin /ffs0/niagara/bin
      4. Defect Result shown as [2], the correct result should be [3].

      [1] CanonicalPathTest.java
      import java.io.File;
      import java.io.IOException;
      public class CanonicalPathTest {
      public static void main(String[] args) throws IOException {
      File file = null;
      for (int index = 0; index < args.length; index++)

      { file = new File(args[index]); System.out.println(args[index] + "->" + file.getCanonicalPath()); }

      }
      }

      [2] Defect Result:
      /niagara->/ffs0/niagara
      /ffs0/niagara->/ffs0/niagara
      /niagara/bin->/niagara/bin // it's wrong
      /ffs0/niagara/bin->/ffs0/niagara/bin

      [3] Correct Result:
      /niagara->/ffs0/niagara
      /ffs0/niagara->/ffs0/niagara
      /niagara/bin->/ffs0/niagara/bin
      /ffs0/niagara/bin->/ffs0/niagara/bi

      Attachments

        1. HARMONY-6006.diff
          8 kB
          Kevin Zhou

        Activity

          People

            qiuxiaox Sean Qiu
            zhoukevin Kevin Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 24h
                24h
                Remaining:
                Remaining Estimate - 24h
                24h
                Logged:
                Time Spent - Not Specified
                Not Specified