Useless Math.ceil calls in GLXSurfaceData

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: P5
    • tbd
    • Affects Version/s: 11, 17, 20
    • Component/s: client-libs
    • None
    • 2d
    • 9

      There are 4 confusing calls to Math.ceil with int argument.
      sun.java2d.opengl.GLXSurfaceData.GLXOffScreenSurfaceData#getBounds:

                  r.width = (int) Math.ceil(r.width * scale);
                  r.height = (int) Math.ceil(r.height * scale);

      sun.java2d.opengl.GLXSurfaceData.GLXWindowSurfaceData#getBounds:

                  r.width = (int) Math.ceil(r.width * scale);
                  r.height = (int) Math.ceil(r.height * scale);

      r.width, r.height and scale variables have 'int' type. It means Math.ceil is called with 'int' argument too. Math.ceil is useless when called with integer values - it just returns its argument.
      Seems like scale was supposed to have 'double' type?

            Assignee:
            Jayathirth D V
            Reporter:
            Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: