Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7098024

FindBugs violations: DLS: Dead store of class literal (DLS_DEAD_STORE_OF_CLASS_LITERAL)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P3
    • jt4.5
    • jt4.4.1
    • tools
    • b05
    • b05
    • generic
    • generic
    • Fix failed

    Description

      This instruction assigns a class literal to a variable and then never uses it. The behavior of this differs in Java 1.4 and in Java 5. In Java 1.4 and earlier, a reference to Foo.class would force the static initializer for Foo to be executed, if it has not been executed already. In Java 5 and later, it does not.

      See Sun's article on Java SE compatibility for more details and examples, and suggestions on how to force class initialization in Java 5.
      ===========================
      DLS: In class com.sun.javatest.mrep.ReportDirChooser
      In class com.sun.javatest.mrep.ReportDirChooser
      In method com.sun.javatest.mrep.ReportDirChooser.<static initializer>()
      Local variable named reportClass
      Type com.sun.javatest.report.Report
      At ReportDirChooser.java:[line 54]
      Dead store of com.sun.javatest.report.Report.class in com.sun.javatest.mrep.ReportDirChooser.<static initializer>()
         DLS: In class com.sun.javatest.report.ReportDirChooser
      In class com.sun.javatest.report.ReportDirChooser
      In method com.sun.javatest.report.ReportDirChooser.<static initializer>()
      Local variable named reportClass
      Type com.sun.javatest.report.Report
      At ReportDirChooser.java:[line 53]
      Dead store of com.sun.javatest.report.Report.class in com.sun.javatest.report.ReportDirChooser.<static initializer>()
         DLS: In class com.sun.javatest.tool.TestSuiteChooser
      In class com.sun.javatest.tool.TestSuiteChooser
      In method com.sun.javatest.tool.TestSuiteChooser.<static initializer>()
      Local variable named testSuiteClass
      Type com.sun.javatest.TestSuite
      At TestSuiteChooser.java:[line 48]
      Dead store of com.sun.javatest.TestSuite.class in com.sun.javatest.tool.TestSuiteChooser.<static initializer>()
         DLS: In class com.sun.javatest.tool.WorkDirChooser
      In class com.sun.javatest.tool.WorkDirChooser
      In method com.sun.javatest.tool.WorkDirChooser.<static initializer>()
      Local variable named workDirClass
      Type com.sun.javatest.WorkDirectory
      At WorkDirChooser.java:[line 51]
      Dead store of com.sun.javatest.WorkDirectory.class in com.sun.javatest.tool.WorkDirChooser.<static initializer>()

      Attachments

        Activity

          People

            ersh Mikhail Ershov (Inactive)
            ersh Mikhail Ershov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: