Skip to content

Refactorings 22#3189

Merged
lbownik merged 14 commits intodevelopfrom
refactorings_22
Jan 27, 2026
Merged

Refactorings 22#3189
lbownik merged 14 commits intodevelopfrom
refactorings_22

Conversation

@lbownik
Copy link
Contributor

@lbownik lbownik commented Jan 23, 2026

No description provided.

assertThat(role1.equals("")).isFalse();
assertThat(role1.equals(role2)).isTrue();

assertThat(role1.equals(role2)).isTrue();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate of line 21?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

return result != 0 ? result : role1.getOwnerId().compareTo(role2.getOwnerId());
};

private final static Long zero = new Long(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be replaced with Long.valueOf(0) to use cached value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}

public boolean appliesTo(Class<? extends DvObject> aClass) {
for (Class<? extends DvObject> c : appliesTo) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe throw IllegalArgumentException when aClass is null
I saw in unit test check for NPE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Class.isAssignableFrom throws NPE if argument is null so Permission.appliesTo only fails to throws NPE for null argument when appliesTo array is empty which never happens

@rscipien rscipien assigned lbownik and unassigned rscipien Jan 27, 2026
@lbownik lbownik assigned rscipien and unassigned lbownik Jan 27, 2026
@rscipien rscipien assigned lbownik and unassigned rscipien Jan 27, 2026
@lbownik lbownik merged commit b1e8b44 into develop Jan 27, 2026
1 check passed
@lbownik lbownik deleted the refactorings_22 branch January 27, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants