Skip to content

Commit

Permalink
Merge pull request #5540 from eclipse-ee4j/fix_BindingFacesMessage_id…
Browse files Browse the repository at this point in the history
…entity
  • Loading branch information
arjantijms authored Dec 26, 2024
2 parents 83af87b + 9964486 commit 93934ed
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
14 changes: 14 additions & 0 deletions impl/src/main/java/com/sun/faces/util/MessageFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.text.MessageFormat;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.Objects;
import java.util.ResourceBundle;

import jakarta.el.ValueExpression;
Expand Down Expand Up @@ -322,6 +323,19 @@ private String getFormattedString(String msgtext, Object[] params) {
private final Locale locale;
private final Object[] parameters;
private Object[] resolvedParameters;

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), locale, parameters, resolvedParameters);
}

@Override
public boolean equals(Object object) {
return super.equals(object)
&& Objects.equals(locale, ((BindingFacesMessage) object).locale)
&& Objects.equals(parameters, ((BindingFacesMessage) object).parameters)
&& Objects.equals(resolvedParameters, ((BindingFacesMessage) object).resolvedParameters);
}
}

} // end of class MessageFactory
14 changes: 14 additions & 0 deletions impl/src/main/java/jakarta/faces/validator/MessageFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.text.MessageFormat;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.Objects;
import java.util.ResourceBundle;

import jakarta.el.ValueExpression;
Expand Down Expand Up @@ -322,6 +323,19 @@ private String getFormattedString(String msgtext, Object[] params) {
private Locale locale;
private Object[] parameters;
private Object[] resolvedParameters;

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), locale, parameters, resolvedParameters);
}

@Override
public boolean equals(Object object) {
return super.equals(object)
&& Objects.equals(locale, ((BindingFacesMessage) object).locale)
&& Objects.equals(parameters, ((BindingFacesMessage) object).parameters)
&& Objects.equals(resolvedParameters, ((BindingFacesMessage) object).resolvedParameters);
}
}

} // end of class MessageFactory

0 comments on commit 93934ed

Please sign in to comment.