Wicket
  1. Wicket
  2. WICKET-4859

Integer overflow in AbstractToolbar

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.2.0, 1.5.9
    • Fix Version/s: 1.5.9, 6.3.0
    • Component/s: wicket-extensions
    • Labels:
      None

      Description

      private static int counter = 0;

      This counter will overflow anytime... Please remove static.

        Issue Links

          Activity

          Hide
          Sven Meier added a comment -

          The counter has to be static since it is used to assure unique component ids among all AbstractToolbar instances. I've changed the static field to long, similar to RepeatingView.

          Show
          Sven Meier added a comment - The counter has to be static since it is used to assure unique component ids among all AbstractToolbar instances. I've changed the static field to long, similar to RepeatingView.
          Hide
          count negative added a comment -

          Sorry, I didn't get that. In RepeatingView the long childIdCounter isn't static. What about long running systems?

          Show
          count negative added a comment - Sorry, I didn't get that. In RepeatingView the long childIdCounter isn't static. What about long running systems?
          Hide
          Sven Meier added a comment -

          Well, for RepeatingView the ids have to be unique for all components inside the repeater only.
          The toolbars needs globally unique ids because it's not sure in which dataTable the toolbar is going to be put in.

          Regarding long running systems:
          Actually you'd have to create a lot of toolbars and put them in a single dataTable to run into duplicate ids. Apart from that there's no problem if the counter overflows - you'll just get negative ids.

          Show
          Sven Meier added a comment - Well, for RepeatingView the ids have to be unique for all components inside the repeater only. The toolbars needs globally unique ids because it's not sure in which dataTable the toolbar is going to be put in. Regarding long running systems: Actually you'd have to create a lot of toolbars and put them in a single dataTable to run into duplicate ids. Apart from that there's no problem if the counter overflows - you'll just get negative ids.
          Hide
          count negative added a comment -

          ok, now I see. Thanks Sven!

          Show
          count negative added a comment - ok, now I see. Thanks Sven!

            People

            • Assignee:
              Sven Meier
              Reporter:
              count negative
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development