Author: jmitchell
Date: Sun Apr 10 21:25:14 2005
New Revision: 160832
URL: http://svn.apache.org/viewcvs?view=rev&rev=160832
Log:
remove useless 'else' statements
Modified:
struts/core/trunk/src/share/org/apache/struts/mock/MockPageContext.java
Modified:
struts/core/trunk/src/share/org/apache/struts/mock/MockPageContext.java
URL:
http://svn.apache.org/viewcvs/struts/core/trunk/src/share/org/apache/struts/mock/MockPageContext.java?view=diff&r1=160831&r2=160832
==============================================================================
--- struts/core/trunk/src/share/org/apache/struts/mock/MockPageContext.java
(original)
+++ struts/core/trunk/src/share/org/apache/struts/mock/MockPageContext.java Sun
Apr 10 21:25:14 2005
@@ -141,21 +141,18 @@
} else if (scope == PageContext.REQUEST_SCOPE) {
if (request != null) {
return (request.getAttribute(name));
- } else {
- return (null);
}
+ return (null);
} else if (scope == PageContext.SESSION_SCOPE) {
if (session != null) {
return (session.getAttribute(name));
- } else {
- return (null);
}
+ return (null);
} else if (scope == PageContext.APPLICATION_SCOPE) {
if (application != null) {
return (application.getAttribute(name));
- } else {
- return (null);
}
+ return (null);
} else {
throw new IllegalArgumentException("Invalid scope " + scope);
}
@@ -168,24 +165,18 @@
} else if (scope == PageContext.REQUEST_SCOPE) {
if (request != null) {
return (request.getAttributeNames());
- } else {
- return
- (new MockEnumeration(Collections.EMPTY_LIST.iterator()));
}
+ return (new MockEnumeration(Collections.EMPTY_LIST.iterator()));
} else if (scope == PageContext.SESSION_SCOPE) {
if (session != null) {
return (session.getAttributeNames());
- } else {
- return
- (new MockEnumeration(Collections.EMPTY_LIST.iterator()));
}
+ return (new MockEnumeration(Collections.EMPTY_LIST.iterator()));
} else if (scope == PageContext.APPLICATION_SCOPE) {
if (application != null) {
return (application.getAttributeNames());
- } else {
- return
- (new MockEnumeration(Collections.EMPTY_LIST.iterator()));
}
+ return new MockEnumeration(Collections.EMPTY_LIST.iterator());
} else {
throw new IllegalArgumentException("Invalid scope " + scope);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]