Revision: 794
http://stripes.svn.sourceforge.net/stripes/?rev=794&view=rev
Author: bengunter
Date: 2008-01-21 15:34:08 -0800 (Mon, 21 Jan 2008)
Log Message:
-----------
Added @Override and @SuppressWarnings where necessary to clear warnings. Also
fixed one bizarre syntax error that somehow got committed.
Modified Paths:
--------------
trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java
trunk/stripes/src/net/sourceforge/stripes/validation/expression/CommonsElExpressionExecutor.java
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp20ExpressionExecutor.java
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp21ExpressionExecutor.java
Modified: trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java
===================================================================
--- trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java
2008-01-21 23:29:03 UTC (rev 793)
+++ trunk/stripes/src/net/sourceforge/stripes/tag/HtmlTagSupport.java
2008-01-21 23:34:08 UTC (rev 794)
@@ -20,7 +20,6 @@
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
-import javax.servlet.jsp.el.ELException;
import javax.servlet.jsp.tagext.BodyContent;
import javax.servlet.jsp.tagext.DynamicAttributes;
import java.io.IOException;
@@ -217,13 +216,13 @@
* @param resultType the Class representing the desired return type from
the expression
* @throws StripesJspException when an ELException occurs trying to
evaluate the expression
*/
- @SuppressWarnings("unchecked")
+ @SuppressWarnings({ "unchecked", "deprecation" })
protected <R> R evaluateExpression(String expression, Class<R>
resultType) throws StripesJspException {
try {
return (R) this.pageContext.getExpressionEvaluator().
evaluate(expression, resultType,
this.pageContext.getVariableResolver(), null);
}
- catch (ELException ele) {
+ catch (javax.servlet.jsp.el.ELException ele) {
throw new StripesJspException
("Could not evaluate EL expression [" + expression + "] with
result type [" +
resultType.getName() + "] in tag class of type: " +
getClass().getName(), ele);
Modified:
trunk/stripes/src/net/sourceforge/stripes/validation/expression/CommonsElExpressionExecutor.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/validation/expression/CommonsElExpressionExecutor.java
2008-01-21 23:29:03 UTC (rev 793)
+++
trunk/stripes/src/net/sourceforge/stripes/validation/expression/CommonsElExpressionExecutor.java
2008-01-21 23:34:08 UTC (rev 794)
@@ -49,6 +49,7 @@
*
* @return an instance of ExpressionEvaluatorImpl if it can, null otherwise
*/
+ @Override
protected ExpressionEvaluator getEvaluator() {
try {
return (ExpressionEvaluator)
Modified:
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp20ExpressionExecutor.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp20ExpressionExecutor.java
2008-01-21 23:29:03 UTC (rev 793)
+++
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp20ExpressionExecutor.java
2008-01-21 23:34:08 UTC (rev 794)
@@ -39,6 +39,7 @@
*
* @return an ExpressionEvaluator if possible, or null otherwise
*/
+ @Override
protected ExpressionEvaluator getEvaluator() {
final PageContext context = DispatcherHelper.getPageContext();
Modified:
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp21ExpressionExecutor.java
===================================================================
---
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp21ExpressionExecutor.java
2008-01-21 23:29:03 UTC (rev 793)
+++
trunk/stripes/src/net/sourceforge/stripes/validation/expression/Jsp21ExpressionExecutor.java
2008-01-21 23:34:08 UTC (rev 794)
@@ -83,7 +83,8 @@
* @param prop the name of the property being looked for
* @return the value of the property or null if one can't be found
*/
- public Object getValue(ELContext ctx, Object base, Object prop) throws
{
+ @Override
+ public Object getValue(ELContext ctx, Object base, Object prop) {
if ("this".equals(prop)) {
ctx.setPropertyResolved(true);
return this.currentValue;
@@ -104,23 +105,28 @@
}
/** Does nothing. Always returns Object.class. */
+ @Override
public Class<?> getType(final ELContext ctx, final Object base, final
Object prop) {
ctx.setPropertyResolved(true);
return Object.class;
}
/** Does nothing. Always throws PropertyNotWritableException. */
+ @Override
public void setValue(ELContext elContext, Object o, Object o1, Object
o2) throws PropertyNotWritableException {
throw new PropertyNotWritableException("Unsupported Op");
}
/** Always returns true. */
+ @Override
public boolean isReadOnly(final ELContext elContext, final Object o,
final Object o1) { return true; }
/** Always returns null. */
+ @Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(final
ELContext elContext, final Object o) { return null; }
/** Always returns Object.class. */
+ @Override
public Class<?> getCommonPropertyType(final ELContext elContext, final
Object o) { return Object.class; }
}
@@ -133,10 +139,12 @@
* @since Stripes 1.5
*/
protected static class StripesELContext extends ELContext {
+ @SuppressWarnings("unused")
private ActionBean bean;
private StripesELResolver resolver;
private VariableMapper vmapper;
private static final FunctionMapper fmapper = new FunctionMapper() {
+ @Override
public Method resolveFunction(final String s, final String s1) {
return null; }
};
@@ -151,10 +159,12 @@
this.resolver = new StripesELResolver(bean);
this.vmapper = new VariableMapper() {
+ @Override
public ValueExpression resolveVariable(final String s) {
return null;
}
+ @Override
public ValueExpression setVariable(final String s, final
ValueExpression valueExpression) {
return null;
}
@@ -165,12 +175,15 @@
public void setCurrentValue(final Object value)
{resolver.setCurrentValue(value);}
/** Returns the StripesELResovler. */
+ @Override
public StripesELResolver getELResolver() { return this.resolver; }
/** Returns a no-op implementation of FunctionMapper. */
+ @Override
public FunctionMapper getFunctionMapper() { return fmapper; }
/** Returns a no-op implementation of VariableMapper. */
+ @Override
public VariableMapper getVariableMapper() { return vmapper; }
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Stripes-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-development