Author: Alex.Kolonitsky
Date: 2009-07-31 11:31:21 -0400 (Fri, 31 Jul 2009)
New Revision: 15082
Modified:
branches/community/3.3.X/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
Log:
Regression: "messages: globalOnly does not work properly"
https://jira.jboss.org/jira/browse/RF-7351
Modified:
branches/community/3.3.X/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java
===================================================================
---
branches/community/3.3.X/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2009-07-31
15:30:43 UTC (rev 15081)
+++
branches/community/3.3.X/ui/message/src/main/java/org/richfaces/component/UIRichMessages.java 2009-07-31
15:31:21 UTC (rev 15082)
@@ -27,6 +27,7 @@
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
+import java.util.Locale;
import javax.el.ELException;
import javax.el.ValueExpression;
@@ -173,7 +174,11 @@
*/
protected void addMessagesForId(FacesContext context, String forId,
List<String> severenities) {
- Iterator<FacesMessage> messages = context.getMessages(forId);
+ if (isGlobalOnly() && forId != null) {
+ return;
+ }
+
+ Iterator<FacesMessage> messages = context.getMessages(forId);
while (messages.hasNext()) {
FacesMessage message = messages.next();
if (severenities.size() == 0 || severenities.contains("ALL")
@@ -201,7 +206,7 @@
for (Object key : FacesMessage.VALUES_MAP.keySet()) {
Severity sev = (Severity) FacesMessage.VALUES_MAP.get(key);
if (0 == sev.compareTo(severity)) {
- return severenities.contains(((String)key).toUpperCase());
+ return severenities.contains(((String)key).toUpperCase(Locale.ENGLISH));
}
}
return false;