Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8337468

Redundant Math.ceil call in ELFFileParser

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P5 P5
    • tbd
    • 24
    • hotspot
    • None

      There are couple of places in the method 'sun.jvm.hotspot.debugger.posix.elf.ELFFileParser.ELFFileImpl.ELFHeaderImpl#getELFSymbol' where `Math.ceil` called with 'int' arguments. Calling Math.ceil with integer argument is useless - it will just return the same passed value.
      https://github.com/openjdk/jdk/blob/156f0b4332bf076165898417cf6678d2fc32df5c/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java#L307
      https://github.com/openjdk/jdk/blob/156f0b4332bf076165898417cf6678d2fc32df5c/src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFFileParser.java#L323

           for (int i = 0; i < Math.ceil(numSymbols / 2); i++) {

      'numSymbols' is 'int'.

      Seems we should remove them.

            Unassigned Unassigned
            aturbanov Andrey Turbanov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: