You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Mohammed AMHEND <am...@gmail.com> on 2011/05/15 11:26:43 UTC

CalendarButton Bug

Hi,
When I try to add to my project a CalendarButton it gives an error as follow
:

An error occurred at line number 27 in file
/C:/Users/Mohammed/BC/tests/bin/cours/calendar_test.bxml:
java.lang.IndexOutOfBoundsException: index -1 out of bounds.
    at
org.apache.pivot.collections.ArrayList.verifyIndexBounds(ArrayList.java:577)
    at org.apache.pivot.collections.ArrayList.get(ArrayList.java:346)
    at org.apache.pivot.wtk.TablePane$Row.get(TablePane.java:263)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:706)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
    at
org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
    at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin$4.selectionChanged(TerraCalendarSkin.java:506)
    at
org.apache.pivot.wtk.ButtonGroup$ButtonGroupListenerList.selectionChanged(ButtonGroup.java:46)
    at org.apache.pivot.wtk.ButtonGroup.setSelection(ButtonGroup.java:128)
    at org.apache.pivot.wtk.Button.setState(Button.java:469)
    at org.apache.pivot.wtk.Button.setSelected(Button.java:432)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:707)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
    at
org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
    at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin$4.selectionChanged(TerraCalendarSkin.java:506)
    at
org.apache.pivot.wtk.ButtonGroup$ButtonGroupListenerList.selectionChanged(ButtonGroup.java:46)
    at org.apache.pivot.wtk.ButtonGroup.setSelection(ButtonGroup.java:128)
    at org.apache.pivot.wtk.Button.setState(Button.java:469)
    at org.apache.pivot.wtk.Button.setSelected(Button.java:432)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:707)
    at
org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
    at
org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
    at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
    at
org.apache.pivot.wtk.skin.CalendarButtonSkin.selectedDateChanged(CalendarButtonSkin.java:353)
    at
org.apache.pivot.wtk.CalendarButton$CalendarButtonSelectionListenerList.selectedDateChanged(CalendarButton.java:75)
    at
org.apache.pivot.wtk.CalendarButton.setSelectedDate(CalendarButton.java:243)
    at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:155)
    at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:145)
    at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:141)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at
org.apache.pivot.beans.BXMLSerializer.newTypedObject(BXMLSerializer.java:1544)
    at
org.apache.pivot.beans.BXMLSerializer.processStartElement(BXMLSerializer.java:755)
    at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:435)
    at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:614)
    at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:568)
    at
org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:534)
    at cours.CalendarTest.startup(CalendarTest.java:29)
    at
org.apache.pivot.wtk.DesktopApplicationContext$2.run(DesktopApplicationContext.java:594)
    at
org.apache.pivot.wtk.ApplicationContext$QueuedCallback.run(ApplicationContext.java:1474)
    at java.awt.event.InvocationEvent.dispatch(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$000(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.awt.EventQueue$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


code :

<?xml version="1.0" encoding="UTF-8"?>

<Window title="Calendar Test" maximized="true"
    xmlns:bxml="http://pivot.apache.org/bxml"
    xmlns="org.apache.pivot.wtk">
....
    <BoxPane>
        <CalendarButton bxml:id="calendarButton"/> <!--line 27 -->
        <ListButton listData="['One', 'Two', 'Three']"/>
    </BoxPane>
</Window>


But, When I changed the current date to January 2010 it works good !

I'm confused, please help me !

Re: CalendarButton Bug

Posted by Greg Brown <gk...@verizon.net>.
I believe this was fixed for 2.0.1 which has not yet been released. Can you build from source and verify that it resolves your problem?

On May 15, 2011, at 5:26 AM, Mohammed AMHEND wrote:

> Hi, 
> When I try to add to my project a CalendarButton it gives an error as follow :
> 
> An error occurred at line number 27 in file /C:/Users/Mohammed/BC/tests/bin/cours/calendar_test.bxml:
> java.lang.IndexOutOfBoundsException: index -1 out of bounds.
>     at org.apache.pivot.collections.ArrayList.verifyIndexBounds(ArrayList.java:577)
>     at org.apache.pivot.collections.ArrayList.get(ArrayList.java:346)
>     at org.apache.pivot.wtk.TablePane$Row.get(TablePane.java:263)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:706)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
>     at org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
>     at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin$4.selectionChanged(TerraCalendarSkin.java:506)
>     at org.apache.pivot.wtk.ButtonGroup$ButtonGroupListenerList.selectionChanged(ButtonGroup.java:46)
>     at org.apache.pivot.wtk.ButtonGroup.setSelection(ButtonGroup.java:128)
>     at org.apache.pivot.wtk.Button.setState(Button.java:469)
>     at org.apache.pivot.wtk.Button.setSelected(Button.java:432)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:707)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
>     at org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
>     at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin$4.selectionChanged(TerraCalendarSkin.java:506)
>     at org.apache.pivot.wtk.ButtonGroup$ButtonGroupListenerList.selectionChanged(ButtonGroup.java:46)
>     at org.apache.pivot.wtk.ButtonGroup.setSelection(ButtonGroup.java:128)
>     at org.apache.pivot.wtk.Button.setState(Button.java:469)
>     at org.apache.pivot.wtk.Button.setSelected(Button.java:432)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.updateSelection(TerraCalendarSkin.java:707)
>     at org.apache.pivot.wtk.skin.terra.TerraCalendarSkin.selectedDateChanged(TerraCalendarSkin.java:963)
>     at org.apache.pivot.wtk.Calendar$CalendarSelectionListenerList.selectedDateChanged(Calendar.java:90)
>     at org.apache.pivot.wtk.Calendar.setSelectedDate(Calendar.java:212)
>     at org.apache.pivot.wtk.skin.CalendarButtonSkin.selectedDateChanged(CalendarButtonSkin.java:353)
>     at org.apache.pivot.wtk.CalendarButton$CalendarButtonSelectionListenerList.selectedDateChanged(CalendarButton.java:75)
>     at org.apache.pivot.wtk.CalendarButton.setSelectedDate(CalendarButton.java:243)
>     at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:155)
>     at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:145)
>     at org.apache.pivot.wtk.CalendarButton.<init>(CalendarButton.java:141)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>     at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
>     at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
>     at java.lang.reflect.Constructor.newInstance(Unknown Source)
>     at java.lang.Class.newInstance0(Unknown Source)
>     at java.lang.Class.newInstance(Unknown Source)
>     at org.apache.pivot.beans.BXMLSerializer.newTypedObject(BXMLSerializer.java:1544)
>     at org.apache.pivot.beans.BXMLSerializer.processStartElement(BXMLSerializer.java:755)
>     at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:435)
>     at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:614)
>     at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:568)
>     at org.apache.pivot.beans.BXMLSerializer.readObject(BXMLSerializer.java:534)
>     at cours.CalendarTest.startup(CalendarTest.java:29)
>     at org.apache.pivot.wtk.DesktopApplicationContext$2.run(DesktopApplicationContext.java:594)
>     at org.apache.pivot.wtk.ApplicationContext$QueuedCallback.run(ApplicationContext.java:1474)
>     at java.awt.event.InvocationEvent.dispatch(Unknown Source)
>     at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
>     at java.awt.EventQueue.access$000(Unknown Source)
>     at java.awt.EventQueue$1.run(Unknown Source)
>     at java.awt.EventQueue$1.run(Unknown Source)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
>     at java.awt.EventQueue.dispatchEvent(Unknown Source)
>     at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
>     at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
>     at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
>     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>     at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>     at java.awt.EventDispatchThread.run(Unknown Source)
> 
> 
> code :
> 
> <?xml version="1.0" encoding="UTF-8"?>
> 
> <Window title="Calendar Test" maximized="true"
>     xmlns:bxml="http://pivot.apache.org/bxml"
>     xmlns="org.apache.pivot.wtk">
> ....
>     <BoxPane>
>         <CalendarButton bxml:id="calendarButton"/> <!--line 27 -->
>         <ListButton listData="['One', 'Two', 'Three']"/>
>     </BoxPane>
> </Window>
> 
> 
> But, When I changed the current date to January 2010 it works good !
> 
> I'm confused, please help me !


RE: CalendarButton Bug

Posted by Jérôme Serré <je...@gmail.com>.
I finish something and i do it. :)
Bye,
Jérôme

-----Message d'origine-----
De : Sandro Martini [mailto:sandro.martini@gmail.com] 
Envoyé : lundi 16 mai 2011 12:00
À : user@pivot.apache.org
Objet : RE: CalendarButton Bug

Hi Jérôme,
have you time for trying to do the tests I described in thew previous post (just to ensure that the issue is really no more valid) ?
But you have to use Pivot sources from the trunk.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p2947191.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: CalendarButton Bug

Posted by Greg Brown <gk...@verizon.net>.
OK. You should be able to verify the fix when Pivot 2.0.1 becomes available then.  :-)

On May 17, 2011, at 8:53 AM, Jérôme Serré wrote:

> Sorry Greg but 
> I don't know Ant and SVN :-( and I do not even know Why this! 
> I just to learn how to launch a pivot app with eclipse :-)
> 
> Jérôme
> 
> -----Message d'origine-----
> De : Greg Brown [mailto:gk_brown@verizon.net] 
> Envoyé : mardi 17 mai 2011 14:10
> À : user@pivot.apache.org
> Objet : Re: CalendarButton Bug
> 
>> I thought the test this anomaly was limited to recompile a single class.
>> The test of the full version is too heavy, it requires a special 
>> environment and leisure time.
>> I do not intend to get into this business.
> 
> OK.  :-)  If you already have Ant and SVN installed, it really isn't too
> time-consuming, though. You just need to do this (from ~/Projects or
> wherever you generally put development code):
> 
> svn co http://svn.apache.org/repos/asf/pivot/trunk/ pivot cd pivot ant
> package
> 
> The Pivot libraries will be compiled to a lib directory relative to the
> current directory.
> 
> 
> 
> 
> 


RE: CalendarButton Bug

Posted by Jérôme Serré <je...@gmail.com>.
Sorry Greg but 
I don't know Ant and SVN :-( and I do not even know Why this! 
I just to learn how to launch a pivot app with eclipse :-)

Jérôme

-----Message d'origine-----
De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : mardi 17 mai 2011 14:10
À : user@pivot.apache.org
Objet : Re: CalendarButton Bug

> I thought the test this anomaly was limited to recompile a single class.
> The test of the full version is too heavy, it requires a special 
> environment and leisure time.
> I do not intend to get into this business.

OK.  :-)  If you already have Ant and SVN installed, it really isn't too
time-consuming, though. You just need to do this (from ~/Projects or
wherever you generally put development code):

svn co http://svn.apache.org/repos/asf/pivot/trunk/ pivot cd pivot ant
package

The Pivot libraries will be compiled to a lib directory relative to the
current directory.






Re: CalendarButton Bug

Posted by Greg Brown <gk...@verizon.net>.
> I thought the test this anomaly was limited to recompile a single class.
> The test of the full version is too heavy, it requires a special environment
> and leisure time.
> I do not intend to get into this business.

OK.  :-)  If you already have Ant and SVN installed, it really isn't too time-consuming, though. You just need to do this (from ~/Projects or wherever you generally put development code):

svn co http://svn.apache.org/repos/asf/pivot/trunk/ pivot
cd pivot
ant package

The Pivot libraries will be compiled to a lib directory relative to the current directory.






RE: CalendarButton Bug

Posted by Jérôme Serré <je...@gmail.com>.
Hello,

 I thought the test this anomaly was limited to recompile a single class.
The test of the full version is too heavy, it requires a special environment
and leisure time.
 I do not intend to get into this business.

Jérôme

-----Message d'origine-----
De : Greg Brown [mailto:gk_brown@verizon.net] 
Envoyé : lundi 16 mai 2011 16:35
À : user@pivot.apache.org
Objet : Re: CalendarButton Bug

Just sync with the trunk in SVN and run "ant package" from the root:

http://svn.apache.org/repos/asf/pivot/trunk/

That will generate the Pivot JARs in a lib directory relative to the root.
 
On May 16, 2011, at 10:30 AM, Jérôme Serré wrote:

> How can I get the patch in the trunk ?
> Thanks
> 
> -----Message d'origine-----
> De : Sandro Martini [mailto:sandro.martini@gmail.com] Envoyé : lundi 
> 16 mai 2011 12:00 À : user@pivot.apache.org Objet : RE: CalendarButton 
> Bug
> 
> Hi Jérôme,
> have you time for trying to do the tests I described in thew previous post
(just to ensure that the issue is really no more valid) ?
> But you have to use Pivot sources from the trunk.
> 
> Bye,
> Sandro
> 
> 
> --
> View this message in context: 
> http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp29
> 42924p2947191.html Sent from the Apache Pivot - Users mailing list 
> archive at Nabble.com.
> 


Re: CalendarButton Bug

Posted by Greg Brown <gk...@verizon.net>.
Just sync with the trunk in SVN and run "ant package" from the root:

http://svn.apache.org/repos/asf/pivot/trunk/

That will generate the Pivot JARs in a lib directory relative to the root.
 
On May 16, 2011, at 10:30 AM, Jérôme Serré wrote:

> How can I get the patch in the trunk ?
> Thanks 
> 
> -----Message d'origine-----
> De : Sandro Martini [mailto:sandro.martini@gmail.com] 
> Envoyé : lundi 16 mai 2011 12:00
> À : user@pivot.apache.org
> Objet : RE: CalendarButton Bug
> 
> Hi Jérôme,
> have you time for trying to do the tests I described in thew previous post (just to ensure that the issue is really no more valid) ?
> But you have to use Pivot sources from the trunk.
> 
> Bye,
> Sandro
> 
> 
> --
> View this message in context: http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p2947191.html
> Sent from the Apache Pivot - Users mailing list archive at Nabble.com.
> 


RE: CalendarButton Bug

Posted by Jérôme Serré <je...@gmail.com>.
How can I get the patch in the trunk ?
Thanks 

-----Message d'origine-----
De : Sandro Martini [mailto:sandro.martini@gmail.com] 
Envoyé : lundi 16 mai 2011 12:00
À : user@pivot.apache.org
Objet : RE: CalendarButton Bug

Hi Jérôme,
have you time for trying to do the tests I described in thew previous post (just to ensure that the issue is really no more valid) ?
But you have to use Pivot sources from the trunk.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p2947191.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


RE: CalendarButton Bug

Posted by Sandro Martini <sa...@gmail.com>.
Hi Jérôme,
have you time for trying to do the tests I described in thew previous post
(just to ensure that the issue is really no more valid) ?
But you have to use Pivot sources from the trunk.

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p2947191.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.

RE: CalendarButton Bug

Posted by Jérôme Serré <je...@gmail.com>.
Hello,
Personally, I was surprised yesterday to see this error in my application
and I put this review for information.
I have not applied the patch and it is therefore normal that it does not
work.
I'm waiting the 2.0.1

Jérôme

-----Message d'origine-----
De : Sandro Martini [mailto:sandro.martini@gmail.com] 
Envoyé : lundi 16 mai 2011 11:23
À : user@pivot.apache.org
Objet : Re: CalendarButton Bug

Hi,
probably you are seeing this issue (
https://issues.apache.org/jira/browse/PIVOT-702 ), but to exclude that it's
still open, can you try to synchronize with latest sources in trunk and
retry ?

As written in a comment, in local, the calendar.bxml under Tutorials works (
/org/apache/pivot/tutorials/calendars/calendars.bxml , you can run inside
Eclipse with the "Run as Pivot Script Application") ?


Other questions: 
what OS/Java version ?
what Locale are you using ? 
what text direction (left to right, or right to left) ?

Bye,
Sandro


--
View this message in context:
http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p
2947092.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.


Re: CalendarButton Bug

Posted by Sandro Martini <sa...@gmail.com>.
Hi,
probably you are seeing this issue (
https://issues.apache.org/jira/browse/PIVOT-702 ), but to exclude that it's
still open, can you try to synchronize with latest sources in trunk and
retry ?

As written in a comment, in local, the calendar.bxml under Tutorials works (
/org/apache/pivot/tutorials/calendars/calendars.bxml , you can run inside
Eclipse with the "Run as Pivot Script Application") ?


Other questions: 
what OS/Java version ?
what Locale are you using ? 
what text direction (left to right, or right to left) ?

Bye,
Sandro


--
View this message in context: http://apache-pivot-users.399431.n3.nabble.com/CalendarButton-Bug-tp2942924p2947092.html
Sent from the Apache Pivot - Users mailing list archive at Nabble.com.