6572945: javah should be written as an annotation processor, not a doclet

Reviewed-by: darcy
This commit is contained in:
Jonathan Gibbons 2009-09-23 19:15:04 -07:00
parent 6e3d970196
commit e116c27b51
36 changed files with 6639 additions and 1038 deletions

View file

@ -0,0 +1,239 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
/*
* @test
* @bug 6572945
* @summary rewrite javah as an annotation processor, instead of as a doclet
* @build TestClass1 TestClass2 TestClass3
* @run main T6572945
*/
import java.io.*;
import java.util.*;
import com.sun.tools.javah.Main;
public class T6572945
{
static File testSrc = new File(System.getProperty("test.src", "."));
static File testClasses = new File(System.getProperty("test.classes", "."));
static boolean isWindows = System.getProperty("os.name").startsWith("Windows");
public static void main(String... args)
throws IOException, InterruptedException
{
boolean ok = new T6572945().run(args);
if (!ok)
throw new Error("Test Failed");
}
public boolean run(String[] args)
throws IOException, InterruptedException
{
if (args.length == 1)
jdk = new File(args[0]);
test("-o", "jni.file.1", "-jni", "TestClass1");
test("-o", "jni.file.2", "-jni", "TestClass1", "TestClass2");
test("-d", "jni.dir.1", "-jni", "TestClass1", "TestClass2");
test("-o", "jni.file.3", "-jni", "TestClass3");
// The following tests are disabled because llni support has been
// discontinued, and because bugs in old javah means that character
// for character testing against output from old javah does not work.
// In fact, the LLNI impl in new javah is actually better than the
// impl in old javah because of a couple of significant bug fixes.
// test("-o", "llni.file.1", "-llni", "TestClass1");
// test("-o", "llni.file.2", "-llni", "TestClass1", "TestClass2");
// test("-d", "llni.dir.1", "-llni", "TestClass1", "TestClass2");
// test("-o", "llni.file.3", "-llni", "TestClass3");
return (errors == 0);
}
void test(String... args)
throws IOException, InterruptedException
{
String[] cp_args = new String[args.length + 2];
cp_args[0] = "-classpath";
cp_args[1] = testClasses.getPath();
System.arraycopy(args, 0, cp_args, 2, args.length);
if (jdk != null)
init(cp_args);
File out = null;
for (int i = 0; i < args.length; i++) {
if (args[i].equals("-o")) {
out = new File(args[++i]);
break;
} else if (args[i].equals("-d")) {
out = new File(args[++i]);
out.mkdirs();
break;
}
}
try {
System.out.println("test: " + Arrays.asList(cp_args));
// // Uncomment and use the following lines to execute javah via the
// // command line -- for example, to run old javah and set up the golden files
// List<String> cmd = new ArrayList<String>();
// File javaHome = new File(System.getProperty("java.home"));
// if (javaHome.getName().equals("jre"))
// javaHome = javaHome.getParentFile();
// File javah = new File(new File(javaHome, "bin"), "javah");
// cmd.add(javah.getPath());
// cmd.addAll(Arrays.asList(cp_args));
// ProcessBuilder pb = new ProcessBuilder(cmd);
// pb.redirectErrorStream(true);
// pb.start();
// Process p = pb.start();
// String line;
// BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
// while ((line = in.readLine()) != null)
// System.err.println(line);
// in.close();
// int rc = p.waitFor();
// Use new javah
PrintWriter err = new PrintWriter(System.err, true);
int rc = Main.run(cp_args, err);
if (rc != 0) {
error("javah failed: rc=" + rc);
return;
}
// The golden files use the LL suffix for long constants, which
// is used on Linux and Solaris. On Windows, the suffix is i64,
// so compare will update the golden files on the fly before the
// final comparison.
compare(new File(new File(testSrc, "gold"), out.getName()), out);
} catch (Throwable t) {
t.printStackTrace();
error("javah threw exception");
}
}
void init(String[] args) throws IOException, InterruptedException {
String[] cmdArgs = new String[args.length + 1];
cmdArgs[0] = new File(new File(jdk, "bin"), "javah").getPath();
System.arraycopy(args, 0, cmdArgs, 1, args.length);
System.out.println("init: " + Arrays.asList(cmdArgs));
ProcessBuilder pb = new ProcessBuilder(cmdArgs);
pb.directory(new File(testSrc, "gold"));
pb.redirectErrorStream(true);
Process p = pb.start();
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
while ((line = in.readLine()) != null)
System.out.println("javah: " + line);
int rc = p.waitFor();
if (rc != 0)
error("javah: exit code " + rc);
}
/** Compare two directories.
* @param f1 The golden directory
* @param f2 The directory to be compared
*/
void compare(File f1, File f2) {
compare(f1, f2, null);
}
/** Compare two files or directories
* @param f1 The golden directory
* @param f2 The directory to be compared
* @param p An optional path identifying a file within the two directories
*/
void compare(File f1, File f2, String p) {
File f1p = (p == null ? f1 : new File(f1, p));
File f2p = (p == null ? f2 : new File(f2, p));
System.out.println("compare " + f1p + " " + f2p);
if (f1p.isDirectory() && f2p.isDirectory()) {
Set<String> children = new HashSet<String>();
children.addAll(Arrays.asList(f1p.list()));
children.addAll(Arrays.asList(f2p.list()));
for (String c: children) {
compare(f1, f2, new File(p, c).getPath()); // null-safe for p
}
}
else if (f1p.isFile() && f2p.isFile()) {
String s1 = read(f1p);
if (isWindows) {
// f1/s1 is the golden file
// on Windows, long constants use the i64 suffix, not LL
s1 = s1.replaceAll("( [0-9]+)LL\n", "$1i64\n");
}
String s2 = read(f2p);
if (!s1.equals(s2)) {
System.out.println("File: " + f1p + "\n" + s1);
System.out.println("File: " + f2p + "\n" + s2);
error("Files differ: " + f1p + " " + f2p);
}
}
else if (f1p.exists() && !f2p.exists())
error("Only in " + f1 + ": " + p);
else if (f2p.exists() && !f1p.exists())
error("Only in " + f2 + ": " + p);
else
error("Files differ: " + f1p + " " + f2p);
}
private String read(File f) {
try {
BufferedReader in = new BufferedReader(new FileReader(f));
try {
StringBuilder sb = new StringBuilder((int) f.length());
String line;
while ((line = in.readLine()) != null) {
sb.append(line);
sb.append("\n");
}
return sb.toString();
} finally {
try {
in.close();
} catch (IOException e) {
}
}
} catch (IOException e) {
error("error reading " + f + ": " + e);
return "";
}
}
private void error(String msg) {
System.out.println(msg);
errors++;
}
private int errors;
private File jdk;
}

View file

@ -0,0 +1,475 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import java.util.List;
public class TestClass1 {
// simple types
byte b;
short s;
int i;
long l;
float f;
double d;
Object o;
String t;
List<String> g;
// constants
static final byte bc = 0;
static final short sc = 0;
static final int ic = 0;
static final long lc = 0;
static final float fc = 0;
static final double dc = 0;
static final Object oc = null;
static final String tc = "";
static final List<String> gc = null;
// simple arrays
byte[] ba;
short[] sa; // not handled corrected by javah v6
int[] ia;
long[] la;
float[] fa;
double[] da;
Object[] oa;
String[] ta;
List<String>[] ga;
// multidimensional arrays
byte[][] baa;
short[][] saa;
int[][] iaa;
long[][] laa;
float[][] faa;
double[][] daa;
Object[][] oaa;
String[][] taa;
List<String>[] gaa;
// simple Java methods
byte bm() { return 0; }
short sm() { return 0; }
int im() { return 0; }
long lm() { return 0; }
float fm() { return 0; }
double dm() { return 0; }
Object om() { return null; }
String tm() { return ""; }
List<String> gm() { return null; }
void vm() { }
byte[] bam() { return null; }
short[] sam() { return null; }
int[] iam() { return null; }
long[] lam() { return null; }
float[] fam() { return null; }
double[] dam() { return null; }
Object[] oam() { return null; }
String[] tam() { return null; }
List<String>[] gam() { return null; }
byte[][] baam() { return null; }
short[][] saam() { return null; }
int[][] iaam() { return null; }
long[][] laam() { return null; }
float[][] faam() { return null; }
double[][] daam() { return null; }
Object[][] oaam() { return null; }
String[][] taam() { return null; }
List<String>[] gaam() { return null; }
// simple native methods
native byte bmn();
native short smn();
native int imn();
native long lmn();
native float fmn();
native double dmn();
native Object omn();
native String tmn();
native List<String> gmn();
native void vmn();
native byte[] bamn();
native short[] samn();
native int[] iamn();
native long[] lamn();
native float[] famn();
native double[] damn();
native Object[] oamn();
native String[] tamn();
native List<String>[] gamn();
native byte[][] baamn();
native short[][] saamn();
native int[][] iaamn();
native long[][] laamn();
native float[][] faamn();
native double[][] daamn();
native Object[][] oaamn();
native String[][] taamn();
native List<String>[] gaamn();
// overloaded Java methods
byte bm1() { return 0; }
short sm1() { return 0; }
int im1() { return 0; }
long lm1() { return 0; }
float fm1() { return 0; }
double dm1() { return 0; }
Object om1() { return null; }
String tm1() { return ""; }
List<String> gm1() { return null; }
void vm1() { }
byte bm2(int i) { return 0; }
short sm2(int i) { return 0; }
int im2(int i) { return 0; }
long lm2(int i) { return 0; }
float fm2(int i) { return 0; }
double dm2(int i) { return 0; }
Object om2(int i) { return null; }
String tm2(int i) { return ""; }
List<String> gm2(int i) { return null; }
void vm2(int i) { }
// overloaded native methods
native byte bmn1();
native short smn1();
native int imn1();
native long lmn1();
native float fmn1();
native double dmn1();
native Object omn1();
native String tmn1();
native List<String> gmn1();
native void vmn1();
native byte bmn2(int i);
native short smn2(int i);
native int imn2(int i);
native long lmn2(int i);
native float fmn2(int i);
native double dmn2(int i);
native Object omn2(int i);
native String tmn2(int i);
native List<String> gmn2(int i);
native void vmn2(int i);
// arg types for Java methods
void mb(byte b) { }
void ms(short s) { }
void mi(int i) { }
void ml(long l) { }
void mf(float f) { }
void md(double d) { }
void mo(Object o) { }
void mt(String t) { }
void mg(List<String> g) { }
// arg types for native methods
native void mbn(byte b);
native void msn(short s);
native void min(int i);
native void mln(long l);
native void mfn(float f);
native void mdn(double d);
native void mon(Object o);
native void mtn(String t);
native void mgn(List<String> g);
static class Inner1 {
// simple types
byte b;
short s;
int i;
long l;
float f;
double d;
Object o;
String t;
List<String> g;
// constants
static final byte bc = 0;
static final short sc = 0;
static final int ic = 0;
static final long lc = 0;
static final float fc = 0;
static final double dc = 0;
static final Object oc = null;
static final String tc = "";
static final List<String> gc = null;
// simple arrays
byte[] ba;
// short[] sa; // not handled corrected by javah v6
int[] ia;
long[] la;
float[] fa;
double[] da;
Object[] oa;
String[] ta;
List<String>[] ga;
// multidimensional arrays
byte[][] baa;
short[][] saa;
int[][] iaa;
long[][] laa;
float[][] faa;
double[][] daa;
Object[][] oaa;
String[][] taa;
List<String>[] gaa;
// simple Java methods
byte bm() { return 0; }
short sm() { return 0; }
int im() { return 0; }
long lm() { return 0; }
float fm() { return 0; }
double dm() { return 0; }
Object om() { return null; }
String tm() { return ""; }
List<String> gm() { return null; }
void vm() { }
// simple native methods
native byte bmn();
native short smn();
native int imn();
native long lmn();
native float fmn();
native double dmn();
native Object omn();
native String tmn();
native List<String> gmn();
native void vmn();
// overloaded Java methods
byte bm1() { return 0; }
short sm1() { return 0; }
int im1() { return 0; }
long lm1() { return 0; }
float fm1() { return 0; }
double dm1() { return 0; }
Object om1() { return null; }
String tm1() { return ""; }
List<String> gm1() { return null; }
void vm1() { }
byte bm2(int i) { return 0; }
short sm2(int i) { return 0; }
int im2(int i) { return 0; }
long lm2(int i) { return 0; }
float fm2(int i) { return 0; }
double dm2(int i) { return 0; }
Object om2(int i) { return null; }
String tm2(int i) { return ""; }
List<String> gm2(int i) { return null; }
void vm2(int i) { }
// overloaded native methods
native byte bmn1();
native short smn1();
native int imn1();
native long lmn1();
native float fmn1();
native double dmn1();
native Object omn1();
native String tmn1();
native List<String> gmn1();
native void vmn1();
native byte bmn2(int i);
native short smn2(int i);
native int imn2(int i);
native long lmn2(int i);
native float fmn2(int i);
native double dmn2(int i);
native Object omn2(int i);
native String tmn2(int i);
native List<String> gmn2(int i);
native void vmn2(int i);
// arg types for Java methods
void mb(byte b) { }
void ms(short s) { }
void mi(int i) { }
void ml(long l) { }
void mf(float f) { }
void md(double d) { }
void mo(Object o) { }
void mt(String t) { }
void mg(List<String> g) { }
// arg types for native methods
native void mbn(byte b);
native void msn(short s);
native void min(int i);
native void mln(long l);
native void mfn(float f);
native void mdn(double d);
native void mon(Object o);
native void mtn(String t);
native void mgn(List<String> g);
}
class Inner2 {
// simple types
byte b;
short s;
int i;
long l;
float f;
double d;
Object o;
String t;
List<String> g;
// constants
static final byte bc = 0;
static final short sc = 0;
static final int ic = 0;
static final long lc = 0;
static final float fc = 0;
static final double dc = 0;
//static final Object oc = null;
static final String tc = "";
//static final List<String> gc = null;
// simple arrays
byte[] ba;
// short[] sa; // not handled corrected by javah v6
int[] ia;
long[] la;
float[] fa;
double[] da;
Object[] oa;
String[] ta;
List<String>[] ga;
// multidimensional arrays
byte[][] baa;
short[][] saa;
int[][] iaa;
long[][] laa;
float[][] faa;
double[][] daa;
Object[][] oaa;
String[][] taa;
List<String>[] gaa;
// simple Java methods
byte bm() { return 0; }
short sm() { return 0; }
int im() { return 0; }
long lm() { return 0; }
float fm() { return 0; }
double dm() { return 0; }
Object om() { return null; }
String tm() { return ""; }
List<String> gm() { return null; }
void vm() { }
// simple native methods
native byte bmn();
native short smn();
native int imn();
native long lmn();
native float fmn();
native double dmn();
native Object omn();
native String tmn();
native List<String> gmn();
native void vmn();
// overloaded Java methods
byte bm1() { return 0; }
short sm1() { return 0; }
int im1() { return 0; }
long lm1() { return 0; }
float fm1() { return 0; }
double dm1() { return 0; }
Object om1() { return null; }
String tm1() { return ""; }
List<String> gm1() { return null; }
void vm1() { }
byte bm2(int i) { return 0; }
short sm2(int i) { return 0; }
int im2(int i) { return 0; }
long lm2(int i) { return 0; }
float fm2(int i) { return 0; }
double dm2(int i) { return 0; }
Object om2(int i) { return null; }
String tm2(int i) { return ""; }
List<String> gm2(int i) { return null; }
void vm2(int i) { }
// overloaded native methods
native byte bmn1();
native short smn1();
native int imn1();
native long lmn1();
native float fmn1();
native double dmn1();
native Object omn1();
native String tmn1();
native List<String> gmn1();
native void vmn1();
native byte bmn2(int i);
native short smn2(int i);
native int imn2(int i);
native long lmn2(int i);
native float fmn2(int i);
native double dmn2(int i);
native Object omn2(int i);
native String tmn2(int i);
native List<String> gmn2(int i);
native void vmn2(int i);
// arg types for Java methods
void mb(byte b) { }
void ms(short s) { }
void mi(int i) { }
void ml(long l) { }
void mf(float f) { }
void md(double d) { }
void mo(Object o) { }
void mt(String t) { }
void mg(List<String> g) { }
// arg types for native methods
native void mbn(byte b);
native void msn(short s);
native void min(int i);
native void mln(long l);
native void mfn(float f);
native void mdn(double d);
native void mon(Object o);
native void mtn(String t);
native void mgn(List<String> g);
}
}

View file

@ -0,0 +1,33 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
public class TestClass2 {
byte b;
short s;
int i;
long l;
float f;
double d;
Object o;
String t;
}

View file

@ -0,0 +1,51 @@
/*
* Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
public class TestClass3 {
public int tc3;
public class Inner1 {
public int tc3i1;
public class Inner1A {
public int tc3i1i1a;
}
public class Inner1B {
public int tc3i1i1b;
}
}
public class Inner2 {
public int tc321;
public class Inner2A {
public int tc3i2i2a;
}
public class Inner2B {
public int tc3i2i2b;
}
}
}

View file

@ -0,0 +1,481 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestClass1 */
#ifndef _Included_TestClass1
#define _Included_TestClass1
#ifdef __cplusplus
extern "C" {
#endif
#undef TestClass1_bc
#define TestClass1_bc 0L
#undef TestClass1_sc
#define TestClass1_sc 0L
#undef TestClass1_ic
#define TestClass1_ic 0L
#undef TestClass1_lc
#define TestClass1_lc 0LL
#undef TestClass1_fc
#define TestClass1_fc 0.0f
#undef TestClass1_dc
#define TestClass1_dc 0.0
/*
* Class: TestClass1
* Method: bmn
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_bmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: smn
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_smn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: imn
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_imn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: lmn
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_lmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: fmn
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_fmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: dmn
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_dmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: omn
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_omn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: tmn
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_tmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: gmn
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_gmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: vmn
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_vmn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: bamn
* Signature: ()[B
*/
JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: samn
* Signature: ()[S
*/
JNIEXPORT jshortArray JNICALL Java_TestClass1_samn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: iamn
* Signature: ()[I
*/
JNIEXPORT jintArray JNICALL Java_TestClass1_iamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: lamn
* Signature: ()[J
*/
JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: famn
* Signature: ()[F
*/
JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: damn
* Signature: ()[D
*/
JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: oamn
* Signature: ()[Ljava/lang/Object;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: tamn
* Signature: ()[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: gamn
* Signature: ()[Ljava/util/List;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: baamn
* Signature: ()[[B
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: saamn
* Signature: ()[[S
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: iaamn
* Signature: ()[[I
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: laamn
* Signature: ()[[J
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: faamn
* Signature: ()[[F
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: daamn
* Signature: ()[[D
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: oaamn
* Signature: ()[[Ljava/lang/Object;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: taamn
* Signature: ()[[Ljava/lang/String;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: gaamn
* Signature: ()[Ljava/util/List;
*/
JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: bmn1
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: smn1
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_smn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: imn1
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_imn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: lmn1
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_lmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: fmn1
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: dmn1
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: omn1
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_omn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: tmn1
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_tmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: gmn1
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_gmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: vmn1
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_vmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1
* Method: bmn2
* Signature: (I)B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: smn2
* Signature: (I)S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_smn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: imn2
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_TestClass1_imn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: lmn2
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_lmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: fmn2
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: dmn2
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: omn2
* Signature: (I)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_omn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: tmn2
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_tmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: gmn2
* Signature: (I)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_gmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: vmn2
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_vmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: mbn
* Signature: (B)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mbn
(JNIEnv *, jobject, jbyte);
/*
* Class: TestClass1
* Method: msn
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_TestClass1_msn
(JNIEnv *, jobject, jshort);
/*
* Class: TestClass1
* Method: min
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_min
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1
* Method: mln
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mln
(JNIEnv *, jobject, jlong);
/*
* Class: TestClass1
* Method: mfn
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mfn
(JNIEnv *, jobject, jfloat);
/*
* Class: TestClass1
* Method: mdn
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mdn
(JNIEnv *, jobject, jdouble);
/*
* Class: TestClass1
* Method: mon
* Signature: (Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mon
(JNIEnv *, jobject, jobject);
/*
* Class: TestClass1
* Method: mtn
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mtn
(JNIEnv *, jobject, jstring);
/*
* Class: TestClass1
* Method: mgn
* Signature: (Ljava/util/List;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_mgn
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,337 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestClass1_Inner1 */
#ifndef _Included_TestClass1_Inner1
#define _Included_TestClass1_Inner1
#ifdef __cplusplus
extern "C" {
#endif
#undef TestClass1_Inner1_bc
#define TestClass1_Inner1_bc 0L
#undef TestClass1_Inner1_sc
#define TestClass1_Inner1_sc 0L
#undef TestClass1_Inner1_ic
#define TestClass1_Inner1_ic 0L
#undef TestClass1_Inner1_lc
#define TestClass1_Inner1_lc 0LL
#undef TestClass1_Inner1_fc
#define TestClass1_Inner1_fc 0.0f
#undef TestClass1_Inner1_dc
#define TestClass1_Inner1_dc 0.0
/*
* Class: TestClass1_Inner1
* Method: bmn
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: smn
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: imn
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: lmn
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: fmn
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: dmn
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: omn
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: tmn
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: gmn
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: vmn
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: bmn1
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: smn1
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: imn1
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: lmn1
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: fmn1
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: dmn1
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: omn1
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: tmn1
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: gmn1
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: vmn1
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner1
* Method: bmn2
* Signature: (I)B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: smn2
* Signature: (I)S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: imn2
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: lmn2
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: fmn2
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: dmn2
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: omn2
* Signature: (I)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: tmn2
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: gmn2
* Signature: (I)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: vmn2
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: mbn
* Signature: (B)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn
(JNIEnv *, jobject, jbyte);
/*
* Class: TestClass1_Inner1
* Method: msn
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn
(JNIEnv *, jobject, jshort);
/*
* Class: TestClass1_Inner1
* Method: min
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner1
* Method: mln
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln
(JNIEnv *, jobject, jlong);
/*
* Class: TestClass1_Inner1
* Method: mfn
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn
(JNIEnv *, jobject, jfloat);
/*
* Class: TestClass1_Inner1
* Method: mdn
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn
(JNIEnv *, jobject, jdouble);
/*
* Class: TestClass1_Inner1
* Method: mon
* Signature: (Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon
(JNIEnv *, jobject, jobject);
/*
* Class: TestClass1_Inner1
* Method: mtn
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn
(JNIEnv *, jobject, jstring);
/*
* Class: TestClass1_Inner1
* Method: mgn
* Signature: (Ljava/util/List;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,337 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestClass1_Inner2 */
#ifndef _Included_TestClass1_Inner2
#define _Included_TestClass1_Inner2
#ifdef __cplusplus
extern "C" {
#endif
#undef TestClass1_Inner2_bc
#define TestClass1_Inner2_bc 0L
#undef TestClass1_Inner2_sc
#define TestClass1_Inner2_sc 0L
#undef TestClass1_Inner2_ic
#define TestClass1_Inner2_ic 0L
#undef TestClass1_Inner2_lc
#define TestClass1_Inner2_lc 0LL
#undef TestClass1_Inner2_fc
#define TestClass1_Inner2_fc 0.0f
#undef TestClass1_Inner2_dc
#define TestClass1_Inner2_dc 0.0
/*
* Class: TestClass1_Inner2
* Method: bmn
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: smn
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: imn
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: lmn
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: fmn
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: dmn
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: omn
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: tmn
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: gmn
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: vmn
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: bmn1
* Signature: ()B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: smn1
* Signature: ()S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: imn1
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: lmn1
* Signature: ()J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: fmn1
* Signature: ()F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: dmn1
* Signature: ()D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: omn1
* Signature: ()Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: tmn1
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: gmn1
* Signature: ()Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: vmn1
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1
(JNIEnv *, jobject);
/*
* Class: TestClass1_Inner2
* Method: bmn2
* Signature: (I)B
*/
JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: smn2
* Signature: (I)S
*/
JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: imn2
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: lmn2
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: fmn2
* Signature: (I)F
*/
JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: dmn2
* Signature: (I)D
*/
JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: omn2
* Signature: (I)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: tmn2
* Signature: (I)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: gmn2
* Signature: (I)Ljava/util/List;
*/
JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: vmn2
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: mbn
* Signature: (B)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn
(JNIEnv *, jobject, jbyte);
/*
* Class: TestClass1_Inner2
* Method: msn
* Signature: (S)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn
(JNIEnv *, jobject, jshort);
/*
* Class: TestClass1_Inner2
* Method: min
* Signature: (I)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min
(JNIEnv *, jobject, jint);
/*
* Class: TestClass1_Inner2
* Method: mln
* Signature: (J)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln
(JNIEnv *, jobject, jlong);
/*
* Class: TestClass1_Inner2
* Method: mfn
* Signature: (F)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn
(JNIEnv *, jobject, jfloat);
/*
* Class: TestClass1_Inner2
* Method: mdn
* Signature: (D)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn
(JNIEnv *, jobject, jdouble);
/*
* Class: TestClass1_Inner2
* Method: mon
* Signature: (Ljava/lang/Object;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon
(JNIEnv *, jobject, jobject);
/*
* Class: TestClass1_Inner2
* Method: mtn
* Signature: (Ljava/lang/String;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn
(JNIEnv *, jobject, jstring);
/*
* Class: TestClass1_Inner2
* Method: mgn
* Signature: (Ljava/util/List;)V
*/
JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mgn
(JNIEnv *, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -0,0 +1,13 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestClass2 */
#ifndef _Included_TestClass2
#define _Included_TestClass2
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,79 @@
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class TestClass3 */
#ifndef _Included_TestClass3
#define _Included_TestClass3
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner2 */
#ifndef _Included_TestClass3_Inner2
#define _Included_TestClass3_Inner2
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner2_Inner2B */
#ifndef _Included_TestClass3_Inner2_Inner2B
#define _Included_TestClass3_Inner2_Inner2B
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner2_Inner2A */
#ifndef _Included_TestClass3_Inner2_Inner2A
#define _Included_TestClass3_Inner2_Inner2A
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner1 */
#ifndef _Included_TestClass3_Inner1
#define _Included_TestClass3_Inner1
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner1_Inner1B */
#ifndef _Included_TestClass3_Inner1_Inner1B
#define _Included_TestClass3_Inner1_Inner1B
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif
/* Header for class TestClass3_Inner1_Inner1A */
#ifndef _Included_TestClass3_Inner1_Inner1A
#define _Included_TestClass3_Inner1_Inner1A
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif
#endif

View file

@ -77,10 +77,7 @@ GENERATED_HEADER_FILE=ParamClassTest.h
rm -f ParamClassTest.class MissingParamClassException.class ParamClassTest.h
rm -f ${TMP1}
cp ${TESTSRC}${FS}ParamClassTest.java .
cp ${TESTSRC}${FS}MissingParamClassException.java .
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java"
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java"
# Before running javah remove dependent class file
rm -f MissingParamClassException.class
@ -88,15 +85,12 @@ rm -f MissingParamClassException.class
"${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1}
if [ -f $GENERATED_HEADER_FILE ]; then
echo "Failed"
exit 1
echo "1-- Failed: $GENERATED_HEADER_FILE found"
rc=1
fi
if [ ! -f ${TMP1} ]; then
echo "Failed"
exit 1
else
echo "Passed"
exit 0
if [ ! -s ${TMP1} ]; then
echo "1-- Failed: ${TMP1} is empty"
rc=1
fi
# Clean out work dir
@ -104,7 +98,9 @@ rm -f MissingParamClassException.class ParamClassTest.class
rm -f $GENERATED_HEADER_FILE $TMP1
# Re-compile everything
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}ParamClassTest.java
"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java"
# Before re-run of javah remove dependent class file Param.class
rm -f Param.class
@ -112,13 +108,17 @@ rm -f Param.class
"${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1}
if [ -f $GENERATED_HEADER_FILE ]; then
echo "Failed"
exit 1
echo "2-- Failed: $GENERATED_HEADER_FILE found"
rc=1
fi
if [ ! -f ${TMP1} ]; then
echo "Failed"
exit 1
if [ ! -s ${TMP1} ]; then
echo "2-- Failed: ${TMP1} is empty"
rc=1
fi
if [ "$rc" = "" ]; then
echo Passed
else
echo "Passed"
exit 0
echo Failed
exit 1
fi

View file

@ -0,0 +1,265 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Enumeration;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import com.sun.tools.classfile.AccessFlags;
import com.sun.tools.classfile.ClassFile;
import com.sun.tools.classfile.ConstantPoolException;
import com.sun.tools.classfile.Method;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.util.LinkedHashSet;
public class CompareTest {
String[][] testCases = {
{ },
{ "-jni" },
// { "-llni" },
};
public static void main(String... args) throws Exception {
new CompareTest().run(args);
}
public void run(String... args) throws Exception {
old_javah_cmd = new File(args[0]);
rt_jar = new File(args[1]);
Set<String> testClasses;
if (args.length > 2) {
testClasses = new LinkedHashSet<String>(Arrays.asList(Arrays.copyOfRange(args, 2, args.length)));
} else
testClasses = getNativeClasses(new JarFile(rt_jar));
for (String[] options: testCases) {
for (String name: testClasses) {
test(Arrays.asList(options), rt_jar, name);
}
}
if (errors == 0)
System.out.println(count + " tests passed");
else
throw new Exception(errors + "/" + count + " tests failed");
}
public void test(List<String> options, File bootclasspath, String className)
throws IOException, InterruptedException {
System.err.println("test: " + options + " " + className);
count++;
testOptions = options;
testClassName = className;
File oldOutDir = initDir(file(new File("old"), className));
int old_rc = old_javah(options, oldOutDir, bootclasspath, className);
File newOutDir = initDir(file(new File("new"), className));
int new_rc = new_javah(options, newOutDir, bootclasspath, className);
if (old_rc != new_rc)
error("return codes differ; old: " + old_rc + ", new: " + new_rc);
compare(oldOutDir, newOutDir);
}
int old_javah(List<String> options, File outDir, File bootclasspath, String className)
throws IOException, InterruptedException {
List<String> cmd = new ArrayList<String>();
cmd.add(old_javah_cmd.getPath());
cmd.addAll(options);
cmd.add("-d");
cmd.add(outDir.getPath());
cmd.add("-bootclasspath");
cmd.add(bootclasspath.getPath());
cmd.add(className);
System.err.println("old_javah: " + cmd);
ProcessBuilder pb = new ProcessBuilder(cmd);
pb.redirectErrorStream(true);
Process p = pb.start();
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while ((line = in.readLine()) != null) {
sb.append(line);
sb.append("\n");
}
System.err.println("old javah out: " + sb.toString());
return p.waitFor();
}
int new_javah(List<String> options, File outDir, File bootclasspath, String className) {
List<String> args = new ArrayList<String>();
args.addAll(options);
args.add("-d");
args.add(outDir.getPath());
args.add("-bootclasspath");
args.add(bootclasspath.getPath());
args.add(className);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
int rc = com.sun.tools.javah.Main.run(args.toArray(new String[args.size()]), pw);
pw.close();
System.err.println("new javah out: " + sw.toString());
return rc;
}
Set<String> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException {
System.err.println("getNativeClasses: " + jar.getName());
Set<String> results = new TreeSet<String>();
Enumeration<JarEntry> e = jar.entries();
while (e.hasMoreElements()) {
JarEntry je = e.nextElement();
if (isNativeClass(jar, je)) {
String name = je.getName();
results.add(name.substring(0, name.length() - 6).replace("/", "."));
}
}
return results;
}
boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException {
String name = entry.getName();
if (name.startsWith("META-INF") || !name.endsWith(".class"))
return false;
//String className = name.substring(0, name.length() - 6).replace("/", ".");
//System.err.println("check " + className);
InputStream in = jar.getInputStream(entry);
ClassFile cf = ClassFile.read(in);
for (int i = 0; i < cf.methods.length; i++) {
Method m = cf.methods[i];
if (m.access_flags.is(AccessFlags.ACC_NATIVE)) {
// System.err.println(className);
return true;
}
}
return false;
}
void compare(File f1, File f2) throws IOException {
if (f1.isFile() && f2.isFile())
compareFiles(f1, f2);
else if (f1.isDirectory() && f2.isDirectory())
compareDirectories(f1, f2);
else
error("files differ: "
+ f1 + " (" + getFileType(f1) + "), "
+ f2 + " (" + getFileType(f2) + ")");
}
void compareDirectories(File d1, File d2) throws IOException {
Set<String> list = new TreeSet<String>();
list.addAll(Arrays.asList(d1.list()));
list.addAll(Arrays.asList(d2.list()));
for (String c: list)
compare(new File(d1, c), new File(d2, c));
}
void compareFiles(File f1, File f2) throws IOException {
byte[] c1 = readFile(f1);
byte[] c2 = readFile(f2);
if (!Arrays.equals(c1, c2))
error("files differ: " + f1 + ", " + f2);
}
byte[] readFile(File file) throws IOException {
int size = (int) file.length();
byte[] data = new byte[size];
DataInputStream in = new DataInputStream(new FileInputStream(file));
try {
in.readFully(data);
} finally {
in.close();
}
return data;
}
String getFileType(File f) {
return f.isDirectory() ? "directory"
: f.isFile() ? "file"
: f.exists() ? "other"
: "not found";
}
/**
* Set up an empty directory.
*/
public File initDir(File dir) {
if (dir.exists())
deleteAll(dir);
dir.mkdirs();
return dir;
}
/**
* Delete a file or a directory (including all its contents).
*/
boolean deleteAll(File file) {
if (file.isDirectory()) {
for (File f: file.listFiles())
deleteAll(f);
}
return file.delete();
}
File file(File dir, String... path) {
File f = dir;
for (String p: path)
f = new File(f, p);
return f;
}
/**
* Report an error.
*/
void error(String msg, String... more) {
System.err.println("test: " + testOptions + " " + testClassName);
System.err.println("error: " + msg);
for (String s: more)
System.err.println(s);
errors++;
System.exit(1);
}
File old_javah_cmd;
File rt_jar;
List<String> testOptions;
String testClassName;
int count;
int errors;
}

View file

@ -0,0 +1,43 @@
#!/bin/sh
#
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation.
#
# This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code).
#
# You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
#
# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
# CA 95054 USA or visit www.sun.com if you need additional information or
# have any questions.
#
jdk=${1:-/opt/jdk/1.6.0}
javah=${jdk}/bin/javah
rtjar=${jdk}/jre/lib/rt.jar
# compile test
mkdir -p build/compareTest
/opt/jdk/1.7.0/bin/javac -classpath build/classes -d build/compareTest test/tools/javah/compareTest/*.java
# run test
/opt/jdk/1.7.0/bin/java -classpath build/compareTest:build/classes CompareTest $javah $rtjar 2>&1 | tee CompareTest.out
# show diffs for tests that failed
grep 'error:' CompareTest.out | sed -e 's|.*new/||' -e 's/\.h$//' -e 's|_|.|g' > CompareTest.classes.fail
for i in $(cat CompareTest.classes.fail) ; do
/opt/jdk/1.7.0/bin/java -classpath compareTest:build/classes CompareTest $javah $rtjar $i
diff -r old new
done

View file

@ -0,0 +1,86 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
* have any questions.
*/
import java.io.IOException;
import java.io.InputStream;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import com.sun.tools.classfile.AccessFlags;
import com.sun.tools.classfile.ClassFile;
import com.sun.tools.classfile.ConstantPoolException;
import com.sun.tools.classfile.Method;
import java.util.Comparator;
import java.util.Set;
import java.util.TreeSet;
public class FindNativeFiles {
public static void main(String[] args) throws IOException, ConstantPoolException {
new FindNativeFiles().run(args);
}
public void run(String[] args) throws IOException, ConstantPoolException {
JarFile jar = new JarFile(args[0]);
Set<JarEntry> entries = getNativeClasses(jar);
for (JarEntry e: entries) {
String name = e.getName();
String className = name.substring(0, name.length() - 6).replace("/", ".");
System.out.println(className);
}
}
Set<JarEntry> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException {
Set<JarEntry> results = new TreeSet<JarEntry>(new Comparator<JarEntry>() {
public int compare(JarEntry o1, JarEntry o2) {
return o1.getName().compareTo(o2.getName());
}
});
Enumeration<JarEntry> e = jar.entries();
while (e.hasMoreElements()) {
JarEntry je = e.nextElement();
if (isNativeClass(jar, je))
results.add(je);
}
return results;
}
boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException {
String name = entry.getName();
if (name.startsWith("META-INF") || !name.endsWith(".class"))
return false;
//String className = name.substring(0, name.length() - 6).replace("/", ".");
//System.err.println("check " + className);
InputStream in = jar.getInputStream(entry);
ClassFile cf = ClassFile.read(in);
in.close();
for (int i = 0; i < cf.methods.length; i++) {
Method m = cf.methods[i];
if (m.access_flags.is(AccessFlags.ACC_NATIVE)) {
// System.err.println(className);
return true;
}
}
return false;
}
}

View file

@ -0,0 +1,16 @@
test/tools/javah/compareTest/README
This directory contains a program for comparing the output of new javah against the
output of JDK 6 or other older versions of javah.
It cannot be run automatically because of the need for the older version of javah
to compare against.
The test works by scanning a jar file, such as rt.jar, looking for all files with
native methods. It then runs both the old and new versions of javah on those
classes with native methods, and verifies that the results are character-for-character
identical.
To run the test, build langtools, then execute the script in the root langtools
directory, providing the location of the JDK to be tested. The default is
/opt/jdk/1.6.0.