calendar.get(Calendar.MONTH) == Calendar.JANUARY 给出 lint 错误

calendar.get(Calendar.MONTH) == Calendar.JANUARY gives a lint error

我正在使用以下代码检查所选月份是否为一月:

if (calendar.get(Calendar.MONTH) == Calendar.JANUARY) {
    ...
}

这给了我一个 lint 错误(抑制它会给出 "WrongConstant")。 有一个 old issue about annotation problems in this area (got there from this SO question),但它已在 Android Studio 0.5.6 中修复,我目前使用的是 2.2.3。

我是不是做错了什么或者这是同一个(或不同的)错误?

几周前我遇到了这个警告,我认为这是 linting 系统中的一个新错误,因为如果你拆分 get 方法调用和 if 语句,就不会再有警告:

int month = calendar.get(Calendar.MONTH);
if (month == Calendar.JANUARY) {
    // We are in January and no warning is displayed!  
}

在 Android Studio 中发布修复程序之前,我将使用此解决方法...