langtools/src/share/classes/com/sun/tools/javah/LLNI.java
changeset 22163 3651128c74eb
parent 14263 473b1eaede64
child 25690 b1dac768ab79
equal deleted inserted replaced
22162:3b3e23e67329 22163:3651128c74eb
    87     }
    87     }
    88 
    88 
    89     protected void generateDeclsForClass(PrintWriter pw,
    89     protected void generateDeclsForClass(PrintWriter pw,
    90             TypeElement clazz, String cname)
    90             TypeElement clazz, String cname)
    91             throws TypeSignature.SignatureException, Util.Exit {
    91             throws TypeSignature.SignatureException, Util.Exit {
    92         doneHandleTypes  = new HashSet<String>();
    92         doneHandleTypes  = new HashSet<>();
    93         /* The following handle types are predefined in "typedefs.h". Suppress
    93         /* The following handle types are predefined in "typedefs.h". Suppress
    94            inclusion in the output by generating them "into the blue" here. */
    94            inclusion in the output by generating them "into the blue" here. */
    95         genHandleType(null, "java.lang.Class");
    95         genHandleType(null, "java.lang.Class");
    96         genHandleType(null, "java.lang.ClassLoader");
    96         genHandleType(null, "java.lang.ClassLoader");
    97         genHandleType(null, "java.lang.Object");
    97         genHandleType(null, "java.lang.Object");
   451 
   451 
   452 
   452 
   453         res = "JNIEXPORT " + jniType(retType) + " JNICALL" + lineSep + jniMethodName(method, cname, longName)
   453         res = "JNIEXPORT " + jniType(retType) + " JNICALL" + lineSep + jniMethodName(method, cname, longName)
   454             + "(JNIEnv *, " + cRcvrDecl(method, cname);
   454             + "(JNIEnv *, " + cRcvrDecl(method, cname);
   455         List<? extends VariableElement> params = method.getParameters();
   455         List<? extends VariableElement> params = method.getParameters();
   456         List<TypeMirror> argTypes = new ArrayList<TypeMirror>();
   456         List<TypeMirror> argTypes = new ArrayList<>();
   457         for (VariableElement p: params){
   457         for (VariableElement p: params){
   458             argTypes.add(types.erasure(p.asType()));
   458             argTypes.add(types.erasure(p.asType()));
   459         }
   459         }
   460 
   460 
   461         /* It would have been nice to include the argument names in the
   461         /* It would have been nice to include the argument names in the
   486         String res = "Java_" + cname + "_" + method.getSimpleName();
   486         String res = "Java_" + cname + "_" + method.getSimpleName();
   487 
   487 
   488         if (longName) {
   488         if (longName) {
   489             TypeMirror mType =  types.erasure(method.getReturnType());
   489             TypeMirror mType =  types.erasure(method.getReturnType());
   490             List<? extends VariableElement> params = method.getParameters();
   490             List<? extends VariableElement> params = method.getParameters();
   491             List<TypeMirror> argTypes = new ArrayList<TypeMirror>();
   491             List<TypeMirror> argTypes = new ArrayList<>();
   492             for (VariableElement param: params) {
   492             for (VariableElement param: params) {
   493                 argTypes.add(types.erasure(param.asType()));
   493                 argTypes.add(types.erasure(param.asType()));
   494             }
   494             }
   495 
   495 
   496             res = res + "__";
   496             res = res + "__";