substance
  1. substance
  2. SUBSTANCE-504

null pointer exception thrown at SubstanceTableUI.java 1895

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Blocker Blocker
    • Resolution: Unresolved
    • Affects Version/s: 6.1
    • Fix Version/s: RC
    • Component/s: base package
    • Labels:
      None
    • Environment:

      Operating System: Windows XP
      Platform: All

    • Issuezilla Id:
      504

      Description

      A null pointer exception gets thrown from time to time in SubstanceTableUI.java.
      The code causing this is mouseLoc. MouseInfo.getPointerInfo() can return null,
      which then sets mouseLoc to null and then a null pointer exception is thrown.
      Thanks in advance for fixing this.

      Arif

      Code from MouseInfo:

      public static PointerInfo getPointerInfo() throws HeadlessException {
      if (GraphicsEnvironment.isHeadless())

      { throw new HeadlessException(); }

      SecurityManager security = System.getSecurityManager();
      if (security != null)

      { security.checkPermission(SecurityConstants.WATCH_MOUSE_PERMISSION); }

      Point point = new Point(0, 0);
      int deviceNum =
      Toolkit.getDefaultToolkit().getMouseInfoPeer().fillPointWithCoords(point);
      GraphicsDevice[] gds = GraphicsEnvironment.getLocalGraphicsEnvironment().
      getScreenDevices();
      PointerInfo retval = null;
      if (areScreenDevicesIndependent(gds))

      { retval = new PointerInfo(gds[deviceNum], point); }

      else {
      for (int i = 0; i < gds.length; i++) {
      GraphicsConfiguration gc = gds[i].getDefaultConfiguration();
      Rectangle bounds = gc.getBounds();
      if (bounds.contains(point))

      { retval = new PointerInfo(gds[i], point); }

      }
      }

      return retval;
      }

      **********************************end MouseInfo code.

      ****************Code from SubstanceTableUI.java:

      public void mouseExited(MouseEvent e) {
      // if (SubstanceCoreUtilities.toBleedWatermark(list))
      // return;

      if (table == null)
      return;

      if (!table.isEnabled())
      return;

      // check the mouse location. If the cell editor has been shown
      // or hidden, we will get a mouseExited() event, but shouldn't
      // be changing the rollover indication if the mouse is still
      // over the table
      Point mouseLoc = MouseInfo.getPointerInfo().getLocation();
      Window windowAncestor = SwingUtilities.getWindowAncestor(table);
      SwingUtilities.convertPointFromScreen(mouseLoc, windowAncestor);
      Component deepest = SwingUtilities.getDeepestComponentAt(
      windowAncestor, mouseLoc.x, mouseLoc.y);

      while (deepest != null) {
      if (deepest == table)

      { // still in table return; }

      deepest = deepest.getParent();
      }

      fadeOutAllRollovers();
      this.fadeOutTableHeader();
      rolledOverIndices.clear();
      rolledOverColumn = -1;
      }

      ***************************************************

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            kirillcool
            Reporter:
            arifm
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: