Quantcast

Cannot create sequence from 1 to 0 with step 1

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cannot create sequence from 1 to 0 with step 1

bwfrieds
Anyone know what this error means?  

java.lang.IllegalArgumentException: Cannot create sequence from 1 to 0 with step 1
        at org.thymeleaf.util.NumberUtils.sequence(NumberUtils.java:147) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.thymeleaf.util.NumberUtils.sequence(NumberUtils.java:112) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at org.thymeleaf.expression.Numbers.sequence(Numbers.java:301) ~[thymeleaf-2.1.5.RELEASE.jar:2.1.5.RELEASE]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_79]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_79]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_79]
        at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_79]
        at org.springframework.expression.spel.support.ReflectiveMethodExecutor.execute(ReflectiveMethodExecutor.java:113) ~[spring-expression-4.2.7.RELEASE.jar:4.2.7.RELEASE]


It happens on this line...

<li th:each="item : ${#numbers.sequence(beginIndex,endIndex)}" th:class="${item == currentIndex ? 'active' : '' }">

This is displayed on the whiltelable error page...

Exception evaluating SpringEL expression: "#numbers.sequence(beginIndex,endIndex)" (submissions:73)

       
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot create sequence from 1 to 0 with step 1

bwfrieds
Never mind.  I'm an idiot.  My ending index was less than my beginning index which is illogical.  

SOLVED
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot create sequence from 1 to 0 with step 1

Pawel
You are definitely not an idiot. After upgrading my Spring Boot from 1.3.2 to 1.4.1 the views where I had the following code fragments are broken.

<select id="quantity" name="quantity">
    <option th:each="n:${#numbers.sequence(9,1)}" th:value="${n}">[[${n}]]</option>
</select>

Up to this version the #numbers.sequence(9,1) generated a sequence in a reverse order. It looks rather that some idiot changed this behaviour because of whatever reason.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot create sequence from 1 to 0 with step 1

danielfernandez
Administrator
> It looks rather that some idiot changed this behaviour because of whatever reason.

Excuse me?

If you believe calling idiots a group of people who have devoted thousands of hours of their personal life to create the software you are using for free is a way to get your issues solved, you are extremely wrong.

I have to ask you to please behave in these forums.

Regards.
Loading...