fmgasparino / google-gin

Automatically exported from code.google.com/p/google-gin
Apache License 2.0
0 stars 0 forks source link

ArrayIndexOutOfBoundsException on "#/" historyTokens #116

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. User incorrectly enters page.html#/

What is the expected output? What do you see instead?
Default/Error page should be revealed in response to no presenter being 
assigned the name token.

However since "/" is the default separator, it is stripped out of the
historytoken and the placeHeirarchy.get(placeHierarchy.size() - 1)
fails with ArrayIndexOutOfBoundsException

A simple fix 

 @Override
 public PlaceRequest getCurrentPlaceRequest() {
     try {
         return placeHierarchy.get(placeHierarchy.size() - 1);
     } catch (ArrayIndexOutOfBoundsException e){
         return new PlaceRequest();
     }
 }

Original issue reported on code.google.com by thagriz...@gmail.com on 28 Aug 2010 at 10:44

GoogleCodeExporter commented 9 years ago
Oops wrong project, multiple tabs open.
Greatly sorry,

My apologies

Original comment by thagriz...@gmail.com on 28 Aug 2010 at 10:47

GoogleCodeExporter commented 9 years ago
Not an issue with Gin. :)

Original comment by aragos on 30 Aug 2010 at 2:00

GoogleCodeExporter commented 9 years ago
Which project was this bug intended for?  I've implemented a fairly flexible 
Place library for a product I'm developing and would be happy to either donate 
it wholesale or help out with a similar project.

Original comment by chry...@gmail.com on 1 Sep 2010 at 3:10