code: public int getActualMaximum(int field) {
          if (field == YEAR) {
              int era = get(Calendar.ERA);
              if (era == CURRENT_ERA) {
                  // TODO: Investigate what value should be used here - revisit after 4.0.
                  return handleGetLimit(YEAR, MAXIMUM);
              } else {
                  int nextEraYear = ERAS[(era+1)*3];
                  int nextEraMonth = ERAS[(era+1)*3 + 1];
                  int nextEraDate = ERAS[(era+1)*3 + 2];
  
                  int maxYear = nextEraYear - ERAS[era*3] + 1; // 1-base
                  if (nextEraMonth == 1 && nextEraDate == 1) {
                      // Substract 1, because the next era starts at Jan 1
                      maxYear--;
                  }
                  return maxYear;
              }
          }
          return super.getActualMaximum(field);
      }
docs: {@inheritDoc}