Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-5134

Replace path constructions using separator char

    XMLWordPrintable

    Details

    • Type: Task
    • Status: In Progress
    • Priority: Should
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: OpenMRS 1.7.5
    • Component/s: None
    • Labels:

      Description

      Find ALL occurrences where we construct a file path using

      • File.separatorChar
      • System.getProperty("file.separator")

      and string concatenation like for example when creating a FileInputStream

      FileInputStream fis = new FileInputStream(appDataDir + System.getProperty("file.separator")
      + DatabaseUtil.ORDER_ENTRY_UPGRADE_SETTINGS_FILENAME);
      

      and replace the construction of the file path with proper use of Java's Path constructor which can easily do this for us, like so

      FileInputStream fis = new FileInputStream(Paths.get("a", "b", "c").toFile());
      

      To clarify:
      The task is to replace the string concatenation with proper use of Java's Paths class which can construct paths for us. The above code sample is just an example from the code base, this task does not mean you need to replace anything with FileInputStream.

        Gliffy Diagrams

          Attachments

            Activity

              People

              Assignee:
              ankerj Jessie Anker
              Reporter:
              teleivo Ivo Ulrich
              Designated Committer:
              Tara Dedrickson Tara Dedrickson
              Votes:
              0 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 1 hour
                  1d 1h