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

Robot(GraphicsDevice) constructor initializes LEGAL_BUTTON_MASK variable improperly

XMLWordPrintable

    • b66
    • generic
    • generic, linux_redhat_5.0
    • Verified

      AWT Robot has two constructors that initialize instance differently. Robot(GraphicsDevice) constructor does not invoke default constructor implementation and by this reason misses initialization of LEGAL_BUTTON_MASK variable.

      Improper initialization of LEGAL_BUTTON_MASK could bring to an exception.

      Exception in thread "main" java.lang.IllegalArgumentException: Invalid combination of button flags
      at java.awt.Robot.checkButtonsArgument(Robot.java:325)
      at java.awt.Robot.mousePress(Robot.java:257)
      at FileListBetweenJVMsTest.<init>(FileListBetweenJVMsTest.java:119)
      at FileListBetweenJVMsTest.main(FileListBetweenJVMsTest.java:150)

      The exception is caused by the fact that LEGAL_BUTTON_MASK value is 0.

            dcherepanov Dmitry Cherepanov
            denis Denis Fokin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: