Created
June 16, 2013 05:19
-
-
Save hborders/5790859 to your computer and use it in GitHub Desktop.
Another "why" comment that is valuable. Without the comment, a naive developer might very declare the values at the call site, breaking the SWT library.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final int BUTTON_MASK; | |
public static final int MODIFIER_MASK; | |
static { | |
/* | |
* These values represent bit masks that may need to | |
* expand in the future. Therefore they are not initialized | |
* in the declaration to stop the compiler from inlining. | |
*/ | |
BUTTON_MASK = BUTTON1 | BUTTON2 | BUTTON3 | BUTTON4 | BUTTON5; | |
MODIFIER_MASK = ALT | SHIFT | CTRL | COMMAND; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment