[ 
https://issues.apache.org/jira/browse/VELOCITY-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763095#action_12763095
 ] 

Christoph Reck commented on VELOCITY-736:
-----------------------------------------

I tested it with 1.5, where it works; whereas in 1.6.2 it fails - so this is a 
regression. 

It seems to be due to the protected class 
org.apache.commons.fileupload.FileUploadBase$SizeException - see:

> javap -protected 
> 'org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException'
Compiled from "FileUploadBase.java"
public class 
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException extends 
org.apache.commons.fileupload.FileUploadBase$SizeException{
    public 
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException();
    public 
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException(java.lang.String);
    public 
org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException(java.lang.String,
 long, long);
}

> javap -protected 'org.apache.commons.fileupload.FileUploadBase$SizeException' 
Compiled from "FileUploadBase.java"
public abstract class 
org.apache.commons.fileupload.FileUploadBase$SizeException extends 
org.apache.commons.fileupload.FileUploadException{
    protected 
org.apache.commons.fileupload.FileUploadBase$SizeException(java.lang.String, 
long, long);
    public long getActualSize();
    public long getPermittedSize();
}

Seems to be duplicate of VELOCITY-579


> Introspection regression from 1.5 to 1.6.2
> ------------------------------------------
>
>                 Key: VELOCITY-736
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-736
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6.2
>         Environment: Sun JDK 1.6.0_16
>            Reporter: David Esposito
>
> When upgrading from Velcocity 1.5 to 1.6.2, the following snippet of code 
> changed behavior. 
> In Velocity 1.5, the output was:
> The file upload exceeded 100
> In Velocity 1.6.2, the output is:
> The file upload exceeded $ex.permittedSize
> There is nothing in the velocity log file to help me identify why it's not 
> resolving 'permittedSize' to the correct bean method.
> Here is a test program to replicate the problem. The context variable in 
> question is the Commons FileUpload exception class documented here:
> http://commons.apache.org/fileupload/apidocs/org/apache/commons/fileupload/FileUploadBase.SizeLimitExceededException.html
> I am using commons-fileupload-1.2.jar
> import java.io.StringWriter;
> import org.apache.commons.fileupload.FileUploadBase;
> import org.apache.velocity.VelocityContext;
> import org.apache.velocity.app.VelocityEngine;
> import org.apache.velocity.context.Context;
> public class Main {
>     public static void main(String[] args) throws Exception{
>         VelocityEngine e = new VelocityEngine();
>               String testTemplate = "The file upload exceeded 
> $ex.permittedSize";
>               StringWriter out = new StringWriter();
>               Context ctx = new VelocityContext();
>               FileUploadBase.FileSizeLimitExceededException ex = new 
> FileUploadBase.FileSizeLimitExceededException("too big!", 50, 100);
>               ctx.put("ex",ex);
>               e.evaluate(ctx, out, "Tester", testTemplate);
>               System.out.println(out.toString());
>     }
> }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to