Author: youngm
Date: 2010-01-22 13:51:48 -0500 (Fri, 22 Jan 2010)
New Revision: 11984
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
Log:
Some JBSEAM-4525 cleanup
Modified: branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22
18:39:43 UTC (rev 11983)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/faces/FacesMessages.java 2010-01-22
18:51:48 UTC (rev 11984)
@@ -347,13 +347,11 @@
public static FacesMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active
"+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active
"+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some
potential hack situations.
return (FacesMessages) Component.getInstance(StatusMessages.COMPONENT_NAME);
}
}
Modified:
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java
===================================================================
---
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22
18:39:43 UTC (rev 11983)
+++
branches/community/Seam_2_2/src/main/org/jboss/seam/international/StatusMessages.java 2010-01-22
18:51:48 UTC (rev 11984)
@@ -376,6 +376,7 @@
{
return;
}
+ //Attempting to get the instance anyway for backwards compatibility with some
potential hack situations.
StatusMessages statusMessages = instance();
if ( statusMessages != null )
{
@@ -395,13 +396,11 @@
public static StatusMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active
"+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active
"+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some
potential hack situations.
return (StatusMessages) Component.getInstance(COMPONENT_NAME);
}
Modified:
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java
===================================================================
---
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22
18:39:43 UTC (rev 11983)
+++
branches/community/Seam_2_2/src/wicket/org/jboss/seam/wicket/international/WicketStatusMessages.java 2010-01-22
18:51:48 UTC (rev 11984)
@@ -38,13 +38,11 @@
public static WicketStatusMessages instance()
{
Component component = Component.forName(StatusMessages.COMPONENT_NAME);
- if(component != null)
+ if(component != null && !component.getScope().isContextActive())
{
- if ( !component.getScope().isContextActive() )
- {
- throw new IllegalStateException("No active
"+component.getScope().name()+" context");
- }
+ throw new IllegalStateException("No active
"+component.getScope().name()+" context");
}
+ //Attempting to get the instance anyway for backwards compatibility with some
potential hack situations.
return (WicketStatusMessages)
Component.getInstance(StatusMessages.COMPONENT_NAME);
}
Show replies by date