Skip to content

Commit

Permalink
#29498 Add private constructors and default constructor for CDI
Browse files Browse the repository at this point in the history
Added a private constructor in Predicates to prevent instantiation and a default constructor in RetryPolicyProcessor for CDI proxy creation. This change improves the design by enforcing non-instantiability where necessary and ensuring the proper creation of CDI proxies.
  • Loading branch information
jgambarios committed Oct 23, 2024
1 parent 5518ef3 commit b9019cd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ public void onJobProgressUpdated(@Observes JobProgressUpdatedEvent event) {
*/
public static class Predicates {

private Predicates() {
// Prevent instantiation
}

/**
* Creates a predicate that matches jobs with any of the specified states.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@
@ApplicationScoped
public class RetryPolicyProcessor {

private final NoRetryStrategy noRetryStrategy;
private NoRetryStrategy noRetryStrategy;

/**
* Default constructor required for CDI proxy creation.
*/
public RetryPolicyProcessor() {
// Default constructor for CDI
}

@Inject
public RetryPolicyProcessor(NoRetryStrategy noRetryStrategy) {
Expand Down

0 comments on commit b9019cd

Please sign in to comment.