Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master SEI_CERT_MET01_J #14

Merged
merged 7 commits into from
Jun 15, 2023
Merged

Merge master SEI_CERT_MET01_J #14

merged 7 commits into from
Jun 15, 2023

Conversation

JuditKnoll
Copy link
Collaborator

Merging the master branch to SEI_CERT_MET01_J and resolving conflicts.


Make sure these boxes are checked before submitting your PR -- thank you!

  • Added an entry into CHANGELOG.md if you have changed SpotBugs code

baloghadamsoftware and others added 7 commits June 8, 2023 21:38
…BUTE and PA_PUBLIC_MUTABLE_OBJECT_ATTRIBUTE (spotbugs#1500)

* Add new rule PA_PUBLIC_ATTRIBUTES

SEI CERT rule OBJ01-J requires that accessibility of fields must be
limited. In general, requiring that no fields must be public is
overkill and unrealistic. Even the rule mentions that final fields
may be public, except if the type of the field is a mutable reference
type which can be modified despite the reference itself being final.
Besides final fields, there may be other usages for public fields: some
public fields may serve as "flags" which affect the behavior of the
class. These fields are expected to be read by the containing class
itself and written by other classes. If a field is both written by
the methods of the containing class itself and from outside is
suspicious. This new rule PA_PUBLIC_ATTRIBUTES warns for such field.

* Updated according to the comments of @KengoTODA

* URL to SEI CERT rule changed to a HTML link in messages.xml

* Warnings separated to 3 different messages

* Changed detection of mutable classes and refactored two utility functions

* Constant containers renamed to all-capitals, moved to the front & made static

* Static mutables are detected by MS, duplicate error reports removed

* Missing space inserted into the error message description.

* Grammar fix

* Changelog adjusted

* Detector renamed, bug messages and descriptions changed

* add license header, fix typos

* refactoring tests to the new type

* add sourceline for non-static fields at the first PUT (init)

* making PA_PUBLIC_ATTRIBUTES messages more concrete

* fix tests, whitespaces

* fix CHANGELOG.md to master merge

* Fix Error marker location to the first assignment

* Remove unnecessary line

* CHANGELOG updated

* Small refactor

* Reverting changes to firstFile.xml and secondFile.xml

* spotless apply

---------

Co-authored-by: Ádám Balogh <adam.balogh@ericsson.com>
Co-authored-by: Judit Knoll <judit.knoll@sigmatechnology.com>
Co-authored-by: Judit Knoll <123470644+JuditKnoll@users.noreply.github.com>
…potbugs#2444)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
* Fix SER11-J - java-static-analysis/dev-spotbugs#19

* Reformat code

* Add message and changelog

* Fix style and tests

* Fix descriptions

* Remove synchronized

* Add second good test and refactor variable name

* Rephrase documentation

* Add comment to optionalBugs map

* Update CHANGELOG.md

* Add resolve suggestion

---------

Co-authored-by: Jeremy Landis <jeremylandis@hotmail.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@baloghadamsoftware baloghadamsoftware merged commit 87cabaa into baloghadamsoftware:SEI_CERT_MET01_J Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants