tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 25117] New: - PageService.getLink() throws ClassCastException if parameters arg is Object[]
Date Mon, 01 Dec 2003 18:06:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25117>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25117

PageService.getLink() throws ClassCastException if parameters arg is Object[]

           Summary: PageService.getLink() throws ClassCastException if
                    parameters arg is Object[]
           Product: Tapestry
           Version: 3.0
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Framework
        AssignedTo: tapestry-dev@jakarta.apache.org
        ReportedBy: pmf8@columbia.edu


If I use the following code to generate a url:
cycle.getEngine().getService(Tapestry.PAGE_SERVICE).getLink(cycle,
cycle.getPage(), new Object[] { "MyPage" }).getURL();

I get a ClassCastException complaining that it cannot cast my Object[] to a
String[].  This is counter-intuitive given the method signature of
IEngineService.getLink(IRequestCycle, IComponent, Object[]).  The PageService
should require that the first parameter be a String, not necessarily that the
parameter array itself be a String[].

The problem lies in line 88 of PageService.java:

return constructLink(cycle, Tapestry.PAGE_SERVICE, (String[]) parameters, null,
true);

It seems to me that this line should look like this:

return constructLink(cycle, Tapestry.PAGE_SERVICE, new String[] { (String)
parameters[0] }, null, true);

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org


Mime
View raw message