Details

    • Type: Language-Specification
    • Status: Active
    • Resolution: Unresolved
    • Labels:
      None
    • Impact:
      Unknown 'null' severity
    • Likelihood:
      Unknown 'null' severity

      Description

      Noncompliant Code Example

      if (file != null) {
        if (file.isFile() || file.isDirectory()) {
          /* ... */
        }
      }
      

      Compliant Solution

      if (file != null && isFileOrDirectory(file)) { 
        /* ... */
      }
      fun isFileOrDirectory(file: File): Boolean {
          return file.isFile() || file.isDirectory();
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              andrea.guarino Andrea Guarino
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: