Uploaded image for project: 'Geomajas GWT2 client - proposal'
  1. Geomajas GWT2 client - proposal
  2. PURE-162

A constructor of AbstractHtmlObject creates an invalid instance (can trigger a NumberFormatException)

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M5
    • Fix Version/s: 1.0.0-M6
    • Component/s: None
    • Labels:
      None
    • Environment:
    • CLA:
      I have read and agree with the Geomajas CLA for the attachments

      Description

      The constructor AbstractHtmlObject(Widget widget)
      Contains the lines:
      DOM.setStyleAttribute(widget.getElement(), "width", "100%");
      DOM.setStyleAttribute(widget.getElement(), "height", "100%");
      But if AbstractHtmlObject.getWidth() (or getHeight()) is called on a freshly created instance,
      this results in a NumberFormatException :

      caused by java.lang.NumberFormatException: For input string: "100%"
         java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
         java.lang.Integer.parseInt(Integer.java:492)
         java.lang.Integer.parseInt(Integer.java:527)
         org.geomajas.puregwt.client.gfx.AbstractHtmlObject.sizeToInt(AbstractHtmlObject.java:167)
      org.geomajas.puregwt.client.gfx.AbstractHtmlObject.getWidth(AbstractHtmlObject.java:104)
      

      So the constructor's code will be updated to:
      this(widget, 100, 100);
      Resulting in a width and height of 100px.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                anb An Buyle
                Reporter:
                anb An Buyle
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: