Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-36362

Omnibus Java code static analyzer warning fixes

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.2.0
    • 3.3.0
    • Spark Core, SQL, Tests
    • None

    Description

      Inspired by a recent Java code touch-up, I wanted to fix in one pass several lingering non-trivial issues with the Java code that a static analyzer turns up. Only a few of these have material effects, but some do, and figured we could avoid taking N PRs over time to address these.

      • Some int*int multiplications that widen to long maybe could overflow
      • Unnecessarily non-static inner classes
      • Some tests "catch (AssertionError)" and do nothing
      • Manual array iteration vs very slightly faster/simpler foreach
      • Incorrect generic types that just happen to not cause a runtime error
      • Missed opportunities for try-close
      • Mutable enums which shouldn't be
      • .. and a few other minor things

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            srowen Sean R. Owen
            srowen Sean R. Owen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment