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

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

      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.");
          }

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

              Created:
              Updated:
              Resolved: