Skip to content

Comments

Leftovers#2136

Open
triceo wants to merge 4 commits intoTimefoldAI:mainfrom
triceo:leftovers
Open

Leftovers#2136
triceo wants to merge 4 commits intoTimefoldAI:mainfrom
triceo:leftovers

Conversation

@triceo
Copy link
Collaborator

@triceo triceo commented Feb 21, 2026

The commits will not be squashed, they are too unrelated.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR contains miscellaneous "leftover" changes that address various technical debt items and API modernizations. The changes are intentionally unrelated and will not be squashed, as noted in the PR description.

Changes:

  • Standardized locale format from underscore (cs_cz) to hyphen (cs-CZ) notation using Locale.forLanguageTag() and toLanguageTag()
  • Removed the ProblemId_ generic type parameter from SolverManager, SolverJob, SolverJobBuilder and related classes, simplifying the API to use Object for problem IDs
  • Updated Jackson API calls from deprecated methods (serializationInclusion(), getCurrentName(), fields()) to modern equivalents (defaultPropertyInclusion(), currentName(), properties())
  • Updated JUnit 5 API to add ParameterDeclarations parameter to ArgumentsProvider.provideArguments()
  • Modernized Gizmo API calls from objEquals() to exprEquals()
  • Modernized thread factory implementation using Java's Thread.ofPlatform() builder pattern
  • Added strict validation for constraint names and groups (alphanumeric, spaces, underscores, hyphens, apostrophes, dots only)
  • Migrated from @NonNull to @NullMarked with @Nullable for null safety annotations
  • Added no-args constructor to MutableReference class
  • Simplified compiler warnings configuration to -Xlint:none

Reviewed changes

Copilot reviewed 80 out of 80 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
locale XML/Java files Changed locale format from underscore to hyphen notation (cs_cz → cs-CZ)
SolverManager and related Removed ProblemId_ generic parameter, simplified to Object
Jackson integration Updated deprecated Jackson APIs to modern equivalents
TerminationTest.java Added ParameterDeclarations parameter for JUnit 5 compatibility
Thread factory Modernized using Thread.ofPlatform() builder
AbstractConstraintBuilder Added constraint name/group validation with tests
Build configuration Simplified compiler args to suppress all warnings
Gizmo classes Updated from objEquals to exprEquals
Null annotations Migrated to @NullMarked pattern throughout

var trimmed = fieldValue.trim();
if (trimmed.isEmpty()) {
throw new IllegalArgumentException(
"The %s (%s) must not be empty or only contain whitespace.".formatted(fieldName, fieldName));
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The error message at line 55 duplicates fieldName instead of fieldValue. It should format fieldValue, not fieldName twice.

Suggested change
"The %s (%s) must not be empty or only contain whitespace.".formatted(fieldName, fieldName));
"The %s (%s) must not be empty or only contain whitespace.".formatted(fieldName, fieldValue));

Copilot uses AI. Check for mistakes.
Comment on lines 28 to 30
if (sanitized.isEmpty()) {
throw new IllegalArgumentException("The %s cannot be empty."
.formatted("constraint name"));
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The redundant check at line 28 is unnecessary since sanitize() at line 27 already validates non-empty strings. The sanitized value can never be empty at this point.

Copilot uses AI. Check for mistakes.
Comment on lines +450 to +454
<!--
Suppress warnings about generated code to reduce log length.
Warnings are primarily dealt with during development in the IDE.
-->
<compilerArgument>-Xlint:none</compilerArgument>
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The compiler configuration disables all warnings with -Xlint:none, but the comment suggests warnings should be handled in the IDE. However, this approach may allow warnings to accumulate in the codebase since they won't be visible during CI builds. Consider using a more targeted approach that suppresses only specific unavoidable warnings while keeping critical warnings enabled.

Copilot uses AI. Check for mistakes.
- [ ] `Rebaser` renamed to `Lookup` and made public.
- [ ] `ProblemChangeDirector#lookUpWorkingObject()` no longer returns `Optional`.
- [ ] `AutoDiscoverMemberType` is gone
- [ ] Constraint name and group now forces strict validation.
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The removal of the ProblemId_ generic type parameter from SolverManager, SolverJob, and related classes is a significant API breaking change that should be documented in docs/TODO.md. Users will need to remove the second type parameter from their code, which is a non-trivial migration.

Copilot uses AI. Check for mistakes.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
B Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant