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

javac -h can't handle multiple headers with same name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8-pool, 11, 17, 19, 20
    • tools
    • generic
    • generic

      A DESCRIPTION OF THE PROBLEM :
      JNI headers generator maps classnames to headers names by replasing all dots (.) to underscores (_) in full classname.

      Compiler doesn't handle case when several classes mapped into same header.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      File example.java:
      package com;
      class example { native void x(); }

      File com_example.java
      // no package
      class com_example { native void y(); }

      run: javac -h include example.java com_example.java

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      File com_example.h:

      JNIEXPORT void JNICALL Java_com_example_x(JNIEnv *, jobject);
      JNIEXPORT void JNICALL Java_com_1example_y(JNIEnv *, jobject);
      ACTUAL -
      File com_example.h:

      // functions only from last file in list
      JNIEXPORT void JNICALL Java_com_1example_y(JNIEnv *, jobject);

      FREQUENCY : always


            acobbs Archie Cobbs
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: