#1071 PeriodLabelAxisInfo createInstance() Method does not work

1.0.x
closed-rejected
General (896)
5
2012-09-23
2011-12-13
szediwmi
No

The method createInstance() of the PeriodLabelAxisInfo class does not work since 1.0.14. The attached patch may help.

Discussion

  • David Gilbert

    David Gilbert - 2011-12-17

    I'm not sure what you mean by 'does not work'. Could you provide an example of some code that fails? I added a small unit test:

    /**
    * A test for the createInstance() method.
    */
    public void testCreateInstance() {
    PeriodAxisLabelInfo info = new PeriodAxisLabelInfo(Day.class,
    new SimpleDateFormat("d"));
    Day d = (Day) info.createInstance(new Date(0L),
    TimeZone.getTimeZone("GMT"), Locale.UK);
    assertEquals(new Day(1, 1, 1970), d);
    }

    ...and that works as expected. Looking at the PeriodAxisLabelInfo class, I think it would be possible to specify a 'Class' that is not a subclass of RegularTimePeriod and that would generate an exception in this method, but in that case nothing is going to work anyway.

    If you can clarify the bug, I'll take another look.

     
  • David Gilbert

    David Gilbert - 2011-12-17
    • assigned_to: nobody --> mungady
    • milestone: --> 1.0.x
     
  • David Gilbert

    David Gilbert - 2012-09-23

    Closing this, I reviewed it again and I still don't see anything to fix.

     
  • David Gilbert

    David Gilbert - 2012-09-23
    • status: open --> closed-rejected
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks