You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Roberto <ro...@dbmsrl.com> on 2022/03/28 14:15:45 UTC
ChecksumPath exception on unexistent assets
Hi,
It appears that the "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws exception
like "String index out of range: -1" when trying to apply substring function on unexistent resource path.
Maybe throwing an exception like "404 code error and resource not found" would be more convenient.
kind regards
bob
Re: ChecksumPath exception on unexistent assets
Posted by Roberto <ro...@dbmsrl.com>.
Hi Ben,
thank you for the commit.
Cheers,
Bob
Roberto Marotta
D.B.M. Srl
Via Enrico Noe, 23
20133 Milano
Tel. 02.26.60.05.21
----- Original Message -----
From: "Ben Weidig" <be...@netzgut.net>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, 9 May, 2022 5:56:47 PM
Subject: Re: ChecksumPath exception on unexistent assets
Hi Bob,
thanks for the patch!
I've changed it to an early return to don't check for -1 again, and added
some tests.
https://github.com/apache/tapestry-5/commit/b01906961a456656404fc2bc9d85ea2aeff10c53
Cheers,
Ben
On Mon, May 9, 2022 at 3:57 PM Roberto <ro...@dbmsrl.com> wrote:
> Hi Ben,
>
> a possible solution for TAP5-2713 (ChecksumPath:
> java.lang.StringIndexOutOfBoundsException) ticket could be this:
>
> In 'ChecksumPath' method only check 'slashx' variable and if it is -1
> return NON_EXISTING_RESOURCE, otherwise it executes the normal code.
>
> The patch is in attached.
>
> Regards,
> Bob
>
> Roberto Marotta
> D.B.M. Srl
> Via Enrico Noe, 23
> 20133 Milano
> Tel. 02.26.60.05.21
>
>
> ------------------------------
> *From: *"Ben Weidig" <be...@netzgut.net>
> *To: *"Tapestry users" <us...@tapestry.apache.org>
> *Sent: *Monday, 28 March, 2022 4:30:28 PM
> *Subject: *Re: ChecksumPath exception on unexistent assets
>
> Hi Bob,
>
> thanks for informing us about the exception on non-existant resources,
> I've created an issue: https://issues.apache.org/jira/browse/TAP5-2713 and
> will take a look.
>
> Cheers,
> Ben
>
>
> On Mon, Mar 28, 2022 at 4:15 PM Roberto <ro...@dbmsrl.com> wrote:
>
> >
> >
> > Hi,
> >
> > It appears that the
> > "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws
> > exception
> > like "String index out of range: -1" when trying to apply substring
> > function on unexistent resource path.
> > Maybe throwing an exception like "404 code error and resource not found"
> > would be more convenient.
> >
> > kind regards
> > bob
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
Re: ChecksumPath exception on unexistent assets
Posted by Ben Weidig <be...@netzgut.net>.
Hi Bob,
thanks for the patch!
I've changed it to an early return to don't check for -1 again, and added
some tests.
https://github.com/apache/tapestry-5/commit/b01906961a456656404fc2bc9d85ea2aeff10c53
Cheers,
Ben
On Mon, May 9, 2022 at 3:57 PM Roberto <ro...@dbmsrl.com> wrote:
> Hi Ben,
>
> a possible solution for TAP5-2713 (ChecksumPath:
> java.lang.StringIndexOutOfBoundsException) ticket could be this:
>
> In 'ChecksumPath' method only check 'slashx' variable and if it is -1
> return NON_EXISTING_RESOURCE, otherwise it executes the normal code.
>
> The patch is in attached.
>
> Regards,
> Bob
>
> Roberto Marotta
> D.B.M. Srl
> Via Enrico Noe, 23
> 20133 Milano
> Tel. 02.26.60.05.21
>
>
> ------------------------------
> *From: *"Ben Weidig" <be...@netzgut.net>
> *To: *"Tapestry users" <us...@tapestry.apache.org>
> *Sent: *Monday, 28 March, 2022 4:30:28 PM
> *Subject: *Re: ChecksumPath exception on unexistent assets
>
> Hi Bob,
>
> thanks for informing us about the exception on non-existant resources,
> I've created an issue: https://issues.apache.org/jira/browse/TAP5-2713 and
> will take a look.
>
> Cheers,
> Ben
>
>
> On Mon, Mar 28, 2022 at 4:15 PM Roberto <ro...@dbmsrl.com> wrote:
>
> >
> >
> > Hi,
> >
> > It appears that the
> > "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws
> > exception
> > like "String index out of range: -1" when trying to apply substring
> > function on unexistent resource path.
> > Maybe throwing an exception like "404 code error and resource not found"
> > would be more convenient.
> >
> > kind regards
> > bob
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
Re: ChecksumPath exception on unexistent assets
Posted by Roberto <ro...@dbmsrl.com>.
Hi Ben,
a possible solution for TAP5-2713 (ChecksumPath: java.lang.StringIndexOutOfBoundsException) ticket could be this:
In 'ChecksumPath' method only check 'slashx' variable and if it is -1 return NON_EXISTING_RESOURCE, otherwise it executes the normal code.
The patch is in attached.
Regards,
Bob
Roberto Marotta
D.B.M. Srl
Via Enrico Noe, 23
20133 Milano
Tel. 02.26.60.05.21
----- Original Message -----
From: "Ben Weidig" <be...@netzgut.net>
To: "Tapestry users" <us...@tapestry.apache.org>
Sent: Monday, 28 March, 2022 4:30:28 PM
Subject: Re: ChecksumPath exception on unexistent assets
Hi Bob,
thanks for informing us about the exception on non-existant resources,
I've created an issue: https://issues.apache.org/jira/browse/TAP5-2713 and
will take a look.
Cheers,
Ben
On Mon, Mar 28, 2022 at 4:15 PM Roberto <ro...@dbmsrl.com> wrote:
>
>
> Hi,
>
> It appears that the
> "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws
> exception
> like "String index out of range: -1" when trying to apply substring
> function on unexistent resource path.
> Maybe throwing an exception like "404 code error and resource not found"
> would be more convenient.
>
> kind regards
> bob
>
>
>
Re: ChecksumPath exception on unexistent assets
Posted by Ben Weidig <be...@netzgut.net>.
Hi Bob,
thanks for informing us about the exception on non-existant resources,
I've created an issue: https://issues.apache.org/jira/browse/TAP5-2713 and
will take a look.
Cheers,
Ben
On Mon, Mar 28, 2022 at 4:15 PM Roberto <ro...@dbmsrl.com> wrote:
>
>
> Hi,
>
> It appears that the
> "org.apache.tapestry5.internal.services.assets.ChecksumPath" class throws
> exception
> like "String index out of range: -1" when trying to apply substring
> function on unexistent resource path.
> Maybe throwing an exception like "404 code error and resource not found"
> would be more convenient.
>
> kind regards
> bob
>
>
>