Author: julien(a)jboss.com
Date: 2007-12-04 06:01:27 -0500 (Tue, 04 Dec 2007)
New Revision: 9275
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
Log:
simplify isAllowedAsChild implementation
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-12-04
10:59:41 UTC (rev 9274)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIContextImpl.java 2007-12-04
11:01:27 UTC (rev 9275)
@@ -201,14 +201,7 @@
protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
{
- boolean isAllowedAsChild = false;
-
- if(type == UIPortal.class)
- {
- isAllowedAsChild = true;
- }
-
- return isAllowedAsChild;
+ return type == UIPortal.class;
}
protected void fireEvent(ModelEvent event)
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-12-04
10:59:41 UTC (rev 9274)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPageImpl.java 2007-12-04
11:01:27 UTC (rev 9275)
@@ -43,17 +43,6 @@
protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
{
- boolean isAllowedAsChild = false;
-
- if(
- type == UIPage.class ||
- type == UIContainer.class ||
- type == UIWindow.class
- )
- {
- isAllowedAsChild = true;
- }
-
- return isAllowedAsChild;
+ return type == UIPage.class || type == UIContainer.class || type == UIWindow.class;
}
}
Modified:
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java
===================================================================
---
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-12-04
10:59:41 UTC (rev 9274)
+++
branches/presentation/presentation/src/main/org/jboss/portal/presentation/impl/model/UIPortalImpl.java 2007-12-04
11:01:27 UTC (rev 9275)
@@ -42,13 +42,6 @@
protected <T extends UIObject> boolean isAllowedAsChild(Class<T> type)
{
- boolean isAllowedAsChild = false;
-
- if(type == UIPage.class)
- {
- isAllowedAsChild = true;
- }
-
- return isAllowedAsChild;
+ return type == UIPage.class;
}
}
Show replies by date