Skip to content

Remove BaseModel since it breaks equals/hashCode contract #112

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

Merged
merged 21 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
f6e3b49
#23 Remove BaseModel since it breaks equals/hashCode contract
Weltraumschaf Jan 26, 2024
dad835c
#23 Use native types as model's field types
Weltraumschaf Jan 26, 2024
531480f
#23 Make constant private which is only used local
Weltraumschaf Jan 26, 2024
50b3175
#23 Reformat Java code
Weltraumschaf Jan 26, 2024
6912e55
#23 Add missing tests for model's equalsQueryString()
Weltraumschaf Jan 26, 2024
a4a21e1
#23 Reduce code duplication in equalsQueryString() implememtations
Weltraumschaf Jan 26, 2024
2a49a8a
#23 Also return false if id value in query params is null
Weltraumschaf Jan 26, 2024
14b33e2
#23 Give the Class a Better Name and Documentation
Weltraumschaf Feb 2, 2024
e926804
#23 Give the PaginatedResult Also an Upper Bound
Weltraumschaf Feb 2, 2024
01a958d
#23 Add Default Values to Prevent NPEs
Weltraumschaf Feb 2, 2024
8b098aa
#23 Add More Questions to PaginatedResult
Weltraumschaf Feb 2, 2024
fdd130c
#23 Clean Test Code
Weltraumschaf Feb 2, 2024
b0dc5ae
#23 Document Requirement for Null Values
Weltraumschaf Feb 2, 2024
f97b4ae
#23 Remove Unnecessary Code Clutter
Weltraumschaf Feb 2, 2024
6f6a2ab
#23 Clean Code
Weltraumschaf Feb 2, 2024
8772a60
#23 Clean Test Code
Weltraumschaf Feb 2, 2024
490e584
#23 Add TODO Hint to Remove Checked Exceptions from Public API
Weltraumschaf Feb 5, 2024
52cbd44
#23 Add Identical Behaviour Likethe Others Implementations Have
Weltraumschaf Feb 6, 2024
146c324
#23 Fix copy Paste Error in JavaDoc
Weltraumschaf Feb 6, 2024
4381585
Add Missing JavaDoc to PagianteResult Fileds
Weltraumschaf Feb 6, 2024
ed5fa7c
Add Missing JavaDoc to ScanFile
Weltraumschaf Feb 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#23 Also return false if id value in query params is null
Since the implementation of isNameEqual returns false, if the
value in the map is null, we do this for id the same way to be
consistent.

Signed-off-by: Sven Strittmatter <sven.strittmatter@iteratec.com>
  • Loading branch information
Weltraumschaf committed Feb 5, 2024
commit 2a49a8a40de9e1ab319a1d3e796e2804ec6638e7
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ static boolean isIdEqual(HasId model, Map<String, Object> queryParams) {
return false;
}

// FIXME: Since th generic type for value is Object, possible NPE here!
if (isNull(queryParams.get(QUERY_PARAM_KEY_FOR_ID))) {
return false;
}

return queryParams.get(QUERY_PARAM_KEY_FOR_ID).equals(model.getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ void isIdEqual_falseIfQueryParamsDoesNotContainId() {
}

@Test
@Disabled("Unclear if this behaviour will break something.")
void isIdEqual_falseIfQueryParamValueIsNull() {
final var queryParams = new HashMap<String, Object>();
queryParams.put(QueryParamsComparator.QUERY_PARAM_KEY_FOR_ID, null);
Expand Down