Uploaded image for project: 'Commons Lang'
  1. Commons Lang
  2. LANG-568

@SuppressWarnings("unchecked") is used too generally

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 3.0
    • General
    • None

    Description

      @SuppressWarnings("unchecked") is used in several places on entire methods.
      Mostly there is no documentation as to why it is safe to ignore the warnings.

      Seems to me the annotation should be used as close as possible to the site of the warning, and the reason should be documented, so it can be revisited if there is a code change later.

      In fact, at least one of the warnings is NOT safe to ignore:

      String[] s = ArrayUtils.add((String[])null, null);

      generates a ClassCastException, which should not happen if the warning is OK to ignore.

      Attachments

        Issue Links

          Activity

            People

              sebb Sebb
              sebb Sebb
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: