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

Unused local variables in java/net/Inet6AddressImpl.c:lookupIfLocalhost(JNIEnv *

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 8u45
    • core-libs
    • x86
    • os_x

    Description

      FULL PRODUCT VERSION :
      $ java -version
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      $ uname -a
      Darwin dhcp-whq501ip-3rd-and-4th-floor-gen-off-10-213-54-150.usdhcp.oraclecorp.com 13.4.0 Darwin Kernel Version 13.4.0: Sun Aug 17 19:50:11 PDT 2014; root:xnu-2422.115.4~1/RELEASE_X86_64 x86_64

      A DESCRIPTION OF THE PROBLEM :
      In src/solaris/native/java/net/Inet6AddressImpl.c, in the MACOSX-only method lookupIfLocalhost(JNIEnv *env, const char *hostname, jboolean includeV6), there are the local variable declarations

          166 int familyOrder = 0;
          167 int count = 0;

      but neither of those local variables is used in the body of the method.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Look at the source code, e.g., http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/48143da4c15d/src/solaris/native/java/net/Inet6AddressImpl.c lines 166 and 167

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I would not expect to see unused variable declarations.
      ACTUAL -
      The variables were declared, but unused.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      Attachments

        Issue Links

          Activity

            People

              robm Robert Mckenna
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: