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

Fix warnings: Null pointer access: The variable instance can only be null at this location

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • jfx19
    • None
    • javafx

    Description

      Eclipse Version 2022-06 (4.24.0) reports this warning in the following places:

      ```
      Null pointer access: The variable instance can only be null at this location RuleTest.java line 175 /graphics/src/test/java/test/javafx/css
      ```

      This code cannot be right:

          @Ignore("JDK-8234154")
          @Test
          public void testToString() {
              System.out.println("toString");
              Rule instance = null;
              String expResult = "";
              String result = instance.toString(); // <---- NPE
              assertEquals(expResult, result);
              fail("The test case is a prototype.");
          }

      Attachments

        Issue Links

          Activity

            People

              angorya Andy Goryachev
              angorya Andy Goryachev
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: