Wed, 07 Oct 2009 14:14:45 -0700
Merge
src/share/classes/com/sun/tools/javac/file/Old199.java | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/MainDoclet.java | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/resources/Linux_ppc.properties | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/resources/Linux_sparc.properties | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/resources/SunOS_sparc.properties | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/resources/SunOS_sparcv9.properties | file | annotate | diff | comparison | revisions | |
src/share/classes/com/sun/tools/javah/resources/win32_x86.properties | file | annotate | diff | comparison | revisions |
1.1 --- a/make/build.xml Fri Oct 02 11:26:53 2009 -0700 1.2 +++ b/make/build.xml Wed Oct 07 14:14:45 2009 -0700 1.3 @@ -286,10 +286,10 @@ 1.4 jarclasspath="javadoc.jar doclets.jar javac.jar"/> 1.5 </target> 1.6 1.7 - <target name="build-javah" depends="build-javadoc"> 1.8 + <target name="build-javah" depends="build-javac"> 1.9 <build-tool name="javah" 1.10 includes="${javah.includes}" 1.11 - jarclasspath="javadoc.jar doclets.jar javac.jar"/> 1.12 + jarclasspath="javac.jar"/> 1.13 </target> 1.14 1.15 <target name="build-classes-javah" depends="build-classes-javadoc">
2.1 --- a/src/share/classes/com/sun/tools/apt/comp/Apt.java Fri Oct 02 11:26:53 2009 -0700 2.2 +++ b/src/share/classes/com/sun/tools/apt/comp/Apt.java Wed Oct 07 14:14:45 2009 -0700 2.3 @@ -201,7 +201,7 @@ 2.4 computeAnnotationSet(param, annotationSet); 2.5 2.6 if (symbol.members() != null) { 2.7 - for(Scope.Entry e: symbol.members().table) 2.8 + for(Scope.Entry e = symbol.members().elems; e != null; e = e.sibling) 2.9 computeAnnotationSet(e.sym, annotationSet); 2.10 } 2.11 }
3.1 --- a/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java Fri Oct 02 11:26:53 2009 -0700 3.2 +++ b/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java Wed Oct 07 14:14:45 2009 -0700 3.3 @@ -67,15 +67,15 @@ 3.4 public String toString() { 3.5 int ln = line(); 3.6 return (ln == Position.NOPOS) 3.7 - ? sourcefile.toString() 3.8 - : sourcefile + ":" + ln; 3.9 + ? sourcefile.getName() 3.10 + : sourcefile.getName() + ":" + ln; 3.11 } 3.12 3.13 /** 3.14 * {@inheritDoc} 3.15 */ 3.16 public File file() { 3.17 - return new File(sourcefile.toString()); 3.18 + return new File(sourcefile.toUri()); 3.19 } 3.20 3.21 /**
4.1 --- a/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java Fri Oct 02 11:26:53 2009 -0700 4.2 +++ b/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java Wed Oct 07 14:14:45 2009 -0700 4.3 @@ -34,6 +34,7 @@ 4.4 import java.nio.charset.CharsetDecoder; 4.5 import javax.lang.model.element.Modifier; 4.6 import javax.lang.model.element.NestingKind; 4.7 +import javax.tools.FileObject; 4.8 import javax.tools.JavaFileObject; 4.9 4.10 import static javax.tools.JavaFileObject.Kind.*; 4.11 @@ -49,33 +50,15 @@ 4.12 this.fileManager = fileManager; 4.13 } 4.14 4.15 - public JavaFileObject.Kind getKind() { 4.16 - String n = getName(); 4.17 - if (n.endsWith(CLASS.extension)) 4.18 - return CLASS; 4.19 - else if (n.endsWith(SOURCE.extension)) 4.20 - return SOURCE; 4.21 - else if (n.endsWith(HTML.extension)) 4.22 - return HTML; 4.23 - else 4.24 - return OTHER; 4.25 - } 4.26 + /** Return a short name for the object, such as for use in raw diagnostics 4.27 + */ 4.28 + public abstract String getShortName(); 4.29 4.30 @Override 4.31 public String toString() { 4.32 - return getPath(); 4.33 + return getClass().getSimpleName() + "[" + getName() + "]"; 4.34 } 4.35 4.36 - /** @deprecated see bug 6410637 */ 4.37 - @Deprecated 4.38 - public String getPath() { 4.39 - return getName(); 4.40 - } 4.41 - 4.42 - /** @deprecated see bug 6410637 */ 4.43 - @Deprecated 4.44 - abstract public String getName(); 4.45 - 4.46 public NestingKind getNestingKind() { return null; } 4.47 4.48 public Modifier getAccessLevel() { return null; } 4.49 @@ -90,6 +73,17 @@ 4.50 4.51 protected abstract String inferBinaryName(Iterable<? extends File> path); 4.52 4.53 + protected static JavaFileObject.Kind getKind(String filename) { 4.54 + if (filename.endsWith(CLASS.extension)) 4.55 + return CLASS; 4.56 + else if (filename.endsWith(SOURCE.extension)) 4.57 + return SOURCE; 4.58 + else if (filename.endsWith(HTML.extension)) 4.59 + return HTML; 4.60 + else 4.61 + return OTHER; 4.62 + } 4.63 + 4.64 protected static String removeExtension(String fileName) { 4.65 int lastDot = fileName.lastIndexOf("."); 4.66 return (lastDot == -1 ? fileName : fileName.substring(0, lastDot)); 4.67 @@ -115,6 +109,17 @@ 4.68 } 4.69 } 4.70 4.71 + /** Return the last component of a presumed hierarchical URI. 4.72 + * From the scheme specific part of the URI, it returns the substring 4.73 + * after the last "/" if any, or everything if no "/" is found. 4.74 + */ 4.75 + public static String getSimpleName(FileObject fo) { 4.76 + URI uri = fo.toUri(); 4.77 + String s = uri.getSchemeSpecificPart(); 4.78 + return s.substring(s.lastIndexOf("/") + 1); // safe when / not found 4.79 + 4.80 + } 4.81 + 4.82 /** The file manager that created this JavaFileObject. */ 4.83 protected final JavacFileManager fileManager; 4.84 }
5.1 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Oct 02 11:26:53 2009 -0700 5.2 +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Wed Oct 07 14:14:45 2009 -0700 5.3 @@ -1116,36 +1116,6 @@ 5.4 throw new IllegalArgumentException("Invalid relative path: " + file); 5.5 } 5.6 5.7 - @SuppressWarnings("deprecation") // bug 6410637 5.8 - public static String getJavacFileName(FileObject file) { 5.9 - if (file instanceof BaseFileObject) 5.10 - return ((BaseFileObject)file).getPath(); 5.11 - URI uri = file.toUri(); 5.12 - String scheme = uri.getScheme(); 5.13 - if (scheme == null || scheme.equals("file") || scheme.equals("jar")) 5.14 - return uri.getPath(); 5.15 - else 5.16 - return uri.toString(); 5.17 - } 5.18 - 5.19 - @SuppressWarnings("deprecation") // bug 6410637 5.20 - public static String getJavacBaseFileName(FileObject file) { 5.21 - if (file instanceof BaseFileObject) 5.22 - return ((BaseFileObject)file).getName(); 5.23 - URI uri = file.toUri(); 5.24 - String scheme = uri.getScheme(); 5.25 - if (scheme == null || scheme.equals("file") || scheme.equals("jar")) { 5.26 - String path = uri.getPath(); 5.27 - if (path == null) 5.28 - return null; 5.29 - if (scheme != null && scheme.equals("jar")) 5.30 - path = path.substring(path.lastIndexOf('!') + 1); 5.31 - return path.substring(path.lastIndexOf('/') + 1); 5.32 - } else { 5.33 - return uri.toString(); 5.34 - } 5.35 - } 5.36 - 5.37 private static <T> T nullCheck(T o) { 5.38 o.getClass(); // null check 5.39 return o;
6.1 --- a/src/share/classes/com/sun/tools/javac/file/Old199.java Fri Oct 02 11:26:53 2009 -0700 6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 6.3 @@ -1,54 +0,0 @@ 6.4 -/* 6.5 - * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 6.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6.7 - * 6.8 - * This code is free software; you can redistribute it and/or modify it 6.9 - * under the terms of the GNU General Public License version 2 only, as 6.10 - * published by the Free Software Foundation. Sun designates this 6.11 - * particular file as subject to the "Classpath" exception as provided 6.12 - * by Sun in the LICENSE file that accompanied this code. 6.13 - * 6.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 6.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 6.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 6.17 - * version 2 for more details (a copy is included in the LICENSE file that 6.18 - * accompanied this code). 6.19 - * 6.20 - * You should have received a copy of the GNU General Public License version 6.21 - * 2 along with this work; if not, write to the Free Software Foundation, 6.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 6.23 - * 6.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 6.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 6.26 - * have any questions. 6.27 - */ 6.28 - 6.29 -package com.sun.tools.javac.file; 6.30 - 6.31 -import javax.tools.FileObject; 6.32 - 6.33 -/** 6.34 - * Provides an easy migration to JSR 199 v3.3. The class is 6.35 - * deprecated as we should remove it as soon as possible. 6.36 - * 6.37 - * <p><b>This is NOT part of any API supported by Sun Microsystems. 6.38 - * If you write code that depends on this, you do so at your own 6.39 - * risk. This code and its internal interfaces are subject to change 6.40 - * or deletion without notice.</b></p> 6.41 - * 6.42 - * @author Peter von der Ah\u00e9 6.43 - */ 6.44 -@Deprecated 6.45 -public class Old199 { 6.46 - 6.47 - private Old199() {} 6.48 - 6.49 - public static String getPath(FileObject jfo) { 6.50 - return JavacFileManager.getJavacFileName(jfo); 6.51 - } 6.52 - 6.53 - public static String getName(FileObject jfo) { 6.54 - return JavacFileManager.getJavacBaseFileName(jfo); 6.55 - } 6.56 - 6.57 -}
7.1 --- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Fri Oct 02 11:26:53 2009 -0700 7.2 +++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Wed Oct 07 14:14:45 2009 -0700 7.3 @@ -68,98 +68,38 @@ 7.4 this.f = f; 7.5 } 7.6 7.7 + @Override 7.8 + public URI toUri() { 7.9 + return f.toURI().normalize(); 7.10 + } 7.11 + 7.12 + @Override 7.13 + public String getName() { 7.14 + return f.getPath(); 7.15 + } 7.16 + 7.17 + @Override 7.18 + public String getShortName() { 7.19 + return name; 7.20 + } 7.21 + 7.22 + @Override 7.23 + public JavaFileObject.Kind getKind() { 7.24 + return getKind(name); 7.25 + } 7.26 + 7.27 + @Override 7.28 public InputStream openInputStream() throws IOException { 7.29 return new FileInputStream(f); 7.30 } 7.31 7.32 @Override 7.33 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 7.34 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 7.35 - } 7.36 - 7.37 public OutputStream openOutputStream() throws IOException { 7.38 ensureParentDirectoriesExist(); 7.39 return new FileOutputStream(f); 7.40 } 7.41 7.42 - public Writer openWriter() throws IOException { 7.43 - ensureParentDirectoriesExist(); 7.44 - return new OutputStreamWriter(new FileOutputStream(f), fileManager.getEncodingName()); 7.45 - } 7.46 - 7.47 @Override 7.48 - protected String inferBinaryName(Iterable<? extends File> path) { 7.49 - String fPath = f.getPath(); 7.50 - //System.err.println("RegularFileObject " + file + " " +r.getPath()); 7.51 - for (File dir: path) { 7.52 - //System.err.println("dir: " + dir); 7.53 - String dPath = dir.getPath(); 7.54 - if (dPath.length() == 0) 7.55 - dPath = System.getProperty("user.dir"); 7.56 - if (!dPath.endsWith(File.separator)) 7.57 - dPath += File.separator; 7.58 - if (fPath.regionMatches(true, 0, dPath, 0, dPath.length()) 7.59 - && new File(fPath.substring(0, dPath.length())).equals(new File(dPath))) { 7.60 - String relativeName = fPath.substring(dPath.length()); 7.61 - return removeExtension(relativeName).replace(File.separatorChar, '.'); 7.62 - } 7.63 - } 7.64 - return null; 7.65 - } 7.66 - 7.67 - private void ensureParentDirectoriesExist() throws IOException { 7.68 - if (!hasParents) { 7.69 - File parent = f.getParentFile(); 7.70 - if (parent != null && !parent.exists()) { 7.71 - if (!parent.mkdirs()) { 7.72 - if (!parent.exists() || !parent.isDirectory()) { 7.73 - throw new IOException("could not create parent directories"); 7.74 - } 7.75 - } 7.76 - } 7.77 - hasParents = true; 7.78 - } 7.79 - } 7.80 - 7.81 - @Deprecated 7.82 - public String getName() { 7.83 - return name; 7.84 - } 7.85 - 7.86 - public boolean isNameCompatible(String cn, JavaFileObject.Kind kind) { 7.87 - cn.getClass(); 7.88 - // null check 7.89 - if (kind == Kind.OTHER && getKind() != kind) { 7.90 - return false; 7.91 - } 7.92 - String n = cn + kind.extension; 7.93 - if (name.equals(n)) { 7.94 - return true; 7.95 - } 7.96 - if (name.equalsIgnoreCase(n)) { 7.97 - try { 7.98 - // allow for Windows 7.99 - return f.getCanonicalFile().getName().equals(n); 7.100 - } catch (IOException e) { 7.101 - } 7.102 - } 7.103 - return false; 7.104 - } 7.105 - 7.106 - @Deprecated 7.107 - @Override 7.108 - public String getPath() { 7.109 - return f.getPath(); 7.110 - } 7.111 - 7.112 - public long getLastModified() { 7.113 - return f.lastModified(); 7.114 - } 7.115 - 7.116 - public boolean delete() { 7.117 - return f.delete(); 7.118 - } 7.119 - 7.120 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 7.121 CharBuffer cb = fileManager.getCachedContent(this); 7.122 if (cb == null) { 7.123 @@ -184,6 +124,82 @@ 7.124 } 7.125 7.126 @Override 7.127 + public Writer openWriter() throws IOException { 7.128 + ensureParentDirectoriesExist(); 7.129 + return new OutputStreamWriter(new FileOutputStream(f), fileManager.getEncodingName()); 7.130 + } 7.131 + 7.132 + @Override 7.133 + public long getLastModified() { 7.134 + return f.lastModified(); 7.135 + } 7.136 + 7.137 + @Override 7.138 + public boolean delete() { 7.139 + return f.delete(); 7.140 + } 7.141 + 7.142 + @Override 7.143 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 7.144 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 7.145 + } 7.146 + 7.147 + @Override 7.148 + protected String inferBinaryName(Iterable<? extends File> path) { 7.149 + String fPath = f.getPath(); 7.150 + //System.err.println("RegularFileObject " + file + " " +r.getPath()); 7.151 + for (File dir: path) { 7.152 + //System.err.println("dir: " + dir); 7.153 + String dPath = dir.getPath(); 7.154 + if (dPath.length() == 0) 7.155 + dPath = System.getProperty("user.dir"); 7.156 + if (!dPath.endsWith(File.separator)) 7.157 + dPath += File.separator; 7.158 + if (fPath.regionMatches(true, 0, dPath, 0, dPath.length()) 7.159 + && new File(fPath.substring(0, dPath.length())).equals(new File(dPath))) { 7.160 + String relativeName = fPath.substring(dPath.length()); 7.161 + return removeExtension(relativeName).replace(File.separatorChar, '.'); 7.162 + } 7.163 + } 7.164 + return null; 7.165 + } 7.166 + 7.167 + @Override 7.168 + public boolean isNameCompatible(String cn, JavaFileObject.Kind kind) { 7.169 + cn.getClass(); 7.170 + // null check 7.171 + if (kind == Kind.OTHER && getKind() != kind) { 7.172 + return false; 7.173 + } 7.174 + String n = cn + kind.extension; 7.175 + if (name.equals(n)) { 7.176 + return true; 7.177 + } 7.178 + if (name.equalsIgnoreCase(n)) { 7.179 + try { 7.180 + // allow for Windows 7.181 + return f.getCanonicalFile().getName().equals(n); 7.182 + } catch (IOException e) { 7.183 + } 7.184 + } 7.185 + return false; 7.186 + } 7.187 + 7.188 + private void ensureParentDirectoriesExist() throws IOException { 7.189 + if (!hasParents) { 7.190 + File parent = f.getParentFile(); 7.191 + if (parent != null && !parent.exists()) { 7.192 + if (!parent.mkdirs()) { 7.193 + if (!parent.exists() || !parent.isDirectory()) { 7.194 + throw new IOException("could not create parent directories"); 7.195 + } 7.196 + } 7.197 + } 7.198 + hasParents = true; 7.199 + } 7.200 + } 7.201 + 7.202 + @Override 7.203 public boolean equals(Object other) { 7.204 if (!(other instanceof RegularFileObject)) { 7.205 return false; 7.206 @@ -200,8 +216,4 @@ 7.207 public int hashCode() { 7.208 return f.hashCode(); 7.209 } 7.210 - 7.211 - public URI toUri() { 7.212 - return f.toURI().normalize(); 7.213 - } 7.214 }
8.1 --- a/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java Fri Oct 02 11:26:53 2009 -0700 8.2 +++ b/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java Wed Oct 07 14:14:45 2009 -0700 8.3 @@ -95,7 +95,7 @@ 8.4 8.5 @Override 8.6 protected String inferBinaryName(Iterable<? extends File> path) { 8.7 - String entryName = getZipEntryName(); 8.8 + String entryName = entry.getName(); 8.9 String prefix = ((SymbolArchive) zarch).prefix.path; 8.10 if (entryName.startsWith(prefix)) 8.11 entryName = entryName.substring(prefix.length());
9.1 --- a/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Fri Oct 02 11:26:53 2009 -0700 9.2 +++ b/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Wed Oct 07 14:14:45 2009 -0700 9.3 @@ -147,51 +147,37 @@ 9.4 this.entry = entry; 9.5 } 9.6 9.7 + public URI toUri() { 9.8 + File zipFile = new File(zarch.zdir.getName()); 9.9 + return createJarUri(zipFile, entry.getName()); 9.10 + } 9.11 + 9.12 + @Override 9.13 + public String getName() { 9.14 + return zarch.zdir.getName() + "(" + entry.getName() + ")"; 9.15 + } 9.16 + 9.17 + @Override 9.18 + public String getShortName() { 9.19 + return new File(zarch.zdir.getName()).getName() + "(" + entry + ")"; 9.20 + } 9.21 + 9.22 + @Override 9.23 + public JavaFileObject.Kind getKind() { 9.24 + return getKind(entry.getName()); 9.25 + } 9.26 + 9.27 + @Override 9.28 public InputStream openInputStream() throws IOException { 9.29 return zarch.zdir.getInputStream(entry); 9.30 } 9.31 9.32 + @Override 9.33 public OutputStream openOutputStream() throws IOException { 9.34 throw new UnsupportedOperationException(); 9.35 } 9.36 9.37 @Override 9.38 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 9.39 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 9.40 - } 9.41 - 9.42 - public Writer openWriter() throws IOException { 9.43 - throw new UnsupportedOperationException(); 9.44 - } 9.45 - 9.46 - @Deprecated 9.47 - public String getName() { 9.48 - return name; 9.49 - } 9.50 - 9.51 - public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 9.52 - cn.getClass(); 9.53 - // null check 9.54 - if (k == Kind.OTHER && getKind() != k) { 9.55 - return false; 9.56 - } 9.57 - return name.equals(cn + k.extension); 9.58 - } 9.59 - 9.60 - @Deprecated 9.61 - @Override 9.62 - public String getPath() { 9.63 - return zarch.zdir.getName() + "(" + entry + ")"; 9.64 - } 9.65 - 9.66 - public long getLastModified() { 9.67 - return entry.getTime(); 9.68 - } 9.69 - 9.70 - public boolean delete() { 9.71 - throw new UnsupportedOperationException(); 9.72 - } 9.73 - 9.74 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 9.75 CharBuffer cb = fileManager.getCachedContent(this); 9.76 if (cb == null) { 9.77 @@ -216,6 +202,42 @@ 9.78 } 9.79 9.80 @Override 9.81 + public Writer openWriter() throws IOException { 9.82 + throw new UnsupportedOperationException(); 9.83 + } 9.84 + 9.85 + @Override 9.86 + public long getLastModified() { 9.87 + return entry.getTime(); 9.88 + } 9.89 + 9.90 + @Override 9.91 + public boolean delete() { 9.92 + throw new UnsupportedOperationException(); 9.93 + } 9.94 + 9.95 + @Override 9.96 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 9.97 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 9.98 + } 9.99 + 9.100 + @Override 9.101 + protected String inferBinaryName(Iterable<? extends File> path) { 9.102 + String entryName = entry.getName(); 9.103 + return removeExtension(entryName).replace('/', '.'); 9.104 + } 9.105 + 9.106 + @Override 9.107 + public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 9.108 + cn.getClass(); 9.109 + // null check 9.110 + if (k == Kind.OTHER && getKind() != k) { 9.111 + return false; 9.112 + } 9.113 + return name.equals(cn + k.extension); 9.114 + } 9.115 + 9.116 + @Override 9.117 public boolean equals(Object other) { 9.118 if (!(other instanceof ZipFileObject)) { 9.119 return false; 9.120 @@ -228,25 +250,6 @@ 9.121 public int hashCode() { 9.122 return zarch.zdir.hashCode() + name.hashCode(); 9.123 } 9.124 - 9.125 - public String getZipName() { 9.126 - return zarch.zdir.getName(); 9.127 - } 9.128 - 9.129 - public String getZipEntryName() { 9.130 - return entry.getName(); 9.131 - } 9.132 - 9.133 - public URI toUri() { 9.134 - File zipFile = new File(getZipName()); 9.135 - return createJarUri(zipFile, entry.getName()); 9.136 - } 9.137 - 9.138 - @Override 9.139 - protected String inferBinaryName(Iterable<? extends File> path) { 9.140 - String entryName = getZipEntryName(); 9.141 - return removeExtension(entryName).replace('/', '.'); 9.142 - } 9.143 } 9.144 9.145 }
10.1 --- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Fri Oct 02 11:26:53 2009 -0700 10.2 +++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Wed Oct 07 14:14:45 2009 -0700 10.3 @@ -123,88 +123,41 @@ 10.4 this.zipName = zipFileName; 10.5 } 10.6 10.7 + @Override 10.8 + public URI toUri() { 10.9 + return createJarUri(zipName, getPrefixedEntryName()); 10.10 + } 10.11 + 10.12 + @Override 10.13 + public String getName() { 10.14 + return zipName + "(" + getPrefixedEntryName() + ")"; 10.15 + } 10.16 + 10.17 + @Override 10.18 + public String getShortName() { 10.19 + return zipName.getName() + "(" + entry.getName() + ")"; 10.20 + } 10.21 + 10.22 + @Override 10.23 + public JavaFileObject.Kind getKind() { 10.24 + return getKind(entry.getName()); 10.25 + } 10.26 + 10.27 + @Override 10.28 public InputStream openInputStream() throws IOException { 10.29 - 10.30 if (inputStream == null) { 10.31 - inputStream = new ByteArrayInputStream(read()); 10.32 + assert entry != null; // see constructor 10.33 + inputStream = new ByteArrayInputStream(zfIndex.read(entry)); 10.34 } 10.35 return inputStream; 10.36 } 10.37 10.38 @Override 10.39 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 10.40 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 10.41 - } 10.42 - 10.43 public OutputStream openOutputStream() throws IOException { 10.44 throw new UnsupportedOperationException(); 10.45 } 10.46 10.47 - public Writer openWriter() throws IOException { 10.48 - throw new UnsupportedOperationException(); 10.49 - } 10.50 - 10.51 - /** @deprecated see bug 6410637 */ 10.52 - @Deprecated 10.53 - public String getName() { 10.54 - return name; 10.55 - } 10.56 - 10.57 - public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 10.58 - cn.getClass(); // null check 10.59 - if (k == Kind.OTHER && getKind() != k) 10.60 - return false; 10.61 - return name.equals(cn + k.extension); 10.62 - } 10.63 - 10.64 - /** @deprecated see bug 6410637 */ 10.65 - @Deprecated 10.66 @Override 10.67 - public String getPath() { 10.68 - return zipName + "(" + entry.getName() + ")"; 10.69 - } 10.70 - 10.71 - public long getLastModified() { 10.72 - return entry.getLastModified(); 10.73 - } 10.74 - 10.75 - public boolean delete() { 10.76 - throw new UnsupportedOperationException(); 10.77 - } 10.78 - 10.79 - @Override 10.80 - public boolean equals(Object other) { 10.81 - if (!(other instanceof ZipFileIndexFileObject)) 10.82 - return false; 10.83 - ZipFileIndexFileObject o = (ZipFileIndexFileObject) other; 10.84 - return entry.equals(o.entry); 10.85 - } 10.86 - 10.87 - @Override 10.88 - public int hashCode() { 10.89 - return zipName.hashCode() + (name.hashCode() << 10); 10.90 - } 10.91 - 10.92 - public String getZipName() { 10.93 - return zipName.getPath(); 10.94 - } 10.95 - 10.96 - public String getZipEntryName() { 10.97 - return entry.getName(); 10.98 - } 10.99 - 10.100 - public URI toUri() { 10.101 - if (zfIndex.symbolFilePrefix != null) 10.102 - return createJarUri(zipName, zfIndex.symbolFilePrefix.path + entry.getName()); 10.103 - else 10.104 - return createJarUri(zipName, entry.getName()); 10.105 - } 10.106 - 10.107 - private byte[] read() throws IOException { 10.108 - assert entry != null; // see constructor 10.109 - return zfIndex.read(entry); 10.110 - } 10.111 - 10.112 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 10.113 CharBuffer cb = fileManager.getCachedContent(this); 10.114 if (cb == null) { 10.115 @@ -228,8 +181,28 @@ 10.116 } 10.117 10.118 @Override 10.119 + public Writer openWriter() throws IOException { 10.120 + throw new UnsupportedOperationException(); 10.121 + } 10.122 + 10.123 + @Override 10.124 + public long getLastModified() { 10.125 + return entry.getLastModified(); 10.126 + } 10.127 + 10.128 + @Override 10.129 + public boolean delete() { 10.130 + throw new UnsupportedOperationException(); 10.131 + } 10.132 + 10.133 + @Override 10.134 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 10.135 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 10.136 + } 10.137 + 10.138 + @Override 10.139 protected String inferBinaryName(Iterable<? extends File> path) { 10.140 - String entryName = getZipEntryName(); 10.141 + String entryName = entry.getName(); 10.142 if (zfIndex.symbolFilePrefix != null) { 10.143 String prefix = zfIndex.symbolFilePrefix.path; 10.144 if (entryName.startsWith(prefix)) 10.145 @@ -237,6 +210,34 @@ 10.146 } 10.147 return removeExtension(entryName).replace('/', '.'); 10.148 } 10.149 + 10.150 + @Override 10.151 + public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 10.152 + cn.getClass(); // null check 10.153 + if (k == Kind.OTHER && getKind() != k) 10.154 + return false; 10.155 + return name.equals(cn + k.extension); 10.156 + } 10.157 + 10.158 + @Override 10.159 + public boolean equals(Object other) { 10.160 + if (!(other instanceof ZipFileIndexFileObject)) 10.161 + return false; 10.162 + ZipFileIndexFileObject o = (ZipFileIndexFileObject) other; 10.163 + return entry.equals(o.entry); 10.164 + } 10.165 + 10.166 + @Override 10.167 + public int hashCode() { 10.168 + return zipName.hashCode() + (name.hashCode() << 10); 10.169 + } 10.170 + 10.171 + private String getPrefixedEntryName() { 10.172 + if (zfIndex.symbolFilePrefix != null) 10.173 + return zfIndex.symbolFilePrefix.path + entry.getName(); 10.174 + else 10.175 + return entry.getName(); 10.176 + } 10.177 } 10.178 10.179 }
11.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri Oct 02 11:26:53 2009 -0700 11.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Wed Oct 07 14:14:45 2009 -0700 11.3 @@ -2563,38 +2563,73 @@ 11.4 this.flatname = flatname; 11.5 } 11.6 11.7 + @Override 11.8 + public URI toUri() { 11.9 + try { 11.10 + return new URI(null, name.toString(), null); 11.11 + } catch (URISyntaxException e) { 11.12 + throw new CannotCreateUriError(name.toString(), e); 11.13 + } 11.14 + } 11.15 + 11.16 + @Override 11.17 + public String getName() { 11.18 + return name.toString(); 11.19 + } 11.20 + 11.21 + @Override 11.22 + public String getShortName() { 11.23 + return getName(); 11.24 + } 11.25 + 11.26 + @Override 11.27 + public JavaFileObject.Kind getKind() { 11.28 + return getKind(getName()); 11.29 + } 11.30 + 11.31 + @Override 11.32 public InputStream openInputStream() { 11.33 throw new UnsupportedOperationException(); 11.34 } 11.35 11.36 + @Override 11.37 public OutputStream openOutputStream() { 11.38 throw new UnsupportedOperationException(); 11.39 } 11.40 11.41 - public Reader openReader() { 11.42 + @Override 11.43 + public CharBuffer getCharContent(boolean ignoreEncodingErrors) { 11.44 throw new UnsupportedOperationException(); 11.45 } 11.46 11.47 + @Override 11.48 + public Reader openReader(boolean ignoreEncodingErrors) { 11.49 + throw new UnsupportedOperationException(); 11.50 + } 11.51 + 11.52 + @Override 11.53 public Writer openWriter() { 11.54 throw new UnsupportedOperationException(); 11.55 } 11.56 11.57 - /** @deprecated see bug 6410637 */ 11.58 - @Deprecated 11.59 - public String getName() { 11.60 - return name.toString(); 11.61 - } 11.62 - 11.63 + @Override 11.64 public long getLastModified() { 11.65 throw new UnsupportedOperationException(); 11.66 } 11.67 11.68 + @Override 11.69 public boolean delete() { 11.70 throw new UnsupportedOperationException(); 11.71 } 11.72 11.73 - public CharBuffer getCharContent(boolean ignoreEncodingErrors) { 11.74 - throw new UnsupportedOperationException(); 11.75 + @Override 11.76 + protected String inferBinaryName(Iterable<? extends File> path) { 11.77 + return flatname.toString(); 11.78 + } 11.79 + 11.80 + @Override 11.81 + public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) { 11.82 + return true; // fail-safe mode 11.83 } 11.84 11.85 @Override 11.86 @@ -2609,27 +2644,5 @@ 11.87 public int hashCode() { 11.88 return name.hashCode(); 11.89 } 11.90 - 11.91 - public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) { 11.92 - return true; // fail-safe mode 11.93 - } 11.94 - 11.95 - public URI toUri() { 11.96 - try { 11.97 - return new URI(null, name.toString(), null); 11.98 - } catch (URISyntaxException e) { 11.99 - throw new CannotCreateUriError(name.toString(), e); 11.100 - } 11.101 - } 11.102 - 11.103 - @Override 11.104 - public Reader openReader(boolean ignoreEncodingErrors) throws IOException { 11.105 - throw new UnsupportedOperationException(); 11.106 - } 11.107 - 11.108 - @Override 11.109 - protected String inferBinaryName(Iterable<? extends File> path) { 11.110 - return flatname.toString(); 11.111 - } 11.112 } 11.113 }
12.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Fri Oct 02 11:26:53 2009 -0700 12.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Wed Oct 07 14:14:45 2009 -0700 12.3 @@ -36,6 +36,7 @@ 12.4 import com.sun.tools.javac.code.*; 12.5 import com.sun.tools.javac.code.Symbol.*; 12.6 import com.sun.tools.javac.code.Type.*; 12.7 +import com.sun.tools.javac.file.BaseFileObject; 12.8 import com.sun.tools.javac.util.*; 12.9 12.10 import static com.sun.tools.javac.code.BoundKind.*; 12.11 @@ -1685,13 +1686,8 @@ 12.12 // the last possible moment because the sourcefile may be used 12.13 // elsewhere in error diagnostics. Fixes 4241573. 12.14 //databuf.appendChar(c.pool.put(c.sourcefile)); 12.15 - String filename = c.sourcefile.toString(); 12.16 - int sepIdx = filename.lastIndexOf(File.separatorChar); 12.17 - // Allow '/' as separator on all platforms, e.g., on Win32. 12.18 - int slashIdx = filename.lastIndexOf('/'); 12.19 - if (slashIdx > sepIdx) sepIdx = slashIdx; 12.20 - if (sepIdx >= 0) filename = filename.substring(sepIdx + 1); 12.21 - databuf.appendChar(c.pool.put(names.fromString(filename))); 12.22 + String simpleName = BaseFileObject.getSimpleName(c.sourcefile); 12.23 + databuf.appendChar(c.pool.put(names.fromString(simpleName))); 12.24 endAttr(alenIdx); 12.25 acount++; 12.26 }
13.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Oct 02 11:26:53 2009 -0700 13.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Wed Oct 07 14:14:45 2009 -0700 13.3 @@ -2236,7 +2236,7 @@ 13.4 13.5 /* AnnotationValue = ConditionalExpression 13.6 * | Annotation 13.7 - * | "{" [ AnnotationValue { "," AnnotationValue } ] "}" 13.8 + * | "{" [ AnnotationValue { "," AnnotationValue } ] [","] "}" 13.9 */ 13.10 JCExpression annotationValue() { 13.11 int pos; 13.12 @@ -2253,7 +2253,7 @@ 13.13 buf.append(annotationValue()); 13.14 while (S.token() == COMMA) { 13.15 S.nextToken(); 13.16 - if (S.token() == RPAREN) break; 13.17 + if (S.token() == RBRACE) break; 13.18 buf.append(annotationValue()); 13.19 } 13.20 }
14.1 --- a/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Fri Oct 02 11:26:53 2009 -0700 14.2 +++ b/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Wed Oct 07 14:14:45 2009 -0700 14.3 @@ -42,8 +42,8 @@ 14.4 import com.sun.tools.javac.code.Symbol; 14.5 import com.sun.tools.javac.code.Type; 14.6 import com.sun.tools.javac.code.Type.CapturedType; 14.7 -import com.sun.tools.javac.file.JavacFileManager; 14.8 14.9 +import com.sun.tools.javac.file.BaseFileObject; 14.10 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*; 14.11 14.12 /** 14.13 @@ -133,8 +133,15 @@ 14.14 } 14.15 14.16 public String formatSource(JCDiagnostic d, boolean fullname, Locale l) { 14.17 - assert (d.getSource() != null); 14.18 - return fullname ? d.getSourceName() : d.getSource().getName(); 14.19 + JavaFileObject fo = d.getSource(); 14.20 + if (fo == null) 14.21 + throw new IllegalArgumentException(); // d should have source set 14.22 + if (fullname) 14.23 + return fo.getName(); 14.24 + else if (fo instanceof BaseFileObject) 14.25 + return ((BaseFileObject) fo).getShortName(); 14.26 + else 14.27 + return BaseFileObject.getSimpleName(fo); 14.28 } 14.29 14.30 /** 14.31 @@ -182,7 +189,7 @@ 14.32 return printer.visit((Symbol)arg, l); 14.33 } 14.34 else if (arg instanceof JavaFileObject) { 14.35 - return JavacFileManager.getJavacBaseFileName((JavaFileObject)arg); 14.36 + return ((JavaFileObject)arg).getName(); 14.37 } 14.38 else if (arg instanceof Formattable) { 14.39 return ((Formattable)arg).toString(l, messages);
15.1 --- a/src/share/classes/com/sun/tools/javac/util/Constants.java Fri Oct 02 11:26:53 2009 -0700 15.2 +++ b/src/share/classes/com/sun/tools/javac/util/Constants.java Wed Oct 07 14:14:45 2009 -0700 15.3 @@ -83,16 +83,28 @@ 15.4 */ 15.5 public static String format(Object value) { 15.6 if (value instanceof Byte) return formatByte((Byte) value); 15.7 + if (value instanceof Short) return formatShort((Short) value); 15.8 if (value instanceof Long) return formatLong((Long) value); 15.9 if (value instanceof Float) return formatFloat((Float) value); 15.10 if (value instanceof Double) return formatDouble((Double) value); 15.11 if (value instanceof Character) return formatChar((Character) value); 15.12 if (value instanceof String) return formatString((String) value); 15.13 - return value + ""; 15.14 + if (value instanceof Integer || 15.15 + value instanceof Boolean) return value.toString(); 15.16 + else 15.17 + throw new IllegalArgumentException("Argument is not a primitive type or a string; it " + 15.18 + ((value == null) ? 15.19 + "is a null value." : 15.20 + "has class " + 15.21 + value.getClass().getName()) + "." ); 15.22 } 15.23 15.24 private static String formatByte(byte b) { 15.25 - return String.format("0x%02x", b); 15.26 + return String.format("(byte)0x%02x", b); 15.27 + } 15.28 + 15.29 + private static String formatShort(short s) { 15.30 + return String.format("(short)%d", s); 15.31 } 15.32 15.33 private static String formatLong(long lng) {
16.1 --- a/src/share/classes/com/sun/tools/javac/util/Convert.java Fri Oct 02 11:26:53 2009 -0700 16.2 +++ b/src/share/classes/com/sun/tools/javac/util/Convert.java Wed Oct 07 14:14:45 2009 -0700 16.3 @@ -239,9 +239,9 @@ 16.4 case '\"': return "\\\""; 16.5 case '\\': return "\\\\"; 16.6 default: 16.7 - return (ch > 127 || isPrintableAscii(ch)) 16.8 + return (isPrintableAscii(ch)) 16.9 ? String.valueOf(ch) 16.10 - : String.format("\\%03o", (int) ch); 16.11 + : String.format("\\u%04x", (int) ch); 16.12 } 16.13 } 16.14
17.1 --- a/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java Fri Oct 02 11:26:53 2009 -0700 17.2 +++ b/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java Wed Oct 07 14:14:45 2009 -0700 17.3 @@ -69,10 +69,6 @@ 17.4 return fileObject; 17.5 } 17.6 17.7 - public CharSequence getName() { 17.8 - return JavacFileManager.getJavacBaseFileName(fileObject); 17.9 - } 17.10 - 17.11 /** Return the one-based line number associated with a given pos 17.12 * for the current source file. Zero is returned if no line exists 17.13 * for the given position.
18.1 --- a/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Fri Oct 02 11:26:53 2009 -0700 18.2 +++ b/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Wed Oct 07 14:14:45 2009 -0700 18.3 @@ -32,7 +32,6 @@ 18.4 import javax.tools.JavaFileObject; 18.5 18.6 import com.sun.tools.javac.api.DiagnosticFormatter; 18.7 -import com.sun.tools.javac.file.JavacFileManager; 18.8 import com.sun.tools.javac.tree.JCTree; 18.9 18.10 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*; 18.11 @@ -354,15 +353,6 @@ 18.12 } 18.13 18.14 /** 18.15 - * Get the name of the source file referred to by this diagnostic. 18.16 - * @return the name of the source referred to with this diagnostic, or null if none 18.17 - */ 18.18 - public String getSourceName() { 18.19 - JavaFileObject s = getSource(); 18.20 - return s == null ? null : JavacFileManager.getJavacFileName(s); 18.21 - } 18.22 - 18.23 - /** 18.24 * Get the source referred to by this diagnostic. 18.25 * @return the source referred to with this diagnostic, or null if none 18.26 */ 18.27 @@ -437,6 +427,7 @@ 18.28 /** 18.29 * Return the standard presentation of this diagnostic. 18.30 */ 18.31 + @Override 18.32 public String toString() { 18.33 return defaultFormatter.format(this,Locale.getDefault()); 18.34 }
19.1 --- a/src/share/classes/com/sun/tools/javac/util/Log.java Fri Oct 02 11:26:53 2009 -0700 19.2 +++ b/src/share/classes/com/sun/tools/javac/util/Log.java Wed Oct 07 14:14:45 2009 -0700 19.3 @@ -33,7 +33,6 @@ 19.4 import javax.tools.DiagnosticListener; 19.5 import javax.tools.JavaFileObject; 19.6 19.7 -import com.sun.tools.javac.file.JavacFileManager; 19.8 import com.sun.tools.javac.tree.JCTree; 19.9 import com.sun.tools.javac.api.DiagnosticFormatter; 19.10 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; 19.11 @@ -428,7 +427,7 @@ 19.12 JavaFileObject file = source.getFile(); 19.13 if (file != null) 19.14 printLines(errWriter, 19.15 - JavacFileManager.getJavacFileName(file) + ":" + 19.16 + file.getName() + ":" + 19.17 line + ": " + msg); 19.18 printErrLine(pos, errWriter); 19.19 }
20.1 --- a/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Fri Oct 02 11:26:53 2009 -0700 20.2 +++ b/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Wed Oct 07 14:14:45 2009 -0700 20.3 @@ -30,6 +30,7 @@ 20.4 20.5 import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.*; 20.6 import com.sun.tools.javac.api.Formattable; 20.7 +import com.sun.tools.javac.file.BaseFileObject; 20.8 import com.sun.tools.javac.util.AbstractDiagnosticFormatter.SimpleConfiguration; 20.9 20.10 import static com.sun.tools.javac.api.DiagnosticFormatter.PositionKind.*; 20.11 @@ -109,6 +110,8 @@ 20.12 String s; 20.13 if (arg instanceof Formattable) 20.14 s = arg.toString(); 20.15 + else if (arg instanceof BaseFileObject) 20.16 + s = ((BaseFileObject) arg).getShortName(); 20.17 else 20.18 s = super.formatArgument(diag, arg, null); 20.19 if (arg instanceof JCDiagnostic)
21.1 --- a/src/share/classes/com/sun/tools/javadoc/SourcePositionImpl.java Fri Oct 02 11:26:53 2009 -0700 21.2 +++ b/src/share/classes/com/sun/tools/javadoc/SourcePositionImpl.java Wed Oct 07 14:14:45 2009 -0700 21.3 @@ -95,7 +95,7 @@ 21.4 public String toString() { 21.5 // Backwards compatibility hack. ZipFileObjects use the format 21.6 // zipfile(zipentry) but javadoc has been using zipfile/zipentry 21.7 - String fn = filename.toString(); 21.8 + String fn = filename.getName(); 21.9 if (fn.endsWith(")")) { 21.10 int paren = fn.lastIndexOf("("); 21.11 if (paren != -1)
22.1 --- a/src/share/classes/com/sun/tools/javah/Gen.java Fri Oct 02 11:26:53 2009 -0700 22.2 +++ b/src/share/classes/com/sun/tools/javah/Gen.java Wed Oct 07 14:14:45 2009 -0700 22.3 @@ -27,15 +27,32 @@ 22.4 22.5 import java.io.UnsupportedEncodingException; 22.6 import java.io.ByteArrayOutputStream; 22.7 +import java.io.FileNotFoundException; 22.8 import java.io.IOException; 22.9 +import java.io.InputStream; 22.10 import java.io.OutputStream; 22.11 +import java.io.OutputStreamWriter; 22.12 import java.io.PrintWriter; 22.13 -import com.sun.javadoc.*; 22.14 -import java.io.*; 22.15 +import java.util.ArrayList; 22.16 +import java.util.Arrays; 22.17 +import java.util.List; 22.18 +import java.util.Set; 22.19 import java.util.Stack; 22.20 -import java.util.Vector; 22.21 -import java.util.Arrays; 22.22 22.23 +import javax.annotation.processing.ProcessingEnvironment; 22.24 + 22.25 +import javax.lang.model.element.ExecutableElement; 22.26 +import javax.lang.model.element.Modifier; 22.27 +import javax.lang.model.element.TypeElement; 22.28 +import javax.lang.model.element.VariableElement; 22.29 +import javax.lang.model.util.ElementFilter; 22.30 +import javax.lang.model.util.Elements; 22.31 +import javax.lang.model.util.Types; 22.32 + 22.33 +import javax.tools.FileObject; 22.34 +import javax.tools.JavaFileManager; 22.35 +import javax.tools.JavaFileObject; 22.36 +import javax.tools.StandardLocation; 22.37 22.38 /** 22.39 * An abstraction for generating support files required by native methods. 22.40 @@ -43,31 +60,39 @@ 22.41 * original writing, this interface is rich enough to support JNI and the 22.42 * old 1.0-style native method interface. 22.43 * 22.44 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 22.45 + * If you write code that depends on this, you do so at your own 22.46 + * risk. This code and its internal interfaces are subject to change 22.47 + * or deletion without notice.</b></p> 22.48 + * 22.49 * @author Sucheta Dambalkar(Revised) 22.50 */ 22.51 - 22.52 - 22.53 public abstract class Gen { 22.54 protected String lineSep = System.getProperty("line.separator"); 22.55 22.56 - RootDoc root; 22.57 + protected ProcessingEnvironment processingEnvironment; 22.58 + protected Types types; 22.59 + protected Elements elems; 22.60 + protected Mangle mangler; 22.61 + protected Util util; 22.62 + 22.63 + protected Gen(Util util) { 22.64 + this.util = util; 22.65 + } 22.66 + 22.67 /* 22.68 * List of classes for which we must generate output. 22.69 */ 22.70 - protected ClassDoc[] classes; 22.71 + protected Set<TypeElement> classes; 22.72 static private final boolean isWindows = 22.73 System.getProperty("os.name").startsWith("Windows"); 22.74 22.75 - public Gen(RootDoc root){ 22.76 - this.root = root; 22.77 - } 22.78 22.79 /** 22.80 * Override this abstract method, generating content for the named 22.81 * class into the outputstream. 22.82 */ 22.83 - protected abstract void write(OutputStream o, ClassDoc clazz) 22.84 - throws ClassNotFoundException; 22.85 + protected abstract void write(OutputStream o, TypeElement clazz) throws Util.Exit; 22.86 22.87 /** 22.88 * Override this method to provide a list of #include statements 22.89 @@ -78,31 +103,29 @@ 22.90 /* 22.91 * Output location. 22.92 */ 22.93 - protected String outDir; 22.94 - protected String outFile; 22.95 + protected JavaFileManager fileManager; 22.96 + protected JavaFileObject outFile; 22.97 22.98 - public void setOutDir(String outDir) { 22.99 - /* Check important, otherwise concatenation of two null strings 22.100 - * produces the "nullnull" String. 22.101 - */ 22.102 - if (outDir != null) { 22.103 - this.outDir = outDir + System.getProperty("file.separator"); 22.104 - File d = new File(outDir); 22.105 - if (!d.exists()) 22.106 - if (!d.mkdirs()) 22.107 - Util.error("cant.create.dir", d.toString()); 22.108 - } 22.109 + public void setFileManager(JavaFileManager fm) { 22.110 + fileManager = fm; 22.111 } 22.112 22.113 - public void setOutFile(String outFile) { 22.114 + public void setOutFile(JavaFileObject outFile) { 22.115 this.outFile = outFile; 22.116 } 22.117 22.118 22.119 - public void setClasses(ClassDoc[] classes) { 22.120 + public void setClasses(Set<TypeElement> classes) { 22.121 this.classes = classes; 22.122 } 22.123 22.124 + void setProcessingEnvironment(ProcessingEnvironment pEnv) { 22.125 + processingEnvironment = pEnv; 22.126 + elems = pEnv.getElementUtils(); 22.127 + types = pEnv.getTypeUtils(); 22.128 + mangler = new Mangle(elems, types); 22.129 + } 22.130 + 22.131 /* 22.132 * Smartness with generated files. 22.133 */ 22.134 @@ -116,12 +139,11 @@ 22.135 * We explicitly need to write ASCII files because that is what C 22.136 * compilers understand. 22.137 */ 22.138 - protected PrintWriter wrapWriter(OutputStream o) { 22.139 + protected PrintWriter wrapWriter(OutputStream o) throws Util.Exit { 22.140 try { 22.141 - return new 22.142 - PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true); 22.143 + return new PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true); 22.144 } catch (UnsupportedEncodingException use) { 22.145 - Util.bug("encoding.iso8859_1.not.found"); 22.146 + util.bug("encoding.iso8859_1.not.found"); 22.147 return null; /* dead code */ 22.148 } 22.149 } 22.150 @@ -133,26 +155,25 @@ 22.151 * Buffer size chosen as an approximation from a single sampling of: 22.152 * expr `du -sk` / `ls *.h | wc -l` 22.153 */ 22.154 - public void run() throws IOException, ClassNotFoundException { 22.155 + public void run() throws IOException, ClassNotFoundException, Util.Exit { 22.156 int i = 0; 22.157 if (outFile != null) { 22.158 /* Everything goes to one big file... */ 22.159 ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); 22.160 writeFileTop(bout); /* only once */ 22.161 22.162 - for (i = 0; i < classes.length; i++) { 22.163 - write(bout, classes[i]); 22.164 + for (TypeElement t: classes) { 22.165 + write(bout, t); 22.166 } 22.167 22.168 writeIfChanged(bout.toByteArray(), outFile); 22.169 } else { 22.170 /* Each class goes to its own file... */ 22.171 - for (i = 0; i < classes.length; i++) { 22.172 + for (TypeElement t: classes) { 22.173 ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); 22.174 writeFileTop(bout); 22.175 - ClassDoc clazz = classes[i]; 22.176 - write(bout, clazz); 22.177 - writeIfChanged(bout.toByteArray(), getFileName(clazz.qualifiedName())); 22.178 + write(bout, t); 22.179 + writeIfChanged(bout.toByteArray(), getFileObject(t.getQualifiedName())); 22.180 } 22.181 } 22.182 } 22.183 @@ -162,8 +183,7 @@ 22.184 * is done if either the file doesn't exist or if the contents are 22.185 * different. 22.186 */ 22.187 - private void writeIfChanged(byte[] b, String file) throws IOException { 22.188 - File f = new File(file); 22.189 + private void writeIfChanged(byte[] b, FileObject file) throws IOException { 22.190 boolean mustWrite = false; 22.191 String event = "[No need to update file "; 22.192 22.193 @@ -171,71 +191,80 @@ 22.194 mustWrite = true; 22.195 event = "[Forcefully writing file "; 22.196 } else { 22.197 - if (!f.exists()) { 22.198 + InputStream in; 22.199 + byte[] a; 22.200 + try { 22.201 + // regrettably, there's no API to get the length in bytes 22.202 + // for a FileObject, so we can't short-circuit reading the 22.203 + // file here 22.204 + in = file.openInputStream(); 22.205 + a = readBytes(in); 22.206 + if (!Arrays.equals(a, b)) { 22.207 + mustWrite = true; 22.208 + event = "[Overwriting file "; 22.209 + 22.210 + } 22.211 + } catch (FileNotFoundException e) { 22.212 mustWrite = true; 22.213 event = "[Creating file "; 22.214 - } else { 22.215 - int l = (int)f.length(); 22.216 - if (b.length != l) { 22.217 - mustWrite = true; 22.218 - event = "[Overwriting file "; 22.219 - } else { 22.220 - /* Lengths are equal, so read it. */ 22.221 - byte[] a = new byte[l]; 22.222 - FileInputStream in = new FileInputStream(f); 22.223 - if (in.read(a) != l) { 22.224 - in.close(); 22.225 - /* This can't happen, we already checked the length. */ 22.226 - Util.error("not.enough.bytes", Integer.toString(l), 22.227 - f.toString()); 22.228 - } 22.229 - in.close(); 22.230 - while (--l >= 0) { 22.231 - if (a[l] != b[l]) { 22.232 - mustWrite = true; 22.233 - event = "[Overwriting file "; 22.234 - } 22.235 - } 22.236 - } 22.237 } 22.238 } 22.239 - if (Util.verbose) 22.240 - Util.log(event + file + "]"); 22.241 + 22.242 + if (util.verbose) 22.243 + util.log(event + file + "]"); 22.244 + 22.245 if (mustWrite) { 22.246 - OutputStream out = new FileOutputStream(file); 22.247 + OutputStream out = file.openOutputStream(); 22.248 out.write(b); /* No buffering, just one big write! */ 22.249 out.close(); 22.250 } 22.251 } 22.252 22.253 - protected String defineForStatic(ClassDoc c, FieldDoc f){ 22.254 + protected byte[] readBytes(InputStream in) throws IOException { 22.255 + try { 22.256 + byte[] array = new byte[in.available() + 1]; 22.257 + int offset = 0; 22.258 + int n; 22.259 + while ((n = in.read(array, offset, array.length - offset)) != -1) { 22.260 + offset += n; 22.261 + if (offset == array.length) 22.262 + array = Arrays.copyOf(array, array.length * 2); 22.263 + } 22.264 22.265 - String cnamedoc = c.qualifiedName(); 22.266 - String fnamedoc = f.name(); 22.267 + return Arrays.copyOf(array, offset); 22.268 + } finally { 22.269 + in.close(); 22.270 + } 22.271 + } 22.272 22.273 - String cname = Mangle.mangle(cnamedoc, Mangle.Type.CLASS); 22.274 - String fname = Mangle.mangle(fnamedoc, Mangle.Type.FIELDSTUB); 22.275 + protected String defineForStatic(TypeElement c, VariableElement f) 22.276 + throws Util.Exit { 22.277 + CharSequence cnamedoc = c.getQualifiedName(); 22.278 + CharSequence fnamedoc = f.getSimpleName(); 22.279 22.280 - if (!f.isStatic()) 22.281 - Util.bug("tried.to.define.non.static"); 22.282 + String cname = mangler.mangle(cnamedoc, Mangle.Type.CLASS); 22.283 + String fname = mangler.mangle(fnamedoc, Mangle.Type.FIELDSTUB); 22.284 22.285 - if (f.isFinal()) { 22.286 + if (!f.getModifiers().contains(Modifier.STATIC)) 22.287 + util.bug("tried.to.define.non.static"); 22.288 + 22.289 + if (f.getModifiers().contains(Modifier.FINAL)) { 22.290 Object value = null; 22.291 22.292 - value = f.constantValue(); 22.293 + value = f.getConstantValue(); 22.294 22.295 if (value != null) { /* so it is a ConstantExpression */ 22.296 String constString = null; 22.297 if ((value instanceof Integer) 22.298 || (value instanceof Byte) 22.299 - || (value instanceof Character) 22.300 - || (value instanceof Short) 22.301 - || (value instanceof Boolean)) { 22.302 - /* covers byte, boolean, char, short, int */ 22.303 - if(value instanceof Boolean) 22.304 - constString = (value.toString() == "true") ? "1L" : "0L"; 22.305 - else 22.306 - constString = value.toString() + "L"; 22.307 + || (value instanceof Short)) { 22.308 + /* covers byte, short, int */ 22.309 + constString = value.toString() + "L"; 22.310 + } else if (value instanceof Boolean) { 22.311 + constString = ((Boolean) value) ? "1L" : "0L"; 22.312 + } else if (value instanceof Character) { 22.313 + Character ch = (Character) value; 22.314 + constString = String.valueOf(((int) ch) & 0xffff) + "L"; 22.315 } else if (value instanceof Long) { 22.316 // Visual C++ supports the i64 suffix, not LL. 22.317 if (isWindows) 22.318 @@ -294,24 +323,19 @@ 22.319 /* 22.320 * File name and file preamble related operations. 22.321 */ 22.322 - protected void writeFileTop(OutputStream o) { 22.323 + protected void writeFileTop(OutputStream o) throws Util.Exit { 22.324 PrintWriter pw = wrapWriter(o); 22.325 pw.println("/* DO NOT EDIT THIS FILE - it is machine generated */" + lineSep + 22.326 getIncludes()); 22.327 } 22.328 22.329 - protected String baseFileName(String clazz) { 22.330 - StringBuffer f = 22.331 - new StringBuffer(Mangle.mangle(clazz, 22.332 - Mangle.Type.CLASS)); 22.333 - if (outDir != null) { 22.334 - f.insert(0, outDir); 22.335 - } 22.336 - return f.toString(); 22.337 + protected String baseFileName(CharSequence className) { 22.338 + return mangler.mangle(className, Mangle.Type.CLASS); 22.339 } 22.340 22.341 - protected String getFileName(String clazz) { 22.342 - return baseFileName(clazz) + getFileSuffix(); 22.343 + protected FileObject getFileObject(CharSequence className) throws IOException { 22.344 + String name = baseFileName(className) + getFileSuffix(); 22.345 + return fileManager.getFileForOutput(StandardLocation.SOURCE_OUTPUT, "", name, null); 22.346 } 22.347 22.348 protected String getFileSuffix() { 22.349 @@ -322,26 +346,39 @@ 22.350 * Including super classes' fields. 22.351 */ 22.352 22.353 - FieldDoc[] getAllFields(ClassDoc subclazz) 22.354 - throws ClassNotFoundException { 22.355 - Vector<FieldDoc> fields = new Vector<FieldDoc>(); 22.356 - ClassDoc cd = null; 22.357 - Stack<Object> s = new Stack<Object>(); 22.358 + List<VariableElement> getAllFields(TypeElement subclazz) { 22.359 + List<VariableElement> fields = new ArrayList<VariableElement>(); 22.360 + TypeElement cd = null; 22.361 + Stack<TypeElement> s = new Stack<TypeElement>(); 22.362 22.363 cd = subclazz; 22.364 while (true) { 22.365 s.push(cd); 22.366 - ClassDoc c = cd.superclass(); 22.367 + TypeElement c = (TypeElement) (types.asElement(cd.getSuperclass())); 22.368 if (c == null) 22.369 break; 22.370 cd = c; 22.371 } 22.372 22.373 while (!s.empty()) { 22.374 - cd = (ClassDoc)s.pop(); 22.375 - fields.addAll(Arrays.asList(cd.fields())); 22.376 + cd = s.pop(); 22.377 + fields.addAll(ElementFilter.fieldsIn(cd.getEnclosedElements())); 22.378 } 22.379 22.380 - return fields.toArray(new FieldDoc[fields.size()]); 22.381 + return fields; 22.382 + } 22.383 + 22.384 + // c.f. MethodDoc.signature 22.385 + String signature(ExecutableElement e) { 22.386 + StringBuffer sb = new StringBuffer("("); 22.387 + String sep = ""; 22.388 + for (VariableElement p: e.getParameters()) { 22.389 + sb.append(sep); 22.390 + sb.append(types.erasure(p.asType()).toString()); 22.391 + sep = ","; 22.392 + } 22.393 + sb.append(")"); 22.394 + return sb.toString(); 22.395 } 22.396 } 22.397 +
23.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 23.2 +++ b/src/share/classes/com/sun/tools/javah/InternalError.java Wed Oct 07 14:14:45 2009 -0700 23.3 @@ -0,0 +1,40 @@ 23.4 +/* 23.5 + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 23.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.7 + * 23.8 + * This code is free software; you can redistribute it and/or modify it 23.9 + * under the terms of the GNU General Public License version 2 only, as 23.10 + * published by the Free Software Foundation. Sun designates this 23.11 + * particular file as subject to the "Classpath" exception as provided 23.12 + * by Sun in the LICENSE file that accompanied this code. 23.13 + * 23.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 23.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 23.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 23.17 + * version 2 for more details (a copy is included in the LICENSE file that 23.18 + * accompanied this code). 23.19 + * 23.20 + * You should have received a copy of the GNU General Public License version 23.21 + * 2 along with this work; if not, write to the Free Software Foundation, 23.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 23.23 + * 23.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 23.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 23.26 + * have any questions. 23.27 + */ 23.28 + 23.29 +package com.sun.tools.javah; 23.30 + 23.31 +/** 23.32 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 23.33 + * you write code that depends on this, you do so at your own risk. 23.34 + * This code and its internal interfaces are subject to change or 23.35 + * deletion without notice.</b> 23.36 + */ 23.37 +public class InternalError extends Error { 23.38 + private static final long serialVersionUID = 8411861562497165022L; 23.39 + InternalError(String msg, Throwable cause) { 23.40 + super("Internal error: " + msg); 23.41 + initCause(cause); 23.42 + } 23.43 +}
24.1 --- a/src/share/classes/com/sun/tools/javah/JNI.java Fri Oct 02 11:26:53 2009 -0700 24.2 +++ b/src/share/classes/com/sun/tools/javah/JNI.java Wed Oct 07 14:14:45 2009 -0700 24.3 @@ -1,5 +1,5 @@ 24.4 /* 24.5 - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. 24.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 24.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 24.8 * 24.9 * This code is free software; you can redistribute it and/or modify it 24.10 @@ -27,95 +27,98 @@ 24.11 24.12 import java.io.OutputStream; 24.13 import java.io.PrintWriter; 24.14 -import java.util.Vector; 24.15 -import java.util.Enumeration; 24.16 -import com.sun.javadoc.*; 24.17 +import java.util.ArrayList; 24.18 +import java.util.List; 24.19 +import javax.lang.model.element.Element; 24.20 +import javax.lang.model.element.ExecutableElement; 24.21 +import javax.lang.model.element.Modifier; 24.22 +import javax.lang.model.element.TypeElement; 24.23 +import javax.lang.model.element.VariableElement; 24.24 +import javax.lang.model.type.ArrayType; 24.25 +import javax.lang.model.type.TypeMirror; 24.26 +import javax.lang.model.util.ElementFilter; 24.27 24.28 24.29 /** 24.30 * Header file generator for JNI. 24.31 * 24.32 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 24.33 + * If you write code that depends on this, you do so at your own 24.34 + * risk. This code and its internal interfaces are subject to change 24.35 + * or deletion without notice.</b></p> 24.36 + * 24.37 * @author Sucheta Dambalkar(Revised) 24.38 */ 24.39 - 24.40 public class JNI extends Gen { 24.41 - 24.42 - public JNI(RootDoc root){ 24.43 - super(root); 24.44 + JNI(Util util) { 24.45 + super(util); 24.46 } 24.47 24.48 public String getIncludes() { 24.49 return "#include <jni.h>"; 24.50 } 24.51 24.52 - public void write(OutputStream o, ClassDoc clazz) 24.53 - throws ClassNotFoundException { 24.54 - 24.55 - String cname = Mangle.mangle(clazz.qualifiedName(), Mangle.Type.CLASS); 24.56 + public void write(OutputStream o, TypeElement clazz) throws Util.Exit { 24.57 + String cname = mangler.mangle(clazz.getQualifiedName(), Mangle.Type.CLASS); 24.58 PrintWriter pw = wrapWriter(o); 24.59 pw.println(guardBegin(cname)); 24.60 pw.println(cppGuardBegin()); 24.61 24.62 /* Write statics. */ 24.63 - FieldDoc[] classfields = getAllFields(clazz); 24.64 + List<VariableElement> classfields = getAllFields(clazz); 24.65 24.66 - for (int i = 0; i < classfields.length; i++) { 24.67 - if (!classfields[i].isStatic()) 24.68 + for (VariableElement v: classfields) { 24.69 + if (!v.getModifiers().contains(Modifier.STATIC)) 24.70 continue; 24.71 String s = null; 24.72 - s = defineForStatic(clazz, classfields[i]); 24.73 + s = defineForStatic(clazz, v); 24.74 if (s != null) { 24.75 pw.println(s); 24.76 } 24.77 } 24.78 24.79 /* Write methods. */ 24.80 - MethodDoc[] classmethods = clazz.methods(); 24.81 - for (int i = 0; i < classmethods.length; i++) { 24.82 - if(classmethods[i].isNative()){ 24.83 - MethodDoc md = classmethods[i]; 24.84 - Type mtr = classmethods[i].returnType(); 24.85 - String sig = md.signature(); 24.86 - TypeSignature newtypesig = new TypeSignature(root); 24.87 - String methodName = md.name(); 24.88 + List<ExecutableElement> classmethods = ElementFilter.methodsIn(clazz.getEnclosedElements()); 24.89 + for (ExecutableElement md: classmethods) { 24.90 + if(md.getModifiers().contains(Modifier.NATIVE)){ 24.91 + TypeMirror mtr = types.erasure(md.getReturnType()); 24.92 + String sig = signature(md); 24.93 + TypeSignature newtypesig = new TypeSignature(elems); 24.94 + CharSequence methodName = md.getSimpleName(); 24.95 boolean longName = false; 24.96 - for (int j = 0; j < classmethods.length; j++) { 24.97 - if ((classmethods[j] != md) 24.98 - && (methodName.equals(classmethods[j].name())) 24.99 - && (classmethods[j].isNative())) 24.100 + for (ExecutableElement md2: classmethods) { 24.101 + if ((md2 != md) 24.102 + && (methodName.equals(md2.getSimpleName())) 24.103 + && (md2.getModifiers().contains(Modifier.NATIVE))) 24.104 longName = true; 24.105 24.106 } 24.107 pw.println("/*"); 24.108 pw.println(" * Class: " + cname); 24.109 pw.println(" * Method: " + 24.110 - Mangle.mangle(methodName, Mangle.Type.FIELDSTUB)); 24.111 + mangler.mangle(methodName, Mangle.Type.FIELDSTUB)); 24.112 pw.println(" * Signature: " + newtypesig.getTypeSignature(sig, mtr)); 24.113 pw.println(" */"); 24.114 pw.println("JNIEXPORT " + jniType(mtr) + 24.115 " JNICALL " + 24.116 - Mangle.mangleMethod(md, root,clazz, 24.117 + mangler.mangleMethod(md, clazz, 24.118 (longName) ? 24.119 Mangle.Type.METHOD_JNI_LONG : 24.120 Mangle.Type.METHOD_JNI_SHORT)); 24.121 pw.print(" (JNIEnv *, "); 24.122 - Parameter[] paramargs = md.parameters(); 24.123 - Type []args =new Type[ paramargs.length]; 24.124 - for(int p = 0; p < paramargs.length; p++){ 24.125 - args[p] = paramargs[p].type(); 24.126 + List<? extends VariableElement> paramargs = md.getParameters(); 24.127 + List<TypeMirror> args = new ArrayList<TypeMirror>(); 24.128 + for (VariableElement p: paramargs) { 24.129 + args.add(types.erasure(p.asType())); 24.130 } 24.131 - if (md.isStatic()) 24.132 + if (md.getModifiers().contains(Modifier.STATIC)) 24.133 pw.print("jclass"); 24.134 else 24.135 pw.print("jobject"); 24.136 - if (args.length > 0) 24.137 + 24.138 + for (TypeMirror arg: args) { 24.139 pw.print(", "); 24.140 - 24.141 - for (int j = 0; j < args.length; j++) { 24.142 - pw.print(jniType(args[j])); 24.143 - if (j != (args.length - 1)) { 24.144 - pw.print(", "); 24.145 - } 24.146 + pw.print(jniType(arg)); 24.147 } 24.148 pw.println(");" + lineSep); 24.149 } 24.150 @@ -125,42 +128,54 @@ 24.151 } 24.152 24.153 24.154 - protected final String jniType(Type t){ 24.155 + protected final String jniType(TypeMirror t) throws Util.Exit { 24.156 + TypeElement throwable = elems.getTypeElement("java.lang.Throwable"); 24.157 + TypeElement jClass = elems.getTypeElement("java.lang.Class"); 24.158 + TypeElement jString = elems.getTypeElement("java.lang.String"); 24.159 + Element tclassDoc = types.asElement(t); 24.160 24.161 - String elmT = t.typeName(); 24.162 - ClassDoc throwable = root.classNamed("java.lang.Throwable"); 24.163 - ClassDoc jClass = root.classNamed("java.lang.Class"); 24.164 - ClassDoc tclassDoc = t.asClassDoc(); 24.165 24.166 - if((t.dimension()).indexOf("[]") != -1){ 24.167 - if((t.dimension().indexOf("[][]") != -1) 24.168 - || (tclassDoc != null)) return "jobjectArray"; 24.169 - else if(elmT.equals("boolean"))return "jbooleanArray"; 24.170 - else if(elmT.equals("byte"))return "jbyteArray"; 24.171 - else if(elmT.equals("char"))return "jcharArray"; 24.172 - else if(elmT.equals("short"))return "jshortArray"; 24.173 - else if(elmT.equals("int"))return "jintArray"; 24.174 - else if(elmT.equals("long"))return "jlongArray"; 24.175 - else if(elmT.equals("float"))return "jfloatArray"; 24.176 - else if(elmT.equals("double"))return "jdoubleArray"; 24.177 - }else{ 24.178 - if(elmT.equals("void"))return "void"; 24.179 - else if(elmT.equals("String"))return "jstring"; 24.180 - else if(elmT.equals("boolean"))return "jboolean"; 24.181 - else if(elmT.equals("byte"))return "jbyte"; 24.182 - else if(elmT.equals("char"))return "jchar"; 24.183 - else if(elmT.equals("short"))return "jshort"; 24.184 - else if(elmT.equals("int"))return "jint"; 24.185 - else if(elmT.equals("long"))return "jlong"; 24.186 - else if(elmT.equals("float"))return "jfloat"; 24.187 - else if(elmT.equals("double"))return "jdouble"; 24.188 - else if(tclassDoc != null){ 24.189 - if(tclassDoc.subclassOf(throwable)) return "jthrowable"; 24.190 - else if(tclassDoc.subclassOf(jClass)) return "jclass"; 24.191 - else return "jobject"; 24.192 + switch (t.getKind()) { 24.193 + case ARRAY: { 24.194 + TypeMirror ct = ((ArrayType) t).getComponentType(); 24.195 + switch (ct.getKind()) { 24.196 + case BOOLEAN: return "jbooleanArray"; 24.197 + case BYTE: return "jbyteArray"; 24.198 + case CHAR: return "jcharArray"; 24.199 + case SHORT: return "jshortArray"; 24.200 + case INT: return "jintArray"; 24.201 + case LONG: return "jlongArray"; 24.202 + case FLOAT: return "jfloatArray"; 24.203 + case DOUBLE: return "jdoubleArray"; 24.204 + case ARRAY: 24.205 + case DECLARED: return "jobjectArray"; 24.206 + default: throw new Error(ct.toString()); 24.207 + } 24.208 + } 24.209 + 24.210 + case VOID: return "void"; 24.211 + case BOOLEAN: return "jboolean"; 24.212 + case BYTE: return "jbyte"; 24.213 + case CHAR: return "jchar"; 24.214 + case SHORT: return "jshort"; 24.215 + case INT: return "jint"; 24.216 + case LONG: return "jlong"; 24.217 + case FLOAT: return "jfloat"; 24.218 + case DOUBLE: return "jdouble"; 24.219 + 24.220 + case DECLARED: { 24.221 + if (tclassDoc.equals(jString)) 24.222 + return "jstring"; 24.223 + else if (types.isAssignable(t, throwable.asType())) 24.224 + return "jthrowable"; 24.225 + else if (types.isAssignable(t, jClass.asType())) 24.226 + return "jclass"; 24.227 + else 24.228 + return "jobject"; 24.229 } 24.230 } 24.231 - Util.bug("jni.unknown.type"); 24.232 + 24.233 + util.bug("jni.unknown.type"); 24.234 return null; /* dead code. */ 24.235 } 24.236 }
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 25.2 +++ b/src/share/classes/com/sun/tools/javah/JavahFileManager.java Wed Oct 07 14:14:45 2009 -0700 25.3 @@ -0,0 +1,63 @@ 25.4 +/* 25.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 25.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 25.7 + * 25.8 + * This code is free software; you can redistribute it and/or modify it 25.9 + * under the terms of the GNU General Public License version 2 only, as 25.10 + * published by the Free Software Foundation. Sun designates this 25.11 + * particular file as subject to the "Classpath" exception as provided 25.12 + * by Sun in the LICENSE file that accompanied this code. 25.13 + * 25.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 25.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 25.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 25.17 + * version 2 for more details (a copy is included in the LICENSE file that 25.18 + * accompanied this code). 25.19 + * 25.20 + * You should have received a copy of the GNU General Public License version 25.21 + * 2 along with this work; if not, write to the Free Software Foundation, 25.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 25.23 + * 25.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 25.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 25.26 + * have any questions. 25.27 + */ 25.28 + 25.29 +package com.sun.tools.javah; 25.30 + 25.31 +import java.io.PrintWriter; 25.32 +import java.nio.charset.Charset; 25.33 +import javax.tools.DiagnosticListener; 25.34 +import javax.tools.JavaFileObject; 25.35 + 25.36 +import com.sun.tools.javac.file.JavacFileManager; 25.37 +import com.sun.tools.javac.util.Context; 25.38 + 25.39 +/** 25.40 + * javah's implementation of JavaFileManager. 25.41 + * 25.42 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 25.43 + * you write code that depends on this, you do so at your own risk. 25.44 + * This code and its internal interfaces are subject to change or 25.45 + * deletion without notice.</b> 25.46 + */ 25.47 +class JavahFileManager extends JavacFileManager { 25.48 + private JavahFileManager(Context context, Charset charset) { 25.49 + super(context, true, charset); 25.50 + setIgnoreSymbolFile(true); 25.51 + } 25.52 + 25.53 + static JavahFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { 25.54 + Context javac_context = new Context(); 25.55 + 25.56 + if (dl != null) 25.57 + javac_context.put(DiagnosticListener.class, dl); 25.58 + javac_context.put(com.sun.tools.javac.util.Log.outKey, log); 25.59 + 25.60 + return new JavahFileManager(javac_context, null); 25.61 + } 25.62 + 25.63 + void setIgnoreSymbolFile(boolean b) { 25.64 + ignoreSymbolFile = b; 25.65 + } 25.66 +}
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 26.2 +++ b/src/share/classes/com/sun/tools/javah/JavahTask.java Wed Oct 07 14:14:45 2009 -0700 26.3 @@ -0,0 +1,724 @@ 26.4 +/* 26.5 + * Copyright 2002-2009 Sun Microsystems, Inc. All Rights Reserved. 26.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 26.7 + * 26.8 + * This code is free software; you can redistribute it and/or modify it 26.9 + * under the terms of the GNU General Public License version 2 only, as 26.10 + * published by the Free Software Foundation. Sun designates this 26.11 + * particular file as subject to the "Classpath" exception as provided 26.12 + * by Sun in the LICENSE file that accompanied this code. 26.13 + * 26.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 26.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 26.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 26.17 + * version 2 for more details (a copy is included in the LICENSE file that 26.18 + * accompanied this code). 26.19 + * 26.20 + * You should have received a copy of the GNU General Public License version 26.21 + * 2 along with this work; if not, write to the Free Software Foundation, 26.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 26.23 + * 26.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 26.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 26.26 + * have any questions. 26.27 + */ 26.28 + 26.29 +package com.sun.tools.javah; 26.30 + 26.31 +import java.io.File; 26.32 +import java.io.IOException; 26.33 +import java.io.OutputStream; 26.34 +import java.io.PrintWriter; 26.35 +import java.io.Writer; 26.36 +import java.text.MessageFormat; 26.37 +import java.util.ArrayList; 26.38 +import java.util.Arrays; 26.39 +import java.util.Collections; 26.40 +import java.util.HashMap; 26.41 +import java.util.Iterator; 26.42 +import java.util.LinkedHashSet; 26.43 +import java.util.List; 26.44 +import java.util.Locale; 26.45 +import java.util.Map; 26.46 +import java.util.MissingResourceException; 26.47 +import java.util.ResourceBundle; 26.48 +import java.util.Set; 26.49 + 26.50 +import javax.annotation.processing.AbstractProcessor; 26.51 +import javax.annotation.processing.Messager; 26.52 +import javax.annotation.processing.RoundEnvironment; 26.53 +import javax.annotation.processing.SupportedAnnotationTypes; 26.54 +import javax.annotation.processing.SupportedSourceVersion; 26.55 + 26.56 +import javax.lang.model.SourceVersion; 26.57 +import javax.lang.model.element.ExecutableElement; 26.58 +import javax.lang.model.element.TypeElement; 26.59 +import javax.lang.model.element.VariableElement; 26.60 +import javax.lang.model.type.ArrayType; 26.61 +import javax.lang.model.type.DeclaredType; 26.62 +import javax.lang.model.type.TypeMirror; 26.63 +import javax.lang.model.type.TypeVisitor; 26.64 +import javax.lang.model.util.ElementFilter; 26.65 +import javax.lang.model.util.SimpleTypeVisitor6; 26.66 +import javax.lang.model.util.Types; 26.67 + 26.68 +import javax.tools.Diagnostic; 26.69 +import javax.tools.DiagnosticListener; 26.70 +import javax.tools.JavaCompiler; 26.71 +import javax.tools.JavaCompiler.CompilationTask; 26.72 +import javax.tools.JavaFileManager; 26.73 +import javax.tools.JavaFileObject; 26.74 +import javax.tools.StandardJavaFileManager; 26.75 +import javax.tools.StandardLocation; 26.76 +import javax.tools.ToolProvider; 26.77 + 26.78 +/** 26.79 + * Javah generates support files for native methods. 26.80 + * Parse commandline options & Invokes javadoc to execute those commands. 26.81 + * 26.82 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 26.83 + * If you write code that depends on this, you do so at your own 26.84 + * risk. This code and its internal interfaces are subject to change 26.85 + * or deletion without notice.</b></p> 26.86 + * 26.87 + * @author Sucheta Dambalkar 26.88 + * @author Jonathan Gibbons 26.89 + */ 26.90 +public class JavahTask implements NativeHeaderTool.NativeHeaderTask { 26.91 + public class BadArgs extends Exception { 26.92 + private static final long serialVersionUID = 1479361270874789045L; 26.93 + BadArgs(String key, Object... args) { 26.94 + super(JavahTask.this.getMessage(key, args)); 26.95 + this.key = key; 26.96 + this.args = args; 26.97 + } 26.98 + 26.99 + BadArgs showUsage(boolean b) { 26.100 + showUsage = b; 26.101 + return this; 26.102 + } 26.103 + 26.104 + final String key; 26.105 + final Object[] args; 26.106 + boolean showUsage; 26.107 + } 26.108 + 26.109 + static abstract class Option { 26.110 + Option(boolean hasArg, String... aliases) { 26.111 + this.hasArg = hasArg; 26.112 + this.aliases = aliases; 26.113 + } 26.114 + 26.115 + boolean isHidden() { 26.116 + return false; 26.117 + } 26.118 + 26.119 + boolean matches(String opt) { 26.120 + for (String a: aliases) { 26.121 + if (a.equals(opt)) 26.122 + return true; 26.123 + } 26.124 + return false; 26.125 + } 26.126 + 26.127 + boolean ignoreRest() { 26.128 + return false; 26.129 + } 26.130 + 26.131 + abstract void process(JavahTask task, String opt, String arg) throws BadArgs; 26.132 + 26.133 + final boolean hasArg; 26.134 + final String[] aliases; 26.135 + } 26.136 + 26.137 + static abstract class HiddenOption extends Option { 26.138 + HiddenOption(boolean hasArg, String... aliases) { 26.139 + super(hasArg, aliases); 26.140 + } 26.141 + 26.142 + @Override 26.143 + boolean isHidden() { 26.144 + return true; 26.145 + } 26.146 + } 26.147 + 26.148 + static Option[] recognizedOptions = { 26.149 + new Option(true, "-o") { 26.150 + void process(JavahTask task, String opt, String arg) { 26.151 + task.ofile = new File(arg); 26.152 + } 26.153 + }, 26.154 + 26.155 + new Option(true, "-d") { 26.156 + void process(JavahTask task, String opt, String arg) { 26.157 + task.odir = new File(arg); 26.158 + } 26.159 + }, 26.160 + 26.161 + new HiddenOption(true, "-td") { 26.162 + void process(JavahTask task, String opt, String arg) { 26.163 + // ignored; for backwards compatibility 26.164 + } 26.165 + }, 26.166 + 26.167 + new HiddenOption(false, "-stubs") { 26.168 + void process(JavahTask task, String opt, String arg) { 26.169 + // ignored; for backwards compatibility 26.170 + } 26.171 + }, 26.172 + 26.173 + new Option(false, "-v", "-verbose") { 26.174 + void process(JavahTask task, String opt, String arg) { 26.175 + task.verbose = true; 26.176 + } 26.177 + }, 26.178 + 26.179 + new Option(false, "-help", "--help", "-?") { 26.180 + void process(JavahTask task, String opt, String arg) { 26.181 + task.help = true; 26.182 + } 26.183 + }, 26.184 + 26.185 + new HiddenOption(false, "-trace") { 26.186 + void process(JavahTask task, String opt, String arg) { 26.187 + task.trace = true; 26.188 + } 26.189 + }, 26.190 + 26.191 + new Option(false, "-version") { 26.192 + void process(JavahTask task, String opt, String arg) { 26.193 + task.version = true; 26.194 + } 26.195 + }, 26.196 + 26.197 + new HiddenOption(false, "-fullversion") { 26.198 + void process(JavahTask task, String opt, String arg) { 26.199 + task.fullVersion = true; 26.200 + } 26.201 + }, 26.202 + 26.203 + new Option(false, "-jni") { 26.204 + void process(JavahTask task, String opt, String arg) { 26.205 + task.jni = true; 26.206 + } 26.207 + }, 26.208 + 26.209 + new Option(false, "-force") { 26.210 + void process(JavahTask task, String opt, String arg) { 26.211 + task.force = true; 26.212 + } 26.213 + }, 26.214 + 26.215 + new HiddenOption(false, "-Xnew") { 26.216 + void process(JavahTask task, String opt, String arg) { 26.217 + // we're already using the new javah 26.218 + } 26.219 + }, 26.220 + 26.221 + new HiddenOption(false, "-old") { 26.222 + void process(JavahTask task, String opt, String arg) { 26.223 + task.old = true; 26.224 + } 26.225 + }, 26.226 + 26.227 + new HiddenOption(false, "-llni", "-Xllni") { 26.228 + void process(JavahTask task, String opt, String arg) { 26.229 + task.llni = true; 26.230 + } 26.231 + }, 26.232 + 26.233 + new HiddenOption(false, "-llnidouble") { 26.234 + void process(JavahTask task, String opt, String arg) { 26.235 + task.llni = true; 26.236 + task.doubleAlign = true; 26.237 + } 26.238 + }, 26.239 + }; 26.240 + 26.241 + JavahTask() { 26.242 + } 26.243 + 26.244 + JavahTask(Writer out, 26.245 + JavaFileManager fileManager, 26.246 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 26.247 + Iterable<String> options, 26.248 + Iterable<String> classes) { 26.249 + this(); 26.250 + this.log = getPrintWriterForWriter(out); 26.251 + this.fileManager = fileManager; 26.252 + this.diagnosticListener = diagnosticListener; 26.253 + 26.254 + try { 26.255 + handleOptions(options, false); 26.256 + } catch (BadArgs e) { 26.257 + throw new IllegalArgumentException(e.getMessage()); 26.258 + } 26.259 + 26.260 + this.classes = new ArrayList<String>(); 26.261 + for (String classname: classes) { 26.262 + classname.getClass(); // null-check 26.263 + this.classes.add(classname); 26.264 + } 26.265 + } 26.266 + 26.267 + public void setLocale(Locale locale) { 26.268 + if (locale == null) 26.269 + locale = Locale.getDefault(); 26.270 + task_locale = locale; 26.271 + } 26.272 + 26.273 + public void setLog(PrintWriter log) { 26.274 + this.log = log; 26.275 + } 26.276 + 26.277 + public void setLog(OutputStream s) { 26.278 + setLog(getPrintWriterForStream(s)); 26.279 + } 26.280 + 26.281 + static PrintWriter getPrintWriterForStream(OutputStream s) { 26.282 + return new PrintWriter(s, true); 26.283 + } 26.284 + 26.285 + static PrintWriter getPrintWriterForWriter(Writer w) { 26.286 + if (w == null) 26.287 + return getPrintWriterForStream(null); 26.288 + else if (w instanceof PrintWriter) 26.289 + return (PrintWriter) w; 26.290 + else 26.291 + return new PrintWriter(w, true); 26.292 + } 26.293 + 26.294 + public void setDiagnosticListener(DiagnosticListener<? super JavaFileObject> dl) { 26.295 + diagnosticListener = dl; 26.296 + } 26.297 + 26.298 + public void setDiagnosticListener(OutputStream s) { 26.299 + setDiagnosticListener(getDiagnosticListenerForStream(s)); 26.300 + } 26.301 + 26.302 + private DiagnosticListener<JavaFileObject> getDiagnosticListenerForStream(OutputStream s) { 26.303 + return getDiagnosticListenerForWriter(getPrintWriterForStream(s)); 26.304 + } 26.305 + 26.306 + private DiagnosticListener<JavaFileObject> getDiagnosticListenerForWriter(Writer w) { 26.307 + final PrintWriter pw = getPrintWriterForWriter(w); 26.308 + return new DiagnosticListener<JavaFileObject> () { 26.309 + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { 26.310 + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { 26.311 + pw.print(getMessage("err.prefix")); 26.312 + pw.print(" "); 26.313 + } 26.314 + pw.println(diagnostic.getMessage(null)); 26.315 + } 26.316 + }; 26.317 + } 26.318 + 26.319 + int run(String[] args) { 26.320 + try { 26.321 + handleOptions(args); 26.322 + boolean ok = run(); 26.323 + return ok ? 0 : 1; 26.324 + } catch (BadArgs e) { 26.325 + diagnosticListener.report(createDiagnostic(e.key, e.args)); 26.326 + return 1; 26.327 + } catch (InternalError e) { 26.328 + diagnosticListener.report(createDiagnostic("err.internal.error", e.getMessage())); 26.329 + return 1; 26.330 + } finally { 26.331 + log.flush(); 26.332 + } 26.333 + } 26.334 + 26.335 + public void handleOptions(String[] args) throws BadArgs { 26.336 + handleOptions(Arrays.asList(args), true); 26.337 + } 26.338 + 26.339 + private void handleOptions(Iterable<String> args, boolean allowClasses) throws BadArgs { 26.340 + if (log == null) { 26.341 + log = getPrintWriterForStream(System.out); 26.342 + if (diagnosticListener == null) 26.343 + diagnosticListener = getDiagnosticListenerForStream(System.err); 26.344 + } else { 26.345 + if (diagnosticListener == null) 26.346 + diagnosticListener = getDiagnosticListenerForWriter(log); 26.347 + } 26.348 + 26.349 + if (fileManager == null) 26.350 + fileManager = getDefaultFileManager(diagnosticListener, log); 26.351 + 26.352 + Iterator<String> iter = args.iterator(); 26.353 + if (!iter.hasNext()) 26.354 + help = true; 26.355 + 26.356 + while (iter.hasNext()) { 26.357 + String arg = iter.next(); 26.358 + if (arg.startsWith("-")) 26.359 + handleOption(arg, iter); 26.360 + else if (allowClasses) { 26.361 + if (classes == null) 26.362 + classes = new ArrayList<String>(); 26.363 + classes.add(arg); 26.364 + while (iter.hasNext()) 26.365 + classes.add(iter.next()); 26.366 + } else 26.367 + throw new BadArgs("err.unknown.option", arg).showUsage(true); 26.368 + } 26.369 + 26.370 + if ((classes == null || classes.size() == 0) && 26.371 + !(help || version || fullVersion)) { 26.372 + throw new BadArgs("err.no.classes.specified"); 26.373 + } 26.374 + 26.375 + if (jni && llni) 26.376 + throw new BadArgs("jni.llni.mixed"); 26.377 + 26.378 + if (odir != null && ofile != null) 26.379 + throw new BadArgs("dir.file.mixed"); 26.380 + } 26.381 + 26.382 + private void handleOption(String name, Iterator<String> rest) throws BadArgs { 26.383 + for (Option o: recognizedOptions) { 26.384 + if (o.matches(name)) { 26.385 + if (o.hasArg) { 26.386 + if (rest.hasNext()) 26.387 + o.process(this, name, rest.next()); 26.388 + else 26.389 + throw new BadArgs("err.missing.arg", name).showUsage(true); 26.390 + } else 26.391 + o.process(this, name, null); 26.392 + 26.393 + if (o.ignoreRest()) { 26.394 + while (rest.hasNext()) 26.395 + rest.next(); 26.396 + } 26.397 + return; 26.398 + } 26.399 + } 26.400 + 26.401 + if (fileManager.handleOption(name, rest)) 26.402 + return; 26.403 + 26.404 + throw new BadArgs("err.unknown.option", name).showUsage(true); 26.405 + } 26.406 + 26.407 + public Boolean call() { 26.408 + return run(); 26.409 + } 26.410 + 26.411 + public boolean run() throws Util.Exit { 26.412 + 26.413 + Util util = new Util(log, diagnosticListener); 26.414 + 26.415 + if (help) { 26.416 + showHelp(); 26.417 + return true; 26.418 + } 26.419 + 26.420 + if (version || fullVersion) { 26.421 + showVersion(fullVersion); 26.422 + return true; 26.423 + } 26.424 + 26.425 + util.verbose = verbose; 26.426 + 26.427 + Gen g; 26.428 + 26.429 + if (llni) 26.430 + g = new LLNI(doubleAlign, util); 26.431 + else { 26.432 +// if (stubs) 26.433 +// throw new BadArgs("jni.no.stubs"); 26.434 + g = new JNI(util); 26.435 + } 26.436 + 26.437 + if (ofile != null) { 26.438 + if (!(fileManager instanceof StandardJavaFileManager)) { 26.439 + diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-o")); 26.440 + return false; 26.441 + } 26.442 + Iterable<? extends JavaFileObject> iter = 26.443 + ((StandardJavaFileManager) fileManager).getJavaFileObjectsFromFiles(Collections.singleton(ofile)); 26.444 + JavaFileObject fo = iter.iterator().next(); 26.445 + g.setOutFile(fo); 26.446 + } else { 26.447 + if (odir != null) { 26.448 + if (!(fileManager instanceof StandardJavaFileManager)) { 26.449 + diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-d")); 26.450 + return false; 26.451 + } 26.452 + 26.453 + if (!odir.exists()) 26.454 + if (!odir.mkdirs()) 26.455 + util.error("cant.create.dir", odir.toString()); 26.456 + try { 26.457 + ((StandardJavaFileManager) fileManager).setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(odir)); 26.458 + } catch (IOException e) { 26.459 + Object msg = e.getLocalizedMessage(); 26.460 + if (msg == null) { 26.461 + msg = e; 26.462 + } 26.463 + diagnosticListener.report(createDiagnostic("err.ioerror", odir, msg)); 26.464 + return false; 26.465 + } 26.466 + } 26.467 + g.setFileManager(fileManager); 26.468 + } 26.469 + 26.470 + /* 26.471 + * Force set to false will turn off smarts about checking file 26.472 + * content before writing. 26.473 + */ 26.474 + g.setForce(force); 26.475 + 26.476 + if (fileManager instanceof JavahFileManager) 26.477 + ((JavahFileManager) fileManager).setIgnoreSymbolFile(true); 26.478 + 26.479 + JavaCompiler c = ToolProvider.getSystemJavaCompiler(); 26.480 + List<String> opts = Arrays.asList("-proc:only"); 26.481 + CompilationTask t = c.getTask(log, fileManager, diagnosticListener, opts, internalize(classes), null); 26.482 + JavahProcessor p = new JavahProcessor(g); 26.483 + t.setProcessors(Collections.singleton(p)); 26.484 + 26.485 + boolean ok = t.call(); 26.486 + if (p.exit != null) 26.487 + throw new Util.Exit(p.exit); 26.488 + return ok; 26.489 + } 26.490 + 26.491 + private List<String> internalize(List<String> classes) { 26.492 + List<String> l = new ArrayList<String>(); 26.493 + for (String c: classes) { 26.494 + l.add(c.replace('$', '.')); 26.495 + } 26.496 + return l; 26.497 + } 26.498 + 26.499 + private List<File> pathToFiles(String path) { 26.500 + List<File> files = new ArrayList<File>(); 26.501 + for (String f: path.split(File.pathSeparator)) { 26.502 + if (f.length() > 0) 26.503 + files.add(new File(f)); 26.504 + } 26.505 + return files; 26.506 + } 26.507 + 26.508 + static StandardJavaFileManager getDefaultFileManager(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { 26.509 + return JavahFileManager.create(dl, log); 26.510 + } 26.511 + 26.512 + private void showHelp() { 26.513 + log.println(getMessage("main.usage", progname)); 26.514 + for (Option o: recognizedOptions) { 26.515 + if (o.isHidden()) 26.516 + continue; 26.517 + String name = o.aliases[0].substring(1); // there must always be at least one name 26.518 + log.println(getMessage("main.opt." + name)); 26.519 + } 26.520 + String[] fmOptions = { "-classpath", "-bootclasspath" }; 26.521 + for (String o: fmOptions) { 26.522 + if (fileManager.isSupportedOption(o) == -1) 26.523 + continue; 26.524 + String name = o.substring(1); 26.525 + log.println(getMessage("main.opt." + name)); 26.526 + } 26.527 + log.println(getMessage("main.usage.foot")); 26.528 + } 26.529 + 26.530 + private void showVersion(boolean full) { 26.531 + log.println(version(full ? "full" : "release")); 26.532 + } 26.533 + 26.534 + private static final String versionRBName = "com.sun.tools.javah.resources.version"; 26.535 + private static ResourceBundle versionRB; 26.536 + 26.537 + private String version(String key) { 26.538 + // key=version: mm.nn.oo[-milestone] 26.539 + // key=full: mm.mm.oo[-milestone]-build 26.540 + if (versionRB == null) { 26.541 + try { 26.542 + versionRB = ResourceBundle.getBundle(versionRBName); 26.543 + } catch (MissingResourceException e) { 26.544 + return getMessage("version.resource.missing", System.getProperty("java.version")); 26.545 + } 26.546 + } 26.547 + try { 26.548 + return versionRB.getString(key); 26.549 + } 26.550 + catch (MissingResourceException e) { 26.551 + return getMessage("version.unknown", System.getProperty("java.version")); 26.552 + } 26.553 + } 26.554 + 26.555 + private Diagnostic<JavaFileObject> createDiagnostic(final String key, final Object... args) { 26.556 + return new Diagnostic<JavaFileObject>() { 26.557 + public Kind getKind() { 26.558 + return Diagnostic.Kind.ERROR; 26.559 + } 26.560 + 26.561 + public JavaFileObject getSource() { 26.562 + return null; 26.563 + } 26.564 + 26.565 + public long getPosition() { 26.566 + return Diagnostic.NOPOS; 26.567 + } 26.568 + 26.569 + public long getStartPosition() { 26.570 + return Diagnostic.NOPOS; 26.571 + } 26.572 + 26.573 + public long getEndPosition() { 26.574 + return Diagnostic.NOPOS; 26.575 + } 26.576 + 26.577 + public long getLineNumber() { 26.578 + return Diagnostic.NOPOS; 26.579 + } 26.580 + 26.581 + public long getColumnNumber() { 26.582 + return Diagnostic.NOPOS; 26.583 + } 26.584 + 26.585 + public String getCode() { 26.586 + return key; 26.587 + } 26.588 + 26.589 + public String getMessage(Locale locale) { 26.590 + return JavahTask.this.getMessage(locale, key, args); 26.591 + } 26.592 + 26.593 + }; 26.594 + 26.595 + } 26.596 + private String getMessage(String key, Object... args) { 26.597 + return getMessage(task_locale, key, args); 26.598 + } 26.599 + 26.600 + private String getMessage(Locale locale, String key, Object... args) { 26.601 + if (bundles == null) { 26.602 + // could make this a HashMap<Locale,SoftReference<ResourceBundle>> 26.603 + // and for efficiency, keep a hard reference to the bundle for the task 26.604 + // locale 26.605 + bundles = new HashMap<Locale, ResourceBundle>(); 26.606 + } 26.607 + 26.608 + if (locale == null) 26.609 + locale = Locale.getDefault(); 26.610 + 26.611 + ResourceBundle b = bundles.get(locale); 26.612 + if (b == null) { 26.613 + try { 26.614 + b = ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n", locale); 26.615 + bundles.put(locale, b); 26.616 + } catch (MissingResourceException e) { 26.617 + throw new InternalError("Cannot find javah resource bundle for locale " + locale, e); 26.618 + } 26.619 + } 26.620 + 26.621 + try { 26.622 + return MessageFormat.format(b.getString(key), args); 26.623 + } catch (MissingResourceException e) { 26.624 + return key; 26.625 + //throw new InternalError(e, key); 26.626 + } 26.627 + } 26.628 + 26.629 + File ofile; 26.630 + File odir; 26.631 + String bootcp; 26.632 + String usercp; 26.633 + List<String> classes; 26.634 + boolean verbose; 26.635 + boolean help; 26.636 + boolean trace; 26.637 + boolean version; 26.638 + boolean fullVersion; 26.639 + boolean jni; 26.640 + boolean llni; 26.641 + boolean doubleAlign; 26.642 + boolean force; 26.643 + boolean old; 26.644 + 26.645 + PrintWriter log; 26.646 + JavaFileManager fileManager; 26.647 + DiagnosticListener<? super JavaFileObject> diagnosticListener; 26.648 + Locale task_locale; 26.649 + Map<Locale, ResourceBundle> bundles; 26.650 + 26.651 + private static final String progname = "javah"; 26.652 + 26.653 + @SupportedAnnotationTypes("*") 26.654 + @SupportedSourceVersion(SourceVersion.RELEASE_7) 26.655 + class JavahProcessor extends AbstractProcessor { 26.656 + JavahProcessor(Gen g) { 26.657 + this.g = g; 26.658 + } 26.659 + 26.660 + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 26.661 + Messager messager = processingEnv.getMessager(); 26.662 + Set<TypeElement> classes = getAllClasses(ElementFilter.typesIn(roundEnv.getRootElements())); 26.663 + if (classes.size() > 0) { 26.664 + checkMethodParameters(classes); 26.665 + g.setProcessingEnvironment(processingEnv); 26.666 + g.setClasses(classes); 26.667 + 26.668 + try { 26.669 + g.run(); 26.670 + } catch (ClassNotFoundException cnfe) { 26.671 + messager.printMessage(Diagnostic.Kind.ERROR, getMessage("class.not.found", cnfe.getMessage())); 26.672 + } catch (IOException ioe) { 26.673 + messager.printMessage(Diagnostic.Kind.ERROR, getMessage("io.exception", ioe.getMessage())); 26.674 + } catch (Util.Exit e) { 26.675 + exit = e; 26.676 + } 26.677 + } 26.678 + return true; 26.679 + } 26.680 + 26.681 + private Set<TypeElement> getAllClasses(Set<? extends TypeElement> classes) { 26.682 + Set<TypeElement> allClasses = new LinkedHashSet<TypeElement>(); 26.683 + getAllClasses0(classes, allClasses); 26.684 + return allClasses; 26.685 + } 26.686 + 26.687 + private void getAllClasses0(Iterable<? extends TypeElement> classes, Set<TypeElement> allClasses) { 26.688 + for (TypeElement c: classes) { 26.689 + allClasses.add(c); 26.690 + getAllClasses0(ElementFilter.typesIn(c.getEnclosedElements()), allClasses); 26.691 + } 26.692 + } 26.693 + 26.694 + // 4942232: 26.695 + // check that classes exist for all the parameters of native methods 26.696 + private void checkMethodParameters(Set<TypeElement> classes) { 26.697 + Types types = processingEnv.getTypeUtils(); 26.698 + for (TypeElement te: classes) { 26.699 + for (ExecutableElement ee: ElementFilter.methodsIn(te.getEnclosedElements())) { 26.700 + for (VariableElement ve: ee.getParameters()) { 26.701 + TypeMirror tm = ve.asType(); 26.702 + checkMethodParametersVisitor.visit(tm, types); 26.703 + } 26.704 + } 26.705 + } 26.706 + } 26.707 + 26.708 + private TypeVisitor<Void,Types> checkMethodParametersVisitor = 26.709 + new SimpleTypeVisitor6<Void,Types>() { 26.710 + @Override 26.711 + public Void visitArray(ArrayType t, Types types) { 26.712 + visit(t.getComponentType(), types); 26.713 + return null; 26.714 + } 26.715 + @Override 26.716 + public Void visitDeclared(DeclaredType t, Types types) { 26.717 + t.asElement().getKind(); // ensure class exists 26.718 + for (TypeMirror st: types.directSupertypes(t)) 26.719 + visit(st, types); 26.720 + return null; 26.721 + } 26.722 + }; 26.723 + 26.724 + private Gen g; 26.725 + private Util.Exit exit; 26.726 + } 26.727 +}
27.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 27.2 +++ b/src/share/classes/com/sun/tools/javah/JavahTool.java Wed Oct 07 14:14:45 2009 -0700 27.3 @@ -0,0 +1,84 @@ 27.4 +/* 27.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 27.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 27.7 + * 27.8 + * This code is free software; you can redistribute it and/or modify it 27.9 + * under the terms of the GNU General Public License version 2 only, as 27.10 + * published by the Free Software Foundation. Sun designates this 27.11 + * particular file as subject to the "Classpath" exception as provided 27.12 + * by Sun in the LICENSE file that accompanied this code. 27.13 + * 27.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 27.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 27.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 27.17 + * version 2 for more details (a copy is included in the LICENSE file that 27.18 + * accompanied this code). 27.19 + * 27.20 + * You should have received a copy of the GNU General Public License version 27.21 + * 2 along with this work; if not, write to the Free Software Foundation, 27.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 27.23 + * 27.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 27.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 27.26 + * have any questions. 27.27 + */ 27.28 + 27.29 +package com.sun.tools.javah; 27.30 + 27.31 +import java.io.InputStream; 27.32 +import java.io.OutputStream; 27.33 +import java.io.Writer; 27.34 +import java.nio.charset.Charset; 27.35 +import java.util.Arrays; 27.36 +import java.util.EnumSet; 27.37 +import java.util.Locale; 27.38 +import java.util.Set; 27.39 +import javax.lang.model.SourceVersion; 27.40 +import javax.tools.DiagnosticListener; 27.41 +import javax.tools.JavaFileManager; 27.42 +import javax.tools.JavaFileObject; 27.43 +import javax.tools.StandardJavaFileManager; 27.44 + 27.45 +/* 27.46 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 27.47 + * If you write code that depends on this, you do so at your own 27.48 + * risk. This code and its internal interfaces are subject to change 27.49 + * or deletion without notice.</b></p> 27.50 + */ 27.51 +public class JavahTool implements NativeHeaderTool { 27.52 + 27.53 + public NativeHeaderTask getTask(Writer out, 27.54 + JavaFileManager fileManager, 27.55 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 27.56 + Iterable<String> options, 27.57 + Iterable<String> classes) { 27.58 + return new JavahTask(out, fileManager, diagnosticListener, options, classes); 27.59 + } 27.60 + 27.61 + public StandardJavaFileManager getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) { 27.62 + return JavahTask.getDefaultFileManager(diagnosticListener, null); 27.63 + } 27.64 + 27.65 + public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) { 27.66 + JavahTask t = new JavahTask( 27.67 + JavahTask.getPrintWriterForStream(out), 27.68 + null, 27.69 + null, 27.70 + Arrays.asList(arguments), 27.71 + null); 27.72 + return (t.run() ? 0 : 1); 27.73 + } 27.74 + 27.75 + public Set<SourceVersion> getSourceVersions() { 27.76 + return EnumSet.allOf(SourceVersion.class); 27.77 + } 27.78 + 27.79 + public int isSupportedOption(String option) { 27.80 + JavahTask.Option[] options = JavahTask.recognizedOptions; 27.81 + for (int i = 0; i < options.length; i++) { 27.82 + if (options[i].matches(option)) 27.83 + return (options[i].hasArg ? 1 : 0); 27.84 + } 27.85 + return -1; 27.86 + } 27.87 +}
28.1 --- a/src/share/classes/com/sun/tools/javah/LLNI.java Fri Oct 02 11:26:53 2009 -0700 28.2 +++ b/src/share/classes/com/sun/tools/javah/LLNI.java Wed Oct 07 14:14:45 2009 -0700 28.3 @@ -1,5 +1,5 @@ 28.4 /* 28.5 - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. 28.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 28.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 28.8 * 28.9 * This code is free software; you can redistribute it and/or modify it 28.10 @@ -26,49 +26,65 @@ 28.11 28.12 package com.sun.tools.javah; 28.13 28.14 -import java.io.File; 28.15 import java.io.OutputStream; 28.16 import java.io.PrintWriter; 28.17 -import java.util.Hashtable; 28.18 -import com.sun.javadoc.*; 28.19 +import java.util.ArrayList; 28.20 +import java.util.HashSet; 28.21 +import java.util.List; 28.22 28.23 - /* 28.24 - * @author Sucheta Dambalkar(Revised) 28.25 - */ 28.26 +import java.util.Set; 28.27 +import javax.lang.model.element.Element; 28.28 +import javax.lang.model.element.ExecutableElement; 28.29 +import javax.lang.model.element.Modifier; 28.30 +import javax.lang.model.element.Name; 28.31 +import javax.lang.model.element.TypeElement; 28.32 +import javax.lang.model.element.VariableElement; 28.33 +import javax.lang.model.type.ArrayType; 28.34 +import javax.lang.model.type.PrimitiveType; 28.35 +import javax.lang.model.type.TypeKind; 28.36 +import javax.lang.model.type.TypeMirror; 28.37 +import javax.lang.model.type.TypeVisitor; 28.38 +import javax.lang.model.util.ElementFilter; 28.39 +import javax.lang.model.util.SimpleTypeVisitor6; 28.40 + 28.41 +/* 28.42 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 28.43 + * If you write code that depends on this, you do so at your own 28.44 + * risk. This code and its internal interfaces are subject to change 28.45 + * or deletion without notice.</b></p> 28.46 + * 28.47 + * @author Sucheta Dambalkar(Revised) 28.48 + */ 28.49 public class LLNI extends Gen { 28.50 28.51 - protected final char pathChar = File.separatorChar; 28.52 protected final char innerDelim = '$'; /* For inner classes */ 28.53 - protected Hashtable<Object, Object> doneHandleTypes; 28.54 - MemberDoc []fields; 28.55 - MemberDoc [] methods; 28.56 + protected Set<String> doneHandleTypes; 28.57 + List<VariableElement> fields; 28.58 + List<ExecutableElement> methods; 28.59 private boolean doubleAlign; 28.60 private int padFieldNum = 0; 28.61 28.62 - 28.63 - LLNI(boolean doubleAlign, RootDoc root) { 28.64 - super(root); 28.65 + LLNI(boolean doubleAlign, Util util) { 28.66 + super(util); 28.67 this.doubleAlign = doubleAlign; 28.68 } 28.69 28.70 - 28.71 protected String getIncludes() { 28.72 return ""; 28.73 } 28.74 28.75 - protected void write(OutputStream o, ClassDoc clazz) 28.76 - throws ClassNotFoundException { 28.77 - String cname = mangleClassName(clazz.qualifiedName()); 28.78 + protected void write(OutputStream o, TypeElement clazz) throws Util.Exit { 28.79 + String cname = mangleClassName(clazz.getQualifiedName().toString()); 28.80 PrintWriter pw = wrapWriter(o); 28.81 - fields = clazz.fields(); 28.82 - methods = clazz.methods(); 28.83 + fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 28.84 + methods = ElementFilter.methodsIn(clazz.getEnclosedElements()); 28.85 generateDeclsForClass(pw, clazz, cname); 28.86 + // FIXME check if errors occurred on the PrintWriter and throw exception if so 28.87 } 28.88 28.89 protected void generateDeclsForClass(PrintWriter pw, 28.90 - ClassDoc clazz, String cname) 28.91 - throws ClassNotFoundException { 28.92 - doneHandleTypes = new Hashtable<Object, Object>(); 28.93 + TypeElement clazz, String cname) throws Util.Exit { 28.94 + doneHandleTypes = new HashSet<String>(); 28.95 /* The following handle types are predefined in "typedefs.h". Suppress 28.96 inclusion in the output by generating them "into the blue" here. */ 28.97 genHandleType(null, "java.lang.Class"); 28.98 @@ -79,7 +95,7 @@ 28.99 genHandleType(null, "java.lang.ThreadGroup"); 28.100 genHandleType(null, "java.lang.Throwable"); 28.101 28.102 - pw.println("/* LLNI Header for class " + clazz.qualifiedName() + " */" + lineSep); 28.103 + pw.println("/* LLNI Header for class " + clazz.getQualifiedName() + " */" + lineSep); 28.104 pw.println("#ifndef _Included_" + cname); 28.105 pw.println("#define _Included_" + cname); 28.106 pw.println("#include \"typedefs.h\""); 28.107 @@ -94,8 +110,8 @@ 28.108 28.109 protected void genHandleType(PrintWriter pw, String clazzname) { 28.110 String cname = mangleClassName(clazzname); 28.111 - if (!doneHandleTypes.containsKey(cname)) { 28.112 - doneHandleTypes.put(cname, cname); 28.113 + if (!doneHandleTypes.contains(cname)) { 28.114 + doneHandleTypes.add(cname); 28.115 if (pw != null) { 28.116 pw.println("#ifndef DEFINED_" + cname); 28.117 pw.println(" #define DEFINED_" + cname); 28.118 @@ -107,31 +123,29 @@ 28.119 28.120 protected String mangleClassName(String s) { 28.121 return s.replace('.', '_') 28.122 - .replace(pathChar, '_') 28.123 + .replace('/', '_') 28.124 .replace(innerDelim, '_'); 28.125 } 28.126 28.127 - protected void forwardDecls(PrintWriter pw, ClassDoc clazz) 28.128 - throws ClassNotFoundException { 28.129 - ClassDoc clazzfield = null; 28.130 + protected void forwardDecls(PrintWriter pw, TypeElement clazz) { 28.131 + TypeElement object = elems.getTypeElement("java.lang.Object"); 28.132 + if (clazz.equals(object)) 28.133 + return; 28.134 28.135 - if (clazz.qualifiedName().equals("java.lang.Object")) 28.136 - return; 28.137 - genHandleType(pw, clazz.qualifiedName()); 28.138 - ClassDoc superClass = clazz.superclass(); 28.139 + genHandleType(pw, clazz.getQualifiedName().toString()); 28.140 + TypeElement superClass = (TypeElement) (types.asElement(clazz.getSuperclass())); 28.141 28.142 - if(superClass != null){ 28.143 - String superClassName = superClass.qualifiedName(); 28.144 + if (superClass != null) { 28.145 + String superClassName = superClass.getQualifiedName().toString(); 28.146 forwardDecls(pw, superClass); 28.147 } 28.148 28.149 - for (int i = 0; i < fields.length; i++) { 28.150 - FieldDoc field = (FieldDoc)fields[i]; 28.151 + for (VariableElement field: fields) { 28.152 28.153 - if (!field.isStatic()) { 28.154 - Type t = field.type(); 28.155 - String tname = t.qualifiedTypeName(); 28.156 - TypeSignature newTypeSig = new TypeSignature(root); 28.157 + if (!field.getModifiers().contains(Modifier.STATIC)) { 28.158 + TypeMirror t = types.erasure(field.asType()); 28.159 + TypeSignature newTypeSig = new TypeSignature(elems); 28.160 + String tname = newTypeSig.qualifiedTypeName(t); 28.161 String sig = newTypeSig.getTypeSignature(tname); 28.162 28.163 if (sig.charAt(0) != '[') 28.164 @@ -139,13 +153,12 @@ 28.165 } 28.166 } 28.167 28.168 - for (int i = 0; i < methods.length; i++) { 28.169 - MethodDoc method = (MethodDoc)methods[i]; 28.170 + for (ExecutableElement method: methods) { 28.171 28.172 - if (method.isNative()) { 28.173 - Type retType = method.returnType(); 28.174 - String typesig = method.signature(); 28.175 - TypeSignature newTypeSig = new TypeSignature(root); 28.176 + if (method.getModifiers().contains(Modifier.NATIVE)) { 28.177 + TypeMirror retType = types.erasure(method.getReturnType()); 28.178 + String typesig = signature(method); 28.179 + TypeSignature newTypeSig = new TypeSignature(elems); 28.180 String sig = newTypeSig.getTypeSignature(typesig, retType); 28.181 28.182 if (sig.charAt(0) != '[') 28.183 @@ -173,10 +186,9 @@ 28.184 } 28.185 28.186 protected void structSectionForClass(PrintWriter pw, 28.187 - ClassDoc jclazz, String cname) 28.188 - throws ClassNotFoundException { 28.189 + TypeElement jclazz, String cname) { 28.190 28.191 - String jname = jclazz.qualifiedName(); 28.192 + String jname = jclazz.getQualifiedName().toString(); 28.193 28.194 if (cname.equals("java_lang_Object")) { 28.195 pw.println("/* struct java_lang_Object is defined in typedefs.h. */"); 28.196 @@ -207,8 +219,8 @@ 28.197 public boolean bottomMost; 28.198 public boolean printedOne = false; 28.199 28.200 - FieldDefsRes(ClassDoc clazz, FieldDefsRes parent, boolean bottomMost) { 28.201 - this.className = clazz.qualifiedName(); 28.202 + FieldDefsRes(TypeElement clazz, FieldDefsRes parent, boolean bottomMost) { 28.203 + this.className = clazz.getQualifiedName().toString(); 28.204 this.parent = parent; 28.205 this.bottomMost = bottomMost; 28.206 int byteSize = 0; 28.207 @@ -218,9 +230,8 @@ 28.208 } 28.209 28.210 /* Returns "true" iff added a field. */ 28.211 - private boolean doField(FieldDefsRes res, FieldDoc field, 28.212 - String cname, boolean padWord) 28.213 - throws ClassNotFoundException { 28.214 + private boolean doField(FieldDefsRes res, VariableElement field, 28.215 + String cname, boolean padWord) { 28.216 28.217 String fieldDef = addStructMember(field, cname, padWord); 28.218 if (fieldDef != null) { 28.219 @@ -242,16 +253,14 @@ 28.220 return false; 28.221 } 28.222 28.223 - private int doTwoWordFields(FieldDefsRes res, ClassDoc clazz, 28.224 - int offset, String cname, boolean padWord) 28.225 - throws ClassNotFoundException { 28.226 + private int doTwoWordFields(FieldDefsRes res, TypeElement clazz, 28.227 + int offset, String cname, boolean padWord) { 28.228 boolean first = true; 28.229 - FieldDoc[] fields = clazz.fields(); 28.230 + List<VariableElement> fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 28.231 28.232 - for (int i = 0; i <fields.length; i++) { 28.233 - FieldDoc field = fields[i]; 28.234 - String tc =field.type().typeName(); 28.235 - boolean twoWords = (tc.equals("long") || tc.equals("double")); 28.236 + for (VariableElement field: fields) { 28.237 + TypeKind tk = field.asType().getKind(); 28.238 + boolean twoWords = (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 28.239 if (twoWords && doField(res, field, cname, first && padWord)) { 28.240 offset += 8; first = false; 28.241 } 28.242 @@ -259,22 +268,21 @@ 28.243 return offset; 28.244 } 28.245 28.246 - protected String fieldDefs(ClassDoc clazz, String cname) 28.247 - throws ClassNotFoundException { 28.248 + String fieldDefs(TypeElement clazz, String cname) { 28.249 FieldDefsRes res = fieldDefs(clazz, cname, true); 28.250 return res.s; 28.251 } 28.252 28.253 - protected FieldDefsRes fieldDefs(ClassDoc clazz, String cname, 28.254 - boolean bottomMost) 28.255 - throws ClassNotFoundException { 28.256 + FieldDefsRes fieldDefs(TypeElement clazz, String cname, 28.257 + boolean bottomMost){ 28.258 FieldDefsRes res; 28.259 int offset; 28.260 boolean didTwoWordFields = false; 28.261 - ClassDoc superclazz = clazz.superclass(); 28.262 + 28.263 + TypeElement superclazz = (TypeElement) types.asElement(clazz.getSuperclass()); 28.264 28.265 if (superclazz != null) { 28.266 - String supername = superclazz.qualifiedName(); 28.267 + String supername = superclazz.getQualifiedName().toString(); 28.268 res = new FieldDefsRes(clazz, 28.269 fieldDefs(superclazz, cname, false), 28.270 bottomMost); 28.271 @@ -284,18 +292,17 @@ 28.272 offset = 0; 28.273 } 28.274 28.275 - FieldDoc[] fields = clazz.fields(); 28.276 + List<VariableElement> fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 28.277 28.278 - for (int i = 0; i < fields.length; i++) { 28.279 - FieldDoc field = fields[i]; 28.280 + for (VariableElement field: fields) { 28.281 28.282 if (doubleAlign && !didTwoWordFields && (offset % 8) == 0) { 28.283 offset = doTwoWordFields(res, clazz, offset, cname, false); 28.284 didTwoWordFields = true; 28.285 } 28.286 28.287 - String tc = field.type().typeName(); 28.288 - boolean twoWords = (tc.equals("long") ||tc.equals("double")); 28.289 + TypeKind tk = field.asType().getKind(); 28.290 + boolean twoWords = (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 28.291 28.292 if (!doubleAlign || !twoWords) { 28.293 if (doField(res, field, cname, false)) offset += 4; 28.294 @@ -313,19 +320,19 @@ 28.295 } 28.296 28.297 /* OVERRIDE: This method handles instance fields */ 28.298 - protected String addStructMember(FieldDoc member, String cname, 28.299 - boolean padWord) 28.300 - throws ClassNotFoundException { 28.301 + protected String addStructMember(VariableElement member, String cname, 28.302 + boolean padWord) { 28.303 String res = null; 28.304 28.305 - if (member.isStatic()) { 28.306 + if (member.getModifiers().contains(Modifier.STATIC)) { 28.307 res = addStaticStructMember(member, cname); 28.308 // if (res == null) /* JNI didn't handle it, print comment. */ 28.309 // res = " /* Inaccessible static: " + member + " */" + lineSep; 28.310 } else { 28.311 + TypeMirror mt = types.erasure(member.asType()); 28.312 if (padWord) res = " java_int padWord" + padFieldNum++ + ";" + lineSep; 28.313 - res = " " + llniType(member.type(), false, false) + " " + llniFieldName(member); 28.314 - if (isLongOrDouble(member.type())) res = res + "[2]"; 28.315 + res = " " + llniType(mt, false, false) + " " + llniFieldName(member); 28.316 + if (isLongOrDouble(mt)) res = res + "[2]"; 28.317 res = res + ";" + lineSep; 28.318 } 28.319 return res; 28.320 @@ -337,36 +344,42 @@ 28.321 /* 28.322 * This method only handles static final fields. 28.323 */ 28.324 - protected String addStaticStructMember(FieldDoc field, String cname) 28.325 - throws ClassNotFoundException { 28.326 + protected String addStaticStructMember(VariableElement field, String cname) { 28.327 String res = null; 28.328 Object exp = null; 28.329 28.330 - if (!field.isStatic()) 28.331 + if (!field.getModifiers().contains(Modifier.STATIC)) 28.332 return res; 28.333 - if (!field.isFinal()) 28.334 + if (!field.getModifiers().contains(Modifier.FINAL)) 28.335 return res; 28.336 28.337 - exp = field.constantValue(); 28.338 + exp = field.getConstantValue(); 28.339 28.340 if (exp != null) { 28.341 /* Constant. */ 28.342 28.343 - String cn = cname + "_" + field.name(); 28.344 + String cn = cname + "_" + field.getSimpleName(); 28.345 String suffix = null; 28.346 long val = 0; 28.347 /* Can only handle int, long, float, and double fields. */ 28.348 - if (exp instanceof Integer) { 28.349 + if (exp instanceof Byte 28.350 + || exp instanceof Short 28.351 + || exp instanceof Integer) { 28.352 suffix = "L"; 28.353 - val = ((Integer)exp).intValue(); 28.354 + val = ((Number)exp).intValue(); 28.355 } 28.356 - if (exp instanceof Long) { 28.357 + else if (exp instanceof Long) { 28.358 // Visual C++ supports the i64 suffix, not LL 28.359 suffix = isWindows ? "i64" : "LL"; 28.360 val = ((Long)exp).longValue(); 28.361 } 28.362 - if (exp instanceof Float) suffix = "f"; 28.363 - if (exp instanceof Double) suffix = ""; 28.364 + else if (exp instanceof Float) suffix = "f"; 28.365 + else if (exp instanceof Double) suffix = ""; 28.366 + else if (exp instanceof Character) { 28.367 + suffix = "L"; 28.368 + Character ch = (Character) exp; 28.369 + val = ((int) ch) & 0xffff; 28.370 + } 28.371 if (suffix != null) { 28.372 // Some compilers will generate a spurious warning 28.373 // for the integer constants for Integer.MIN_VALUE 28.374 @@ -376,9 +389,12 @@ 28.375 res = " #undef " + cn + lineSep 28.376 + " #define " + cn 28.377 + " (" + (val + 1) + suffix + "-1)" + lineSep; 28.378 + } else if (suffix.equals("L") || suffix.endsWith("LL")) { 28.379 + res = " #undef " + cn + lineSep 28.380 + + " #define " + cn + " " + val + suffix + lineSep; 28.381 } else { 28.382 res = " #undef " + cn + lineSep 28.383 - + " #define " + cn + " "+ exp.toString() + suffix + lineSep; 28.384 + + " #define " + cn + " " + exp + suffix + lineSep; 28.385 } 28.386 } 28.387 } 28.388 @@ -386,8 +402,8 @@ 28.389 } 28.390 28.391 protected void methodSectionForClass(PrintWriter pw, 28.392 - ClassDoc clazz, String cname) 28.393 - throws ClassNotFoundException { 28.394 + TypeElement clazz, String cname) 28.395 + throws Util.Exit { 28.396 String methods = methodDecls(clazz, cname); 28.397 28.398 if (methods.length() != 0) { 28.399 @@ -402,81 +418,77 @@ 28.400 } 28.401 } 28.402 28.403 - protected String methodDecls(ClassDoc clazz, String cname) 28.404 - throws ClassNotFoundException { 28.405 + protected String methodDecls(TypeElement clazz, String cname) throws Util.Exit { 28.406 28.407 String res = ""; 28.408 - for (int i = 0; i < methods.length; i++) { 28.409 - MethodDoc method = (MethodDoc)methods[i]; 28.410 - if (method.isNative()) 28.411 + for (ExecutableElement method: methods) { 28.412 + if (method.getModifiers().contains(Modifier.NATIVE)) 28.413 res = res + methodDecl(method, clazz, cname); 28.414 } 28.415 return res; 28.416 } 28.417 28.418 - protected String methodDecl(MethodDoc method, 28.419 - ClassDoc clazz, String cname) 28.420 - throws ClassNotFoundException { 28.421 + protected String methodDecl(ExecutableElement method, 28.422 + TypeElement clazz, String cname) 28.423 + throws Util.Exit { 28.424 String res = null; 28.425 28.426 - Type retType = method.returnType(); 28.427 - String typesig = method.signature(); 28.428 - TypeSignature newTypeSig = new TypeSignature(root); 28.429 + TypeMirror retType = types.erasure(method.getReturnType()); 28.430 + String typesig = signature(method); 28.431 + TypeSignature newTypeSig = new TypeSignature(elems); 28.432 String sig = newTypeSig.getTypeSignature(typesig, retType); 28.433 boolean longName = needLongName(method, clazz); 28.434 28.435 if (sig.charAt(0) != '(') 28.436 - Util.error("invalid.method.signature", sig); 28.437 + util.error("invalid.method.signature", sig); 28.438 28.439 28.440 res = "JNIEXPORT " + jniType(retType) + " JNICALL" + lineSep + jniMethodName(method, cname, longName) 28.441 + "(JNIEnv *, " + cRcvrDecl(method, cname); 28.442 - Parameter[] params = method.parameters(); 28.443 - Type argTypes[] = new Type[params.length]; 28.444 - for(int p = 0; p < params.length; p++){ 28.445 - argTypes[p] = params[p].type(); 28.446 + List<? extends VariableElement> params = method.getParameters(); 28.447 + List<TypeMirror> argTypes = new ArrayList<TypeMirror>(); 28.448 + for (VariableElement p: params){ 28.449 + argTypes.add(types.erasure(p.asType())); 28.450 } 28.451 28.452 /* It would have been nice to include the argument names in the 28.453 declaration, but there seems to be a bug in the "BinaryField" 28.454 class, causing the getArguments() method to return "null" for 28.455 most (non-constructor) methods. */ 28.456 - for (int i = 0; i < argTypes.length; i++) 28.457 - res = res + ", " + jniType(argTypes[i]); 28.458 + for (TypeMirror argType: argTypes) 28.459 + res = res + ", " + jniType(argType); 28.460 res = res + ");" + lineSep; 28.461 return res; 28.462 } 28.463 28.464 - protected final boolean needLongName(MethodDoc method, 28.465 - ClassDoc clazz) 28.466 - throws ClassNotFoundException { 28.467 - String methodName = method.name(); 28.468 - for (int i = 0; i < methods.length; i++) { 28.469 - MethodDoc memberMethod = (MethodDoc) methods[i]; 28.470 + protected final boolean needLongName(ExecutableElement method, 28.471 + TypeElement clazz) { 28.472 + Name methodName = method.getSimpleName(); 28.473 + for (ExecutableElement memberMethod: methods) { 28.474 if ((memberMethod != method) && 28.475 - memberMethod.isNative() && (methodName == memberMethod.name())) 28.476 + memberMethod.getModifiers().contains(Modifier.NATIVE) && 28.477 + (methodName.equals(memberMethod.getSimpleName()))) 28.478 return true; 28.479 } 28.480 return false; 28.481 } 28.482 28.483 - protected final String jniMethodName(MethodDoc method, String cname, 28.484 + protected final String jniMethodName(ExecutableElement method, String cname, 28.485 boolean longName) { 28.486 - String res = "Java_" + cname + "_" + method.name(); 28.487 + String res = "Java_" + cname + "_" + method.getSimpleName(); 28.488 28.489 if (longName) { 28.490 - Type mType = method.returnType(); 28.491 - Parameter[] params = method.parameters(); 28.492 - Type argTypes[] = new Type[params.length]; 28.493 - for(int p = 0; p < params.length; p++){ 28.494 - argTypes[p] = params[p].type(); 28.495 + TypeMirror mType = types.erasure(method.getReturnType()); 28.496 + List<? extends VariableElement> params = method.getParameters(); 28.497 + List<TypeMirror> argTypes = new ArrayList<TypeMirror>(); 28.498 + for (VariableElement param: params) { 28.499 + argTypes.add(types.erasure(param.asType())); 28.500 } 28.501 28.502 res = res + "__"; 28.503 - for (int i = 0; i < argTypes.length; i++){ 28.504 - Type t = argTypes[i]; 28.505 - String tname = t.typeName(); 28.506 - TypeSignature newTypeSig = new TypeSignature(root); 28.507 + for (TypeMirror t: argTypes) { 28.508 + String tname = t.toString(); 28.509 + TypeSignature newTypeSig = new TypeSignature(elems); 28.510 String sig = newTypeSig.getTypeSignature(tname); 28.511 res = res + nameToIdentifier(sig); 28.512 } 28.513 @@ -484,88 +496,143 @@ 28.514 return res; 28.515 } 28.516 28.517 - protected final String jniType(Type t) { 28.518 - String elmT =t.typeName(); 28.519 - if (t.dimension().indexOf("[]") != -1) { 28.520 - if(elmT.equals("boolean"))return "jbooleanArray"; 28.521 - else if(elmT.equals("byte"))return "jbyteArray"; 28.522 - else if(elmT.equals("char"))return "jcharArray"; 28.523 - else if(elmT.equals("short"))return "jshortArray"; 28.524 - else if(elmT.equals("int"))return "jintArray"; 28.525 - else if(elmT.equals("long"))return "jlongArray"; 28.526 - else if(elmT.equals("float"))return "jfloatArray"; 28.527 - else if(elmT.equals("double"))return "jdoubleArray"; 28.528 - else if((t.dimension().indexOf("[][]") != -1) || (t.asClassDoc() != null)) return "jobjectArray"; 28.529 - } else { 28.530 - if(elmT.equals("void"))return "void"; 28.531 - else if(elmT.equals("boolean"))return "jboolean"; 28.532 - else if(elmT.equals("byte"))return "jbyte"; 28.533 - else if(elmT.equals("char"))return "jchar"; 28.534 - else if(elmT.equals("short"))return "jshort"; 28.535 - else if(elmT.equals("int"))return "jint"; 28.536 - else if(elmT.equals("long"))return "jlong"; 28.537 - else if(elmT.equals("float"))return "jfloat"; 28.538 - else if(elmT.equals("double"))return "jdouble"; 28.539 - else if (t.asClassDoc() != null) { 28.540 - if (elmT.equals("String")) 28.541 + // copied from JNI.java 28.542 + protected final String jniType(TypeMirror t) throws Util.Exit { 28.543 + TypeElement throwable = elems.getTypeElement("java.lang.Throwable"); 28.544 + TypeElement jClass = elems.getTypeElement("java.lang.Class"); 28.545 + TypeElement jString = elems.getTypeElement("java.lang.String"); 28.546 + Element tclassDoc = types.asElement(t); 28.547 + 28.548 + switch (t.getKind()) { 28.549 + case ARRAY: { 28.550 + TypeMirror ct = ((ArrayType) t).getComponentType(); 28.551 + switch (ct.getKind()) { 28.552 + case BOOLEAN: return "jbooleanArray"; 28.553 + case BYTE: return "jbyteArray"; 28.554 + case CHAR: return "jcharArray"; 28.555 + case SHORT: return "jshortArray"; 28.556 + case INT: return "jintArray"; 28.557 + case LONG: return "jlongArray"; 28.558 + case FLOAT: return "jfloatArray"; 28.559 + case DOUBLE: return "jdoubleArray"; 28.560 + case ARRAY: 28.561 + case DECLARED: return "jobjectArray"; 28.562 + default: throw new Error(ct.toString()); 28.563 + } 28.564 + } 28.565 + 28.566 + case VOID: return "void"; 28.567 + case BOOLEAN: return "jboolean"; 28.568 + case BYTE: return "jbyte"; 28.569 + case CHAR: return "jchar"; 28.570 + case SHORT: return "jshort"; 28.571 + case INT: return "jint"; 28.572 + case LONG: return "jlong"; 28.573 + case FLOAT: return "jfloat"; 28.574 + case DOUBLE: return "jdouble"; 28.575 + 28.576 + case DECLARED: { 28.577 + if (tclassDoc.equals(jString)) 28.578 return "jstring"; 28.579 - else if (t.asClassDoc().subclassOf(root.classNamed("java.lang.Class"))) 28.580 + else if (types.isAssignable(t, throwable.asType())) 28.581 + return "jthrowable"; 28.582 + else if (types.isAssignable(t, jClass.asType())) 28.583 return "jclass"; 28.584 else 28.585 return "jobject"; 28.586 } 28.587 } 28.588 - Util.bug("jni.unknown.type"); 28.589 + 28.590 + util.bug("jni.unknown.type"); 28.591 return null; /* dead code. */ 28.592 } 28.593 28.594 - protected String llniType(Type t, boolean handleize, boolean longDoubleOK) { 28.595 + protected String llniType(TypeMirror t, boolean handleize, boolean longDoubleOK) { 28.596 String res = null; 28.597 - String elmt = t.typeName(); 28.598 - if (t.dimension().indexOf("[]") != -1) { 28.599 - if((t.dimension().indexOf("[][]") != -1) 28.600 - || (t.asClassDoc() != null)) res = "IArrayOfRef"; 28.601 - else if(elmt.equals("boolean")) res = "IArrayOfBoolean"; 28.602 - else if(elmt.equals("byte")) res = "IArrayOfByte"; 28.603 - else if(elmt.equals("char")) res = "IArrayOfChar"; 28.604 - else if(elmt.equals("int")) res = "IArrayOfInt"; 28.605 - else if(elmt.equals("long")) res = "IArrayOfLong"; 28.606 - else if(elmt.equals("float")) res = "IArrayOfFloat"; 28.607 - else if(elmt.equals("double")) res = "IArrayOfDouble"; 28.608 - if (!handleize) res = "DEREFERENCED_" + res; 28.609 - } else { 28.610 - if(elmt.equals("void")) res = "void"; 28.611 - else if( (elmt.equals("boolean")) || (elmt.equals("byte")) 28.612 - ||(elmt.equals("char")) || (elmt.equals("short")) 28.613 - || (elmt.equals("int"))) res = "java_int"; 28.614 - else if(elmt.equals("long")) res = longDoubleOK 28.615 - ? "java_long" : "val32 /* java_long */"; 28.616 - else if(elmt.equals("float")) res = "java_float"; 28.617 - else if(elmt.equals("double")) res = res = longDoubleOK 28.618 - ? "java_double" : "val32 /* java_double */"; 28.619 - else if(t.asClassDoc() != null) { 28.620 - res = "I" + mangleClassName(t.asClassDoc().qualifiedName()); 28.621 + 28.622 + switch (t.getKind()) { 28.623 + case ARRAY: { 28.624 + TypeMirror ct = ((ArrayType) t).getComponentType(); 28.625 + switch (ct.getKind()) { 28.626 + case BOOLEAN: res = "IArrayOfBoolean"; break; 28.627 + case BYTE: res = "IArrayOfByte"; break; 28.628 + case CHAR: res = "IArrayOfChar"; break; 28.629 + case SHORT: res = "IArrayOfShort"; break; 28.630 + case INT: res = "IArrayOfInt"; break; 28.631 + case LONG: res = "IArrayOfLong"; break; 28.632 + case FLOAT: res = "IArrayOfFloat"; break; 28.633 + case DOUBLE: res = "IArrayOfDouble"; break; 28.634 + case ARRAY: 28.635 + case DECLARED: res = "IArrayOfRef"; break; 28.636 + default: throw new Error(ct.getKind() + " " + ct); 28.637 + } 28.638 if (!handleize) res = "DEREFERENCED_" + res; 28.639 + break; 28.640 } 28.641 + 28.642 + case VOID: 28.643 + res = "void"; 28.644 + break; 28.645 + 28.646 + case BOOLEAN: 28.647 + case BYTE: 28.648 + case CHAR: 28.649 + case SHORT: 28.650 + case INT: 28.651 + res = "java_int" ; 28.652 + break; 28.653 + 28.654 + case LONG: 28.655 + res = longDoubleOK ? "java_long" : "val32 /* java_long */"; 28.656 + break; 28.657 + 28.658 + case FLOAT: 28.659 + res = "java_float"; 28.660 + break; 28.661 + 28.662 + case DOUBLE: 28.663 + res = longDoubleOK ? "java_double" : "val32 /* java_double */"; 28.664 + break; 28.665 + 28.666 + case DECLARED: 28.667 + TypeElement e = (TypeElement) types.asElement(t); 28.668 + res = "I" + mangleClassName(e.getQualifiedName().toString()); 28.669 + if (!handleize) res = "DEREFERENCED_" + res; 28.670 + break; 28.671 + 28.672 + default: 28.673 + throw new Error(t.getKind() + " " + t); // FIXME 28.674 } 28.675 + 28.676 return res; 28.677 } 28.678 28.679 - protected final String cRcvrDecl(MemberDoc field, String cname) { 28.680 - return (field.isStatic() ? "jclass" : "jobject"); 28.681 + protected final String cRcvrDecl(Element field, String cname) { 28.682 + return (field.getModifiers().contains(Modifier.STATIC) ? "jclass" : "jobject"); 28.683 } 28.684 28.685 protected String maskName(String s) { 28.686 return "LLNI_mask(" + s + ")"; 28.687 } 28.688 28.689 - protected String llniFieldName(MemberDoc field) { 28.690 - return maskName(field.name()); 28.691 + protected String llniFieldName(VariableElement field) { 28.692 + return maskName(field.getSimpleName().toString()); 28.693 } 28.694 28.695 - protected final boolean isLongOrDouble(Type t) { 28.696 - String tc = t.typeName(); 28.697 - return (tc.equals("long") || tc.equals("double")); 28.698 + protected final boolean isLongOrDouble(TypeMirror t) { 28.699 + TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor6<Boolean,Void>() { 28.700 + public Boolean defaultAction(TypeMirror t, Void p){ 28.701 + return false; 28.702 + } 28.703 + public Boolean visitArray(ArrayType t, Void p) { 28.704 + return visit(t.getComponentType(), p); 28.705 + } 28.706 + public Boolean visitPrimitive(PrimitiveType t, Void p) { 28.707 + TypeKind tk = t.getKind(); 28.708 + return (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 28.709 + } 28.710 + }; 28.711 + return v.visit(t, null); 28.712 } 28.713 28.714 /* Do unicode to ansi C identifier conversion. 28.715 @@ -602,3 +669,4 @@ 28.716 return false; 28.717 } 28.718 } 28.719 +
29.1 --- a/src/share/classes/com/sun/tools/javah/Main.java Fri Oct 02 11:26:53 2009 -0700 29.2 +++ b/src/share/classes/com/sun/tools/javah/Main.java Wed Oct 07 14:14:45 2009 -0700 29.3 @@ -1,5 +1,5 @@ 29.4 /* 29.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 29.6 + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 29.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 29.8 * 29.9 * This code is free software; you can redistribute it and/or modify it 29.10 @@ -23,134 +23,39 @@ 29.11 * have any questions. 29.12 */ 29.13 29.14 - 29.15 package com.sun.tools.javah; 29.16 29.17 - 29.18 -import java.io.*; 29.19 +import java.io.PrintWriter; 29.20 29.21 /** 29.22 - * Javah generates support files for native methods. 29.23 - * Parse commandline options & Invokes javadoc to execute those commands. 29.24 + * Main entry point. 29.25 * 29.26 - * @author Sucheta Dambalkar 29.27 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 29.28 + * you write code that depends on this, you do so at your own risk. 29.29 + * This code and its internal interfaces are subject to change or 29.30 + * deletion without notice.</b> 29.31 */ 29.32 -public class Main{ 29.33 - /* 29.34 - * Parse arguments given for javah to give proper error messages. 29.35 +public class Main { 29.36 + /** 29.37 + * Main entry point for the launcher. 29.38 + * Note: This method calls System.exit. 29.39 + * @param args command line arguments 29.40 */ 29.41 - public static void main(String[] args){ 29.42 - 29.43 - if (args.length == 0) { 29.44 - Util.usage(1); 29.45 - } 29.46 - for ( int i = 0; i < args.length; i++) { 29.47 - if (args[i].equals("-o")) { 29.48 - i++; 29.49 - if(i >= args.length){ 29.50 - Util.usage(1); 29.51 - }else if(args[i].charAt(0) == '-'){ 29.52 - Util.error("no.outputfile.specified"); 29.53 - }else if((i+1) >= args.length){ 29.54 - Util.error("no.classes.specified"); 29.55 - } 29.56 - } else if (args[i].equals("-d")) { 29.57 - i++; 29.58 - if(i >= args.length){ 29.59 - Util.usage(1); 29.60 - }else if(args[i].charAt(0) == '-') { 29.61 - Util.error("no.outputdir.specified"); 29.62 - }else if((i+1) >= args.length){ 29.63 - Util.error("no.classes.specified"); 29.64 - } 29.65 - } else if (args[i].equals("-td")) { 29.66 - /* Ignored. Generate tmp files to memory. */ 29.67 - i++; 29.68 - if (i == args.length) 29.69 - Util.usage(1); 29.70 - } else if (args[i].equals("-stubs")) { 29.71 - if((i+1) >= args.length){ 29.72 - Util.error("no.classes.specified"); 29.73 - } 29.74 - } else if (args[i].equals("-v") || args[i].equals("-verbose")) { 29.75 - if((i+1) >= args.length){ 29.76 - Util.error("no.classes.specified"); 29.77 - } 29.78 - args[i] = "-verbose"; 29.79 - } else if ((args[i].equals("-help")) || (args[i].equals("--help")) 29.80 - || (args[i].equals("-?")) || (args[i].equals("-h"))) { 29.81 - Util.usage(0); 29.82 - } else if (args[i].equals("-trace")) { 29.83 - System.err.println(Util.getText("tracing.not.supported")); 29.84 - } else if (args[i].equals("-version")) { 29.85 - if((i+1) >= args.length){ 29.86 - Util.version(); 29.87 - } 29.88 - } else if (args[i].equals("-jni")) { 29.89 - if((i+1) >= args.length){ 29.90 - Util.error("no.classes.specified"); 29.91 - } 29.92 - } else if (args[i].equals("-force")) { 29.93 - if((i+1) >= args.length){ 29.94 - Util.error("no.classes.specified"); 29.95 - } 29.96 - } else if (args[i].equals("-Xnew")) { 29.97 - // we're already using the new javah 29.98 - } else if (args[i].equals("-old")) { 29.99 - System.err.println(Util.getText("old.not.supported")); 29.100 - Util.usage(1); 29.101 - } else if (args[i].equals("-Xllni")) { 29.102 - if((i+1) >= args.length){ 29.103 - Util.error("no.classes.specified"); 29.104 - } 29.105 - } else if (args[i].equals("-llni")) { 29.106 - if((i+1) >= args.length){ 29.107 - Util.error("no.classes.specified"); 29.108 - } 29.109 - } else if (args[i].equals("-llniDouble")) { 29.110 - if((i+1) >= args.length){ 29.111 - Util.error("no.classes.specified"); 29.112 - } 29.113 - } else if (args[i].equals("-classpath")) { 29.114 - i++; 29.115 - if(i >= args.length){ 29.116 - Util.usage(1); 29.117 - }else if(args[i].charAt(0) == '-') { 29.118 - Util.error("no.classpath.specified"); 29.119 - }else if((i+1) >= args.length){ 29.120 - Util.error("no.classes.specified"); 29.121 - } 29.122 - } else if (args[i].equals("-bootclasspath")) { 29.123 - i++; 29.124 - if(i >= args.length){ 29.125 - Util.usage(1); 29.126 - }else if(args[i].charAt(0) == '-'){ 29.127 - Util.error("no.bootclasspath.specified"); 29.128 - }else if((i+1) >= args.length){ 29.129 - Util.error("no.classes.specified"); 29.130 - } 29.131 - } else if (args[i].charAt(0) == '-') { 29.132 - Util.error("unknown.option", args[i], null, true); 29.133 - 29.134 - } else { 29.135 - //break; /* The rest must be classes. */ 29.136 - } 29.137 - } 29.138 - 29.139 - /* Invoke javadoc */ 29.140 - 29.141 - String[] javadocargs = new String[args.length + 2]; 29.142 - int i = 0; 29.143 - 29.144 - for(; i < args.length; i++) { 29.145 - javadocargs[i] = args[i]; 29.146 - } 29.147 - 29.148 - javadocargs[i] = "-private"; 29.149 - i++; 29.150 - javadocargs[i] = "-Xclasses"; 29.151 - 29.152 - int rc = com.sun.tools.javadoc.Main.execute("javadoc", "com.sun.tools.javah.MainDoclet", javadocargs); 29.153 + public static void main(String[] args) { 29.154 + JavahTask t = new JavahTask(); 29.155 + int rc = t.run(args); 29.156 System.exit(rc); 29.157 } 29.158 + 29.159 + /** 29.160 + * Entry point that does <i>not</i> call System.exit. 29.161 + * @param args command line arguments 29.162 + * @param out output stream 29.163 + * @return an exit code. 0 means success, non-zero means an error occurred. 29.164 + */ 29.165 + public static int run(String[] args, PrintWriter out) { 29.166 + JavahTask t = new JavahTask(); 29.167 + t.setLog(out); 29.168 + return t.run(args); 29.169 + } 29.170 }
30.1 --- a/src/share/classes/com/sun/tools/javah/MainDoclet.java Fri Oct 02 11:26:53 2009 -0700 30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 30.3 @@ -1,218 +0,0 @@ 30.4 -/* 30.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 30.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 30.7 - * 30.8 - * This code is free software; you can redistribute it and/or modify it 30.9 - * under the terms of the GNU General Public License version 2 only, as 30.10 - * published by the Free Software Foundation. Sun designates this 30.11 - * particular file as subject to the "Classpath" exception as provided 30.12 - * by Sun in the LICENSE file that accompanied this code. 30.13 - * 30.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 30.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 30.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 30.17 - * version 2 for more details (a copy is included in the LICENSE file that 30.18 - * accompanied this code). 30.19 - * 30.20 - * You should have received a copy of the GNU General Public License version 30.21 - * 2 along with this work; if not, write to the Free Software Foundation, 30.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 30.23 - * 30.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 30.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 30.26 - * have any questions. 30.27 - */ 30.28 - 30.29 - 30.30 -package com.sun.tools.javah; 30.31 - 30.32 -import com.sun.javadoc.*; 30.33 -import java.io.*; 30.34 - 30.35 -/** 30.36 - * A doclet to parse and execute commandline options. 30.37 - * 30.38 - * @author Sucheta Dambalkar(using code from old javap) 30.39 - */ 30.40 -public class MainDoclet{ 30.41 - 30.42 - public static String odir = null; 30.43 - public static String ofile = null; 30.44 - public static boolean stubs = false; 30.45 - public static boolean jni = false; 30.46 - public static boolean llni = false; 30.47 - public static boolean doubleAlign = false; 30.48 - public static boolean force = false; 30.49 - public static String genclass = null; 30.50 - 30.51 - 30.52 - /** 30.53 - * Entry point. 30.54 - */ 30.55 - public static boolean start(RootDoc root) { 30.56 - 30.57 - int j = 0; 30.58 - int k = 0; 30.59 - /** 30.60 - * Command line options. 30.61 - */ 30.62 - String [][] cmdoptions = root.options(); 30.63 - /** 30.64 - * Classes specified on command line. 30.65 - */ 30.66 - ClassDoc[] classes = root.classes(); 30.67 - /** 30.68 - * Generator used by javah. Default is JNI. 30.69 - */ 30.70 - Gen g = new JNI(root); 30.71 - 30.72 - validateOptions(cmdoptions); 30.73 - 30.74 - /* 30.75 - * Select native interface. 30.76 - */ 30.77 - if (jni && llni) Util.error("jni.llni.mixed"); 30.78 - 30.79 - if (llni) 30.80 - g = new LLNI(doubleAlign, root); 30.81 - 30.82 - if (g instanceof JNI && stubs) Util.error("jni.no.stubs"); 30.83 - 30.84 - /* 30.85 - * Arrange for output destination. 30.86 - */ 30.87 - if (odir != null && ofile != null) 30.88 - Util.error("dir.file.mixed"); 30.89 - 30.90 - if (odir != null) 30.91 - g.setOutDir(odir); 30.92 - 30.93 - if (ofile != null) 30.94 - g.setOutFile(ofile); 30.95 - 30.96 - /* 30.97 - * Force set to false will turn off smarts about checking file 30.98 - * content before writing. 30.99 - */ 30.100 - g.setForce(force); 30.101 - 30.102 - /* 30.103 - * Grab the rest of argv[] ... this must be the classes. 30.104 - */ 30.105 - if (classes.length == 0){ 30.106 - Util.error("no.classes.specified"); 30.107 - } 30.108 - /* 30.109 - * Set classes. 30.110 - */ 30.111 - g.setClasses(classes); 30.112 - 30.113 - try { 30.114 - g.run(); 30.115 - } catch (ClassNotFoundException cnfe) { 30.116 - Util.error("class.not.found", cnfe.getMessage()); 30.117 - } catch (IOException ioe) { 30.118 - Util.error("io.exception", ioe.getMessage()); 30.119 - } 30.120 - 30.121 - return true; 30.122 - } 30.123 - 30.124 - /** 30.125 - * Required doclet method. 30.126 - */ 30.127 - public static int optionLength(String option) { 30.128 - if (option.equals("-o")) { 30.129 - return 2; 30.130 - } else if(option.equals("-d")){ 30.131 - return 2; 30.132 - } else if (option.equals("-td")) { 30.133 - return 1; 30.134 - } else if (option.equals("-stubs")) { 30.135 - return 1; 30.136 - } else if(option.equals("-help")){ 30.137 - return 1; 30.138 - } else if(option.equals("--help")){ 30.139 - return 1; 30.140 - } else if(option.equals("-?")){ 30.141 - return 1; 30.142 - } else if(option.equals("-h")){ 30.143 - return 1; 30.144 - } else if(option.equals("-trace")){ 30.145 - return 1; 30.146 - } else if(option.equals("-version")) { 30.147 - return 1; 30.148 - } else if(option.equals("-jni")){ 30.149 - return 1; 30.150 - } else if(option.equals("-force")){ 30.151 - return 1; 30.152 - } else if(option.equals("-Xllni")){ 30.153 - return 1; 30.154 - } else if(option.equals("-llni")){ 30.155 - return 1; 30.156 - } else if(option.equals("-llniDouble")){ 30.157 - return 1; 30.158 - } else return 0; 30.159 - } 30.160 - 30.161 - /** 30.162 - * Parse the command line options. 30.163 - */ 30.164 - public static void validateOptions(String cmdoptions[][]) { 30.165 - /* Default values for options, overridden by user options. */ 30.166 - String bootcp = System.getProperty("sun.boot.class.path"); 30.167 - String usercp = System.getProperty("env.class.path"); 30.168 - 30.169 - for(int p = 0; p < cmdoptions.length; p++){ 30.170 - 30.171 - if (cmdoptions[p][0].equals("-o")) { 30.172 - ofile = cmdoptions[p][1]; 30.173 - } else if(cmdoptions[p][0].equals("-d")){ 30.174 - odir = cmdoptions[p][1]; 30.175 - } else if (cmdoptions[p][0].equals("-td")) { 30.176 - if (p ==cmdoptions.length) 30.177 - Util.usage(1); 30.178 - } else if (cmdoptions[p][0].equals("-stubs")) { 30.179 - stubs = true; 30.180 - } else if (cmdoptions[p][0].equals("-verbose")) { 30.181 - Util.verbose = true; 30.182 - } else if((cmdoptions[p][0].equals("-help")) 30.183 - || (cmdoptions[p][0].equals("--help")) 30.184 - || (cmdoptions[p][0].equals("-?")) 30.185 - || (cmdoptions[p][0].equals("-h"))) { 30.186 - Util.usage(0); 30.187 - } else if (cmdoptions[p][0].equals("-trace")) { 30.188 - System.err.println(Util.getText("tracing.not.supported")); 30.189 - } else if (cmdoptions[p][0].equals("-version")) { 30.190 - Util.version(); 30.191 - } else if (cmdoptions[p][0].equals("-jni")) { 30.192 - jni = true; 30.193 - } else if (cmdoptions[p][0].equals("-force")) { 30.194 - force = true; 30.195 - } else if (cmdoptions[p][0].equals("-Xllni")) { 30.196 - llni = true; 30.197 - } else if (cmdoptions[p][0].equals("-llni")) { 30.198 - llni = true; 30.199 - } else if (cmdoptions[p][0].equals("-llniDouble")) { 30.200 - llni = true; doubleAlign = true; 30.201 - } else if (cmdoptions[p][0].equals("-classpath")) { 30.202 - usercp = cmdoptions[p][1]; 30.203 - } else if (cmdoptions[p][0].equals("-bootclasspath")) { 30.204 - bootcp = cmdoptions[p][1]; 30.205 - } else if((cmdoptions[p][0].charAt(0) == '-') 30.206 - && (!cmdoptions[p][0].equals("-private"))){ 30.207 - Util.error("unknown.option", cmdoptions[p][0], null, true); 30.208 - } else { 30.209 - break; /* The rest must be classes. */ 30.210 - } 30.211 - } 30.212 - 30.213 - 30.214 - if (Util.verbose) { 30.215 - System.err.println("[ Search Path: " 30.216 - + bootcp 30.217 - + System.getProperty("file.separator") 30.218 - + usercp + " ]"); 30.219 - } 30.220 - } 30.221 -}
31.1 --- a/src/share/classes/com/sun/tools/javah/Mangle.java Fri Oct 02 11:26:53 2009 -0700 31.2 +++ b/src/share/classes/com/sun/tools/javah/Mangle.java Wed Oct 07 14:14:45 2009 -0700 31.3 @@ -1,5 +1,5 @@ 31.4 /* 31.5 - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. 31.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 31.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.8 * 31.9 * This code is free software; you can redistribute it and/or modify it 31.10 @@ -26,22 +26,30 @@ 31.11 31.12 package com.sun.tools.javah; 31.13 31.14 -import com.sun.javadoc.*; 31.15 +import javax.lang.model.element.ExecutableElement; 31.16 +import javax.lang.model.element.TypeElement; 31.17 +import javax.lang.model.element.VariableElement; 31.18 +import javax.lang.model.util.Elements; 31.19 +import javax.lang.model.util.Types; 31.20 31.21 /** 31.22 * A utility for mangling java identifiers into C names. Should make 31.23 * this more fine grained and distribute the functionality to the 31.24 * generators. 31.25 * 31.26 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 31.27 + * If you write code that depends on this, you do so at your own 31.28 + * risk. This code and its internal interfaces are subject to change 31.29 + * or deletion without notice.</b></p> 31.30 + * 31.31 * @author Sucheta Dambalkar(Revised) 31.32 */ 31.33 -class Mangle { 31.34 +public class Mangle { 31.35 31.36 public static class Type { 31.37 - 31.38 public static final int CLASS = 1; 31.39 public static final int FIELDSTUB = 2; 31.40 - public static final int FIELD = 3; 31.41 + public static final int FIELD = 3; 31.42 public static final int JNI = 4; 31.43 public static final int SIGNATURE = 5; 31.44 public static final int METHOD_JDK_1 = 6; 31.45 @@ -49,8 +57,15 @@ 31.46 public static final int METHOD_JNI_LONG = 8; 31.47 }; 31.48 31.49 + private Elements elems; 31.50 + private Types types; 31.51 31.52 - public static final String mangle(String name, int mtype) { 31.53 + Mangle(Elements elems, Types types) { 31.54 + this.elems = elems; 31.55 + this.types = types; 31.56 + } 31.57 + 31.58 + public final String mangle(CharSequence name, int mtype) { 31.59 StringBuffer result = new StringBuffer(100); 31.60 int length = name.length(); 31.61 31.62 @@ -98,15 +113,15 @@ 31.63 return result.toString(); 31.64 } 31.65 31.66 - public static String mangleMethod(MethodDoc method, RootDoc root, ClassDoc clazz, 31.67 + public String mangleMethod(ExecutableElement method, TypeElement clazz, 31.68 int mtype) { 31.69 StringBuffer result = new StringBuffer(100); 31.70 result.append("Java_"); 31.71 31.72 if (mtype == Mangle.Type.METHOD_JDK_1) { 31.73 - result.append(mangle(clazz.qualifiedName(), Mangle.Type.CLASS)); 31.74 + result.append(mangle(clazz.getQualifiedName(), Mangle.Type.CLASS)); 31.75 result.append('_'); 31.76 - result.append(mangle(method.name(), 31.77 + result.append(mangle(method.getSimpleName(), 31.78 Mangle.Type.FIELD)); 31.79 result.append("_stub"); 31.80 return result.toString(); 31.81 @@ -115,13 +130,13 @@ 31.82 /* JNI */ 31.83 result.append(mangle(getInnerQualifiedName(clazz), Mangle.Type.JNI)); 31.84 result.append('_'); 31.85 - result.append(mangle(method.name(), 31.86 + result.append(mangle(method.getSimpleName(), 31.87 Mangle.Type.JNI)); 31.88 if (mtype == Mangle.Type.METHOD_JNI_LONG) { 31.89 result.append("__"); 31.90 - String typesig = method.signature(); 31.91 - TypeSignature newTypeSig = new TypeSignature(root); 31.92 - String sig = newTypeSig.getTypeSignature(typesig, method.returnType()); 31.93 + String typesig = signature(method); 31.94 + TypeSignature newTypeSig = new TypeSignature(elems); 31.95 + String sig = newTypeSig.getTypeSignature(typesig, method.getReturnType()); 31.96 sig = sig.substring(1); 31.97 sig = sig.substring(0, sig.lastIndexOf(')')); 31.98 sig = sig.replace('/', '.'); 31.99 @@ -131,15 +146,11 @@ 31.100 return result.toString(); 31.101 } 31.102 //where 31.103 - private static String getInnerQualifiedName(ClassDoc clazz) { 31.104 - ClassDoc encl = clazz.containingClass(); 31.105 - if (encl == null) 31.106 - return clazz.qualifiedName(); 31.107 - else 31.108 - return getInnerQualifiedName(encl) + '$' + clazz.simpleTypeName(); 31.109 + private String getInnerQualifiedName(TypeElement clazz) { 31.110 + return elems.getBinaryName(clazz).toString(); 31.111 } 31.112 31.113 - public static final String mangleChar(char ch) { 31.114 + public final String mangleChar(char ch) { 31.115 String s = Integer.toHexString(ch); 31.116 int nzeros = 5 - s.length(); 31.117 char[] result = new char[6]; 31.118 @@ -151,6 +162,19 @@ 31.119 return new String(result); 31.120 } 31.121 31.122 + // Warning: duplicated in Gen 31.123 + private String signature(ExecutableElement e) { 31.124 + StringBuffer sb = new StringBuffer(); 31.125 + String sep = "("; 31.126 + for (VariableElement p: e.getParameters()) { 31.127 + sb.append(sep); 31.128 + sb.append(types.erasure(p.asType()).toString()); 31.129 + sep = ","; 31.130 + } 31.131 + sb.append(")"); 31.132 + return sb.toString(); 31.133 + } 31.134 + 31.135 /* Warning: Intentional ASCII operation. */ 31.136 private static final boolean isalnum(char ch) { 31.137 return ch <= 0x7f && /* quick test */
32.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 32.2 +++ b/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java Wed Oct 07 14:14:45 2009 -0700 32.3 @@ -0,0 +1,147 @@ 32.4 +/* 32.5 + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. 32.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.7 + * 32.8 + * This code is free software; you can redistribute it and/or modify it 32.9 + * under the terms of the GNU General Public License version 2 only, as 32.10 + * published by the Free Software Foundation. Sun designates this 32.11 + * particular file as subject to the "Classpath" exception as provided 32.12 + * by Sun in the LICENSE file that accompanied this code. 32.13 + * 32.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 32.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 32.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 32.17 + * version 2 for more details (a copy is included in the LICENSE file that 32.18 + * accompanied this code). 32.19 + * 32.20 + * You should have received a copy of the GNU General Public License version 32.21 + * 2 along with this work; if not, write to the Free Software Foundation, 32.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 32.23 + * 32.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 32.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 32.26 + * have any questions. 32.27 + */ 32.28 + 32.29 +package com.sun.tools.javah; //javax.tools; 32.30 + 32.31 +import java.io.Writer; 32.32 +import java.nio.charset.Charset; 32.33 +import java.util.Locale; 32.34 +import java.util.concurrent.Callable; 32.35 +import javax.tools.DiagnosticListener; 32.36 +import javax.tools.JavaFileManager; 32.37 +import javax.tools.JavaFileObject; 32.38 +import javax.tools.OptionChecker; 32.39 +import javax.tools.StandardJavaFileManager; 32.40 +import javax.tools.Tool; 32.41 + 32.42 +/** 32.43 + * This class is intended to be put in javax.tools. 32.44 + * 32.45 + * @see DiagnosticListener 32.46 + * @see Diagnostic 32.47 + * @see JavaFileManager 32.48 + * @since 1.7 32.49 + * 32.50 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 32.51 + * you write code that depends on this, you do so at your own risk. 32.52 + * This code and its internal interfaces are subject to change or 32.53 + * deletion without notice.</b> 32.54 + */ 32.55 +public interface NativeHeaderTool extends Tool, OptionChecker { 32.56 + 32.57 + /** 32.58 + * Creates a future for a native header task with the given 32.59 + * components and arguments. The task might not have 32.60 + * completed as described in the NativeHeaderTask interface. 32.61 + * 32.62 + * <p>If a file manager is provided, it must be able to handle all 32.63 + * locations defined in {@link StandardLocation}. 32.64 + * 32.65 + * @param out a Writer for additional output from the task; 32.66 + * use {@code System.err} if {@code null} 32.67 + * @param fileManager a file manager; if {@code null} use the 32.68 + * task's standard filemanager 32.69 + * @param diagnosticListener a diagnostic listener; if {@code 32.70 + * null} use the compiler's default method for reporting 32.71 + * diagnostics 32.72 + * @param options task options, {@code null} means no options 32.73 + * @param classes class names for which native headers should be generated 32.74 + * @return an object representing the task to be done 32.75 + * @throws RuntimeException if an unrecoverable error 32.76 + * occurred in a user supplied component. The 32.77 + * {@linkplain Throwable#getCause() cause} will be the error in 32.78 + * user code. 32.79 + * @throws IllegalArgumentException if any of the given 32.80 + * compilation units are of other kind than 32.81 + * {@linkplain JavaFileObject.Kind#SOURCE source} 32.82 + */ 32.83 + NativeHeaderTask getTask(Writer out, 32.84 + JavaFileManager fileManager, 32.85 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 32.86 + Iterable<String> options, 32.87 + Iterable<String> classes); 32.88 + 32.89 + /** 32.90 + * Gets a new instance of the standard file manager implementation 32.91 + * for this tool. The file manager will use the given diagnostic 32.92 + * listener for producing any non-fatal diagnostics. Fatal errors 32.93 + * will be signalled with the appropriate exceptions. 32.94 + * 32.95 + * <p>The standard file manager will be automatically reopened if 32.96 + * it is accessed after calls to {@code flush} or {@code close}. 32.97 + * The standard file manager must be usable with other tools. 32.98 + * 32.99 + * @param diagnosticListener a diagnostic listener for non-fatal 32.100 + * diagnostics; if {@code null} use the tool's default method 32.101 + * for reporting diagnostics 32.102 + * @param locale the locale to apply when formatting diagnostics; 32.103 + * {@code null} means the {@linkplain Locale#getDefault() default locale}. 32.104 + * @param charset the character set used for decoding bytes; if 32.105 + * {@code null} use the platform default 32.106 + * @return the standard file manager 32.107 + */ 32.108 + StandardJavaFileManager getStandardFileManager( 32.109 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 32.110 + Locale locale, 32.111 + Charset charset); 32.112 + 32.113 + /** 32.114 + * Interface representing a future for a native header task. The 32.115 + * task has not yet started. To start the task, call 32.116 + * the {@linkplain #call call} method. 32.117 + * 32.118 + * <p>Before calling the call method, additional aspects of the 32.119 + * task can be configured, for example, by calling the 32.120 + * {@linkplain #setLocale setLocale} method. 32.121 + */ 32.122 + interface NativeHeaderTask extends Callable<Boolean> { 32.123 + 32.124 + /** 32.125 + * Set the locale to be applied when formatting diagnostics and 32.126 + * other localized data. 32.127 + * 32.128 + * @param locale the locale to apply; {@code null} means apply no 32.129 + * locale 32.130 + * @throws IllegalStateException if the task has started 32.131 + */ 32.132 + void setLocale(Locale locale); 32.133 + 32.134 + /** 32.135 + * Performs this native header task. The task may only 32.136 + * be performed once. Subsequent calls to this method throw 32.137 + * IllegalStateException. 32.138 + * 32.139 + * @return true if and only all the files were processed without errors; 32.140 + * false otherwise 32.141 + * 32.142 + * @throws RuntimeException if an unrecoverable error occurred 32.143 + * in a user-supplied component. The 32.144 + * {@linkplain Throwable#getCause() cause} will be the error 32.145 + * in user code. 32.146 + * @throws IllegalStateException if called more than once 32.147 + */ 32.148 + Boolean call(); 32.149 + } 32.150 +}
33.1 --- a/src/share/classes/com/sun/tools/javah/TypeSignature.java Fri Oct 02 11:26:53 2009 -0700 33.2 +++ b/src/share/classes/com/sun/tools/javah/TypeSignature.java Wed Oct 07 14:14:45 2009 -0700 33.3 @@ -1,5 +1,5 @@ 33.4 /* 33.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 33.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 33.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 33.8 * 33.9 * This code is free software; you can redistribute it and/or modify it 33.10 @@ -26,19 +26,34 @@ 33.11 33.12 package com.sun.tools.javah; 33.13 33.14 -import com.sun.javadoc.*; 33.15 -import java.io.*; 33.16 import java.util.*; 33.17 +import javax.lang.model.element.Name; 33.18 +import javax.lang.model.element.TypeElement; 33.19 +import javax.lang.model.type.ArrayType; 33.20 +import javax.lang.model.type.DeclaredType; 33.21 +import javax.lang.model.type.NoType; 33.22 +import javax.lang.model.type.PrimitiveType; 33.23 +import javax.lang.model.type.TypeKind; 33.24 +import javax.lang.model.type.TypeMirror; 33.25 +import javax.lang.model.type.TypeVariable; 33.26 +import javax.lang.model.type.TypeVisitor; 33.27 +import javax.lang.model.util.Elements; 33.28 +import javax.lang.model.util.SimpleTypeVisitor6; 33.29 33.30 /** 33.31 * Returns internal type signature. 33.32 * 33.33 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 33.34 + * If you write code that depends on this, you do so at your own 33.35 + * risk. This code and its internal interfaces are subject to change 33.36 + * or deletion without notice.</b></p> 33.37 + * 33.38 * @author Sucheta Dambalkar 33.39 */ 33.40 33.41 public class TypeSignature{ 33.42 33.43 - RootDoc root = null; 33.44 + Elements elems; 33.45 33.46 /* Signature Characters */ 33.47 33.48 @@ -56,8 +71,8 @@ 33.49 33.50 33.51 33.52 - public TypeSignature(RootDoc root){ 33.53 - this.root = root; 33.54 + public TypeSignature(Elements elems){ 33.55 + this.elems = elems; 33.56 } 33.57 33.58 /* 33.59 @@ -70,16 +85,15 @@ 33.60 /* 33.61 * Returns the type signature of a method according to JVM specs 33.62 */ 33.63 - public String getTypeSignature(String javasignature, Type returnType){ 33.64 - 33.65 + public String getTypeSignature(String javasignature, TypeMirror returnType){ 33.66 String signature = null; //Java type signature. 33.67 String typeSignature = null; //Internal type signature. 33.68 - Vector<Object> params = new Vector<Object>(); //List of parameters. 33.69 + List<String> params = new ArrayList<String>(); //List of parameters. 33.70 String paramsig = null; //Java parameter signature. 33.71 String paramJVMSig = null; //Internal parameter signature. 33.72 String returnSig = null; //Java return type signature. 33.73 String returnJVMType = null; //Internal return type signature. 33.74 - String dimension = null; //Array dimension. 33.75 + int dimensions = 0; //Array dimension. 33.76 33.77 int startIndex = -1; 33.78 int endIndex = -1; 33.79 @@ -87,28 +101,27 @@ 33.80 int i = 0; 33.81 33.82 // Gets the actual java signature without parentheses. 33.83 - if(javasignature != null){ 33.84 + if (javasignature != null) { 33.85 startIndex = javasignature.indexOf("("); 33.86 endIndex = javasignature.indexOf(")"); 33.87 } 33.88 33.89 - if(((startIndex != -1) && (endIndex != -1)) 33.90 - &&(startIndex+1 < javasignature.length()) 33.91 - &&(endIndex < javasignature.length())) { 33.92 - 33.93 + if (((startIndex != -1) && (endIndex != -1)) 33.94 + &&(startIndex+1 < javasignature.length()) 33.95 + &&(endIndex < javasignature.length())) { 33.96 signature = javasignature.substring(startIndex+1, endIndex); 33.97 } 33.98 33.99 // Separates parameters. 33.100 - if(signature != null){ 33.101 - if(signature.indexOf(",") != -1){ 33.102 + if (signature != null) { 33.103 + if (signature.indexOf(",") != -1) { 33.104 st = new StringTokenizer(signature, ","); 33.105 - if(st != null){ 33.106 + if (st != null) { 33.107 while (st.hasMoreTokens()) { 33.108 params.add(st.nextToken()); 33.109 } 33.110 } 33.111 - }else { 33.112 + } else { 33.113 params.add(signature); 33.114 } 33.115 } 33.116 @@ -117,10 +130,10 @@ 33.117 typeSignature = "("; 33.118 33.119 // Gets indivisual internal parameter signature. 33.120 - while(params.isEmpty() != true){ 33.121 - paramsig =((String)params.remove(i)).trim(); 33.122 + while (params.isEmpty() != true) { 33.123 + paramsig = params.remove(i).trim(); 33.124 paramJVMSig = getParamJVMSignature(paramsig); 33.125 - if(paramJVMSig != null){ 33.126 + if (paramJVMSig != null) { 33.127 typeSignature += paramJVMSig; 33.128 } 33.129 } 33.130 @@ -130,36 +143,30 @@ 33.131 // Get internal return type signature. 33.132 33.133 returnJVMType = ""; 33.134 - if(returnType != null){ 33.135 - dimension = returnType.dimension(); 33.136 + if (returnType != null) { 33.137 + dimensions = dimensions(returnType); 33.138 } 33.139 33.140 - if(dimension != null){ 33.141 - 33.142 - //Gets array dimension of return type. 33.143 - while(dimension.indexOf("[]") != -1){ 33.144 - returnJVMType += "["; 33.145 - int stindex = dimension.indexOf("]") + 1; 33.146 - if(stindex <= dimension.length()){ 33.147 - dimension = dimension.substring(stindex); 33.148 - }else dimension = ""; 33.149 - } 33.150 + //Gets array dimension of return type. 33.151 + while (dimensions-- > 0) { 33.152 + returnJVMType += "["; 33.153 } 33.154 - if(returnType != null){ 33.155 - returnSig = returnType.qualifiedTypeName(); 33.156 + if (returnType != null) { 33.157 + returnSig = qualifiedTypeName(returnType); 33.158 returnJVMType += getComponentType(returnSig); 33.159 - }else { 33.160 + } else { 33.161 System.out.println("Invalid return type."); 33.162 } 33.163 33.164 typeSignature += returnJVMType; 33.165 + 33.166 return typeSignature; 33.167 } 33.168 33.169 /* 33.170 * Returns internal signature of a parameter. 33.171 */ 33.172 - private String getParamJVMSignature(String paramsig){ 33.173 + private String getParamJVMSignature(String paramsig) { 33.174 String paramJVMSig = ""; 33.175 String componentType =""; 33.176 33.177 @@ -206,12 +213,13 @@ 33.178 else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; 33.179 else { 33.180 if(!componentType.equals("")){ 33.181 - ClassDoc classNameDoc = root.classNamed(componentType); 33.182 + TypeElement classNameDoc = elems.getTypeElement(componentType); 33.183 33.184 if(classNameDoc == null){ 33.185 - System.out.println("Invalid class type"); 33.186 + System.out.println("Invalid class type for " + componentType); 33.187 + new Exception().printStackTrace(); 33.188 }else { 33.189 - String classname = classNameDoc.qualifiedName(); 33.190 + String classname = classNameDoc.getQualifiedName().toString(); 33.191 String newclassname = classname.replace('.', '/'); 33.192 JVMSig += "L"; 33.193 JVMSig += newclassname; 33.194 @@ -222,4 +230,43 @@ 33.195 } 33.196 return JVMSig; 33.197 } 33.198 + 33.199 + int dimensions(TypeMirror t) { 33.200 + if (t.getKind() != TypeKind.ARRAY) 33.201 + return 0; 33.202 + return 1 + dimensions(((ArrayType) t).getComponentType()); 33.203 + } 33.204 + 33.205 + 33.206 + String qualifiedTypeName(TypeMirror type) { 33.207 + TypeVisitor<Name, Void> v = new SimpleTypeVisitor6<Name, Void>() { 33.208 + @Override 33.209 + public Name visitArray(ArrayType t, Void p) { 33.210 + return t.getComponentType().accept(this, p); 33.211 + } 33.212 + 33.213 + @Override 33.214 + public Name visitDeclared(DeclaredType t, Void p) { 33.215 + return ((TypeElement) t.asElement()).getQualifiedName(); 33.216 + } 33.217 + 33.218 + @Override 33.219 + public Name visitPrimitive(PrimitiveType t, Void p) { 33.220 + return elems.getName(t.toString()); 33.221 + } 33.222 + 33.223 + @Override 33.224 + public Name visitNoType(NoType t, Void p) { 33.225 + if (t.getKind() == TypeKind.VOID) 33.226 + return elems.getName("void"); 33.227 + return defaultAction(t, p); 33.228 + } 33.229 + 33.230 + @Override 33.231 + public Name visitTypeVariable(TypeVariable t, Void p) { 33.232 + return t.getUpperBound().accept(this, p); 33.233 + } 33.234 + }; 33.235 + return v.visit(type).toString(); 33.236 + } 33.237 }
34.1 --- a/src/share/classes/com/sun/tools/javah/Util.java Fri Oct 02 11:26:53 2009 -0700 34.2 +++ b/src/share/classes/com/sun/tools/javah/Util.java Wed Oct 07 14:14:45 2009 -0700 34.3 @@ -1,5 +1,5 @@ 34.4 /* 34.5 - * Copyright 2002-2004 Sun Microsystems, Inc. All Rights Reserved. 34.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 34.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.8 * 34.9 * This code is free software; you can redistribute it and/or modify it 34.10 @@ -26,12 +26,15 @@ 34.11 34.12 package com.sun.tools.javah; 34.13 34.14 -import java.io.File; 34.15 -import java.io.FileInputStream; 34.16 -import java.io.IOException; 34.17 +import java.io.PrintWriter; 34.18 +import java.text.MessageFormat; 34.19 +import java.util.Locale; 34.20 import java.util.ResourceBundle; 34.21 -import java.text.MessageFormat; 34.22 import java.util.MissingResourceException; 34.23 +import javax.tools.Diagnostic; 34.24 +import javax.tools.Diagnostic.Kind; 34.25 +import javax.tools.DiagnosticListener; 34.26 +import javax.tools.JavaFileObject; 34.27 34.28 /** 34.29 * Messages, verbose and error handling support. 34.30 @@ -41,42 +44,70 @@ 34.31 * bug -- Bug has occurred in javah 34.32 * fatal -- We can't even find resources, so bail fast, don't localize 34.33 * 34.34 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 34.35 + * If you write code that depends on this, you do so at your own 34.36 + * risk. This code and its internal interfaces are subject to change 34.37 + * or deletion without notice.</b></p> 34.38 */ 34.39 public class Util { 34.40 + /** Exit is used to replace the use of System.exit in the original javah. 34.41 + */ 34.42 + public static class Exit extends Error { 34.43 + private static final long serialVersionUID = 430820978114067221L; 34.44 + Exit(int exitValue) { 34.45 + this(exitValue, null); 34.46 + } 34.47 + 34.48 + Exit(int exitValue, Throwable cause) { 34.49 + super(cause); 34.50 + this.exitValue = exitValue; 34.51 + this.cause = cause; 34.52 + } 34.53 + 34.54 + Exit(Exit e) { 34.55 + this(e.exitValue, e.cause); 34.56 + } 34.57 + 34.58 + public final int exitValue; 34.59 + public final Throwable cause; 34.60 + } 34.61 34.62 /* 34.63 * Help for verbosity. 34.64 */ 34.65 - public static boolean verbose = false; 34.66 + public boolean verbose = false; 34.67 34.68 - public static void log(String s) { 34.69 - System.out.println(s); 34.70 + public PrintWriter log; 34.71 + public DiagnosticListener<? super JavaFileObject> dl; 34.72 + 34.73 + Util(PrintWriter log, DiagnosticListener<? super JavaFileObject> dl) { 34.74 + this.log = log; 34.75 + this.dl = dl; 34.76 + } 34.77 + 34.78 + public void log(String s) { 34.79 + log.println(s); 34.80 } 34.81 34.82 34.83 /* 34.84 * Help for loading localized messages. 34.85 */ 34.86 - private static ResourceBundle m; 34.87 + private ResourceBundle m; 34.88 34.89 - private static void initMessages() { 34.90 + private void initMessages() throws Exit { 34.91 try { 34.92 - m=ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n"); 34.93 + m = ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n"); 34.94 } catch (MissingResourceException mre) { 34.95 fatal("Error loading resources. Please file a bug report.", mre); 34.96 } 34.97 } 34.98 34.99 - public static String getText(String key) { 34.100 - return getText(key, null, null); 34.101 - } 34.102 - 34.103 - private static String getText(String key, String a1, String a2){ 34.104 + private String getText(String key, Object... args) throws Exit { 34.105 if (m == null) 34.106 initMessages(); 34.107 try { 34.108 - return MessageFormat.format(m.getString(key), 34.109 - new Object[] { a1, a2 }); 34.110 + return MessageFormat.format(m.getString(key), args); 34.111 } catch (MissingResourceException e) { 34.112 fatal("Key " + key + " not found in resources.", e); 34.113 } 34.114 @@ -86,107 +117,74 @@ 34.115 /* 34.116 * Usage message. 34.117 */ 34.118 - public static void usage(int exitValue) { 34.119 - if (exitValue == 0) { 34.120 - System.out.println(getText("usage")); 34.121 - } else { 34.122 - System.err.println(getText("usage")); 34.123 - } 34.124 - System.exit(exitValue); 34.125 + public void usage() throws Exit { 34.126 + log.println(getText("usage")); 34.127 } 34.128 34.129 - public static void version() { 34.130 - System.out.println(getText("javah.version", 34.131 + public void version() throws Exit { 34.132 + log.println(getText("javah.version", 34.133 System.getProperty("java.version"), null)); 34.134 - System.exit(0); 34.135 } 34.136 34.137 /* 34.138 * Failure modes. 34.139 */ 34.140 - public static void bug(String key) { 34.141 + public void bug(String key) throws Exit { 34.142 bug(key, null); 34.143 } 34.144 34.145 - public static void bug(String key, Exception e) { 34.146 - if (e != null) 34.147 - e.printStackTrace(); 34.148 - System.err.println(getText(key)); 34.149 - System.err.println(getText("bug.report")); 34.150 - System.exit(11); 34.151 + public void bug(String key, Exception e) throws Exit { 34.152 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key)); 34.153 + dl.report(createDiagnostic(Diagnostic.Kind.NOTE, "bug.report")); 34.154 + throw new Exit(11, e); 34.155 } 34.156 34.157 - public static void error(String key) { 34.158 - error(key, null); 34.159 + public void error(String key, Object... args) throws Exit { 34.160 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key, args)); 34.161 + throw new Exit(15); 34.162 } 34.163 34.164 - public static void error(String key, String a1) { 34.165 - error(key, a1, null); 34.166 - } 34.167 - 34.168 - public static void error(String key, String a1, String a2) { 34.169 - error(key, a1, a2, false); 34.170 - } 34.171 - 34.172 - public static void error(String key, String a1, String a2, 34.173 - boolean showUsage) { 34.174 - System.err.println("Error: " + getText(key, a1, a2)); 34.175 - if (showUsage) 34.176 - usage(15); 34.177 - System.exit(15); 34.178 - } 34.179 - 34.180 - 34.181 - private static void fatal(String msg) { 34.182 + private void fatal(String msg) throws Exit { 34.183 fatal(msg, null); 34.184 } 34.185 34.186 - private static void fatal(String msg, Exception e) { 34.187 - if (e != null) { 34.188 - e.printStackTrace(); 34.189 - } 34.190 - System.err.println(msg); 34.191 - System.exit(10); 34.192 + private void fatal(String msg, Exception e) throws Exit { 34.193 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, "", msg)); 34.194 + throw new Exit(10, e); 34.195 } 34.196 34.197 - /* 34.198 - * Support for platform specific things in javah, such as pragma 34.199 - * directives, exported symbols etc. 34.200 - */ 34.201 - static private ResourceBundle platform = null; 34.202 - 34.203 - /* 34.204 - * Set when platform has been initialized. 34.205 - */ 34.206 - static private boolean platformInit = false; 34.207 - 34.208 - static String getPlatformString(String key) { 34.209 - if (!platformInit) { 34.210 - initPlatform(); 34.211 - platformInit = true; 34.212 - } 34.213 - if (platform == null) 34.214 - return null; 34.215 - try { 34.216 - return platform.getString(key); 34.217 - } catch (MissingResourceException mre) { 34.218 - return null; 34.219 - } 34.220 - } 34.221 - 34.222 - private static void initPlatform() { 34.223 - String os = System.getProperty("os.name"); 34.224 - if (os.startsWith("Windows")) { 34.225 - os = "win32"; 34.226 - } else if (os.indexOf("Linux") >= 0) { 34.227 - os = "Linux"; 34.228 - } 34.229 - String arch = System.getProperty("os.arch"); 34.230 - String resname = "com.sun.tools.javah.resources." + os + "_" + arch; 34.231 - try { 34.232 - platform=ResourceBundle.getBundle(resname); 34.233 - } catch (MissingResourceException mre) { 34.234 - // fatal("Error loading resources. Please file a bug report.", mre); 34.235 - } 34.236 + private Diagnostic<JavaFileObject> createDiagnostic( 34.237 + final Diagnostic.Kind kind, final String code, final Object... args) { 34.238 + return new Diagnostic<JavaFileObject>() { 34.239 + public String getCode() { 34.240 + return code; 34.241 + } 34.242 + public long getColumnNumber() { 34.243 + return Diagnostic.NOPOS; 34.244 + } 34.245 + public long getEndPosition() { 34.246 + return Diagnostic.NOPOS; 34.247 + } 34.248 + public Kind getKind() { 34.249 + return kind; 34.250 + } 34.251 + public long getLineNumber() { 34.252 + return Diagnostic.NOPOS; 34.253 + } 34.254 + public String getMessage(Locale locale) { 34.255 + if (code.length() == 0) 34.256 + return (String) args[0]; 34.257 + return getText(code, args); // FIXME locale 34.258 + } 34.259 + public long getPosition() { 34.260 + return Diagnostic.NOPOS; 34.261 + } 34.262 + public JavaFileObject getSource() { 34.263 + return null; 34.264 + } 34.265 + public long getStartPosition() { 34.266 + return Diagnostic.NOPOS; 34.267 + } 34.268 + }; 34.269 } 34.270 }
35.1 --- a/src/share/classes/com/sun/tools/javah/resources/Linux_ppc.properties Fri Oct 02 11:26:53 2009 -0700 35.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 35.3 @@ -1,27 +0,0 @@ 35.4 -# 35.5 -# Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. 35.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 35.7 -# 35.8 -# This code is free software; you can redistribute it and/or modify it 35.9 -# under the terms of the GNU General Public License version 2 only, as 35.10 -# published by the Free Software Foundation. Sun designates this 35.11 -# particular file as subject to the "Classpath" exception as provided 35.12 -# by Sun in the LICENSE file that accompanied this code. 35.13 -# 35.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 35.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 35.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 35.17 -# version 2 for more details (a copy is included in the LICENSE file that 35.18 -# accompanied this code). 35.19 -# 35.20 -# You should have received a copy of the GNU General Public License version 35.21 -# 2 along with this work; if not, write to the Free Software Foundation, 35.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 35.23 -# 35.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 35.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 35.26 -# have any questions. 35.27 -# 35.28 - 35.29 -pack.pragma.start=\#pragma pack(4)\n 35.30 -pack.pragma.end=\#pragma pack()\n
36.1 --- a/src/share/classes/com/sun/tools/javah/resources/Linux_sparc.properties Fri Oct 02 11:26:53 2009 -0700 36.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 36.3 @@ -1,27 +0,0 @@ 36.4 -# 36.5 -# Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. 36.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 36.7 -# 36.8 -# This code is free software; you can redistribute it and/or modify it 36.9 -# under the terms of the GNU General Public License version 2 only, as 36.10 -# published by the Free Software Foundation. Sun designates this 36.11 -# particular file as subject to the "Classpath" exception as provided 36.12 -# by Sun in the LICENSE file that accompanied this code. 36.13 -# 36.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 36.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 36.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 36.17 -# version 2 for more details (a copy is included in the LICENSE file that 36.18 -# accompanied this code). 36.19 -# 36.20 -# You should have received a copy of the GNU General Public License version 36.21 -# 2 along with this work; if not, write to the Free Software Foundation, 36.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 36.23 -# 36.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 36.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 36.26 -# have any questions. 36.27 -# 36.28 - 36.29 -pack.pragma.start=\#pragma pack(4)\n 36.30 -pack.pragma.end=\#pragma pack()\n
37.1 --- a/src/share/classes/com/sun/tools/javah/resources/SunOS_sparc.properties Fri Oct 02 11:26:53 2009 -0700 37.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 37.3 @@ -1,27 +0,0 @@ 37.4 -# 37.5 -# Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. 37.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 37.7 -# 37.8 -# This code is free software; you can redistribute it and/or modify it 37.9 -# under the terms of the GNU General Public License version 2 only, as 37.10 -# published by the Free Software Foundation. Sun designates this 37.11 -# particular file as subject to the "Classpath" exception as provided 37.12 -# by Sun in the LICENSE file that accompanied this code. 37.13 -# 37.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 37.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 37.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 37.17 -# version 2 for more details (a copy is included in the LICENSE file that 37.18 -# accompanied this code). 37.19 -# 37.20 -# You should have received a copy of the GNU General Public License version 37.21 -# 2 along with this work; if not, write to the Free Software Foundation, 37.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 37.23 -# 37.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 37.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 37.26 -# have any questions. 37.27 -# 37.28 - 37.29 -pack.pragma.start=\#pragma pack(4)\n 37.30 -pack.pragma.end=\#pragma pack()\n
38.1 --- a/src/share/classes/com/sun/tools/javah/resources/SunOS_sparcv9.properties Fri Oct 02 11:26:53 2009 -0700 38.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 38.3 @@ -1,27 +0,0 @@ 38.4 -# 38.5 -# Copyright 2001 Sun Microsystems, Inc. All Rights Reserved. 38.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 38.7 -# 38.8 -# This code is free software; you can redistribute it and/or modify it 38.9 -# under the terms of the GNU General Public License version 2 only, as 38.10 -# published by the Free Software Foundation. Sun designates this 38.11 -# particular file as subject to the "Classpath" exception as provided 38.12 -# by Sun in the LICENSE file that accompanied this code. 38.13 -# 38.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 38.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 38.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 38.17 -# version 2 for more details (a copy is included in the LICENSE file that 38.18 -# accompanied this code). 38.19 -# 38.20 -# You should have received a copy of the GNU General Public License version 38.21 -# 2 along with this work; if not, write to the Free Software Foundation, 38.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 38.23 -# 38.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 38.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 38.26 -# have any questions. 38.27 -# 38.28 - 38.29 -pack.pragma.start=\#pragma pack(4)\n 38.30 -pack.pragma.end=\#pragma pack()\n
39.1 --- a/src/share/classes/com/sun/tools/javah/resources/l10n.properties Fri Oct 02 11:26:53 2009 -0700 39.2 +++ b/src/share/classes/com/sun/tools/javah/resources/l10n.properties Wed Oct 07 14:14:45 2009 -0700 39.3 @@ -21,47 +21,47 @@ 39.4 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 39.5 # CA 95054 USA or visit www.sun.com if you need additional information or 39.6 # have any questions. 39.7 -# 39.8 +# 39.9 39.10 # 39.11 # User errors, command line errors. 39.12 # 39.13 cant.create.dir=\ 39.14 - The directory {0} could not be create for output. 39.15 + The directory {0} could not be create for output. 39.16 at.args.cant.read=\ 39.17 - Can''t read command line arguments from file {1}. 39.18 + Can''t read command line arguments from file {1}. 39.19 at.args.io.exception=\ 39.20 - The following I/O problem was encountered when processing an @ \ 39.21 + The following I/O problem was encountered when processing an @ \ 39.22 argument on the command line: {0}. 39.23 old.jni.mixed=\ 39.24 - Can''t mix options -jni and -old. Try -help. 39.25 + Can''t mix options -jni and -old. Try -help. 39.26 old.llni.mixed=\ 39.27 - Can''t mix options -old and -llni. Try -help. 39.28 + Can''t mix options -old and -llni. Try -help. 39.29 old.not.supported=\ 39.30 - Option -old not supported by this version of javah. 39.31 + Option -old not supported by this version of javah. 39.32 invalid.method.signature=\ 39.33 - Invalid method signature: {0} 39.34 + Invalid method signature: {0} 39.35 jni.llni.mixed=\ 39.36 - Can''t mix options -jni and -llni. Try -help. 39.37 + Can''t mix options -jni and -llni. Try -help. 39.38 jni.no.stubs=\ 39.39 - JNI does not require stubs, please refer to the JNI documentation. 39.40 + JNI does not require stubs, please refer to the JNI documentation. 39.41 dir.file.mixed=\ 39.42 - Can''t mix options -d and -o. Try -help. 39.43 + Can''t mix options -d and -o. Try -help. 39.44 no.classes.specified=\ 39.45 - No classes were specified on the command line. Try -help. 39.46 + No classes were specified on the command line. Try -help. 39.47 no.outputfile.specified=\ 39.48 - No outputfile was specified on the command line. Try -help. 39.49 + No outputfile was specified on the command line. Try -help. 39.50 no.outputdir.specified=\ 39.51 - No output directory was specified on the command line. Try -help. 39.52 + No output directory was specified on the command line. Try -help. 39.53 no.classpath.specified=\ 39.54 - No classpath was specified on the command line. Try -help. 39.55 + No classpath was specified on the command line. Try -help. 39.56 no.bootclasspath.specified=\ 39.57 - No bootclasspath was specified on the command line. Try -help. 39.58 + No bootclasspath was specified on the command line. Try -help. 39.59 unknown.option=\ 39.60 - {0} is an illegal argument\n 39.61 + {0} is an illegal argument\n 39.62 tracing.not.supported=\ 39.63 - Warning: Tracing is no longer supported. Instead, use\ 39.64 - -verbose:jni option of the virtual machine. 39.65 + Warning: Tracing is no longer supported. Instead, use\ 39.66 + -verbose:jni option of the virtual machine. 39.67 39.68 # 39.69 # Usage message. 39.70 @@ -79,11 +79,37 @@ 39.71 -jni Generate JNI-style header file (default)\n\t\ 39.72 -version Print version information\n\t\ 39.73 -verbose Enable verbose output\n\t\ 39.74 --force Always write output files\n\ 39.75 +-force Always write output files\n\ 39.76 \n\ 39.77 <classes> are specified with their fully qualified names (for\n\ 39.78 instance, java.lang.Object).\n 39.79 39.80 +main.usage=\ 39.81 +Usage: \n\ 39.82 +\ javah [options] <classes>\n\ 39.83 +where [options] include: 39.84 +main.opt.o=\ 39.85 +\ -o <file> Output file (only one of -d or -o may be used) 39.86 +main.opt.d=\ 39.87 +\ -d <dir> Output directory 39.88 +main.opt.v=\ 39.89 +\ -v -verbose Enable verbose output 39.90 +main.opt.help=\ 39.91 +\ -h --help -? Print this message 39.92 +main.opt.version=\ 39.93 +\ -version Print version information 39.94 +main.opt.jni=\ 39.95 +\ -jni Generate JNI-style header file (default) 39.96 +main.opt.force=\ 39.97 +\ -force Always write output files 39.98 +main.opt.classpath=\ 39.99 +\ -classpath <path> Path from which to load classes 39.100 +main.opt.bootclasspath=\ 39.101 +\ -bootclasspath <path> Path from which to load bootstrap classes 39.102 +main.usage.foot=\ 39.103 +<classes> are specified with their fully qualified names\n\ 39.104 +(for example, java.lang.Object). 39.105 + 39.106 # 39.107 # Version string. 39.108 # 39.109 @@ -93,26 +119,35 @@ 39.110 # These should have better diagnostics. 39.111 # 39.112 super.class.not.found=\ 39.113 - A required super class {0} could not be found. 39.114 + A required super class {0} could not be found. 39.115 class.not.found=\ 39.116 - Class {0} could not be found. 39.117 + Class {0} could not be found. 39.118 io.exception=\ 39.119 - Can''t recover from an I/O error with the following message: \ 39.120 - {0}. 39.121 + Can''t recover from an I/O error with the following message: \ 39.122 + {0}. 39.123 39.124 # 39.125 # Problems in the guts of javah. 39.126 # 39.127 encoding.iso8859_1.not.found=\ 39.128 - ISO8859_1 converter was not found for output. This is \ 39.129 + ISO8859_1 converter was not found for output. This is \ 39.130 probably due to an error in the installation installation. 39.131 tried.to.define.non.static=\ 39.132 - Tried to generate #define for non-static field. 39.133 + Tried to generate #define for non-static field. 39.134 jni.unknown.type=\ 39.135 - An unknown type encountered (JNI). 39.136 + An unknown type encountered (JNI). 39.137 unknown.array.type=\ 39.138 - An unknown array type encountered when generating old style headers. 39.139 + An unknown array type encountered when generating old style headers. 39.140 unknown.type.for.field=\ 39.141 - An unknown type encountered when generating old style headers. 39.142 + An unknown type encountered when generating old style headers. 39.143 unknown.type.in.method.signature=\ 39.144 - An unknown type eccountered when generating old style stubs. 39.145 + An unknown type eccountered when generating old style stubs. 39.146 + 39.147 + 39.148 +err.prefix=Error: 39.149 +err.cant.use.option.for.fm=Can't use {0} option with given file manager 39.150 +err.internal.error=Internal error: {0} 39.151 +err.ioerror=IO error: {0} 39.152 +err.missing.arg=value missing for {0} 39.153 +err.no.classes.specified=no classes specified 39.154 +err.unknown.option=unknown option: {0}
40.1 --- a/src/share/classes/com/sun/tools/javah/resources/win32_x86.properties Fri Oct 02 11:26:53 2009 -0700 40.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 40.3 @@ -1,28 +0,0 @@ 40.4 -# 40.5 -# Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. 40.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 40.7 -# 40.8 -# This code is free software; you can redistribute it and/or modify it 40.9 -# under the terms of the GNU General Public License version 2 only, as 40.10 -# published by the Free Software Foundation. Sun designates this 40.11 -# particular file as subject to the "Classpath" exception as provided 40.12 -# by Sun in the LICENSE file that accompanied this code. 40.13 -# 40.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 40.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 40.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 40.17 -# version 2 for more details (a copy is included in the LICENSE file that 40.18 -# accompanied this code). 40.19 -# 40.20 -# You should have received a copy of the GNU General Public License version 40.21 -# 2 along with this work; if not, write to the Free Software Foundation, 40.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 40.23 -# 40.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 40.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 40.26 -# have any questions. 40.27 -# 40.28 - 40.29 -dll.export=__declspec(dllexport) 40.30 -pack.pragma.start=\#pragma pack(4)\n 40.31 -pack.pragma.end=\#pragma pack()\n
41.1 --- a/src/share/classes/com/sun/tools/javap/DisassemblerTool.java Fri Oct 02 11:26:53 2009 -0700 41.2 +++ b/src/share/classes/com/sun/tools/javap/DisassemblerTool.java Wed Oct 07 14:14:45 2009 -0700 41.3 @@ -42,7 +42,7 @@ 41.4 * @see DiagnosticListener 41.5 * @see Diagnostic 41.6 * @see JavaFileManager 41.7 - * @since 1.6 41.8 + * @since 1.7 41.9 * 41.10 * <p><b>This is NOT part of any API supported by Sun Microsystems. If 41.11 * you write code that depends on this, you do so at your own risk.
42.1 --- a/src/share/classes/javax/tools/SimpleJavaFileObject.java Fri Oct 02 11:26:53 2009 -0700 42.2 +++ b/src/share/classes/javax/tools/SimpleJavaFileObject.java Wed Oct 07 14:14:45 2009 -0700 42.3 @@ -27,7 +27,6 @@ 42.4 42.5 import java.io.*; 42.6 import java.net.URI; 42.7 -import java.net.URISyntaxException; 42.8 import java.nio.CharBuffer; 42.9 import javax.lang.model.element.Modifier; 42.10 import javax.lang.model.element.NestingKind;
43.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 43.2 +++ b/test/tools/javac/4241573/T4241573.java Wed Oct 07 14:14:45 2009 -0700 43.3 @@ -0,0 +1,225 @@ 43.4 +/* 43.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 43.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 43.7 + * 43.8 + * This code is free software; you can redistribute it and/or modify it 43.9 + * under the terms of the GNU General Public License version 2 only, as 43.10 + * published by the Free Software Foundation. 43.11 + * 43.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 43.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 43.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 43.15 + * version 2 for more details (a copy is included in the LICENSE file that 43.16 + * accompanied this code). 43.17 + * 43.18 + * You should have received a copy of the GNU General Public License version 43.19 + * 2 along with this work; if not, write to the Free Software Foundation, 43.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 43.21 + * 43.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 43.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 43.24 + * have any questions. 43.25 + */ 43.26 + 43.27 +/* 43.28 + * @test 43.29 + * @bug 4241573 43.30 + * @summary SourceFile attribute includes full path 43.31 + */ 43.32 + 43.33 +import com.sun.tools.classfile.Attribute; 43.34 +import com.sun.tools.classfile.ClassFile; 43.35 +import com.sun.tools.classfile.SourceFile_attribute; 43.36 +import java.io.*; 43.37 +import java.util.*; 43.38 +import java.util.jar.*; 43.39 + 43.40 +public class T4241573 { 43.41 + public static void main(String... args) throws Exception { 43.42 + new T4241573().run(); 43.43 + } 43.44 + 43.45 + public void run() throws Exception { 43.46 + // Selection of files to be compiled 43.47 + File absJar = createJar(new File("abs.jar").getAbsoluteFile(), "j.A"); 43.48 + File relJar = createJar(new File("rel.jar"), "j.R"); 43.49 + File absDir = createDir(new File("abs.dir").getAbsoluteFile(), "d.A"); 43.50 + File relDir = createDir(new File("rel.dir"), "d.R"); 43.51 + File absTestFile = writeFile(new File("AbsTest.java").getAbsoluteFile(), "class AbsTest { class Inner { } }"); 43.52 + File relTestFile = writeFile(new File("RelTest.java"), "class RelTest { class Inner { } }"); 43.53 + File relTest2File = writeFile(new File("p/RelTest2.java"), "package p; class RelTest2 { class Inner { } }"); 43.54 + // This next class references other classes that will be found on the source path 43.55 + // and which will therefore need to be compiled as well. 43.56 + File mainFile = writeFile(new File("Main.java"), 43.57 + "class Main { j.A ja; j.R jr; d.A da; d.R dr; }" + 43.58 + ""); 43.59 + 43.60 + String sourcePath = createPath(absJar, relJar, absDir, relDir); 43.61 + File outDir = new File("classes"); 43.62 + outDir.mkdirs(); 43.63 + 43.64 + String[] args = { 43.65 + "-sourcepath", sourcePath, 43.66 + "-d", outDir.getPath(), 43.67 + absTestFile.getPath(), 43.68 + relTestFile.getPath(), 43.69 + relTest2File.getPath(), 43.70 + mainFile.getPath(), 43.71 + }; 43.72 + System.err.println("compile: " + Arrays.asList(args)); 43.73 + StringWriter sw = new StringWriter(); 43.74 + PrintWriter pw = new PrintWriter(sw); 43.75 + int rc = com.sun.tools.javac.Main.compile(args, pw); 43.76 + pw.close(); 43.77 + if (rc != 0) { 43.78 + System.err.println(sw.toString()); 43.79 + throw new Exception("unexpected exit from javac: " + rc); 43.80 + } 43.81 + 43.82 + Set<File> expect = getFiles(outDir, 43.83 + "d/A.class", "d/A$Inner.class", 43.84 + "d/R.class", "d/R$Inner.class", 43.85 + "j/A.class", "j/A$Inner.class", 43.86 + "j/R.class", "j/R$Inner.class", 43.87 + "AbsTest.class", "AbsTest$Inner.class", 43.88 + "RelTest.class", "RelTest$Inner.class", 43.89 + "p/RelTest2.class", "p/RelTest2$Inner.class", 43.90 + "Main.class" ); 43.91 + 43.92 + Set<File> found = findFiles(outDir); 43.93 + 43.94 + if (!found.equals(expect)) { 43.95 + if (found.containsAll(expect)) 43.96 + throw new Exception("unexpected files found: " + diff(found, expect)); 43.97 + else if (expect.containsAll(found)) 43.98 + throw new Exception("expected files not found: " + diff(expect, found)); 43.99 + } 43.100 + 43.101 + for (File f: found) 43.102 + verifySourceFileAttribute(f); 43.103 + 43.104 + if (errors > 0) 43.105 + throw new Exception(errors + " errors occurred"); 43.106 + } 43.107 + 43.108 + /** Check the SourceFileAttribute is the simple name of the original source file. */ 43.109 + void verifySourceFileAttribute(File f) { 43.110 + System.err.println("verify: " + f); 43.111 + try { 43.112 + ClassFile cf = ClassFile.read(f); 43.113 + SourceFile_attribute sfa = (SourceFile_attribute) cf.getAttribute(Attribute.SourceFile); 43.114 + String found = sfa.getSourceFile(cf.constant_pool); 43.115 + String expect = f.getName().replaceAll("([$.].*)?\\.class", ".java"); 43.116 + if (!expect.equals(found)) { 43.117 + error("bad value found: " + found + ", expected: " + expect); 43.118 + } 43.119 + } catch (Exception e) { 43.120 + error("error reading " + f +": " + e); 43.121 + } 43.122 + } 43.123 + 43.124 + /** Create a directory containing one or more files. */ 43.125 + File createDir(File dir, String... entries) throws Exception { 43.126 + if (!dir.mkdirs()) 43.127 + throw new Exception("cannot create directories " + dir); 43.128 + for (String e: entries) { 43.129 + writeFile(new File(dir, getPathForEntry(e)), getBodyForEntry(e)); 43.130 + } 43.131 + return dir; 43.132 + } 43.133 + 43.134 + /** Create a jar file containing one or more entries. */ 43.135 + File createJar(File jar, String... entries) throws IOException { 43.136 + OutputStream out = new FileOutputStream(jar); 43.137 + try { 43.138 + JarOutputStream jos = new JarOutputStream(out); 43.139 + for (String e: entries) { 43.140 + jos.putNextEntry(new JarEntry(getPathForEntry(e))); 43.141 + jos.write(getBodyForEntry(e).getBytes()); 43.142 + } 43.143 + jos.close(); 43.144 + } finally { 43.145 + out.close(); 43.146 + } 43.147 + return jar; 43.148 + } 43.149 + 43.150 + /** Return the path for an entry given to createDir or createJar. */ 43.151 + String getPathForEntry(String e) { 43.152 + return e.replace(".", File.separator) + ".java"; 43.153 + } 43.154 + 43.155 + /** Return the body text for an entry given to createDir or createJar. */ 43.156 + String getBodyForEntry(String e) { 43.157 + int sep = e.lastIndexOf("."); 43.158 + String pkgName = e.substring(0, sep); 43.159 + String className = e.substring(sep + 1); 43.160 + return "package " + pkgName + "; public class " + className + "{ class Inner { } }"; 43.161 + } 43.162 + 43.163 + /** Write a file containing the given string. Parent directories are 43.164 + * created as needed. */ 43.165 + File writeFile(File f, String s) throws IOException { 43.166 + if (f.getParentFile() != null) 43.167 + f.getParentFile().mkdirs(); 43.168 + FileWriter out = new FileWriter(f); 43.169 + try { 43.170 + out.write(s); 43.171 + } finally { 43.172 + out.close(); 43.173 + } 43.174 + return f; 43.175 + } 43.176 + 43.177 + /** Create a path value from a list of directories and jar files. */ 43.178 + String createPath(File... files) { 43.179 + StringBuilder sb = new StringBuilder(); 43.180 + for (File f: files) { 43.181 + if (sb.length() > 0) 43.182 + sb.append(File.pathSeparatorChar); 43.183 + sb.append(f.getPath()); 43.184 + } 43.185 + return sb.toString(); 43.186 + } 43.187 + 43.188 + /** Create a set of files from a base directory and a set of relative paths. */ 43.189 + Set<File> getFiles(File dir, String... paths) { 43.190 + Set<File> files = new LinkedHashSet<File>(); 43.191 + for (String p: paths) 43.192 + files.add(new File(dir, p)); 43.193 + return files; 43.194 + } 43.195 + 43.196 + /** Find all the files in a directory and its subdirectories. */ 43.197 + Set<File> findFiles(File dir) { 43.198 + Set<File> files = new LinkedHashSet<File>(); 43.199 + findFiles(dir, files); 43.200 + return files; 43.201 + } 43.202 + // where 43.203 + void findFiles(File dir, Set<File> files) { 43.204 + for (File f: dir.listFiles()) { 43.205 + if (f.isDirectory()) 43.206 + findFiles(f, files); 43.207 + else 43.208 + files.add(f); 43.209 + } 43.210 + } 43.211 + 43.212 + /** Return the difference of two sets, a - b. */ 43.213 + <T> Set<T> diff(Set<T> a, Set<T> b) { 43.214 + if (b.isEmpty()) 43.215 + return a; 43.216 + Set<T> result = new LinkedHashSet<T>(a); 43.217 + result.removeAll(b); 43.218 + return result; 43.219 + } 43.220 + 43.221 + /** Report an error. */ 43.222 + void error(String msg) { 43.223 + System.err.println(msg); 43.224 + errors++; 43.225 + } 43.226 + 43.227 + int errors; 43.228 +}
44.1 --- a/test/tools/javac/6589361/T6589361.java Fri Oct 02 11:26:53 2009 -0700 44.2 +++ b/test/tools/javac/6589361/T6589361.java Wed Oct 07 14:14:45 2009 -0700 44.3 @@ -25,7 +25,7 @@ 44.4 for (JavaFileObject file : files) { 44.5 // Note: Zip/Jar entry names use '/', not File.separator, but just to be sure, 44.6 // we normalize the filename as well. 44.7 - if (file.toString().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { 44.8 + if (file.getName().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { 44.9 String str = fm.inferBinaryName(StandardLocation.CLASS_PATH, file); 44.10 if (!str.equals("java.lang.Object")) { 44.11 throw new AssertionError("Error in JavacFileManager.inferBinaryName method!");
45.1 --- a/test/tools/javac/Diagnostics/6769027/T6769027.java Fri Oct 02 11:26:53 2009 -0700 45.2 +++ b/test/tools/javac/Diagnostics/6769027/T6769027.java Wed Oct 07 14:14:45 2009 -0700 45.3 @@ -261,7 +261,7 @@ 45.4 45.5 enum PositionKind { 45.6 NOPOS(Position.NOPOS, "- ", "error: "), 45.7 - POS(5, "/Test.java:1:6: ", "myfo:/Test.java:1: "); 45.8 + POS(5, "Test.java:1:6: ", "/Test.java:1: "); 45.9 45.10 int pos; 45.11 String rawOutput;
46.1 --- a/test/tools/javac/T6705935.java Fri Oct 02 11:26:53 2009 -0700 46.2 +++ b/test/tools/javac/T6705935.java Wed Oct 07 14:14:45 2009 -0700 46.3 @@ -48,7 +48,7 @@ 46.4 "java.lang", 46.5 Collections.singleton(JavaFileObject.Kind.CLASS), 46.6 false)) { 46.7 - String p = ((BaseFileObject)fo).getPath(); 46.8 + String p = fo.getName(); 46.9 int bra = p.indexOf("("); 46.10 int ket = p.indexOf(")"); 46.11 //System.err.println(bra + "," + ket + "," + p.length());
47.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 47.2 +++ b/test/tools/javac/annotations/pos/TrailingComma.java Wed Oct 07 14:14:45 2009 -0700 47.3 @@ -0,0 +1,43 @@ 47.4 +/* 47.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 47.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 47.7 + * 47.8 + * This code is free software; you can redistribute it and/or modify it 47.9 + * under the terms of the GNU General Public License version 2 only, as 47.10 + * published by the Free Software Foundation. 47.11 + * 47.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 47.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 47.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 47.15 + * version 2 for more details (a copy is included in the LICENSE file that 47.16 + * accompanied this code). 47.17 + * 47.18 + * You should have received a copy of the GNU General Public License version 47.19 + * 2 along with this work; if not, write to the Free Software Foundation, 47.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 47.21 + * 47.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 47.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 47.24 + * have any questions. 47.25 + */ 47.26 + 47.27 +/* 47.28 + * @test 47.29 + * @bug 6337964 47.30 + * @summary javac incorrectly disallows trailing comma in annotation arrays 47.31 + * @author darcy 47.32 + * @compile TrailingComma.java 47.33 + */ 47.34 + 47.35 +import java.lang.annotation.*; 47.36 + 47.37 +@interface TestAnnotation { 47.38 + SuppressWarnings[] value() default {@SuppressWarnings({"",})}; 47.39 +} 47.40 + 47.41 + 47.42 +@TestAnnotation({@SuppressWarnings(), 47.43 + @SuppressWarnings({"Beware the ides of March.",}), 47.44 + @SuppressWarnings({"Look both ways", "Before Crossing",}), }) 47.45 +public class TrailingComma { 47.46 +}
48.1 --- a/test/tools/javac/api/6411310/T6411310.java Fri Oct 02 11:26:53 2009 -0700 48.2 +++ b/test/tools/javac/api/6411310/T6411310.java Wed Oct 07 14:14:45 2009 -0700 48.3 @@ -37,7 +37,7 @@ 48.4 import static javax.tools.StandardLocation.CLASS_PATH; 48.5 import static javax.tools.JavaFileObject.Kind.CLASS; 48.6 48.7 -// Limited test while we wait for 6419926 48.8 +// Limited test while we wait for 6419926: 6419926 is now closed 48.9 48.10 public class T6411310 extends ToolTester { 48.11 48.12 @@ -45,8 +45,11 @@ 48.13 JavaFileObject file = fm.getJavaFileForInput(PLATFORM_CLASS_PATH, 48.14 "java.lang.Object", 48.15 CLASS); 48.16 - if (!file.getName().equals("Object.class")) 48.17 + String fileName = file.getName(); 48.18 + if (!fileName.matches(".*java/lang/Object.class\\)?")) { 48.19 + System.err.println(fileName); 48.20 throw new AssertionError(file); 48.21 + } 48.22 } 48.23 48.24 public static void main(String... args) throws IOException {
49.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 49.2 +++ b/test/tools/javac/api/6411310/Test.java Wed Oct 07 14:14:45 2009 -0700 49.3 @@ -0,0 +1,254 @@ 49.4 +/* 49.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 49.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 49.7 + * 49.8 + * This code is free software; you can redistribute it and/or modify it 49.9 + * under the terms of the GNU General Public License version 2 only, as 49.10 + * published by the Free Software Foundation. 49.11 + * 49.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 49.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 49.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 49.15 + * version 2 for more details (a copy is included in the LICENSE file that 49.16 + * accompanied this code). 49.17 + * 49.18 + * You should have received a copy of the GNU General Public License version 49.19 + * 2 along with this work; if not, write to the Free Software Foundation, 49.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 49.21 + * 49.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 49.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 49.24 + * have any questions. 49.25 + */ 49.26 + 49.27 +/* 49.28 + * @test 49.29 + * @bug 6410367 6411310 49.30 + * @summary FileObject should support user-friendly names via getName() 49.31 + */ 49.32 + 49.33 +import java.io.*; 49.34 +import java.util.*; 49.35 +import java.util.jar.*; 49.36 +import java.util.zip.*; 49.37 +import javax.tools.*; 49.38 + 49.39 +import com.sun.tools.javac.file.JavacFileManager; 49.40 +import com.sun.tools.javac.util.Context; 49.41 +import com.sun.tools.javac.util.Options; 49.42 + 49.43 +// Test FileObject.getName returned from JavacFileManager and its support classes. 49.44 + 49.45 +public class Test { 49.46 + public static void main(String... args) throws Exception { 49.47 + new Test().run(); 49.48 + } 49.49 + 49.50 + Set<String> foundClasses = new TreeSet<String>(); 49.51 + Set<String> foundJars = new TreeSet<String>(); 49.52 + 49.53 + void run() throws Exception { 49.54 + File rt_jar = findRtJar(); 49.55 + 49.56 + // names for entries to be created in directories and jar files 49.57 + String[] entries = { "p/A.java", "p/A.class", "p/resources/A-1.html" }; 49.58 + 49.59 + // test various combinations of directories and jar files, intended to 49.60 + // cover all sources of file objects within JavacFileManager's support classes 49.61 + 49.62 + test(createFileManager(), createDir("dir", entries), "p", entries); 49.63 + test(createFileManager(), createDir("a b/dir", entries), "p", entries); 49.64 + 49.65 + for (boolean useJavaUtilZip: new boolean[] { false, true }) { 49.66 + test(createFileManager(useJavaUtilZip), createJar("jar", entries), "p", entries); 49.67 + test(createFileManager(useJavaUtilZip), createJar("jar jar", entries), "p", entries); 49.68 + 49.69 + for (boolean useSymbolFile: new boolean[] { false, true }) { 49.70 + test(createFileManager(useJavaUtilZip, useSymbolFile), rt_jar, "java.lang.ref", null); 49.71 + } 49.72 + } 49.73 + 49.74 + if (errors > 0) 49.75 + throw new Exception(errors + " errors found"); 49.76 + 49.77 + // Verify that we hit all the impl classes we intended 49.78 + checkCoverage("classes", foundClasses, 49.79 + "RegularFileObject", "SymbolFileObject", "ZipFileIndexFileObject", "ZipFileObject"); 49.80 + 49.81 + // Verify that we hit the jar files we intended, specifically ct.sym as well as rt.jar 49.82 + checkCoverage("jar files", foundJars, 49.83 + "ct.sym", "jar", "jar jar", "rt.jar"); 49.84 + } 49.85 + 49.86 + // use a new file manager for each test 49.87 + void test(StandardJavaFileManager fm, File f, String pkg, String[] entries) throws Exception { 49.88 + System.err.println("Test " + f); 49.89 + try { 49.90 + if (f.isDirectory()) { 49.91 + for (File dir: new File[] { f, f.getAbsoluteFile() }) { 49.92 + for (String e: entries) { 49.93 + JavaFileObject fo = fm.getJavaFileObjects(new File(dir, e)).iterator().next(); 49.94 + test(fo, dir, e); 49.95 + } 49.96 + } 49.97 + } 49.98 + 49.99 + fm.setLocation(StandardLocation.CLASS_PATH, Collections.singleton(f)); 49.100 + fm.setLocation(StandardLocation.SOURCE_PATH, Collections.singleton(f.getAbsoluteFile())); 49.101 + for (StandardLocation l: EnumSet.of(StandardLocation.CLASS_PATH, StandardLocation.SOURCE_PATH)) { 49.102 + for (JavaFileObject fo: fm.list(l, pkg, EnumSet.allOf(JavaFileObject.Kind.class), true)) { 49.103 + // we could use fm.getLocation but the following guarantees we preserve the original filename 49.104 + File dir = (l == StandardLocation.CLASS_PATH ? f : f.getAbsoluteFile()); 49.105 + char sep = (dir.isDirectory() ? File.separatorChar : '/'); 49.106 + String b = fm.inferBinaryName(l, fo); 49.107 + String e = fo.getKind().extension; 49.108 + test(fo, dir, b.replace('.', sep) + e); 49.109 + } 49.110 + } 49.111 + } finally { 49.112 + fm.close(); 49.113 + } 49.114 + } 49.115 + 49.116 + void test(JavaFileObject fo, File dir, String p) { 49.117 + System.err.println("Test: " + fo); 49.118 + String expect = dir.isDirectory() ? new File(dir, p).getPath() : (dir.getPath() + "(" + p + ")"); 49.119 + String found = fo.getName(); 49.120 + // if ct.sym is found, replace it with the equivalent rt.jar 49.121 + String found2 = found.replaceAll("lib([\\\\/])ct.sym\\(META-INF/sym/rt.jar/", "jre$1lib$1rt.jar("); 49.122 + if (!expect.equals(found2)) { 49.123 + System.err.println("expected: " + expect); 49.124 + System.err.println(" found: " + found); 49.125 + if (!found.equals(found2)) 49.126 + System.err.println(" found2: " + found2); 49.127 + error("Failed: " + fo); 49.128 + } 49.129 + 49.130 + // record the file object class name for coverage checks later 49.131 + foundClasses.add(fo.getClass().getSimpleName()); 49.132 + 49.133 + if (found.contains("(")) { 49.134 + // record access to the jar file for coverage checks later 49.135 + foundJars.add(new File(found.substring(0, found.indexOf("("))).getName()); 49.136 + } 49.137 + } 49.138 + 49.139 + void checkCoverage(String label, Set<String> found, String... expect) throws Exception { 49.140 + Set<String> e = new TreeSet<String>(Arrays.asList(expect)); 49.141 + if (!found.equals(e)) { 49.142 + e.removeAll(found); 49.143 + throw new Exception("expected " + label + " not used: " + e); 49.144 + } 49.145 + } 49.146 + 49.147 + JavacFileManager createFileManager() { 49.148 + return createFileManager(false, false); 49.149 + } 49.150 + 49.151 + JavacFileManager createFileManager(boolean useJavaUtilZip) { 49.152 + return createFileManager(useJavaUtilZip, false); 49.153 + } 49.154 + 49.155 + JavacFileManager createFileManager(boolean useJavaUtilZip, boolean useSymbolFile) { 49.156 + // javac should really not be using system properties like this 49.157 + // -- it should really be using (hidden) options -- but until then 49.158 + // take care to leave system properties as we find them, so as not 49.159 + // to adversely affect other tests that might follow. 49.160 + String prev = System.getProperty("useJavaUtilZip"); 49.161 + boolean resetProperties = false; 49.162 + try { 49.163 + if (useJavaUtilZip) { 49.164 + System.setProperty("useJavaUtilZip", "true"); 49.165 + resetProperties = true; 49.166 + } else if (System.getProperty("useJavaUtilZip") != null) { 49.167 + System.getProperties().remove("useJavaUtilZip"); 49.168 + resetProperties = true; 49.169 + } 49.170 + 49.171 + Context c = new Context(); 49.172 + if (!useSymbolFile) { 49.173 + Options options = Options.instance(c); 49.174 + options.put("ignore.symbol.file", "true"); 49.175 + } 49.176 + 49.177 + return new JavacFileManager(c, false, null); 49.178 + } finally { 49.179 + if (resetProperties) { 49.180 + if (prev == null) { 49.181 + System.getProperties().remove("useJavaUtilZip"); 49.182 + } else { 49.183 + System.setProperty("useJavaUtilZip", prev); 49.184 + } 49.185 + } 49.186 + } 49.187 + } 49.188 + 49.189 + File createDir(String name, String... entries) throws Exception { 49.190 + File dir = new File(name); 49.191 + if (!dir.mkdirs()) 49.192 + throw new Exception("cannot create directories " + dir); 49.193 + for (String e: entries) { 49.194 + writeFile(new File(dir, e), e); 49.195 + } 49.196 + return dir; 49.197 + } 49.198 + 49.199 + File createJar(String name, String... entries) throws IOException { 49.200 + File jar = new File(name); 49.201 + OutputStream out = new FileOutputStream(jar); 49.202 + try { 49.203 + JarOutputStream jos = new JarOutputStream(out); 49.204 + for (String e: entries) { 49.205 + jos.putNextEntry(new ZipEntry(e)); 49.206 + jos.write(e.getBytes()); 49.207 + } 49.208 + jos.close(); 49.209 + } finally { 49.210 + out.close(); 49.211 + } 49.212 + return jar; 49.213 + } 49.214 + 49.215 + File findRtJar() throws Exception { 49.216 + File java_home = new File(System.getProperty("java.home")); 49.217 + if (java_home.getName().equals("jre")) 49.218 + java_home = java_home.getParentFile(); 49.219 + File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar"); 49.220 + if (!rt_jar.exists()) 49.221 + throw new Exception("can't find rt.jar"); 49.222 + return rt_jar; 49.223 + } 49.224 + 49.225 + byte[] read(InputStream in) throws IOException { 49.226 + byte[] data = new byte[1024]; 49.227 + int offset = 0; 49.228 + try { 49.229 + int n; 49.230 + while ((n = in.read(data, offset, data.length - offset)) != -1) { 49.231 + offset += n; 49.232 + if (offset == data.length) 49.233 + data = Arrays.copyOf(data, 2 * data.length); 49.234 + } 49.235 + } finally { 49.236 + in.close(); 49.237 + } 49.238 + return Arrays.copyOf(data, offset); 49.239 + } 49.240 + 49.241 + void writeFile(File f, String s) throws IOException { 49.242 + f.getParentFile().mkdirs(); 49.243 + FileWriter out = new FileWriter(f); 49.244 + try { 49.245 + out.write(s); 49.246 + } finally { 49.247 + out.close(); 49.248 + } 49.249 + } 49.250 + 49.251 + void error(String msg) { 49.252 + System.err.println(msg); 49.253 + errors++; 49.254 + } 49.255 + 49.256 + int errors; 49.257 +}
50.1 --- a/test/tools/javac/api/6733837/T6733837.java Fri Oct 02 11:26:53 2009 -0700 50.2 +++ b/test/tools/javac/api/6733837/T6733837.java Wed Oct 07 14:14:45 2009 -0700 50.3 @@ -46,14 +46,10 @@ 50.4 } 50.5 50.6 public void exec() { 50.7 - JavaFileObject sfo = new SimpleJavaFileObject(URI.create(""),Kind.SOURCE) { 50.8 + JavaFileObject sfo = new SimpleJavaFileObject(URI.create("myfo:/Test.java"),Kind.SOURCE) { 50.9 public CharSequence getCharContent(boolean ignoreEncodingErrors) { 50.10 return "\tclass ErroneousWithTab"; 50.11 } 50.12 - @Override 50.13 - public String getName() { 50.14 - return "RELATIVEPATH"; 50.15 - } 50.16 }; 50.17 StringWriter sw = new StringWriter(); 50.18 PrintWriter out = new PrintWriter(sw); 50.19 @@ -66,7 +62,7 @@ 50.20 throw new Error("Compiler threw an exception"); 50.21 } 50.22 System.err.println(sw.toString()); 50.23 - if (sw.toString().contains("RELATIVEPATH")) 50.24 + if (!sw.toString().contains("/Test.java")) 50.25 throw new Error("Bad source name in diagnostic"); 50.26 } 50.27 }
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 51.2 +++ b/test/tools/javac/processing/model/util/elements/Foo.java Wed Oct 07 14:14:45 2009 -0700 51.3 @@ -0,0 +1,29 @@ 51.4 + 51.5 +/* 51.6 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 51.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 51.8 + * 51.9 + * This code is free software; you can redistribute it and/or modify it 51.10 + * under the terms of the GNU General Public License version 2 only, as 51.11 + * published by the Free Software Foundation. 51.12 + * 51.13 + * This code is distributed in the hope that it will be useful, but WITHOUT 51.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 51.15 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 51.16 + * version 2 for more details (a copy is included in the LICENSE file that 51.17 + * accompanied this code). 51.18 + * 51.19 + * You should have received a copy of the GNU General Public License version 51.20 + * 2 along with this work; if not, write to the Free Software Foundation, 51.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 51.22 + * 51.23 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 51.24 + * CA 95054 USA or visit www.sun.com if you need additional information or 51.25 + * have any questions. 51.26 + */ 51.27 + 51.28 +/** 51.29 + * Dummy type to compile. 51.30 + */ 51.31 +public class Foo { 51.32 +} 51.33 \ No newline at end of file
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 52.2 +++ b/test/tools/javac/processing/model/util/elements/TestGetConstantExpression.java Wed Oct 07 14:14:45 2009 -0700 52.3 @@ -0,0 +1,143 @@ 52.4 +/* 52.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 52.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 52.7 + * 52.8 + * This code is free software; you can redistribute it and/or modify it 52.9 + * under the terms of the GNU General Public License version 2 only, as 52.10 + * published by the Free Software Foundation. 52.11 + * 52.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 52.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 52.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 52.15 + * version 2 for more details (a copy is included in the LICENSE file that 52.16 + * accompanied this code). 52.17 + * 52.18 + * You should have received a copy of the GNU General Public License version 52.19 + * 2 along with this work; if not, write to the Free Software Foundation, 52.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 52.21 + * 52.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 52.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 52.24 + * have any questions. 52.25 + */ 52.26 + 52.27 +/* 52.28 + * @test 52.29 + * @bug 6471577 6517779 52.30 + * @summary Test Elements.getConstantExpression 52.31 + * @author Joseph D. Darcy 52.32 + * @build TestGetConstantExpression 52.33 + * @compile -processor TestGetConstantExpression Foo.java 52.34 + */ 52.35 + 52.36 +import java.util.Set; 52.37 +import javax.annotation.processing.*; 52.38 +import javax.lang.model.SourceVersion; 52.39 +import static javax.lang.model.SourceVersion.*; 52.40 +import javax.lang.model.element.*; 52.41 +import javax.lang.model.util.*; 52.42 +import static javax.lang.model.util.ElementFilter.*; 52.43 +import static javax.tools.Diagnostic.Kind.*; 52.44 +import static javax.tools.StandardLocation.*; 52.45 +import java.io.*; 52.46 + 52.47 +/** 52.48 + * Test basic workings of Elements.getConstantExpression. 52.49 + */ 52.50 +@SupportedAnnotationTypes("*") 52.51 +public class TestGetConstantExpression extends AbstractProcessor { 52.52 + private Elements eltUtils; 52.53 + private Filer filer; 52.54 + private int round = 1; 52.55 + 52.56 + /** 52.57 + * Check expected behavior on classes and packages. 52.58 + */ 52.59 + public boolean process(Set<? extends TypeElement> annotations, 52.60 + RoundEnvironment roundEnv) { 52.61 + int errors = 0; 52.62 + boolean processingOver = roundEnv.processingOver(); 52.63 + 52.64 + if (!processingOver && round == 1) { 52.65 + errors += expectIllegalArgumentException(null); 52.66 + errors += expectIllegalArgumentException(this); 52.67 + 52.68 + // Generate source code with various constant values and 52.69 + // make sure it compiles. 52.70 + 52.71 + try { 52.72 + PrintWriter pw = new PrintWriter(filer.createSourceFile("ConstantTest").openWriter()); 52.73 + try { 52.74 + Boolean[] booleans = {true, false}; 52.75 + Byte[] bytes = {Byte.MIN_VALUE, -1, 0, 1, Byte.MAX_VALUE}; 52.76 + Short[] shorts = {Short.MIN_VALUE, -1, 0, 1, Short.MAX_VALUE}; 52.77 + Integer[] ints = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE}; 52.78 + Long[] longs = {Long.MIN_VALUE, -1L, 0L,1L, Long.MAX_VALUE}; 52.79 + Character[] chars = {Character.MIN_VALUE, ' ', '\t', 'a', 'b', 'c', '~', Character.MAX_VALUE}; 52.80 + Float[] floats = {Float.NaN, Float.NEGATIVE_INFINITY, -1.0f, -0.0f, 0.0f, 1.0f, Float.POSITIVE_INFINITY}; 52.81 + Double[] doubles = {Double.NaN, Double.NEGATIVE_INFINITY, -1.0, -0.0, 0.0, 1.0, Double.POSITIVE_INFINITY}; 52.82 + 52.83 + pw.println("class ConstantTest {"); 52.84 + pw.println(String.format(" private static boolean[] booleans = {%s};", 52.85 + printConstants(booleans))); 52.86 + pw.println(String.format(" private static byte[] bytes = {%s};", 52.87 + printConstants(bytes))); 52.88 + pw.println(String.format(" private static short[] shorts = {%s};", 52.89 + printConstants(shorts))); 52.90 + pw.println(String.format(" private static int[] ints = {%s};", 52.91 + printConstants(ints))); 52.92 + pw.println(String.format(" private static long[] longs = {%s};", 52.93 + printConstants(longs))); 52.94 + pw.println(String.format(" private static char[] chars = {%s};", 52.95 + printConstants(chars))); 52.96 + pw.println(String.format(" private static float[] floats = {%s};", 52.97 + printConstants(floats))); 52.98 + pw.println(String.format(" private static double[] doubles = {%s};", 52.99 + printConstants(doubles))); 52.100 + pw.println("}"); 52.101 + } finally { 52.102 + pw.close(); 52.103 + } 52.104 + } catch(IOException io) { 52.105 + throw new RuntimeException(io); 52.106 + } 52.107 + round++; 52.108 + } else if (processingOver) { 52.109 + if (errors > 0) { 52.110 + throw new RuntimeException(); 52.111 + } 52.112 + } 52.113 + return true; 52.114 + } 52.115 + 52.116 + String printConstants(Object[] constants) { 52.117 + StringBuilder sb = new StringBuilder(); 52.118 + 52.119 + for(Object o : constants) { 52.120 + sb.append(eltUtils.getConstantExpression(o)); 52.121 + sb.append(", "); 52.122 + } 52.123 + return sb.toString(); 52.124 + } 52.125 + 52.126 + int expectIllegalArgumentException(Object o) { 52.127 + String s = ""; 52.128 + try { 52.129 + s = eltUtils.getConstantExpression(o); 52.130 + System.err.println("Unexpected string returned: " + s); 52.131 + return 1; 52.132 + } catch (IllegalArgumentException iae) { 52.133 + return 0; 52.134 + } 52.135 + } 52.136 + 52.137 + public SourceVersion getSupportedSourceVersion() { 52.138 + return SourceVersion.latest(); 52.139 + } 52.140 + 52.141 + public void init(ProcessingEnvironment processingEnv) { 52.142 + super.init(processingEnv); 52.143 + eltUtils = processingEnv.getElementUtils(); 52.144 + filer = processingEnv.getFiler(); 52.145 + } 52.146 +}
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 53.2 +++ b/test/tools/javah/6572945/T6572945.java Wed Oct 07 14:14:45 2009 -0700 53.3 @@ -0,0 +1,239 @@ 53.4 +/* 53.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 53.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 53.7 + * 53.8 + * This code is free software; you can redistribute it and/or modify it 53.9 + * under the terms of the GNU General Public License version 2 only, as 53.10 + * published by the Free Software Foundation. 53.11 + * 53.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 53.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 53.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 53.15 + * version 2 for more details (a copy is included in the LICENSE file that 53.16 + * accompanied this code). 53.17 + * 53.18 + * You should have received a copy of the GNU General Public License version 53.19 + * 2 along with this work; if not, write to the Free Software Foundation, 53.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 53.21 + * 53.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 53.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 53.24 + * have any questions. 53.25 + */ 53.26 + 53.27 +/* 53.28 + * @test 53.29 + * @bug 6572945 53.30 + * @summary rewrite javah as an annotation processor, instead of as a doclet 53.31 + * @build TestClass1 TestClass2 TestClass3 53.32 + * @run main T6572945 53.33 + */ 53.34 + 53.35 +import java.io.*; 53.36 +import java.util.*; 53.37 +import com.sun.tools.javah.Main; 53.38 + 53.39 +public class T6572945 53.40 +{ 53.41 + static File testSrc = new File(System.getProperty("test.src", ".")); 53.42 + static File testClasses = new File(System.getProperty("test.classes", ".")); 53.43 + static boolean isWindows = System.getProperty("os.name").startsWith("Windows"); 53.44 + 53.45 + public static void main(String... args) 53.46 + throws IOException, InterruptedException 53.47 + { 53.48 + boolean ok = new T6572945().run(args); 53.49 + if (!ok) 53.50 + throw new Error("Test Failed"); 53.51 + } 53.52 + 53.53 + public boolean run(String[] args) 53.54 + throws IOException, InterruptedException 53.55 + { 53.56 + if (args.length == 1) 53.57 + jdk = new File(args[0]); 53.58 + 53.59 + test("-o", "jni.file.1", "-jni", "TestClass1"); 53.60 + test("-o", "jni.file.2", "-jni", "TestClass1", "TestClass2"); 53.61 + test("-d", "jni.dir.1", "-jni", "TestClass1", "TestClass2"); 53.62 + test("-o", "jni.file.3", "-jni", "TestClass3"); 53.63 + 53.64 + // The following tests are disabled because llni support has been 53.65 + // discontinued, and because bugs in old javah means that character 53.66 + // for character testing against output from old javah does not work. 53.67 + // In fact, the LLNI impl in new javah is actually better than the 53.68 + // impl in old javah because of a couple of significant bug fixes. 53.69 + 53.70 +// test("-o", "llni.file.1", "-llni", "TestClass1"); 53.71 +// test("-o", "llni.file.2", "-llni", "TestClass1", "TestClass2"); 53.72 +// test("-d", "llni.dir.1", "-llni", "TestClass1", "TestClass2"); 53.73 +// test("-o", "llni.file.3", "-llni", "TestClass3"); 53.74 + 53.75 + return (errors == 0); 53.76 + } 53.77 + 53.78 + void test(String... args) 53.79 + throws IOException, InterruptedException 53.80 + { 53.81 + String[] cp_args = new String[args.length + 2]; 53.82 + cp_args[0] = "-classpath"; 53.83 + cp_args[1] = testClasses.getPath(); 53.84 + System.arraycopy(args, 0, cp_args, 2, args.length); 53.85 + 53.86 + if (jdk != null) 53.87 + init(cp_args); 53.88 + 53.89 + File out = null; 53.90 + for (int i = 0; i < args.length; i++) { 53.91 + if (args[i].equals("-o")) { 53.92 + out = new File(args[++i]); 53.93 + break; 53.94 + } else if (args[i].equals("-d")) { 53.95 + out = new File(args[++i]); 53.96 + out.mkdirs(); 53.97 + break; 53.98 + } 53.99 + } 53.100 + 53.101 + try { 53.102 + System.out.println("test: " + Arrays.asList(cp_args)); 53.103 + 53.104 +// // Uncomment and use the following lines to execute javah via the 53.105 +// // command line -- for example, to run old javah and set up the golden files 53.106 +// List<String> cmd = new ArrayList<String>(); 53.107 +// File javaHome = new File(System.getProperty("java.home")); 53.108 +// if (javaHome.getName().equals("jre")) 53.109 +// javaHome = javaHome.getParentFile(); 53.110 +// File javah = new File(new File(javaHome, "bin"), "javah"); 53.111 +// cmd.add(javah.getPath()); 53.112 +// cmd.addAll(Arrays.asList(cp_args)); 53.113 +// ProcessBuilder pb = new ProcessBuilder(cmd); 53.114 +// pb.redirectErrorStream(true); 53.115 +// pb.start(); 53.116 +// Process p = pb.start(); 53.117 +// String line; 53.118 +// BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 53.119 +// while ((line = in.readLine()) != null) 53.120 +// System.err.println(line); 53.121 +// in.close(); 53.122 +// int rc = p.waitFor(); 53.123 + 53.124 + // Use new javah 53.125 + PrintWriter err = new PrintWriter(System.err, true); 53.126 + int rc = Main.run(cp_args, err); 53.127 + 53.128 + if (rc != 0) { 53.129 + error("javah failed: rc=" + rc); 53.130 + return; 53.131 + } 53.132 + 53.133 + // The golden files use the LL suffix for long constants, which 53.134 + // is used on Linux and Solaris. On Windows, the suffix is i64, 53.135 + // so compare will update the golden files on the fly before the 53.136 + // final comparison. 53.137 + compare(new File(new File(testSrc, "gold"), out.getName()), out); 53.138 + } catch (Throwable t) { 53.139 + t.printStackTrace(); 53.140 + error("javah threw exception"); 53.141 + } 53.142 + } 53.143 + 53.144 + void init(String[] args) throws IOException, InterruptedException { 53.145 + String[] cmdArgs = new String[args.length + 1]; 53.146 + cmdArgs[0] = new File(new File(jdk, "bin"), "javah").getPath(); 53.147 + System.arraycopy(args, 0, cmdArgs, 1, args.length); 53.148 + 53.149 + System.out.println("init: " + Arrays.asList(cmdArgs)); 53.150 + 53.151 + ProcessBuilder pb = new ProcessBuilder(cmdArgs); 53.152 + pb.directory(new File(testSrc, "gold")); 53.153 + pb.redirectErrorStream(true); 53.154 + Process p = pb.start(); 53.155 + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 53.156 + String line; 53.157 + while ((line = in.readLine()) != null) 53.158 + System.out.println("javah: " + line); 53.159 + int rc = p.waitFor(); 53.160 + if (rc != 0) 53.161 + error("javah: exit code " + rc); 53.162 + } 53.163 + 53.164 + /** Compare two directories. 53.165 + * @param f1 The golden directory 53.166 + * @param f2 The directory to be compared 53.167 + */ 53.168 + void compare(File f1, File f2) { 53.169 + compare(f1, f2, null); 53.170 + } 53.171 + 53.172 + /** Compare two files or directories 53.173 + * @param f1 The golden directory 53.174 + * @param f2 The directory to be compared 53.175 + * @param p An optional path identifying a file within the two directories 53.176 + */ 53.177 + void compare(File f1, File f2, String p) { 53.178 + File f1p = (p == null ? f1 : new File(f1, p)); 53.179 + File f2p = (p == null ? f2 : new File(f2, p)); 53.180 + System.out.println("compare " + f1p + " " + f2p); 53.181 + if (f1p.isDirectory() && f2p.isDirectory()) { 53.182 + Set<String> children = new HashSet<String>(); 53.183 + children.addAll(Arrays.asList(f1p.list())); 53.184 + children.addAll(Arrays.asList(f2p.list())); 53.185 + for (String c: children) { 53.186 + compare(f1, f2, new File(p, c).getPath()); // null-safe for p 53.187 + } 53.188 + } 53.189 + else if (f1p.isFile() && f2p.isFile()) { 53.190 + String s1 = read(f1p); 53.191 + if (isWindows) { 53.192 + // f1/s1 is the golden file 53.193 + // on Windows, long constants use the i64 suffix, not LL 53.194 + s1 = s1.replaceAll("( [0-9]+)LL\n", "$1i64\n"); 53.195 + } 53.196 + String s2 = read(f2p); 53.197 + if (!s1.equals(s2)) { 53.198 + System.out.println("File: " + f1p + "\n" + s1); 53.199 + System.out.println("File: " + f2p + "\n" + s2); 53.200 + error("Files differ: " + f1p + " " + f2p); 53.201 + } 53.202 + } 53.203 + else if (f1p.exists() && !f2p.exists()) 53.204 + error("Only in " + f1 + ": " + p); 53.205 + else if (f2p.exists() && !f1p.exists()) 53.206 + error("Only in " + f2 + ": " + p); 53.207 + else 53.208 + error("Files differ: " + f1p + " " + f2p); 53.209 + } 53.210 + 53.211 + private String read(File f) { 53.212 + try { 53.213 + BufferedReader in = new BufferedReader(new FileReader(f)); 53.214 + try { 53.215 + StringBuilder sb = new StringBuilder((int) f.length()); 53.216 + String line; 53.217 + while ((line = in.readLine()) != null) { 53.218 + sb.append(line); 53.219 + sb.append("\n"); 53.220 + } 53.221 + return sb.toString(); 53.222 + } finally { 53.223 + try { 53.224 + in.close(); 53.225 + } catch (IOException e) { 53.226 + } 53.227 + } 53.228 + } catch (IOException e) { 53.229 + error("error reading " + f + ": " + e); 53.230 + return ""; 53.231 + } 53.232 + } 53.233 + 53.234 + 53.235 + private void error(String msg) { 53.236 + System.out.println(msg); 53.237 + errors++; 53.238 + } 53.239 + 53.240 + private int errors; 53.241 + private File jdk; 53.242 +}
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 54.2 +++ b/test/tools/javah/6572945/TestClass1.java Wed Oct 07 14:14:45 2009 -0700 54.3 @@ -0,0 +1,475 @@ 54.4 +/* 54.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 54.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 54.7 + * 54.8 + * This code is free software; you can redistribute it and/or modify it 54.9 + * under the terms of the GNU General Public License version 2 only, as 54.10 + * published by the Free Software Foundation. 54.11 + * 54.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 54.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 54.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 54.15 + * version 2 for more details (a copy is included in the LICENSE file that 54.16 + * accompanied this code). 54.17 + * 54.18 + * You should have received a copy of the GNU General Public License version 54.19 + * 2 along with this work; if not, write to the Free Software Foundation, 54.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 54.21 + * 54.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 54.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 54.24 + * have any questions. 54.25 + */ 54.26 + 54.27 +import java.util.List; 54.28 + 54.29 +public class TestClass1 { 54.30 + // simple types 54.31 + byte b; 54.32 + short s; 54.33 + int i; 54.34 + long l; 54.35 + float f; 54.36 + double d; 54.37 + Object o; 54.38 + String t; 54.39 + List<String> g; 54.40 + 54.41 + // constants 54.42 + static final byte bc = 0; 54.43 + static final short sc = 0; 54.44 + static final int ic = 0; 54.45 + static final long lc = 0; 54.46 + static final float fc = 0; 54.47 + static final double dc = 0; 54.48 + static final Object oc = null; 54.49 + static final String tc = ""; 54.50 + static final List<String> gc = null; 54.51 + 54.52 + // simple arrays 54.53 + byte[] ba; 54.54 + short[] sa; // not handled corrected by javah v6 54.55 + int[] ia; 54.56 + long[] la; 54.57 + float[] fa; 54.58 + double[] da; 54.59 + Object[] oa; 54.60 + String[] ta; 54.61 + List<String>[] ga; 54.62 + 54.63 + // multidimensional arrays 54.64 + byte[][] baa; 54.65 + short[][] saa; 54.66 + int[][] iaa; 54.67 + long[][] laa; 54.68 + float[][] faa; 54.69 + double[][] daa; 54.70 + Object[][] oaa; 54.71 + String[][] taa; 54.72 + List<String>[] gaa; 54.73 + 54.74 + // simple Java methods 54.75 + byte bm() { return 0; } 54.76 + short sm() { return 0; } 54.77 + int im() { return 0; } 54.78 + long lm() { return 0; } 54.79 + float fm() { return 0; } 54.80 + double dm() { return 0; } 54.81 + Object om() { return null; } 54.82 + String tm() { return ""; } 54.83 + List<String> gm() { return null; } 54.84 + void vm() { } 54.85 + byte[] bam() { return null; } 54.86 + short[] sam() { return null; } 54.87 + int[] iam() { return null; } 54.88 + long[] lam() { return null; } 54.89 + float[] fam() { return null; } 54.90 + double[] dam() { return null; } 54.91 + Object[] oam() { return null; } 54.92 + String[] tam() { return null; } 54.93 + List<String>[] gam() { return null; } 54.94 + byte[][] baam() { return null; } 54.95 + short[][] saam() { return null; } 54.96 + int[][] iaam() { return null; } 54.97 + long[][] laam() { return null; } 54.98 + float[][] faam() { return null; } 54.99 + double[][] daam() { return null; } 54.100 + Object[][] oaam() { return null; } 54.101 + String[][] taam() { return null; } 54.102 + List<String>[] gaam() { return null; } 54.103 + 54.104 + // simple native methods 54.105 + native byte bmn(); 54.106 + native short smn(); 54.107 + native int imn(); 54.108 + native long lmn(); 54.109 + native float fmn(); 54.110 + native double dmn(); 54.111 + native Object omn(); 54.112 + native String tmn(); 54.113 + native List<String> gmn(); 54.114 + native void vmn(); 54.115 + native byte[] bamn(); 54.116 + native short[] samn(); 54.117 + native int[] iamn(); 54.118 + native long[] lamn(); 54.119 + native float[] famn(); 54.120 + native double[] damn(); 54.121 + native Object[] oamn(); 54.122 + native String[] tamn(); 54.123 + native List<String>[] gamn(); 54.124 + native byte[][] baamn(); 54.125 + native short[][] saamn(); 54.126 + native int[][] iaamn(); 54.127 + native long[][] laamn(); 54.128 + native float[][] faamn(); 54.129 + native double[][] daamn(); 54.130 + native Object[][] oaamn(); 54.131 + native String[][] taamn(); 54.132 + native List<String>[] gaamn(); 54.133 + 54.134 + // overloaded Java methods 54.135 + byte bm1() { return 0; } 54.136 + short sm1() { return 0; } 54.137 + int im1() { return 0; } 54.138 + long lm1() { return 0; } 54.139 + float fm1() { return 0; } 54.140 + double dm1() { return 0; } 54.141 + Object om1() { return null; } 54.142 + String tm1() { return ""; } 54.143 + List<String> gm1() { return null; } 54.144 + void vm1() { } 54.145 + 54.146 + byte bm2(int i) { return 0; } 54.147 + short sm2(int i) { return 0; } 54.148 + int im2(int i) { return 0; } 54.149 + long lm2(int i) { return 0; } 54.150 + float fm2(int i) { return 0; } 54.151 + double dm2(int i) { return 0; } 54.152 + Object om2(int i) { return null; } 54.153 + String tm2(int i) { return ""; } 54.154 + List<String> gm2(int i) { return null; } 54.155 + void vm2(int i) { } 54.156 + 54.157 + // overloaded native methods 54.158 + native byte bmn1(); 54.159 + native short smn1(); 54.160 + native int imn1(); 54.161 + native long lmn1(); 54.162 + native float fmn1(); 54.163 + native double dmn1(); 54.164 + native Object omn1(); 54.165 + native String tmn1(); 54.166 + native List<String> gmn1(); 54.167 + native void vmn1(); 54.168 + 54.169 + native byte bmn2(int i); 54.170 + native short smn2(int i); 54.171 + native int imn2(int i); 54.172 + native long lmn2(int i); 54.173 + native float fmn2(int i); 54.174 + native double dmn2(int i); 54.175 + native Object omn2(int i); 54.176 + native String tmn2(int i); 54.177 + native List<String> gmn2(int i); 54.178 + native void vmn2(int i); 54.179 + 54.180 + // arg types for Java methods 54.181 + void mb(byte b) { } 54.182 + void ms(short s) { } 54.183 + void mi(int i) { } 54.184 + void ml(long l) { } 54.185 + void mf(float f) { } 54.186 + void md(double d) { } 54.187 + void mo(Object o) { } 54.188 + void mt(String t) { } 54.189 + void mg(List<String> g) { } 54.190 + 54.191 + // arg types for native methods 54.192 + native void mbn(byte b); 54.193 + native void msn(short s); 54.194 + native void min(int i); 54.195 + native void mln(long l); 54.196 + native void mfn(float f); 54.197 + native void mdn(double d); 54.198 + native void mon(Object o); 54.199 + native void mtn(String t); 54.200 + native void mgn(List<String> g); 54.201 + 54.202 + static class Inner1 { 54.203 + // simple types 54.204 + byte b; 54.205 + short s; 54.206 + int i; 54.207 + long l; 54.208 + float f; 54.209 + double d; 54.210 + Object o; 54.211 + String t; 54.212 + List<String> g; 54.213 + 54.214 + // constants 54.215 + static final byte bc = 0; 54.216 + static final short sc = 0; 54.217 + static final int ic = 0; 54.218 + static final long lc = 0; 54.219 + static final float fc = 0; 54.220 + static final double dc = 0; 54.221 + static final Object oc = null; 54.222 + static final String tc = ""; 54.223 + static final List<String> gc = null; 54.224 + 54.225 + // simple arrays 54.226 + byte[] ba; 54.227 + // short[] sa; // not handled corrected by javah v6 54.228 + int[] ia; 54.229 + long[] la; 54.230 + float[] fa; 54.231 + double[] da; 54.232 + Object[] oa; 54.233 + String[] ta; 54.234 + List<String>[] ga; 54.235 + 54.236 + // multidimensional arrays 54.237 + byte[][] baa; 54.238 + short[][] saa; 54.239 + int[][] iaa; 54.240 + long[][] laa; 54.241 + float[][] faa; 54.242 + double[][] daa; 54.243 + Object[][] oaa; 54.244 + String[][] taa; 54.245 + List<String>[] gaa; 54.246 + 54.247 + // simple Java methods 54.248 + byte bm() { return 0; } 54.249 + short sm() { return 0; } 54.250 + int im() { return 0; } 54.251 + long lm() { return 0; } 54.252 + float fm() { return 0; } 54.253 + double dm() { return 0; } 54.254 + Object om() { return null; } 54.255 + String tm() { return ""; } 54.256 + List<String> gm() { return null; } 54.257 + void vm() { } 54.258 + 54.259 + // simple native methods 54.260 + native byte bmn(); 54.261 + native short smn(); 54.262 + native int imn(); 54.263 + native long lmn(); 54.264 + native float fmn(); 54.265 + native double dmn(); 54.266 + native Object omn(); 54.267 + native String tmn(); 54.268 + native List<String> gmn(); 54.269 + native void vmn(); 54.270 + 54.271 + // overloaded Java methods 54.272 + byte bm1() { return 0; } 54.273 + short sm1() { return 0; } 54.274 + int im1() { return 0; } 54.275 + long lm1() { return 0; } 54.276 + float fm1() { return 0; } 54.277 + double dm1() { return 0; } 54.278 + Object om1() { return null; } 54.279 + String tm1() { return ""; } 54.280 + List<String> gm1() { return null; } 54.281 + void vm1() { } 54.282 + 54.283 + byte bm2(int i) { return 0; } 54.284 + short sm2(int i) { return 0; } 54.285 + int im2(int i) { return 0; } 54.286 + long lm2(int i) { return 0; } 54.287 + float fm2(int i) { return 0; } 54.288 + double dm2(int i) { return 0; } 54.289 + Object om2(int i) { return null; } 54.290 + String tm2(int i) { return ""; } 54.291 + List<String> gm2(int i) { return null; } 54.292 + void vm2(int i) { } 54.293 + 54.294 + // overloaded native methods 54.295 + native byte bmn1(); 54.296 + native short smn1(); 54.297 + native int imn1(); 54.298 + native long lmn1(); 54.299 + native float fmn1(); 54.300 + native double dmn1(); 54.301 + native Object omn1(); 54.302 + native String tmn1(); 54.303 + native List<String> gmn1(); 54.304 + native void vmn1(); 54.305 + 54.306 + native byte bmn2(int i); 54.307 + native short smn2(int i); 54.308 + native int imn2(int i); 54.309 + native long lmn2(int i); 54.310 + native float fmn2(int i); 54.311 + native double dmn2(int i); 54.312 + native Object omn2(int i); 54.313 + native String tmn2(int i); 54.314 + native List<String> gmn2(int i); 54.315 + native void vmn2(int i); 54.316 + 54.317 + // arg types for Java methods 54.318 + void mb(byte b) { } 54.319 + void ms(short s) { } 54.320 + void mi(int i) { } 54.321 + void ml(long l) { } 54.322 + void mf(float f) { } 54.323 + void md(double d) { } 54.324 + void mo(Object o) { } 54.325 + void mt(String t) { } 54.326 + void mg(List<String> g) { } 54.327 + 54.328 + // arg types for native methods 54.329 + native void mbn(byte b); 54.330 + native void msn(short s); 54.331 + native void min(int i); 54.332 + native void mln(long l); 54.333 + native void mfn(float f); 54.334 + native void mdn(double d); 54.335 + native void mon(Object o); 54.336 + native void mtn(String t); 54.337 + native void mgn(List<String> g); 54.338 + } 54.339 + 54.340 + class Inner2 { 54.341 + // simple types 54.342 + byte b; 54.343 + short s; 54.344 + int i; 54.345 + long l; 54.346 + float f; 54.347 + double d; 54.348 + Object o; 54.349 + String t; 54.350 + List<String> g; 54.351 + 54.352 + // constants 54.353 + static final byte bc = 0; 54.354 + static final short sc = 0; 54.355 + static final int ic = 0; 54.356 + static final long lc = 0; 54.357 + static final float fc = 0; 54.358 + static final double dc = 0; 54.359 + //static final Object oc = null; 54.360 + static final String tc = ""; 54.361 + //static final List<String> gc = null; 54.362 + 54.363 + // simple arrays 54.364 + byte[] ba; 54.365 + // short[] sa; // not handled corrected by javah v6 54.366 + int[] ia; 54.367 + long[] la; 54.368 + float[] fa; 54.369 + double[] da; 54.370 + Object[] oa; 54.371 + String[] ta; 54.372 + List<String>[] ga; 54.373 + 54.374 + // multidimensional arrays 54.375 + byte[][] baa; 54.376 + short[][] saa; 54.377 + int[][] iaa; 54.378 + long[][] laa; 54.379 + float[][] faa; 54.380 + double[][] daa; 54.381 + Object[][] oaa; 54.382 + String[][] taa; 54.383 + List<String>[] gaa; 54.384 + 54.385 + // simple Java methods 54.386 + byte bm() { return 0; } 54.387 + short sm() { return 0; } 54.388 + int im() { return 0; } 54.389 + long lm() { return 0; } 54.390 + float fm() { return 0; } 54.391 + double dm() { return 0; } 54.392 + Object om() { return null; } 54.393 + String tm() { return ""; } 54.394 + List<String> gm() { return null; } 54.395 + void vm() { } 54.396 + 54.397 + // simple native methods 54.398 + native byte bmn(); 54.399 + native short smn(); 54.400 + native int imn(); 54.401 + native long lmn(); 54.402 + native float fmn(); 54.403 + native double dmn(); 54.404 + native Object omn(); 54.405 + native String tmn(); 54.406 + native List<String> gmn(); 54.407 + native void vmn(); 54.408 + 54.409 + // overloaded Java methods 54.410 + byte bm1() { return 0; } 54.411 + short sm1() { return 0; } 54.412 + int im1() { return 0; } 54.413 + long lm1() { return 0; } 54.414 + float fm1() { return 0; } 54.415 + double dm1() { return 0; } 54.416 + Object om1() { return null; } 54.417 + String tm1() { return ""; } 54.418 + List<String> gm1() { return null; } 54.419 + void vm1() { } 54.420 + 54.421 + byte bm2(int i) { return 0; } 54.422 + short sm2(int i) { return 0; } 54.423 + int im2(int i) { return 0; } 54.424 + long lm2(int i) { return 0; } 54.425 + float fm2(int i) { return 0; } 54.426 + double dm2(int i) { return 0; } 54.427 + Object om2(int i) { return null; } 54.428 + String tm2(int i) { return ""; } 54.429 + List<String> gm2(int i) { return null; } 54.430 + void vm2(int i) { } 54.431 + 54.432 + // overloaded native methods 54.433 + native byte bmn1(); 54.434 + native short smn1(); 54.435 + native int imn1(); 54.436 + native long lmn1(); 54.437 + native float fmn1(); 54.438 + native double dmn1(); 54.439 + native Object omn1(); 54.440 + native String tmn1(); 54.441 + native List<String> gmn1(); 54.442 + native void vmn1(); 54.443 + 54.444 + native byte bmn2(int i); 54.445 + native short smn2(int i); 54.446 + native int imn2(int i); 54.447 + native long lmn2(int i); 54.448 + native float fmn2(int i); 54.449 + native double dmn2(int i); 54.450 + native Object omn2(int i); 54.451 + native String tmn2(int i); 54.452 + native List<String> gmn2(int i); 54.453 + native void vmn2(int i); 54.454 + 54.455 + // arg types for Java methods 54.456 + void mb(byte b) { } 54.457 + void ms(short s) { } 54.458 + void mi(int i) { } 54.459 + void ml(long l) { } 54.460 + void mf(float f) { } 54.461 + void md(double d) { } 54.462 + void mo(Object o) { } 54.463 + void mt(String t) { } 54.464 + void mg(List<String> g) { } 54.465 + 54.466 + // arg types for native methods 54.467 + native void mbn(byte b); 54.468 + native void msn(short s); 54.469 + native void min(int i); 54.470 + native void mln(long l); 54.471 + native void mfn(float f); 54.472 + native void mdn(double d); 54.473 + native void mon(Object o); 54.474 + native void mtn(String t); 54.475 + native void mgn(List<String> g); 54.476 + } 54.477 + 54.478 +}
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 55.2 +++ b/test/tools/javah/6572945/TestClass2.java Wed Oct 07 14:14:45 2009 -0700 55.3 @@ -0,0 +1,33 @@ 55.4 +/* 55.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 55.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 55.7 + * 55.8 + * This code is free software; you can redistribute it and/or modify it 55.9 + * under the terms of the GNU General Public License version 2 only, as 55.10 + * published by the Free Software Foundation. 55.11 + * 55.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 55.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 55.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 55.15 + * version 2 for more details (a copy is included in the LICENSE file that 55.16 + * accompanied this code). 55.17 + * 55.18 + * You should have received a copy of the GNU General Public License version 55.19 + * 2 along with this work; if not, write to the Free Software Foundation, 55.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 55.21 + * 55.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 55.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 55.24 + * have any questions. 55.25 + */ 55.26 + 55.27 +public class TestClass2 { 55.28 + byte b; 55.29 + short s; 55.30 + int i; 55.31 + long l; 55.32 + float f; 55.33 + double d; 55.34 + Object o; 55.35 + String t; 55.36 +}
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 56.2 +++ b/test/tools/javah/6572945/TestClass3.java Wed Oct 07 14:14:45 2009 -0700 56.3 @@ -0,0 +1,51 @@ 56.4 +/* 56.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 56.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 56.7 + * 56.8 + * This code is free software; you can redistribute it and/or modify it 56.9 + * under the terms of the GNU General Public License version 2 only, as 56.10 + * published by the Free Software Foundation. 56.11 + * 56.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 56.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 56.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 56.15 + * version 2 for more details (a copy is included in the LICENSE file that 56.16 + * accompanied this code). 56.17 + * 56.18 + * You should have received a copy of the GNU General Public License version 56.19 + * 2 along with this work; if not, write to the Free Software Foundation, 56.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 56.21 + * 56.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 56.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 56.24 + * have any questions. 56.25 + */ 56.26 + 56.27 +public class TestClass3 { 56.28 + public int tc3; 56.29 + 56.30 + public class Inner1 { 56.31 + public int tc3i1; 56.32 + 56.33 + public class Inner1A { 56.34 + public int tc3i1i1a; 56.35 + } 56.36 + 56.37 + public class Inner1B { 56.38 + public int tc3i1i1b; 56.39 + } 56.40 + } 56.41 + 56.42 + public class Inner2 { 56.43 + public int tc321; 56.44 + 56.45 + public class Inner2A { 56.46 + public int tc3i2i2a; 56.47 + } 56.48 + 56.49 + public class Inner2B { 56.50 + public int tc3i2i2b; 56.51 + } 56.52 + } 56.53 +} 56.54 +
57.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 57.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass1.h Wed Oct 07 14:14:45 2009 -0700 57.3 @@ -0,0 +1,481 @@ 57.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 57.5 +#include <jni.h> 57.6 +/* Header for class TestClass1 */ 57.7 + 57.8 +#ifndef _Included_TestClass1 57.9 +#define _Included_TestClass1 57.10 +#ifdef __cplusplus 57.11 +extern "C" { 57.12 +#endif 57.13 +#undef TestClass1_bc 57.14 +#define TestClass1_bc 0L 57.15 +#undef TestClass1_sc 57.16 +#define TestClass1_sc 0L 57.17 +#undef TestClass1_ic 57.18 +#define TestClass1_ic 0L 57.19 +#undef TestClass1_lc 57.20 +#define TestClass1_lc 0LL 57.21 +#undef TestClass1_fc 57.22 +#define TestClass1_fc 0.0f 57.23 +#undef TestClass1_dc 57.24 +#define TestClass1_dc 0.0 57.25 +/* 57.26 + * Class: TestClass1 57.27 + * Method: bmn 57.28 + * Signature: ()B 57.29 + */ 57.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn 57.31 + (JNIEnv *, jobject); 57.32 + 57.33 +/* 57.34 + * Class: TestClass1 57.35 + * Method: smn 57.36 + * Signature: ()S 57.37 + */ 57.38 +JNIEXPORT jshort JNICALL Java_TestClass1_smn 57.39 + (JNIEnv *, jobject); 57.40 + 57.41 +/* 57.42 + * Class: TestClass1 57.43 + * Method: imn 57.44 + * Signature: ()I 57.45 + */ 57.46 +JNIEXPORT jint JNICALL Java_TestClass1_imn 57.47 + (JNIEnv *, jobject); 57.48 + 57.49 +/* 57.50 + * Class: TestClass1 57.51 + * Method: lmn 57.52 + * Signature: ()J 57.53 + */ 57.54 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn 57.55 + (JNIEnv *, jobject); 57.56 + 57.57 +/* 57.58 + * Class: TestClass1 57.59 + * Method: fmn 57.60 + * Signature: ()F 57.61 + */ 57.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn 57.63 + (JNIEnv *, jobject); 57.64 + 57.65 +/* 57.66 + * Class: TestClass1 57.67 + * Method: dmn 57.68 + * Signature: ()D 57.69 + */ 57.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn 57.71 + (JNIEnv *, jobject); 57.72 + 57.73 +/* 57.74 + * Class: TestClass1 57.75 + * Method: omn 57.76 + * Signature: ()Ljava/lang/Object; 57.77 + */ 57.78 +JNIEXPORT jobject JNICALL Java_TestClass1_omn 57.79 + (JNIEnv *, jobject); 57.80 + 57.81 +/* 57.82 + * Class: TestClass1 57.83 + * Method: tmn 57.84 + * Signature: ()Ljava/lang/String; 57.85 + */ 57.86 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn 57.87 + (JNIEnv *, jobject); 57.88 + 57.89 +/* 57.90 + * Class: TestClass1 57.91 + * Method: gmn 57.92 + * Signature: ()Ljava/util/List; 57.93 + */ 57.94 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn 57.95 + (JNIEnv *, jobject); 57.96 + 57.97 +/* 57.98 + * Class: TestClass1 57.99 + * Method: vmn 57.100 + * Signature: ()V 57.101 + */ 57.102 +JNIEXPORT void JNICALL Java_TestClass1_vmn 57.103 + (JNIEnv *, jobject); 57.104 + 57.105 +/* 57.106 + * Class: TestClass1 57.107 + * Method: bamn 57.108 + * Signature: ()[B 57.109 + */ 57.110 +JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn 57.111 + (JNIEnv *, jobject); 57.112 + 57.113 +/* 57.114 + * Class: TestClass1 57.115 + * Method: samn 57.116 + * Signature: ()[S 57.117 + */ 57.118 +JNIEXPORT jshortArray JNICALL Java_TestClass1_samn 57.119 + (JNIEnv *, jobject); 57.120 + 57.121 +/* 57.122 + * Class: TestClass1 57.123 + * Method: iamn 57.124 + * Signature: ()[I 57.125 + */ 57.126 +JNIEXPORT jintArray JNICALL Java_TestClass1_iamn 57.127 + (JNIEnv *, jobject); 57.128 + 57.129 +/* 57.130 + * Class: TestClass1 57.131 + * Method: lamn 57.132 + * Signature: ()[J 57.133 + */ 57.134 +JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn 57.135 + (JNIEnv *, jobject); 57.136 + 57.137 +/* 57.138 + * Class: TestClass1 57.139 + * Method: famn 57.140 + * Signature: ()[F 57.141 + */ 57.142 +JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn 57.143 + (JNIEnv *, jobject); 57.144 + 57.145 +/* 57.146 + * Class: TestClass1 57.147 + * Method: damn 57.148 + * Signature: ()[D 57.149 + */ 57.150 +JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn 57.151 + (JNIEnv *, jobject); 57.152 + 57.153 +/* 57.154 + * Class: TestClass1 57.155 + * Method: oamn 57.156 + * Signature: ()[Ljava/lang/Object; 57.157 + */ 57.158 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn 57.159 + (JNIEnv *, jobject); 57.160 + 57.161 +/* 57.162 + * Class: TestClass1 57.163 + * Method: tamn 57.164 + * Signature: ()[Ljava/lang/String; 57.165 + */ 57.166 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn 57.167 + (JNIEnv *, jobject); 57.168 + 57.169 +/* 57.170 + * Class: TestClass1 57.171 + * Method: gamn 57.172 + * Signature: ()[Ljava/util/List; 57.173 + */ 57.174 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn 57.175 + (JNIEnv *, jobject); 57.176 + 57.177 +/* 57.178 + * Class: TestClass1 57.179 + * Method: baamn 57.180 + * Signature: ()[[B 57.181 + */ 57.182 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn 57.183 + (JNIEnv *, jobject); 57.184 + 57.185 +/* 57.186 + * Class: TestClass1 57.187 + * Method: saamn 57.188 + * Signature: ()[[S 57.189 + */ 57.190 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn 57.191 + (JNIEnv *, jobject); 57.192 + 57.193 +/* 57.194 + * Class: TestClass1 57.195 + * Method: iaamn 57.196 + * Signature: ()[[I 57.197 + */ 57.198 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn 57.199 + (JNIEnv *, jobject); 57.200 + 57.201 +/* 57.202 + * Class: TestClass1 57.203 + * Method: laamn 57.204 + * Signature: ()[[J 57.205 + */ 57.206 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn 57.207 + (JNIEnv *, jobject); 57.208 + 57.209 +/* 57.210 + * Class: TestClass1 57.211 + * Method: faamn 57.212 + * Signature: ()[[F 57.213 + */ 57.214 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn 57.215 + (JNIEnv *, jobject); 57.216 + 57.217 +/* 57.218 + * Class: TestClass1 57.219 + * Method: daamn 57.220 + * Signature: ()[[D 57.221 + */ 57.222 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn 57.223 + (JNIEnv *, jobject); 57.224 + 57.225 +/* 57.226 + * Class: TestClass1 57.227 + * Method: oaamn 57.228 + * Signature: ()[[Ljava/lang/Object; 57.229 + */ 57.230 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn 57.231 + (JNIEnv *, jobject); 57.232 + 57.233 +/* 57.234 + * Class: TestClass1 57.235 + * Method: taamn 57.236 + * Signature: ()[[Ljava/lang/String; 57.237 + */ 57.238 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn 57.239 + (JNIEnv *, jobject); 57.240 + 57.241 +/* 57.242 + * Class: TestClass1 57.243 + * Method: gaamn 57.244 + * Signature: ()[Ljava/util/List; 57.245 + */ 57.246 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn 57.247 + (JNIEnv *, jobject); 57.248 + 57.249 +/* 57.250 + * Class: TestClass1 57.251 + * Method: bmn1 57.252 + * Signature: ()B 57.253 + */ 57.254 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1 57.255 + (JNIEnv *, jobject); 57.256 + 57.257 +/* 57.258 + * Class: TestClass1 57.259 + * Method: smn1 57.260 + * Signature: ()S 57.261 + */ 57.262 +JNIEXPORT jshort JNICALL Java_TestClass1_smn1 57.263 + (JNIEnv *, jobject); 57.264 + 57.265 +/* 57.266 + * Class: TestClass1 57.267 + * Method: imn1 57.268 + * Signature: ()I 57.269 + */ 57.270 +JNIEXPORT jint JNICALL Java_TestClass1_imn1 57.271 + (JNIEnv *, jobject); 57.272 + 57.273 +/* 57.274 + * Class: TestClass1 57.275 + * Method: lmn1 57.276 + * Signature: ()J 57.277 + */ 57.278 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn1 57.279 + (JNIEnv *, jobject); 57.280 + 57.281 +/* 57.282 + * Class: TestClass1 57.283 + * Method: fmn1 57.284 + * Signature: ()F 57.285 + */ 57.286 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1 57.287 + (JNIEnv *, jobject); 57.288 + 57.289 +/* 57.290 + * Class: TestClass1 57.291 + * Method: dmn1 57.292 + * Signature: ()D 57.293 + */ 57.294 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1 57.295 + (JNIEnv *, jobject); 57.296 + 57.297 +/* 57.298 + * Class: TestClass1 57.299 + * Method: omn1 57.300 + * Signature: ()Ljava/lang/Object; 57.301 + */ 57.302 +JNIEXPORT jobject JNICALL Java_TestClass1_omn1 57.303 + (JNIEnv *, jobject); 57.304 + 57.305 +/* 57.306 + * Class: TestClass1 57.307 + * Method: tmn1 57.308 + * Signature: ()Ljava/lang/String; 57.309 + */ 57.310 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn1 57.311 + (JNIEnv *, jobject); 57.312 + 57.313 +/* 57.314 + * Class: TestClass1 57.315 + * Method: gmn1 57.316 + * Signature: ()Ljava/util/List; 57.317 + */ 57.318 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn1 57.319 + (JNIEnv *, jobject); 57.320 + 57.321 +/* 57.322 + * Class: TestClass1 57.323 + * Method: vmn1 57.324 + * Signature: ()V 57.325 + */ 57.326 +JNIEXPORT void JNICALL Java_TestClass1_vmn1 57.327 + (JNIEnv *, jobject); 57.328 + 57.329 +/* 57.330 + * Class: TestClass1 57.331 + * Method: bmn2 57.332 + * Signature: (I)B 57.333 + */ 57.334 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2 57.335 + (JNIEnv *, jobject, jint); 57.336 + 57.337 +/* 57.338 + * Class: TestClass1 57.339 + * Method: smn2 57.340 + * Signature: (I)S 57.341 + */ 57.342 +JNIEXPORT jshort JNICALL Java_TestClass1_smn2 57.343 + (JNIEnv *, jobject, jint); 57.344 + 57.345 +/* 57.346 + * Class: TestClass1 57.347 + * Method: imn2 57.348 + * Signature: (I)I 57.349 + */ 57.350 +JNIEXPORT jint JNICALL Java_TestClass1_imn2 57.351 + (JNIEnv *, jobject, jint); 57.352 + 57.353 +/* 57.354 + * Class: TestClass1 57.355 + * Method: lmn2 57.356 + * Signature: (I)J 57.357 + */ 57.358 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn2 57.359 + (JNIEnv *, jobject, jint); 57.360 + 57.361 +/* 57.362 + * Class: TestClass1 57.363 + * Method: fmn2 57.364 + * Signature: (I)F 57.365 + */ 57.366 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2 57.367 + (JNIEnv *, jobject, jint); 57.368 + 57.369 +/* 57.370 + * Class: TestClass1 57.371 + * Method: dmn2 57.372 + * Signature: (I)D 57.373 + */ 57.374 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2 57.375 + (JNIEnv *, jobject, jint); 57.376 + 57.377 +/* 57.378 + * Class: TestClass1 57.379 + * Method: omn2 57.380 + * Signature: (I)Ljava/lang/Object; 57.381 + */ 57.382 +JNIEXPORT jobject JNICALL Java_TestClass1_omn2 57.383 + (JNIEnv *, jobject, jint); 57.384 + 57.385 +/* 57.386 + * Class: TestClass1 57.387 + * Method: tmn2 57.388 + * Signature: (I)Ljava/lang/String; 57.389 + */ 57.390 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn2 57.391 + (JNIEnv *, jobject, jint); 57.392 + 57.393 +/* 57.394 + * Class: TestClass1 57.395 + * Method: gmn2 57.396 + * Signature: (I)Ljava/util/List; 57.397 + */ 57.398 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn2 57.399 + (JNIEnv *, jobject, jint); 57.400 + 57.401 +/* 57.402 + * Class: TestClass1 57.403 + * Method: vmn2 57.404 + * Signature: (I)V 57.405 + */ 57.406 +JNIEXPORT void JNICALL Java_TestClass1_vmn2 57.407 + (JNIEnv *, jobject, jint); 57.408 + 57.409 +/* 57.410 + * Class: TestClass1 57.411 + * Method: mbn 57.412 + * Signature: (B)V 57.413 + */ 57.414 +JNIEXPORT void JNICALL Java_TestClass1_mbn 57.415 + (JNIEnv *, jobject, jbyte); 57.416 + 57.417 +/* 57.418 + * Class: TestClass1 57.419 + * Method: msn 57.420 + * Signature: (S)V 57.421 + */ 57.422 +JNIEXPORT void JNICALL Java_TestClass1_msn 57.423 + (JNIEnv *, jobject, jshort); 57.424 + 57.425 +/* 57.426 + * Class: TestClass1 57.427 + * Method: min 57.428 + * Signature: (I)V 57.429 + */ 57.430 +JNIEXPORT void JNICALL Java_TestClass1_min 57.431 + (JNIEnv *, jobject, jint); 57.432 + 57.433 +/* 57.434 + * Class: TestClass1 57.435 + * Method: mln 57.436 + * Signature: (J)V 57.437 + */ 57.438 +JNIEXPORT void JNICALL Java_TestClass1_mln 57.439 + (JNIEnv *, jobject, jlong); 57.440 + 57.441 +/* 57.442 + * Class: TestClass1 57.443 + * Method: mfn 57.444 + * Signature: (F)V 57.445 + */ 57.446 +JNIEXPORT void JNICALL Java_TestClass1_mfn 57.447 + (JNIEnv *, jobject, jfloat); 57.448 + 57.449 +/* 57.450 + * Class: TestClass1 57.451 + * Method: mdn 57.452 + * Signature: (D)V 57.453 + */ 57.454 +JNIEXPORT void JNICALL Java_TestClass1_mdn 57.455 + (JNIEnv *, jobject, jdouble); 57.456 + 57.457 +/* 57.458 + * Class: TestClass1 57.459 + * Method: mon 57.460 + * Signature: (Ljava/lang/Object;)V 57.461 + */ 57.462 +JNIEXPORT void JNICALL Java_TestClass1_mon 57.463 + (JNIEnv *, jobject, jobject); 57.464 + 57.465 +/* 57.466 + * Class: TestClass1 57.467 + * Method: mtn 57.468 + * Signature: (Ljava/lang/String;)V 57.469 + */ 57.470 +JNIEXPORT void JNICALL Java_TestClass1_mtn 57.471 + (JNIEnv *, jobject, jstring); 57.472 + 57.473 +/* 57.474 + * Class: TestClass1 57.475 + * Method: mgn 57.476 + * Signature: (Ljava/util/List;)V 57.477 + */ 57.478 +JNIEXPORT void JNICALL Java_TestClass1_mgn 57.479 + (JNIEnv *, jobject, jobject); 57.480 + 57.481 +#ifdef __cplusplus 57.482 +} 57.483 +#endif 57.484 +#endif
58.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 58.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass1_Inner1.h Wed Oct 07 14:14:45 2009 -0700 58.3 @@ -0,0 +1,337 @@ 58.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 58.5 +#include <jni.h> 58.6 +/* Header for class TestClass1_Inner1 */ 58.7 + 58.8 +#ifndef _Included_TestClass1_Inner1 58.9 +#define _Included_TestClass1_Inner1 58.10 +#ifdef __cplusplus 58.11 +extern "C" { 58.12 +#endif 58.13 +#undef TestClass1_Inner1_bc 58.14 +#define TestClass1_Inner1_bc 0L 58.15 +#undef TestClass1_Inner1_sc 58.16 +#define TestClass1_Inner1_sc 0L 58.17 +#undef TestClass1_Inner1_ic 58.18 +#define TestClass1_Inner1_ic 0L 58.19 +#undef TestClass1_Inner1_lc 58.20 +#define TestClass1_Inner1_lc 0LL 58.21 +#undef TestClass1_Inner1_fc 58.22 +#define TestClass1_Inner1_fc 0.0f 58.23 +#undef TestClass1_Inner1_dc 58.24 +#define TestClass1_Inner1_dc 0.0 58.25 +/* 58.26 + * Class: TestClass1_Inner1 58.27 + * Method: bmn 58.28 + * Signature: ()B 58.29 + */ 58.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn 58.31 + (JNIEnv *, jobject); 58.32 + 58.33 +/* 58.34 + * Class: TestClass1_Inner1 58.35 + * Method: smn 58.36 + * Signature: ()S 58.37 + */ 58.38 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn 58.39 + (JNIEnv *, jobject); 58.40 + 58.41 +/* 58.42 + * Class: TestClass1_Inner1 58.43 + * Method: imn 58.44 + * Signature: ()I 58.45 + */ 58.46 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn 58.47 + (JNIEnv *, jobject); 58.48 + 58.49 +/* 58.50 + * Class: TestClass1_Inner1 58.51 + * Method: lmn 58.52 + * Signature: ()J 58.53 + */ 58.54 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn 58.55 + (JNIEnv *, jobject); 58.56 + 58.57 +/* 58.58 + * Class: TestClass1_Inner1 58.59 + * Method: fmn 58.60 + * Signature: ()F 58.61 + */ 58.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn 58.63 + (JNIEnv *, jobject); 58.64 + 58.65 +/* 58.66 + * Class: TestClass1_Inner1 58.67 + * Method: dmn 58.68 + * Signature: ()D 58.69 + */ 58.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn 58.71 + (JNIEnv *, jobject); 58.72 + 58.73 +/* 58.74 + * Class: TestClass1_Inner1 58.75 + * Method: omn 58.76 + * Signature: ()Ljava/lang/Object; 58.77 + */ 58.78 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn 58.79 + (JNIEnv *, jobject); 58.80 + 58.81 +/* 58.82 + * Class: TestClass1_Inner1 58.83 + * Method: tmn 58.84 + * Signature: ()Ljava/lang/String; 58.85 + */ 58.86 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn 58.87 + (JNIEnv *, jobject); 58.88 + 58.89 +/* 58.90 + * Class: TestClass1_Inner1 58.91 + * Method: gmn 58.92 + * Signature: ()Ljava/util/List; 58.93 + */ 58.94 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn 58.95 + (JNIEnv *, jobject); 58.96 + 58.97 +/* 58.98 + * Class: TestClass1_Inner1 58.99 + * Method: vmn 58.100 + * Signature: ()V 58.101 + */ 58.102 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn 58.103 + (JNIEnv *, jobject); 58.104 + 58.105 +/* 58.106 + * Class: TestClass1_Inner1 58.107 + * Method: bmn1 58.108 + * Signature: ()B 58.109 + */ 58.110 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1 58.111 + (JNIEnv *, jobject); 58.112 + 58.113 +/* 58.114 + * Class: TestClass1_Inner1 58.115 + * Method: smn1 58.116 + * Signature: ()S 58.117 + */ 58.118 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1 58.119 + (JNIEnv *, jobject); 58.120 + 58.121 +/* 58.122 + * Class: TestClass1_Inner1 58.123 + * Method: imn1 58.124 + * Signature: ()I 58.125 + */ 58.126 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1 58.127 + (JNIEnv *, jobject); 58.128 + 58.129 +/* 58.130 + * Class: TestClass1_Inner1 58.131 + * Method: lmn1 58.132 + * Signature: ()J 58.133 + */ 58.134 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1 58.135 + (JNIEnv *, jobject); 58.136 + 58.137 +/* 58.138 + * Class: TestClass1_Inner1 58.139 + * Method: fmn1 58.140 + * Signature: ()F 58.141 + */ 58.142 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1 58.143 + (JNIEnv *, jobject); 58.144 + 58.145 +/* 58.146 + * Class: TestClass1_Inner1 58.147 + * Method: dmn1 58.148 + * Signature: ()D 58.149 + */ 58.150 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1 58.151 + (JNIEnv *, jobject); 58.152 + 58.153 +/* 58.154 + * Class: TestClass1_Inner1 58.155 + * Method: omn1 58.156 + * Signature: ()Ljava/lang/Object; 58.157 + */ 58.158 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1 58.159 + (JNIEnv *, jobject); 58.160 + 58.161 +/* 58.162 + * Class: TestClass1_Inner1 58.163 + * Method: tmn1 58.164 + * Signature: ()Ljava/lang/String; 58.165 + */ 58.166 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1 58.167 + (JNIEnv *, jobject); 58.168 + 58.169 +/* 58.170 + * Class: TestClass1_Inner1 58.171 + * Method: gmn1 58.172 + * Signature: ()Ljava/util/List; 58.173 + */ 58.174 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1 58.175 + (JNIEnv *, jobject); 58.176 + 58.177 +/* 58.178 + * Class: TestClass1_Inner1 58.179 + * Method: vmn1 58.180 + * Signature: ()V 58.181 + */ 58.182 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1 58.183 + (JNIEnv *, jobject); 58.184 + 58.185 +/* 58.186 + * Class: TestClass1_Inner1 58.187 + * Method: bmn2 58.188 + * Signature: (I)B 58.189 + */ 58.190 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2 58.191 + (JNIEnv *, jobject, jint); 58.192 + 58.193 +/* 58.194 + * Class: TestClass1_Inner1 58.195 + * Method: smn2 58.196 + * Signature: (I)S 58.197 + */ 58.198 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2 58.199 + (JNIEnv *, jobject, jint); 58.200 + 58.201 +/* 58.202 + * Class: TestClass1_Inner1 58.203 + * Method: imn2 58.204 + * Signature: (I)I 58.205 + */ 58.206 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2 58.207 + (JNIEnv *, jobject, jint); 58.208 + 58.209 +/* 58.210 + * Class: TestClass1_Inner1 58.211 + * Method: lmn2 58.212 + * Signature: (I)J 58.213 + */ 58.214 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2 58.215 + (JNIEnv *, jobject, jint); 58.216 + 58.217 +/* 58.218 + * Class: TestClass1_Inner1 58.219 + * Method: fmn2 58.220 + * Signature: (I)F 58.221 + */ 58.222 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2 58.223 + (JNIEnv *, jobject, jint); 58.224 + 58.225 +/* 58.226 + * Class: TestClass1_Inner1 58.227 + * Method: dmn2 58.228 + * Signature: (I)D 58.229 + */ 58.230 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2 58.231 + (JNIEnv *, jobject, jint); 58.232 + 58.233 +/* 58.234 + * Class: TestClass1_Inner1 58.235 + * Method: omn2 58.236 + * Signature: (I)Ljava/lang/Object; 58.237 + */ 58.238 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2 58.239 + (JNIEnv *, jobject, jint); 58.240 + 58.241 +/* 58.242 + * Class: TestClass1_Inner1 58.243 + * Method: tmn2 58.244 + * Signature: (I)Ljava/lang/String; 58.245 + */ 58.246 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2 58.247 + (JNIEnv *, jobject, jint); 58.248 + 58.249 +/* 58.250 + * Class: TestClass1_Inner1 58.251 + * Method: gmn2 58.252 + * Signature: (I)Ljava/util/List; 58.253 + */ 58.254 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2 58.255 + (JNIEnv *, jobject, jint); 58.256 + 58.257 +/* 58.258 + * Class: TestClass1_Inner1 58.259 + * Method: vmn2 58.260 + * Signature: (I)V 58.261 + */ 58.262 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2 58.263 + (JNIEnv *, jobject, jint); 58.264 + 58.265 +/* 58.266 + * Class: TestClass1_Inner1 58.267 + * Method: mbn 58.268 + * Signature: (B)V 58.269 + */ 58.270 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn 58.271 + (JNIEnv *, jobject, jbyte); 58.272 + 58.273 +/* 58.274 + * Class: TestClass1_Inner1 58.275 + * Method: msn 58.276 + * Signature: (S)V 58.277 + */ 58.278 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn 58.279 + (JNIEnv *, jobject, jshort); 58.280 + 58.281 +/* 58.282 + * Class: TestClass1_Inner1 58.283 + * Method: min 58.284 + * Signature: (I)V 58.285 + */ 58.286 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min 58.287 + (JNIEnv *, jobject, jint); 58.288 + 58.289 +/* 58.290 + * Class: TestClass1_Inner1 58.291 + * Method: mln 58.292 + * Signature: (J)V 58.293 + */ 58.294 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln 58.295 + (JNIEnv *, jobject, jlong); 58.296 + 58.297 +/* 58.298 + * Class: TestClass1_Inner1 58.299 + * Method: mfn 58.300 + * Signature: (F)V 58.301 + */ 58.302 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn 58.303 + (JNIEnv *, jobject, jfloat); 58.304 + 58.305 +/* 58.306 + * Class: TestClass1_Inner1 58.307 + * Method: mdn 58.308 + * Signature: (D)V 58.309 + */ 58.310 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn 58.311 + (JNIEnv *, jobject, jdouble); 58.312 + 58.313 +/* 58.314 + * Class: TestClass1_Inner1 58.315 + * Method: mon 58.316 + * Signature: (Ljava/lang/Object;)V 58.317 + */ 58.318 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon 58.319 + (JNIEnv *, jobject, jobject); 58.320 + 58.321 +/* 58.322 + * Class: TestClass1_Inner1 58.323 + * Method: mtn 58.324 + * Signature: (Ljava/lang/String;)V 58.325 + */ 58.326 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn 58.327 + (JNIEnv *, jobject, jstring); 58.328 + 58.329 +/* 58.330 + * Class: TestClass1_Inner1 58.331 + * Method: mgn 58.332 + * Signature: (Ljava/util/List;)V 58.333 + */ 58.334 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn 58.335 + (JNIEnv *, jobject, jobject); 58.336 + 58.337 +#ifdef __cplusplus 58.338 +} 58.339 +#endif 58.340 +#endif
59.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 59.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass1_Inner2.h Wed Oct 07 14:14:45 2009 -0700 59.3 @@ -0,0 +1,337 @@ 59.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 59.5 +#include <jni.h> 59.6 +/* Header for class TestClass1_Inner2 */ 59.7 + 59.8 +#ifndef _Included_TestClass1_Inner2 59.9 +#define _Included_TestClass1_Inner2 59.10 +#ifdef __cplusplus 59.11 +extern "C" { 59.12 +#endif 59.13 +#undef TestClass1_Inner2_bc 59.14 +#define TestClass1_Inner2_bc 0L 59.15 +#undef TestClass1_Inner2_sc 59.16 +#define TestClass1_Inner2_sc 0L 59.17 +#undef TestClass1_Inner2_ic 59.18 +#define TestClass1_Inner2_ic 0L 59.19 +#undef TestClass1_Inner2_lc 59.20 +#define TestClass1_Inner2_lc 0LL 59.21 +#undef TestClass1_Inner2_fc 59.22 +#define TestClass1_Inner2_fc 0.0f 59.23 +#undef TestClass1_Inner2_dc 59.24 +#define TestClass1_Inner2_dc 0.0 59.25 +/* 59.26 + * Class: TestClass1_Inner2 59.27 + * Method: bmn 59.28 + * Signature: ()B 59.29 + */ 59.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn 59.31 + (JNIEnv *, jobject); 59.32 + 59.33 +/* 59.34 + * Class: TestClass1_Inner2 59.35 + * Method: smn 59.36 + * Signature: ()S 59.37 + */ 59.38 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn 59.39 + (JNIEnv *, jobject); 59.40 + 59.41 +/* 59.42 + * Class: TestClass1_Inner2 59.43 + * Method: imn 59.44 + * Signature: ()I 59.45 + */ 59.46 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn 59.47 + (JNIEnv *, jobject); 59.48 + 59.49 +/* 59.50 + * Class: TestClass1_Inner2 59.51 + * Method: lmn 59.52 + * Signature: ()J 59.53 + */ 59.54 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn 59.55 + (JNIEnv *, jobject); 59.56 + 59.57 +/* 59.58 + * Class: TestClass1_Inner2 59.59 + * Method: fmn 59.60 + * Signature: ()F 59.61 + */ 59.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn 59.63 + (JNIEnv *, jobject); 59.64 + 59.65 +/* 59.66 + * Class: TestClass1_Inner2 59.67 + * Method: dmn 59.68 + * Signature: ()D 59.69 + */ 59.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn 59.71 + (JNIEnv *, jobject); 59.72 + 59.73 +/* 59.74 + * Class: TestClass1_Inner2 59.75 + * Method: omn 59.76 + * Signature: ()Ljava/lang/Object; 59.77 + */ 59.78 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn 59.79 + (JNIEnv *, jobject); 59.80 + 59.81 +/* 59.82 + * Class: TestClass1_Inner2 59.83 + * Method: tmn 59.84 + * Signature: ()Ljava/lang/String; 59.85 + */ 59.86 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn 59.87 + (JNIEnv *, jobject); 59.88 + 59.89 +/* 59.90 + * Class: TestClass1_Inner2 59.91 + * Method: gmn 59.92 + * Signature: ()Ljava/util/List; 59.93 + */ 59.94 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn 59.95 + (JNIEnv *, jobject); 59.96 + 59.97 +/* 59.98 + * Class: TestClass1_Inner2 59.99 + * Method: vmn 59.100 + * Signature: ()V 59.101 + */ 59.102 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn 59.103 + (JNIEnv *, jobject); 59.104 + 59.105 +/* 59.106 + * Class: TestClass1_Inner2 59.107 + * Method: bmn1 59.108 + * Signature: ()B 59.109 + */ 59.110 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1 59.111 + (JNIEnv *, jobject); 59.112 + 59.113 +/* 59.114 + * Class: TestClass1_Inner2 59.115 + * Method: smn1 59.116 + * Signature: ()S 59.117 + */ 59.118 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1 59.119 + (JNIEnv *, jobject); 59.120 + 59.121 +/* 59.122 + * Class: TestClass1_Inner2 59.123 + * Method: imn1 59.124 + * Signature: ()I 59.125 + */ 59.126 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1 59.127 + (JNIEnv *, jobject); 59.128 + 59.129 +/* 59.130 + * Class: TestClass1_Inner2 59.131 + * Method: lmn1 59.132 + * Signature: ()J 59.133 + */ 59.134 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1 59.135 + (JNIEnv *, jobject); 59.136 + 59.137 +/* 59.138 + * Class: TestClass1_Inner2 59.139 + * Method: fmn1 59.140 + * Signature: ()F 59.141 + */ 59.142 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1 59.143 + (JNIEnv *, jobject); 59.144 + 59.145 +/* 59.146 + * Class: TestClass1_Inner2 59.147 + * Method: dmn1 59.148 + * Signature: ()D 59.149 + */ 59.150 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1 59.151 + (JNIEnv *, jobject); 59.152 + 59.153 +/* 59.154 + * Class: TestClass1_Inner2 59.155 + * Method: omn1 59.156 + * Signature: ()Ljava/lang/Object; 59.157 + */ 59.158 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1 59.159 + (JNIEnv *, jobject); 59.160 + 59.161 +/* 59.162 + * Class: TestClass1_Inner2 59.163 + * Method: tmn1 59.164 + * Signature: ()Ljava/lang/String; 59.165 + */ 59.166 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1 59.167 + (JNIEnv *, jobject); 59.168 + 59.169 +/* 59.170 + * Class: TestClass1_Inner2 59.171 + * Method: gmn1 59.172 + * Signature: ()Ljava/util/List; 59.173 + */ 59.174 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1 59.175 + (JNIEnv *, jobject); 59.176 + 59.177 +/* 59.178 + * Class: TestClass1_Inner2 59.179 + * Method: vmn1 59.180 + * Signature: ()V 59.181 + */ 59.182 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1 59.183 + (JNIEnv *, jobject); 59.184 + 59.185 +/* 59.186 + * Class: TestClass1_Inner2 59.187 + * Method: bmn2 59.188 + * Signature: (I)B 59.189 + */ 59.190 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2 59.191 + (JNIEnv *, jobject, jint); 59.192 + 59.193 +/* 59.194 + * Class: TestClass1_Inner2 59.195 + * Method: smn2 59.196 + * Signature: (I)S 59.197 + */ 59.198 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2 59.199 + (JNIEnv *, jobject, jint); 59.200 + 59.201 +/* 59.202 + * Class: TestClass1_Inner2 59.203 + * Method: imn2 59.204 + * Signature: (I)I 59.205 + */ 59.206 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2 59.207 + (JNIEnv *, jobject, jint); 59.208 + 59.209 +/* 59.210 + * Class: TestClass1_Inner2 59.211 + * Method: lmn2 59.212 + * Signature: (I)J 59.213 + */ 59.214 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2 59.215 + (JNIEnv *, jobject, jint); 59.216 + 59.217 +/* 59.218 + * Class: TestClass1_Inner2 59.219 + * Method: fmn2 59.220 + * Signature: (I)F 59.221 + */ 59.222 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2 59.223 + (JNIEnv *, jobject, jint); 59.224 + 59.225 +/* 59.226 + * Class: TestClass1_Inner2 59.227 + * Method: dmn2 59.228 + * Signature: (I)D 59.229 + */ 59.230 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2 59.231 + (JNIEnv *, jobject, jint); 59.232 + 59.233 +/* 59.234 + * Class: TestClass1_Inner2 59.235 + * Method: omn2 59.236 + * Signature: (I)Ljava/lang/Object; 59.237 + */ 59.238 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2 59.239 + (JNIEnv *, jobject, jint); 59.240 + 59.241 +/* 59.242 + * Class: TestClass1_Inner2 59.243 + * Method: tmn2 59.244 + * Signature: (I)Ljava/lang/String; 59.245 + */ 59.246 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2 59.247 + (JNIEnv *, jobject, jint); 59.248 + 59.249 +/* 59.250 + * Class: TestClass1_Inner2 59.251 + * Method: gmn2 59.252 + * Signature: (I)Ljava/util/List; 59.253 + */ 59.254 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2 59.255 + (JNIEnv *, jobject, jint); 59.256 + 59.257 +/* 59.258 + * Class: TestClass1_Inner2 59.259 + * Method: vmn2 59.260 + * Signature: (I)V 59.261 + */ 59.262 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2 59.263 + (JNIEnv *, jobject, jint); 59.264 + 59.265 +/* 59.266 + * Class: TestClass1_Inner2 59.267 + * Method: mbn 59.268 + * Signature: (B)V 59.269 + */ 59.270 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn 59.271 + (JNIEnv *, jobject, jbyte); 59.272 + 59.273 +/* 59.274 + * Class: TestClass1_Inner2 59.275 + * Method: msn 59.276 + * Signature: (S)V 59.277 + */ 59.278 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn 59.279 + (JNIEnv *, jobject, jshort); 59.280 + 59.281 +/* 59.282 + * Class: TestClass1_Inner2 59.283 + * Method: min 59.284 + * Signature: (I)V 59.285 + */ 59.286 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min 59.287 + (JNIEnv *, jobject, jint); 59.288 + 59.289 +/* 59.290 + * Class: TestClass1_Inner2 59.291 + * Method: mln 59.292 + * Signature: (J)V 59.293 + */ 59.294 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln 59.295 + (JNIEnv *, jobject, jlong); 59.296 + 59.297 +/* 59.298 + * Class: TestClass1_Inner2 59.299 + * Method: mfn 59.300 + * Signature: (F)V 59.301 + */ 59.302 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn 59.303 + (JNIEnv *, jobject, jfloat); 59.304 + 59.305 +/* 59.306 + * Class: TestClass1_Inner2 59.307 + * Method: mdn 59.308 + * Signature: (D)V 59.309 + */ 59.310 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn 59.311 + (JNIEnv *, jobject, jdouble); 59.312 + 59.313 +/* 59.314 + * Class: TestClass1_Inner2 59.315 + * Method: mon 59.316 + * Signature: (Ljava/lang/Object;)V 59.317 + */ 59.318 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon 59.319 + (JNIEnv *, jobject, jobject); 59.320 + 59.321 +/* 59.322 + * Class: TestClass1_Inner2 59.323 + * Method: mtn 59.324 + * Signature: (Ljava/lang/String;)V 59.325 + */ 59.326 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn 59.327 + (JNIEnv *, jobject, jstring); 59.328 + 59.329 +/* 59.330 + * Class: TestClass1_Inner2 59.331 + * Method: mgn 59.332 + * Signature: (Ljava/util/List;)V 59.333 + */ 59.334 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mgn 59.335 + (JNIEnv *, jobject, jobject); 59.336 + 59.337 +#ifdef __cplusplus 59.338 +} 59.339 +#endif 59.340 +#endif
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 60.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass2.h Wed Oct 07 14:14:45 2009 -0700 60.3 @@ -0,0 +1,13 @@ 60.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 60.5 +#include <jni.h> 60.6 +/* Header for class TestClass2 */ 60.7 + 60.8 +#ifndef _Included_TestClass2 60.9 +#define _Included_TestClass2 60.10 +#ifdef __cplusplus 60.11 +extern "C" { 60.12 +#endif 60.13 +#ifdef __cplusplus 60.14 +} 60.15 +#endif 60.16 +#endif
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 61.2 +++ b/test/tools/javah/6572945/gold/jni.file.1 Wed Oct 07 14:14:45 2009 -0700 61.3 @@ -0,0 +1,1151 @@ 61.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 61.5 +#include <jni.h> 61.6 +/* Header for class TestClass1 */ 61.7 + 61.8 +#ifndef _Included_TestClass1 61.9 +#define _Included_TestClass1 61.10 +#ifdef __cplusplus 61.11 +extern "C" { 61.12 +#endif 61.13 +#undef TestClass1_bc 61.14 +#define TestClass1_bc 0L 61.15 +#undef TestClass1_sc 61.16 +#define TestClass1_sc 0L 61.17 +#undef TestClass1_ic 61.18 +#define TestClass1_ic 0L 61.19 +#undef TestClass1_lc 61.20 +#define TestClass1_lc 0LL 61.21 +#undef TestClass1_fc 61.22 +#define TestClass1_fc 0.0f 61.23 +#undef TestClass1_dc 61.24 +#define TestClass1_dc 0.0 61.25 +/* 61.26 + * Class: TestClass1 61.27 + * Method: bmn 61.28 + * Signature: ()B 61.29 + */ 61.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn 61.31 + (JNIEnv *, jobject); 61.32 + 61.33 +/* 61.34 + * Class: TestClass1 61.35 + * Method: smn 61.36 + * Signature: ()S 61.37 + */ 61.38 +JNIEXPORT jshort JNICALL Java_TestClass1_smn 61.39 + (JNIEnv *, jobject); 61.40 + 61.41 +/* 61.42 + * Class: TestClass1 61.43 + * Method: imn 61.44 + * Signature: ()I 61.45 + */ 61.46 +JNIEXPORT jint JNICALL Java_TestClass1_imn 61.47 + (JNIEnv *, jobject); 61.48 + 61.49 +/* 61.50 + * Class: TestClass1 61.51 + * Method: lmn 61.52 + * Signature: ()J 61.53 + */ 61.54 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn 61.55 + (JNIEnv *, jobject); 61.56 + 61.57 +/* 61.58 + * Class: TestClass1 61.59 + * Method: fmn 61.60 + * Signature: ()F 61.61 + */ 61.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn 61.63 + (JNIEnv *, jobject); 61.64 + 61.65 +/* 61.66 + * Class: TestClass1 61.67 + * Method: dmn 61.68 + * Signature: ()D 61.69 + */ 61.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn 61.71 + (JNIEnv *, jobject); 61.72 + 61.73 +/* 61.74 + * Class: TestClass1 61.75 + * Method: omn 61.76 + * Signature: ()Ljava/lang/Object; 61.77 + */ 61.78 +JNIEXPORT jobject JNICALL Java_TestClass1_omn 61.79 + (JNIEnv *, jobject); 61.80 + 61.81 +/* 61.82 + * Class: TestClass1 61.83 + * Method: tmn 61.84 + * Signature: ()Ljava/lang/String; 61.85 + */ 61.86 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn 61.87 + (JNIEnv *, jobject); 61.88 + 61.89 +/* 61.90 + * Class: TestClass1 61.91 + * Method: gmn 61.92 + * Signature: ()Ljava/util/List; 61.93 + */ 61.94 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn 61.95 + (JNIEnv *, jobject); 61.96 + 61.97 +/* 61.98 + * Class: TestClass1 61.99 + * Method: vmn 61.100 + * Signature: ()V 61.101 + */ 61.102 +JNIEXPORT void JNICALL Java_TestClass1_vmn 61.103 + (JNIEnv *, jobject); 61.104 + 61.105 +/* 61.106 + * Class: TestClass1 61.107 + * Method: bamn 61.108 + * Signature: ()[B 61.109 + */ 61.110 +JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn 61.111 + (JNIEnv *, jobject); 61.112 + 61.113 +/* 61.114 + * Class: TestClass1 61.115 + * Method: samn 61.116 + * Signature: ()[S 61.117 + */ 61.118 +JNIEXPORT jshortArray JNICALL Java_TestClass1_samn 61.119 + (JNIEnv *, jobject); 61.120 + 61.121 +/* 61.122 + * Class: TestClass1 61.123 + * Method: iamn 61.124 + * Signature: ()[I 61.125 + */ 61.126 +JNIEXPORT jintArray JNICALL Java_TestClass1_iamn 61.127 + (JNIEnv *, jobject); 61.128 + 61.129 +/* 61.130 + * Class: TestClass1 61.131 + * Method: lamn 61.132 + * Signature: ()[J 61.133 + */ 61.134 +JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn 61.135 + (JNIEnv *, jobject); 61.136 + 61.137 +/* 61.138 + * Class: TestClass1 61.139 + * Method: famn 61.140 + * Signature: ()[F 61.141 + */ 61.142 +JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn 61.143 + (JNIEnv *, jobject); 61.144 + 61.145 +/* 61.146 + * Class: TestClass1 61.147 + * Method: damn 61.148 + * Signature: ()[D 61.149 + */ 61.150 +JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn 61.151 + (JNIEnv *, jobject); 61.152 + 61.153 +/* 61.154 + * Class: TestClass1 61.155 + * Method: oamn 61.156 + * Signature: ()[Ljava/lang/Object; 61.157 + */ 61.158 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn 61.159 + (JNIEnv *, jobject); 61.160 + 61.161 +/* 61.162 + * Class: TestClass1 61.163 + * Method: tamn 61.164 + * Signature: ()[Ljava/lang/String; 61.165 + */ 61.166 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn 61.167 + (JNIEnv *, jobject); 61.168 + 61.169 +/* 61.170 + * Class: TestClass1 61.171 + * Method: gamn 61.172 + * Signature: ()[Ljava/util/List; 61.173 + */ 61.174 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn 61.175 + (JNIEnv *, jobject); 61.176 + 61.177 +/* 61.178 + * Class: TestClass1 61.179 + * Method: baamn 61.180 + * Signature: ()[[B 61.181 + */ 61.182 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn 61.183 + (JNIEnv *, jobject); 61.184 + 61.185 +/* 61.186 + * Class: TestClass1 61.187 + * Method: saamn 61.188 + * Signature: ()[[S 61.189 + */ 61.190 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn 61.191 + (JNIEnv *, jobject); 61.192 + 61.193 +/* 61.194 + * Class: TestClass1 61.195 + * Method: iaamn 61.196 + * Signature: ()[[I 61.197 + */ 61.198 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn 61.199 + (JNIEnv *, jobject); 61.200 + 61.201 +/* 61.202 + * Class: TestClass1 61.203 + * Method: laamn 61.204 + * Signature: ()[[J 61.205 + */ 61.206 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn 61.207 + (JNIEnv *, jobject); 61.208 + 61.209 +/* 61.210 + * Class: TestClass1 61.211 + * Method: faamn 61.212 + * Signature: ()[[F 61.213 + */ 61.214 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn 61.215 + (JNIEnv *, jobject); 61.216 + 61.217 +/* 61.218 + * Class: TestClass1 61.219 + * Method: daamn 61.220 + * Signature: ()[[D 61.221 + */ 61.222 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn 61.223 + (JNIEnv *, jobject); 61.224 + 61.225 +/* 61.226 + * Class: TestClass1 61.227 + * Method: oaamn 61.228 + * Signature: ()[[Ljava/lang/Object; 61.229 + */ 61.230 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn 61.231 + (JNIEnv *, jobject); 61.232 + 61.233 +/* 61.234 + * Class: TestClass1 61.235 + * Method: taamn 61.236 + * Signature: ()[[Ljava/lang/String; 61.237 + */ 61.238 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn 61.239 + (JNIEnv *, jobject); 61.240 + 61.241 +/* 61.242 + * Class: TestClass1 61.243 + * Method: gaamn 61.244 + * Signature: ()[Ljava/util/List; 61.245 + */ 61.246 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn 61.247 + (JNIEnv *, jobject); 61.248 + 61.249 +/* 61.250 + * Class: TestClass1 61.251 + * Method: bmn1 61.252 + * Signature: ()B 61.253 + */ 61.254 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1 61.255 + (JNIEnv *, jobject); 61.256 + 61.257 +/* 61.258 + * Class: TestClass1 61.259 + * Method: smn1 61.260 + * Signature: ()S 61.261 + */ 61.262 +JNIEXPORT jshort JNICALL Java_TestClass1_smn1 61.263 + (JNIEnv *, jobject); 61.264 + 61.265 +/* 61.266 + * Class: TestClass1 61.267 + * Method: imn1 61.268 + * Signature: ()I 61.269 + */ 61.270 +JNIEXPORT jint JNICALL Java_TestClass1_imn1 61.271 + (JNIEnv *, jobject); 61.272 + 61.273 +/* 61.274 + * Class: TestClass1 61.275 + * Method: lmn1 61.276 + * Signature: ()J 61.277 + */ 61.278 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn1 61.279 + (JNIEnv *, jobject); 61.280 + 61.281 +/* 61.282 + * Class: TestClass1 61.283 + * Method: fmn1 61.284 + * Signature: ()F 61.285 + */ 61.286 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1 61.287 + (JNIEnv *, jobject); 61.288 + 61.289 +/* 61.290 + * Class: TestClass1 61.291 + * Method: dmn1 61.292 + * Signature: ()D 61.293 + */ 61.294 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1 61.295 + (JNIEnv *, jobject); 61.296 + 61.297 +/* 61.298 + * Class: TestClass1 61.299 + * Method: omn1 61.300 + * Signature: ()Ljava/lang/Object; 61.301 + */ 61.302 +JNIEXPORT jobject JNICALL Java_TestClass1_omn1 61.303 + (JNIEnv *, jobject); 61.304 + 61.305 +/* 61.306 + * Class: TestClass1 61.307 + * Method: tmn1 61.308 + * Signature: ()Ljava/lang/String; 61.309 + */ 61.310 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn1 61.311 + (JNIEnv *, jobject); 61.312 + 61.313 +/* 61.314 + * Class: TestClass1 61.315 + * Method: gmn1 61.316 + * Signature: ()Ljava/util/List; 61.317 + */ 61.318 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn1 61.319 + (JNIEnv *, jobject); 61.320 + 61.321 +/* 61.322 + * Class: TestClass1 61.323 + * Method: vmn1 61.324 + * Signature: ()V 61.325 + */ 61.326 +JNIEXPORT void JNICALL Java_TestClass1_vmn1 61.327 + (JNIEnv *, jobject); 61.328 + 61.329 +/* 61.330 + * Class: TestClass1 61.331 + * Method: bmn2 61.332 + * Signature: (I)B 61.333 + */ 61.334 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2 61.335 + (JNIEnv *, jobject, jint); 61.336 + 61.337 +/* 61.338 + * Class: TestClass1 61.339 + * Method: smn2 61.340 + * Signature: (I)S 61.341 + */ 61.342 +JNIEXPORT jshort JNICALL Java_TestClass1_smn2 61.343 + (JNIEnv *, jobject, jint); 61.344 + 61.345 +/* 61.346 + * Class: TestClass1 61.347 + * Method: imn2 61.348 + * Signature: (I)I 61.349 + */ 61.350 +JNIEXPORT jint JNICALL Java_TestClass1_imn2 61.351 + (JNIEnv *, jobject, jint); 61.352 + 61.353 +/* 61.354 + * Class: TestClass1 61.355 + * Method: lmn2 61.356 + * Signature: (I)J 61.357 + */ 61.358 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn2 61.359 + (JNIEnv *, jobject, jint); 61.360 + 61.361 +/* 61.362 + * Class: TestClass1 61.363 + * Method: fmn2 61.364 + * Signature: (I)F 61.365 + */ 61.366 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2 61.367 + (JNIEnv *, jobject, jint); 61.368 + 61.369 +/* 61.370 + * Class: TestClass1 61.371 + * Method: dmn2 61.372 + * Signature: (I)D 61.373 + */ 61.374 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2 61.375 + (JNIEnv *, jobject, jint); 61.376 + 61.377 +/* 61.378 + * Class: TestClass1 61.379 + * Method: omn2 61.380 + * Signature: (I)Ljava/lang/Object; 61.381 + */ 61.382 +JNIEXPORT jobject JNICALL Java_TestClass1_omn2 61.383 + (JNIEnv *, jobject, jint); 61.384 + 61.385 +/* 61.386 + * Class: TestClass1 61.387 + * Method: tmn2 61.388 + * Signature: (I)Ljava/lang/String; 61.389 + */ 61.390 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn2 61.391 + (JNIEnv *, jobject, jint); 61.392 + 61.393 +/* 61.394 + * Class: TestClass1 61.395 + * Method: gmn2 61.396 + * Signature: (I)Ljava/util/List; 61.397 + */ 61.398 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn2 61.399 + (JNIEnv *, jobject, jint); 61.400 + 61.401 +/* 61.402 + * Class: TestClass1 61.403 + * Method: vmn2 61.404 + * Signature: (I)V 61.405 + */ 61.406 +JNIEXPORT void JNICALL Java_TestClass1_vmn2 61.407 + (JNIEnv *, jobject, jint); 61.408 + 61.409 +/* 61.410 + * Class: TestClass1 61.411 + * Method: mbn 61.412 + * Signature: (B)V 61.413 + */ 61.414 +JNIEXPORT void JNICALL Java_TestClass1_mbn 61.415 + (JNIEnv *, jobject, jbyte); 61.416 + 61.417 +/* 61.418 + * Class: TestClass1 61.419 + * Method: msn 61.420 + * Signature: (S)V 61.421 + */ 61.422 +JNIEXPORT void JNICALL Java_TestClass1_msn 61.423 + (JNIEnv *, jobject, jshort); 61.424 + 61.425 +/* 61.426 + * Class: TestClass1 61.427 + * Method: min 61.428 + * Signature: (I)V 61.429 + */ 61.430 +JNIEXPORT void JNICALL Java_TestClass1_min 61.431 + (JNIEnv *, jobject, jint); 61.432 + 61.433 +/* 61.434 + * Class: TestClass1 61.435 + * Method: mln 61.436 + * Signature: (J)V 61.437 + */ 61.438 +JNIEXPORT void JNICALL Java_TestClass1_mln 61.439 + (JNIEnv *, jobject, jlong); 61.440 + 61.441 +/* 61.442 + * Class: TestClass1 61.443 + * Method: mfn 61.444 + * Signature: (F)V 61.445 + */ 61.446 +JNIEXPORT void JNICALL Java_TestClass1_mfn 61.447 + (JNIEnv *, jobject, jfloat); 61.448 + 61.449 +/* 61.450 + * Class: TestClass1 61.451 + * Method: mdn 61.452 + * Signature: (D)V 61.453 + */ 61.454 +JNIEXPORT void JNICALL Java_TestClass1_mdn 61.455 + (JNIEnv *, jobject, jdouble); 61.456 + 61.457 +/* 61.458 + * Class: TestClass1 61.459 + * Method: mon 61.460 + * Signature: (Ljava/lang/Object;)V 61.461 + */ 61.462 +JNIEXPORT void JNICALL Java_TestClass1_mon 61.463 + (JNIEnv *, jobject, jobject); 61.464 + 61.465 +/* 61.466 + * Class: TestClass1 61.467 + * Method: mtn 61.468 + * Signature: (Ljava/lang/String;)V 61.469 + */ 61.470 +JNIEXPORT void JNICALL Java_TestClass1_mtn 61.471 + (JNIEnv *, jobject, jstring); 61.472 + 61.473 +/* 61.474 + * Class: TestClass1 61.475 + * Method: mgn 61.476 + * Signature: (Ljava/util/List;)V 61.477 + */ 61.478 +JNIEXPORT void JNICALL Java_TestClass1_mgn 61.479 + (JNIEnv *, jobject, jobject); 61.480 + 61.481 +#ifdef __cplusplus 61.482 +} 61.483 +#endif 61.484 +#endif 61.485 +/* Header for class TestClass1_Inner2 */ 61.486 + 61.487 +#ifndef _Included_TestClass1_Inner2 61.488 +#define _Included_TestClass1_Inner2 61.489 +#ifdef __cplusplus 61.490 +extern "C" { 61.491 +#endif 61.492 +#undef TestClass1_Inner2_bc 61.493 +#define TestClass1_Inner2_bc 0L 61.494 +#undef TestClass1_Inner2_sc 61.495 +#define TestClass1_Inner2_sc 0L 61.496 +#undef TestClass1_Inner2_ic 61.497 +#define TestClass1_Inner2_ic 0L 61.498 +#undef TestClass1_Inner2_lc 61.499 +#define TestClass1_Inner2_lc 0LL 61.500 +#undef TestClass1_Inner2_fc 61.501 +#define TestClass1_Inner2_fc 0.0f 61.502 +#undef TestClass1_Inner2_dc 61.503 +#define TestClass1_Inner2_dc 0.0 61.504 +/* 61.505 + * Class: TestClass1_Inner2 61.506 + * Method: bmn 61.507 + * Signature: ()B 61.508 + */ 61.509 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn 61.510 + (JNIEnv *, jobject); 61.511 + 61.512 +/* 61.513 + * Class: TestClass1_Inner2 61.514 + * Method: smn 61.515 + * Signature: ()S 61.516 + */ 61.517 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn 61.518 + (JNIEnv *, jobject); 61.519 + 61.520 +/* 61.521 + * Class: TestClass1_Inner2 61.522 + * Method: imn 61.523 + * Signature: ()I 61.524 + */ 61.525 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn 61.526 + (JNIEnv *, jobject); 61.527 + 61.528 +/* 61.529 + * Class: TestClass1_Inner2 61.530 + * Method: lmn 61.531 + * Signature: ()J 61.532 + */ 61.533 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn 61.534 + (JNIEnv *, jobject); 61.535 + 61.536 +/* 61.537 + * Class: TestClass1_Inner2 61.538 + * Method: fmn 61.539 + * Signature: ()F 61.540 + */ 61.541 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn 61.542 + (JNIEnv *, jobject); 61.543 + 61.544 +/* 61.545 + * Class: TestClass1_Inner2 61.546 + * Method: dmn 61.547 + * Signature: ()D 61.548 + */ 61.549 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn 61.550 + (JNIEnv *, jobject); 61.551 + 61.552 +/* 61.553 + * Class: TestClass1_Inner2 61.554 + * Method: omn 61.555 + * Signature: ()Ljava/lang/Object; 61.556 + */ 61.557 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn 61.558 + (JNIEnv *, jobject); 61.559 + 61.560 +/* 61.561 + * Class: TestClass1_Inner2 61.562 + * Method: tmn 61.563 + * Signature: ()Ljava/lang/String; 61.564 + */ 61.565 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn 61.566 + (JNIEnv *, jobject); 61.567 + 61.568 +/* 61.569 + * Class: TestClass1_Inner2 61.570 + * Method: gmn 61.571 + * Signature: ()Ljava/util/List; 61.572 + */ 61.573 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn 61.574 + (JNIEnv *, jobject); 61.575 + 61.576 +/* 61.577 + * Class: TestClass1_Inner2 61.578 + * Method: vmn 61.579 + * Signature: ()V 61.580 + */ 61.581 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn 61.582 + (JNIEnv *, jobject); 61.583 + 61.584 +/* 61.585 + * Class: TestClass1_Inner2 61.586 + * Method: bmn1 61.587 + * Signature: ()B 61.588 + */ 61.589 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1 61.590 + (JNIEnv *, jobject); 61.591 + 61.592 +/* 61.593 + * Class: TestClass1_Inner2 61.594 + * Method: smn1 61.595 + * Signature: ()S 61.596 + */ 61.597 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1 61.598 + (JNIEnv *, jobject); 61.599 + 61.600 +/* 61.601 + * Class: TestClass1_Inner2 61.602 + * Method: imn1 61.603 + * Signature: ()I 61.604 + */ 61.605 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1 61.606 + (JNIEnv *, jobject); 61.607 + 61.608 +/* 61.609 + * Class: TestClass1_Inner2 61.610 + * Method: lmn1 61.611 + * Signature: ()J 61.612 + */ 61.613 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1 61.614 + (JNIEnv *, jobject); 61.615 + 61.616 +/* 61.617 + * Class: TestClass1_Inner2 61.618 + * Method: fmn1 61.619 + * Signature: ()F 61.620 + */ 61.621 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1 61.622 + (JNIEnv *, jobject); 61.623 + 61.624 +/* 61.625 + * Class: TestClass1_Inner2 61.626 + * Method: dmn1 61.627 + * Signature: ()D 61.628 + */ 61.629 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1 61.630 + (JNIEnv *, jobject); 61.631 + 61.632 +/* 61.633 + * Class: TestClass1_Inner2 61.634 + * Method: omn1 61.635 + * Signature: ()Ljava/lang/Object; 61.636 + */ 61.637 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1 61.638 + (JNIEnv *, jobject); 61.639 + 61.640 +/* 61.641 + * Class: TestClass1_Inner2 61.642 + * Method: tmn1 61.643 + * Signature: ()Ljava/lang/String; 61.644 + */ 61.645 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1 61.646 + (JNIEnv *, jobject); 61.647 + 61.648 +/* 61.649 + * Class: TestClass1_Inner2 61.650 + * Method: gmn1 61.651 + * Signature: ()Ljava/util/List; 61.652 + */ 61.653 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1 61.654 + (JNIEnv *, jobject); 61.655 + 61.656 +/* 61.657 + * Class: TestClass1_Inner2 61.658 + * Method: vmn1 61.659 + * Signature: ()V 61.660 + */ 61.661 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1 61.662 + (JNIEnv *, jobject); 61.663 + 61.664 +/* 61.665 + * Class: TestClass1_Inner2 61.666 + * Method: bmn2 61.667 + * Signature: (I)B 61.668 + */ 61.669 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2 61.670 + (JNIEnv *, jobject, jint); 61.671 + 61.672 +/* 61.673 + * Class: TestClass1_Inner2 61.674 + * Method: smn2 61.675 + * Signature: (I)S 61.676 + */ 61.677 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2 61.678 + (JNIEnv *, jobject, jint); 61.679 + 61.680 +/* 61.681 + * Class: TestClass1_Inner2 61.682 + * Method: imn2 61.683 + * Signature: (I)I 61.684 + */ 61.685 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2 61.686 + (JNIEnv *, jobject, jint); 61.687 + 61.688 +/* 61.689 + * Class: TestClass1_Inner2 61.690 + * Method: lmn2 61.691 + * Signature: (I)J 61.692 + */ 61.693 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2 61.694 + (JNIEnv *, jobject, jint); 61.695 + 61.696 +/* 61.697 + * Class: TestClass1_Inner2 61.698 + * Method: fmn2 61.699 + * Signature: (I)F 61.700 + */ 61.701 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2 61.702 + (JNIEnv *, jobject, jint); 61.703 + 61.704 +/* 61.705 + * Class: TestClass1_Inner2 61.706 + * Method: dmn2 61.707 + * Signature: (I)D 61.708 + */ 61.709 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2 61.710 + (JNIEnv *, jobject, jint); 61.711 + 61.712 +/* 61.713 + * Class: TestClass1_Inner2 61.714 + * Method: omn2 61.715 + * Signature: (I)Ljava/lang/Object; 61.716 + */ 61.717 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2 61.718 + (JNIEnv *, jobject, jint); 61.719 + 61.720 +/* 61.721 + * Class: TestClass1_Inner2 61.722 + * Method: tmn2 61.723 + * Signature: (I)Ljava/lang/String; 61.724 + */ 61.725 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2 61.726 + (JNIEnv *, jobject, jint); 61.727 + 61.728 +/* 61.729 + * Class: TestClass1_Inner2 61.730 + * Method: gmn2 61.731 + * Signature: (I)Ljava/util/List; 61.732 + */ 61.733 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2 61.734 + (JNIEnv *, jobject, jint); 61.735 + 61.736 +/* 61.737 + * Class: TestClass1_Inner2 61.738 + * Method: vmn2 61.739 + * Signature: (I)V 61.740 + */ 61.741 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2 61.742 + (JNIEnv *, jobject, jint); 61.743 + 61.744 +/* 61.745 + * Class: TestClass1_Inner2 61.746 + * Method: mbn 61.747 + * Signature: (B)V 61.748 + */ 61.749 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn 61.750 + (JNIEnv *, jobject, jbyte); 61.751 + 61.752 +/* 61.753 + * Class: TestClass1_Inner2 61.754 + * Method: msn 61.755 + * Signature: (S)V 61.756 + */ 61.757 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn 61.758 + (JNIEnv *, jobject, jshort); 61.759 + 61.760 +/* 61.761 + * Class: TestClass1_Inner2 61.762 + * Method: min 61.763 + * Signature: (I)V 61.764 + */ 61.765 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min 61.766 + (JNIEnv *, jobject, jint); 61.767 + 61.768 +/* 61.769 + * Class: TestClass1_Inner2 61.770 + * Method: mln 61.771 + * Signature: (J)V 61.772 + */ 61.773 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln 61.774 + (JNIEnv *, jobject, jlong); 61.775 + 61.776 +/* 61.777 + * Class: TestClass1_Inner2 61.778 + * Method: mfn 61.779 + * Signature: (F)V 61.780 + */ 61.781 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn 61.782 + (JNIEnv *, jobject, jfloat); 61.783 + 61.784 +/* 61.785 + * Class: TestClass1_Inner2 61.786 + * Method: mdn 61.787 + * Signature: (D)V 61.788 + */ 61.789 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn 61.790 + (JNIEnv *, jobject, jdouble); 61.791 + 61.792 +/* 61.793 + * Class: TestClass1_Inner2 61.794 + * Method: mon 61.795 + * Signature: (Ljava/lang/Object;)V 61.796 + */ 61.797 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon 61.798 + (JNIEnv *, jobject, jobject); 61.799 + 61.800 +/* 61.801 + * Class: TestClass1_Inner2 61.802 + * Method: mtn 61.803 + * Signature: (Ljava/lang/String;)V 61.804 + */ 61.805 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn 61.806 + (JNIEnv *, jobject, jstring); 61.807 + 61.808 +/* 61.809 + * Class: TestClass1_Inner2 61.810 + * Method: mgn 61.811 + * Signature: (Ljava/util/List;)V 61.812 + */ 61.813 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mgn 61.814 + (JNIEnv *, jobject, jobject); 61.815 + 61.816 +#ifdef __cplusplus 61.817 +} 61.818 +#endif 61.819 +#endif 61.820 +/* Header for class TestClass1_Inner1 */ 61.821 + 61.822 +#ifndef _Included_TestClass1_Inner1 61.823 +#define _Included_TestClass1_Inner1 61.824 +#ifdef __cplusplus 61.825 +extern "C" { 61.826 +#endif 61.827 +#undef TestClass1_Inner1_bc 61.828 +#define TestClass1_Inner1_bc 0L 61.829 +#undef TestClass1_Inner1_sc 61.830 +#define TestClass1_Inner1_sc 0L 61.831 +#undef TestClass1_Inner1_ic 61.832 +#define TestClass1_Inner1_ic 0L 61.833 +#undef TestClass1_Inner1_lc 61.834 +#define TestClass1_Inner1_lc 0LL 61.835 +#undef TestClass1_Inner1_fc 61.836 +#define TestClass1_Inner1_fc 0.0f 61.837 +#undef TestClass1_Inner1_dc 61.838 +#define TestClass1_Inner1_dc 0.0 61.839 +/* 61.840 + * Class: TestClass1_Inner1 61.841 + * Method: bmn 61.842 + * Signature: ()B 61.843 + */ 61.844 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn 61.845 + (JNIEnv *, jobject); 61.846 + 61.847 +/* 61.848 + * Class: TestClass1_Inner1 61.849 + * Method: smn 61.850 + * Signature: ()S 61.851 + */ 61.852 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn 61.853 + (JNIEnv *, jobject); 61.854 + 61.855 +/* 61.856 + * Class: TestClass1_Inner1 61.857 + * Method: imn 61.858 + * Signature: ()I 61.859 + */ 61.860 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn 61.861 + (JNIEnv *, jobject); 61.862 + 61.863 +/* 61.864 + * Class: TestClass1_Inner1 61.865 + * Method: lmn 61.866 + * Signature: ()J 61.867 + */ 61.868 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn 61.869 + (JNIEnv *, jobject); 61.870 + 61.871 +/* 61.872 + * Class: TestClass1_Inner1 61.873 + * Method: fmn 61.874 + * Signature: ()F 61.875 + */ 61.876 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn 61.877 + (JNIEnv *, jobject); 61.878 + 61.879 +/* 61.880 + * Class: TestClass1_Inner1 61.881 + * Method: dmn 61.882 + * Signature: ()D 61.883 + */ 61.884 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn 61.885 + (JNIEnv *, jobject); 61.886 + 61.887 +/* 61.888 + * Class: TestClass1_Inner1 61.889 + * Method: omn 61.890 + * Signature: ()Ljava/lang/Object; 61.891 + */ 61.892 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn 61.893 + (JNIEnv *, jobject); 61.894 + 61.895 +/* 61.896 + * Class: TestClass1_Inner1 61.897 + * Method: tmn 61.898 + * Signature: ()Ljava/lang/String; 61.899 + */ 61.900 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn 61.901 + (JNIEnv *, jobject); 61.902 + 61.903 +/* 61.904 + * Class: TestClass1_Inner1 61.905 + * Method: gmn 61.906 + * Signature: ()Ljava/util/List; 61.907 + */ 61.908 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn 61.909 + (JNIEnv *, jobject); 61.910 + 61.911 +/* 61.912 + * Class: TestClass1_Inner1 61.913 + * Method: vmn 61.914 + * Signature: ()V 61.915 + */ 61.916 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn 61.917 + (JNIEnv *, jobject); 61.918 + 61.919 +/* 61.920 + * Class: TestClass1_Inner1 61.921 + * Method: bmn1 61.922 + * Signature: ()B 61.923 + */ 61.924 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1 61.925 + (JNIEnv *, jobject); 61.926 + 61.927 +/* 61.928 + * Class: TestClass1_Inner1 61.929 + * Method: smn1 61.930 + * Signature: ()S 61.931 + */ 61.932 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1 61.933 + (JNIEnv *, jobject); 61.934 + 61.935 +/* 61.936 + * Class: TestClass1_Inner1 61.937 + * Method: imn1 61.938 + * Signature: ()I 61.939 + */ 61.940 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1 61.941 + (JNIEnv *, jobject); 61.942 + 61.943 +/* 61.944 + * Class: TestClass1_Inner1 61.945 + * Method: lmn1 61.946 + * Signature: ()J 61.947 + */ 61.948 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1 61.949 + (JNIEnv *, jobject); 61.950 + 61.951 +/* 61.952 + * Class: TestClass1_Inner1 61.953 + * Method: fmn1 61.954 + * Signature: ()F 61.955 + */ 61.956 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1 61.957 + (JNIEnv *, jobject); 61.958 + 61.959 +/* 61.960 + * Class: TestClass1_Inner1 61.961 + * Method: dmn1 61.962 + * Signature: ()D 61.963 + */ 61.964 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1 61.965 + (JNIEnv *, jobject); 61.966 + 61.967 +/* 61.968 + * Class: TestClass1_Inner1 61.969 + * Method: omn1 61.970 + * Signature: ()Ljava/lang/Object; 61.971 + */ 61.972 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1 61.973 + (JNIEnv *, jobject); 61.974 + 61.975 +/* 61.976 + * Class: TestClass1_Inner1 61.977 + * Method: tmn1 61.978 + * Signature: ()Ljava/lang/String; 61.979 + */ 61.980 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1 61.981 + (JNIEnv *, jobject); 61.982 + 61.983 +/* 61.984 + * Class: TestClass1_Inner1 61.985 + * Method: gmn1 61.986 + * Signature: ()Ljava/util/List; 61.987 + */ 61.988 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1 61.989 + (JNIEnv *, jobject); 61.990 + 61.991 +/* 61.992 + * Class: TestClass1_Inner1 61.993 + * Method: vmn1 61.994 + * Signature: ()V 61.995 + */ 61.996 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1 61.997 + (JNIEnv *, jobject); 61.998 + 61.999 +/* 61.1000 + * Class: TestClass1_Inner1 61.1001 + * Method: bmn2 61.1002 + * Signature: (I)B 61.1003 + */ 61.1004 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2 61.1005 + (JNIEnv *, jobject, jint); 61.1006 + 61.1007 +/* 61.1008 + * Class: TestClass1_Inner1 61.1009 + * Method: smn2 61.1010 + * Signature: (I)S 61.1011 + */ 61.1012 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2 61.1013 + (JNIEnv *, jobject, jint); 61.1014 + 61.1015 +/* 61.1016 + * Class: TestClass1_Inner1 61.1017 + * Method: imn2 61.1018 + * Signature: (I)I 61.1019 + */ 61.1020 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2 61.1021 + (JNIEnv *, jobject, jint); 61.1022 + 61.1023 +/* 61.1024 + * Class: TestClass1_Inner1 61.1025 + * Method: lmn2 61.1026 + * Signature: (I)J 61.1027 + */ 61.1028 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2 61.1029 + (JNIEnv *, jobject, jint); 61.1030 + 61.1031 +/* 61.1032 + * Class: TestClass1_Inner1 61.1033 + * Method: fmn2 61.1034 + * Signature: (I)F 61.1035 + */ 61.1036 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2 61.1037 + (JNIEnv *, jobject, jint); 61.1038 + 61.1039 +/* 61.1040 + * Class: TestClass1_Inner1 61.1041 + * Method: dmn2 61.1042 + * Signature: (I)D 61.1043 + */ 61.1044 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2 61.1045 + (JNIEnv *, jobject, jint); 61.1046 + 61.1047 +/* 61.1048 + * Class: TestClass1_Inner1 61.1049 + * Method: omn2 61.1050 + * Signature: (I)Ljava/lang/Object; 61.1051 + */ 61.1052 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2 61.1053 + (JNIEnv *, jobject, jint); 61.1054 + 61.1055 +/* 61.1056 + * Class: TestClass1_Inner1 61.1057 + * Method: tmn2 61.1058 + * Signature: (I)Ljava/lang/String; 61.1059 + */ 61.1060 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2 61.1061 + (JNIEnv *, jobject, jint); 61.1062 + 61.1063 +/* 61.1064 + * Class: TestClass1_Inner1 61.1065 + * Method: gmn2 61.1066 + * Signature: (I)Ljava/util/List; 61.1067 + */ 61.1068 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2 61.1069 + (JNIEnv *, jobject, jint); 61.1070 + 61.1071 +/* 61.1072 + * Class: TestClass1_Inner1 61.1073 + * Method: vmn2 61.1074 + * Signature: (I)V 61.1075 + */ 61.1076 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2 61.1077 + (JNIEnv *, jobject, jint); 61.1078 + 61.1079 +/* 61.1080 + * Class: TestClass1_Inner1 61.1081 + * Method: mbn 61.1082 + * Signature: (B)V 61.1083 + */ 61.1084 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn 61.1085 + (JNIEnv *, jobject, jbyte); 61.1086 + 61.1087 +/* 61.1088 + * Class: TestClass1_Inner1 61.1089 + * Method: msn 61.1090 + * Signature: (S)V 61.1091 + */ 61.1092 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn 61.1093 + (JNIEnv *, jobject, jshort); 61.1094 + 61.1095 +/* 61.1096 + * Class: TestClass1_Inner1 61.1097 + * Method: min 61.1098 + * Signature: (I)V 61.1099 + */ 61.1100 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min 61.1101 + (JNIEnv *, jobject, jint); 61.1102 + 61.1103 +/* 61.1104 + * Class: TestClass1_Inner1 61.1105 + * Method: mln 61.1106 + * Signature: (J)V 61.1107 + */ 61.1108 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln 61.1109 + (JNIEnv *, jobject, jlong); 61.1110 + 61.1111 +/* 61.1112 + * Class: TestClass1_Inner1 61.1113 + * Method: mfn 61.1114 + * Signature: (F)V 61.1115 + */ 61.1116 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn 61.1117 + (JNIEnv *, jobject, jfloat); 61.1118 + 61.1119 +/* 61.1120 + * Class: TestClass1_Inner1 61.1121 + * Method: mdn 61.1122 + * Signature: (D)V 61.1123 + */ 61.1124 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn 61.1125 + (JNIEnv *, jobject, jdouble); 61.1126 + 61.1127 +/* 61.1128 + * Class: TestClass1_Inner1 61.1129 + * Method: mon 61.1130 + * Signature: (Ljava/lang/Object;)V 61.1131 + */ 61.1132 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon 61.1133 + (JNIEnv *, jobject, jobject); 61.1134 + 61.1135 +/* 61.1136 + * Class: TestClass1_Inner1 61.1137 + * Method: mtn 61.1138 + * Signature: (Ljava/lang/String;)V 61.1139 + */ 61.1140 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn 61.1141 + (JNIEnv *, jobject, jstring); 61.1142 + 61.1143 +/* 61.1144 + * Class: TestClass1_Inner1 61.1145 + * Method: mgn 61.1146 + * Signature: (Ljava/util/List;)V 61.1147 + */ 61.1148 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn 61.1149 + (JNIEnv *, jobject, jobject); 61.1150 + 61.1151 +#ifdef __cplusplus 61.1152 +} 61.1153 +#endif 61.1154 +#endif
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 62.2 +++ b/test/tools/javah/6572945/gold/jni.file.2 Wed Oct 07 14:14:45 2009 -0700 62.3 @@ -0,0 +1,1162 @@ 62.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 62.5 +#include <jni.h> 62.6 +/* Header for class TestClass1 */ 62.7 + 62.8 +#ifndef _Included_TestClass1 62.9 +#define _Included_TestClass1 62.10 +#ifdef __cplusplus 62.11 +extern "C" { 62.12 +#endif 62.13 +#undef TestClass1_bc 62.14 +#define TestClass1_bc 0L 62.15 +#undef TestClass1_sc 62.16 +#define TestClass1_sc 0L 62.17 +#undef TestClass1_ic 62.18 +#define TestClass1_ic 0L 62.19 +#undef TestClass1_lc 62.20 +#define TestClass1_lc 0LL 62.21 +#undef TestClass1_fc 62.22 +#define TestClass1_fc 0.0f 62.23 +#undef TestClass1_dc 62.24 +#define TestClass1_dc 0.0 62.25 +/* 62.26 + * Class: TestClass1 62.27 + * Method: bmn 62.28 + * Signature: ()B 62.29 + */ 62.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn 62.31 + (JNIEnv *, jobject); 62.32 + 62.33 +/* 62.34 + * Class: TestClass1 62.35 + * Method: smn 62.36 + * Signature: ()S 62.37 + */ 62.38 +JNIEXPORT jshort JNICALL Java_TestClass1_smn 62.39 + (JNIEnv *, jobject); 62.40 + 62.41 +/* 62.42 + * Class: TestClass1 62.43 + * Method: imn 62.44 + * Signature: ()I 62.45 + */ 62.46 +JNIEXPORT jint JNICALL Java_TestClass1_imn 62.47 + (JNIEnv *, jobject); 62.48 + 62.49 +/* 62.50 + * Class: TestClass1 62.51 + * Method: lmn 62.52 + * Signature: ()J 62.53 + */ 62.54 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn 62.55 + (JNIEnv *, jobject); 62.56 + 62.57 +/* 62.58 + * Class: TestClass1 62.59 + * Method: fmn 62.60 + * Signature: ()F 62.61 + */ 62.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn 62.63 + (JNIEnv *, jobject); 62.64 + 62.65 +/* 62.66 + * Class: TestClass1 62.67 + * Method: dmn 62.68 + * Signature: ()D 62.69 + */ 62.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn 62.71 + (JNIEnv *, jobject); 62.72 + 62.73 +/* 62.74 + * Class: TestClass1 62.75 + * Method: omn 62.76 + * Signature: ()Ljava/lang/Object; 62.77 + */ 62.78 +JNIEXPORT jobject JNICALL Java_TestClass1_omn 62.79 + (JNIEnv *, jobject); 62.80 + 62.81 +/* 62.82 + * Class: TestClass1 62.83 + * Method: tmn 62.84 + * Signature: ()Ljava/lang/String; 62.85 + */ 62.86 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn 62.87 + (JNIEnv *, jobject); 62.88 + 62.89 +/* 62.90 + * Class: TestClass1 62.91 + * Method: gmn 62.92 + * Signature: ()Ljava/util/List; 62.93 + */ 62.94 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn 62.95 + (JNIEnv *, jobject); 62.96 + 62.97 +/* 62.98 + * Class: TestClass1 62.99 + * Method: vmn 62.100 + * Signature: ()V 62.101 + */ 62.102 +JNIEXPORT void JNICALL Java_TestClass1_vmn 62.103 + (JNIEnv *, jobject); 62.104 + 62.105 +/* 62.106 + * Class: TestClass1 62.107 + * Method: bamn 62.108 + * Signature: ()[B 62.109 + */ 62.110 +JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn 62.111 + (JNIEnv *, jobject); 62.112 + 62.113 +/* 62.114 + * Class: TestClass1 62.115 + * Method: samn 62.116 + * Signature: ()[S 62.117 + */ 62.118 +JNIEXPORT jshortArray JNICALL Java_TestClass1_samn 62.119 + (JNIEnv *, jobject); 62.120 + 62.121 +/* 62.122 + * Class: TestClass1 62.123 + * Method: iamn 62.124 + * Signature: ()[I 62.125 + */ 62.126 +JNIEXPORT jintArray JNICALL Java_TestClass1_iamn 62.127 + (JNIEnv *, jobject); 62.128 + 62.129 +/* 62.130 + * Class: TestClass1 62.131 + * Method: lamn 62.132 + * Signature: ()[J 62.133 + */ 62.134 +JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn 62.135 + (JNIEnv *, jobject); 62.136 + 62.137 +/* 62.138 + * Class: TestClass1 62.139 + * Method: famn 62.140 + * Signature: ()[F 62.141 + */ 62.142 +JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn 62.143 + (JNIEnv *, jobject); 62.144 + 62.145 +/* 62.146 + * Class: TestClass1 62.147 + * Method: damn 62.148 + * Signature: ()[D 62.149 + */ 62.150 +JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn 62.151 + (JNIEnv *, jobject); 62.152 + 62.153 +/* 62.154 + * Class: TestClass1 62.155 + * Method: oamn 62.156 + * Signature: ()[Ljava/lang/Object; 62.157 + */ 62.158 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn 62.159 + (JNIEnv *, jobject); 62.160 + 62.161 +/* 62.162 + * Class: TestClass1 62.163 + * Method: tamn 62.164 + * Signature: ()[Ljava/lang/String; 62.165 + */ 62.166 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn 62.167 + (JNIEnv *, jobject); 62.168 + 62.169 +/* 62.170 + * Class: TestClass1 62.171 + * Method: gamn 62.172 + * Signature: ()[Ljava/util/List; 62.173 + */ 62.174 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn 62.175 + (JNIEnv *, jobject); 62.176 + 62.177 +/* 62.178 + * Class: TestClass1 62.179 + * Method: baamn 62.180 + * Signature: ()[[B 62.181 + */ 62.182 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn 62.183 + (JNIEnv *, jobject); 62.184 + 62.185 +/* 62.186 + * Class: TestClass1 62.187 + * Method: saamn 62.188 + * Signature: ()[[S 62.189 + */ 62.190 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn 62.191 + (JNIEnv *, jobject); 62.192 + 62.193 +/* 62.194 + * Class: TestClass1 62.195 + * Method: iaamn 62.196 + * Signature: ()[[I 62.197 + */ 62.198 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn 62.199 + (JNIEnv *, jobject); 62.200 + 62.201 +/* 62.202 + * Class: TestClass1 62.203 + * Method: laamn 62.204 + * Signature: ()[[J 62.205 + */ 62.206 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn 62.207 + (JNIEnv *, jobject); 62.208 + 62.209 +/* 62.210 + * Class: TestClass1 62.211 + * Method: faamn 62.212 + * Signature: ()[[F 62.213 + */ 62.214 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn 62.215 + (JNIEnv *, jobject); 62.216 + 62.217 +/* 62.218 + * Class: TestClass1 62.219 + * Method: daamn 62.220 + * Signature: ()[[D 62.221 + */ 62.222 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn 62.223 + (JNIEnv *, jobject); 62.224 + 62.225 +/* 62.226 + * Class: TestClass1 62.227 + * Method: oaamn 62.228 + * Signature: ()[[Ljava/lang/Object; 62.229 + */ 62.230 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn 62.231 + (JNIEnv *, jobject); 62.232 + 62.233 +/* 62.234 + * Class: TestClass1 62.235 + * Method: taamn 62.236 + * Signature: ()[[Ljava/lang/String; 62.237 + */ 62.238 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn 62.239 + (JNIEnv *, jobject); 62.240 + 62.241 +/* 62.242 + * Class: TestClass1 62.243 + * Method: gaamn 62.244 + * Signature: ()[Ljava/util/List; 62.245 + */ 62.246 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn 62.247 + (JNIEnv *, jobject); 62.248 + 62.249 +/* 62.250 + * Class: TestClass1 62.251 + * Method: bmn1 62.252 + * Signature: ()B 62.253 + */ 62.254 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1 62.255 + (JNIEnv *, jobject); 62.256 + 62.257 +/* 62.258 + * Class: TestClass1 62.259 + * Method: smn1 62.260 + * Signature: ()S 62.261 + */ 62.262 +JNIEXPORT jshort JNICALL Java_TestClass1_smn1 62.263 + (JNIEnv *, jobject); 62.264 + 62.265 +/* 62.266 + * Class: TestClass1 62.267 + * Method: imn1 62.268 + * Signature: ()I 62.269 + */ 62.270 +JNIEXPORT jint JNICALL Java_TestClass1_imn1 62.271 + (JNIEnv *, jobject); 62.272 + 62.273 +/* 62.274 + * Class: TestClass1 62.275 + * Method: lmn1 62.276 + * Signature: ()J 62.277 + */ 62.278 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn1 62.279 + (JNIEnv *, jobject); 62.280 + 62.281 +/* 62.282 + * Class: TestClass1 62.283 + * Method: fmn1 62.284 + * Signature: ()F 62.285 + */ 62.286 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1 62.287 + (JNIEnv *, jobject); 62.288 + 62.289 +/* 62.290 + * Class: TestClass1 62.291 + * Method: dmn1 62.292 + * Signature: ()D 62.293 + */ 62.294 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1 62.295 + (JNIEnv *, jobject); 62.296 + 62.297 +/* 62.298 + * Class: TestClass1 62.299 + * Method: omn1 62.300 + * Signature: ()Ljava/lang/Object; 62.301 + */ 62.302 +JNIEXPORT jobject JNICALL Java_TestClass1_omn1 62.303 + (JNIEnv *, jobject); 62.304 + 62.305 +/* 62.306 + * Class: TestClass1 62.307 + * Method: tmn1 62.308 + * Signature: ()Ljava/lang/String; 62.309 + */ 62.310 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn1 62.311 + (JNIEnv *, jobject); 62.312 + 62.313 +/* 62.314 + * Class: TestClass1 62.315 + * Method: gmn1 62.316 + * Signature: ()Ljava/util/List; 62.317 + */ 62.318 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn1 62.319 + (JNIEnv *, jobject); 62.320 + 62.321 +/* 62.322 + * Class: TestClass1 62.323 + * Method: vmn1 62.324 + * Signature: ()V 62.325 + */ 62.326 +JNIEXPORT void JNICALL Java_TestClass1_vmn1 62.327 + (JNIEnv *, jobject); 62.328 + 62.329 +/* 62.330 + * Class: TestClass1 62.331 + * Method: bmn2 62.332 + * Signature: (I)B 62.333 + */ 62.334 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2 62.335 + (JNIEnv *, jobject, jint); 62.336 + 62.337 +/* 62.338 + * Class: TestClass1 62.339 + * Method: smn2 62.340 + * Signature: (I)S 62.341 + */ 62.342 +JNIEXPORT jshort JNICALL Java_TestClass1_smn2 62.343 + (JNIEnv *, jobject, jint); 62.344 + 62.345 +/* 62.346 + * Class: TestClass1 62.347 + * Method: imn2 62.348 + * Signature: (I)I 62.349 + */ 62.350 +JNIEXPORT jint JNICALL Java_TestClass1_imn2 62.351 + (JNIEnv *, jobject, jint); 62.352 + 62.353 +/* 62.354 + * Class: TestClass1 62.355 + * Method: lmn2 62.356 + * Signature: (I)J 62.357 + */ 62.358 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn2 62.359 + (JNIEnv *, jobject, jint); 62.360 + 62.361 +/* 62.362 + * Class: TestClass1 62.363 + * Method: fmn2 62.364 + * Signature: (I)F 62.365 + */ 62.366 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2 62.367 + (JNIEnv *, jobject, jint); 62.368 + 62.369 +/* 62.370 + * Class: TestClass1 62.371 + * Method: dmn2 62.372 + * Signature: (I)D 62.373 + */ 62.374 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2 62.375 + (JNIEnv *, jobject, jint); 62.376 + 62.377 +/* 62.378 + * Class: TestClass1 62.379 + * Method: omn2 62.380 + * Signature: (I)Ljava/lang/Object; 62.381 + */ 62.382 +JNIEXPORT jobject JNICALL Java_TestClass1_omn2 62.383 + (JNIEnv *, jobject, jint); 62.384 + 62.385 +/* 62.386 + * Class: TestClass1 62.387 + * Method: tmn2 62.388 + * Signature: (I)Ljava/lang/String; 62.389 + */ 62.390 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn2 62.391 + (JNIEnv *, jobject, jint); 62.392 + 62.393 +/* 62.394 + * Class: TestClass1 62.395 + * Method: gmn2 62.396 + * Signature: (I)Ljava/util/List; 62.397 + */ 62.398 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn2 62.399 + (JNIEnv *, jobject, jint); 62.400 + 62.401 +/* 62.402 + * Class: TestClass1 62.403 + * Method: vmn2 62.404 + * Signature: (I)V 62.405 + */ 62.406 +JNIEXPORT void JNICALL Java_TestClass1_vmn2 62.407 + (JNIEnv *, jobject, jint); 62.408 + 62.409 +/* 62.410 + * Class: TestClass1 62.411 + * Method: mbn 62.412 + * Signature: (B)V 62.413 + */ 62.414 +JNIEXPORT void JNICALL Java_TestClass1_mbn 62.415 + (JNIEnv *, jobject, jbyte); 62.416 + 62.417 +/* 62.418 + * Class: TestClass1 62.419 + * Method: msn 62.420 + * Signature: (S)V 62.421 + */ 62.422 +JNIEXPORT void JNICALL Java_TestClass1_msn 62.423 + (JNIEnv *, jobject, jshort); 62.424 + 62.425 +/* 62.426 + * Class: TestClass1 62.427 + * Method: min 62.428 + * Signature: (I)V 62.429 + */ 62.430 +JNIEXPORT void JNICALL Java_TestClass1_min 62.431 + (JNIEnv *, jobject, jint); 62.432 + 62.433 +/* 62.434 + * Class: TestClass1 62.435 + * Method: mln 62.436 + * Signature: (J)V 62.437 + */ 62.438 +JNIEXPORT void JNICALL Java_TestClass1_mln 62.439 + (JNIEnv *, jobject, jlong); 62.440 + 62.441 +/* 62.442 + * Class: TestClass1 62.443 + * Method: mfn 62.444 + * Signature: (F)V 62.445 + */ 62.446 +JNIEXPORT void JNICALL Java_TestClass1_mfn 62.447 + (JNIEnv *, jobject, jfloat); 62.448 + 62.449 +/* 62.450 + * Class: TestClass1 62.451 + * Method: mdn 62.452 + * Signature: (D)V 62.453 + */ 62.454 +JNIEXPORT void JNICALL Java_TestClass1_mdn 62.455 + (JNIEnv *, jobject, jdouble); 62.456 + 62.457 +/* 62.458 + * Class: TestClass1 62.459 + * Method: mon 62.460 + * Signature: (Ljava/lang/Object;)V 62.461 + */ 62.462 +JNIEXPORT void JNICALL Java_TestClass1_mon 62.463 + (JNIEnv *, jobject, jobject); 62.464 + 62.465 +/* 62.466 + * Class: TestClass1 62.467 + * Method: mtn 62.468 + * Signature: (Ljava/lang/String;)V 62.469 + */ 62.470 +JNIEXPORT void JNICALL Java_TestClass1_mtn 62.471 + (JNIEnv *, jobject, jstring); 62.472 + 62.473 +/* 62.474 + * Class: TestClass1 62.475 + * Method: mgn 62.476 + * Signature: (Ljava/util/List;)V 62.477 + */ 62.478 +JNIEXPORT void JNICALL Java_TestClass1_mgn 62.479 + (JNIEnv *, jobject, jobject); 62.480 + 62.481 +#ifdef __cplusplus 62.482 +} 62.483 +#endif 62.484 +#endif 62.485 +/* Header for class TestClass1_Inner2 */ 62.486 + 62.487 +#ifndef _Included_TestClass1_Inner2 62.488 +#define _Included_TestClass1_Inner2 62.489 +#ifdef __cplusplus 62.490 +extern "C" { 62.491 +#endif 62.492 +#undef TestClass1_Inner2_bc 62.493 +#define TestClass1_Inner2_bc 0L 62.494 +#undef TestClass1_Inner2_sc 62.495 +#define TestClass1_Inner2_sc 0L 62.496 +#undef TestClass1_Inner2_ic 62.497 +#define TestClass1_Inner2_ic 0L 62.498 +#undef TestClass1_Inner2_lc 62.499 +#define TestClass1_Inner2_lc 0LL 62.500 +#undef TestClass1_Inner2_fc 62.501 +#define TestClass1_Inner2_fc 0.0f 62.502 +#undef TestClass1_Inner2_dc 62.503 +#define TestClass1_Inner2_dc 0.0 62.504 +/* 62.505 + * Class: TestClass1_Inner2 62.506 + * Method: bmn 62.507 + * Signature: ()B 62.508 + */ 62.509 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn 62.510 + (JNIEnv *, jobject); 62.511 + 62.512 +/* 62.513 + * Class: TestClass1_Inner2 62.514 + * Method: smn 62.515 + * Signature: ()S 62.516 + */ 62.517 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn 62.518 + (JNIEnv *, jobject); 62.519 + 62.520 +/* 62.521 + * Class: TestClass1_Inner2 62.522 + * Method: imn 62.523 + * Signature: ()I 62.524 + */ 62.525 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn 62.526 + (JNIEnv *, jobject); 62.527 + 62.528 +/* 62.529 + * Class: TestClass1_Inner2 62.530 + * Method: lmn 62.531 + * Signature: ()J 62.532 + */ 62.533 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn 62.534 + (JNIEnv *, jobject); 62.535 + 62.536 +/* 62.537 + * Class: TestClass1_Inner2 62.538 + * Method: fmn 62.539 + * Signature: ()F 62.540 + */ 62.541 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn 62.542 + (JNIEnv *, jobject); 62.543 + 62.544 +/* 62.545 + * Class: TestClass1_Inner2 62.546 + * Method: dmn 62.547 + * Signature: ()D 62.548 + */ 62.549 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn 62.550 + (JNIEnv *, jobject); 62.551 + 62.552 +/* 62.553 + * Class: TestClass1_Inner2 62.554 + * Method: omn 62.555 + * Signature: ()Ljava/lang/Object; 62.556 + */ 62.557 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn 62.558 + (JNIEnv *, jobject); 62.559 + 62.560 +/* 62.561 + * Class: TestClass1_Inner2 62.562 + * Method: tmn 62.563 + * Signature: ()Ljava/lang/String; 62.564 + */ 62.565 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn 62.566 + (JNIEnv *, jobject); 62.567 + 62.568 +/* 62.569 + * Class: TestClass1_Inner2 62.570 + * Method: gmn 62.571 + * Signature: ()Ljava/util/List; 62.572 + */ 62.573 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn 62.574 + (JNIEnv *, jobject); 62.575 + 62.576 +/* 62.577 + * Class: TestClass1_Inner2 62.578 + * Method: vmn 62.579 + * Signature: ()V 62.580 + */ 62.581 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn 62.582 + (JNIEnv *, jobject); 62.583 + 62.584 +/* 62.585 + * Class: TestClass1_Inner2 62.586 + * Method: bmn1 62.587 + * Signature: ()B 62.588 + */ 62.589 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1 62.590 + (JNIEnv *, jobject); 62.591 + 62.592 +/* 62.593 + * Class: TestClass1_Inner2 62.594 + * Method: smn1 62.595 + * Signature: ()S 62.596 + */ 62.597 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1 62.598 + (JNIEnv *, jobject); 62.599 + 62.600 +/* 62.601 + * Class: TestClass1_Inner2 62.602 + * Method: imn1 62.603 + * Signature: ()I 62.604 + */ 62.605 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1 62.606 + (JNIEnv *, jobject); 62.607 + 62.608 +/* 62.609 + * Class: TestClass1_Inner2 62.610 + * Method: lmn1 62.611 + * Signature: ()J 62.612 + */ 62.613 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1 62.614 + (JNIEnv *, jobject); 62.615 + 62.616 +/* 62.617 + * Class: TestClass1_Inner2 62.618 + * Method: fmn1 62.619 + * Signature: ()F 62.620 + */ 62.621 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1 62.622 + (JNIEnv *, jobject); 62.623 + 62.624 +/* 62.625 + * Class: TestClass1_Inner2 62.626 + * Method: dmn1 62.627 + * Signature: ()D 62.628 + */ 62.629 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1 62.630 + (JNIEnv *, jobject); 62.631 + 62.632 +/* 62.633 + * Class: TestClass1_Inner2 62.634 + * Method: omn1 62.635 + * Signature: ()Ljava/lang/Object; 62.636 + */ 62.637 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1 62.638 + (JNIEnv *, jobject); 62.639 + 62.640 +/* 62.641 + * Class: TestClass1_Inner2 62.642 + * Method: tmn1 62.643 + * Signature: ()Ljava/lang/String; 62.644 + */ 62.645 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1 62.646 + (JNIEnv *, jobject); 62.647 + 62.648 +/* 62.649 + * Class: TestClass1_Inner2 62.650 + * Method: gmn1 62.651 + * Signature: ()Ljava/util/List; 62.652 + */ 62.653 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1 62.654 + (JNIEnv *, jobject); 62.655 + 62.656 +/* 62.657 + * Class: TestClass1_Inner2 62.658 + * Method: vmn1 62.659 + * Signature: ()V 62.660 + */ 62.661 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1 62.662 + (JNIEnv *, jobject); 62.663 + 62.664 +/* 62.665 + * Class: TestClass1_Inner2 62.666 + * Method: bmn2 62.667 + * Signature: (I)B 62.668 + */ 62.669 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2 62.670 + (JNIEnv *, jobject, jint); 62.671 + 62.672 +/* 62.673 + * Class: TestClass1_Inner2 62.674 + * Method: smn2 62.675 + * Signature: (I)S 62.676 + */ 62.677 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2 62.678 + (JNIEnv *, jobject, jint); 62.679 + 62.680 +/* 62.681 + * Class: TestClass1_Inner2 62.682 + * Method: imn2 62.683 + * Signature: (I)I 62.684 + */ 62.685 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2 62.686 + (JNIEnv *, jobject, jint); 62.687 + 62.688 +/* 62.689 + * Class: TestClass1_Inner2 62.690 + * Method: lmn2 62.691 + * Signature: (I)J 62.692 + */ 62.693 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2 62.694 + (JNIEnv *, jobject, jint); 62.695 + 62.696 +/* 62.697 + * Class: TestClass1_Inner2 62.698 + * Method: fmn2 62.699 + * Signature: (I)F 62.700 + */ 62.701 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2 62.702 + (JNIEnv *, jobject, jint); 62.703 + 62.704 +/* 62.705 + * Class: TestClass1_Inner2 62.706 + * Method: dmn2 62.707 + * Signature: (I)D 62.708 + */ 62.709 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2 62.710 + (JNIEnv *, jobject, jint); 62.711 + 62.712 +/* 62.713 + * Class: TestClass1_Inner2 62.714 + * Method: omn2 62.715 + * Signature: (I)Ljava/lang/Object; 62.716 + */ 62.717 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2 62.718 + (JNIEnv *, jobject, jint); 62.719 + 62.720 +/* 62.721 + * Class: TestClass1_Inner2 62.722 + * Method: tmn2 62.723 + * Signature: (I)Ljava/lang/String; 62.724 + */ 62.725 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2 62.726 + (JNIEnv *, jobject, jint); 62.727 + 62.728 +/* 62.729 + * Class: TestClass1_Inner2 62.730 + * Method: gmn2 62.731 + * Signature: (I)Ljava/util/List; 62.732 + */ 62.733 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2 62.734 + (JNIEnv *, jobject, jint); 62.735 + 62.736 +/* 62.737 + * Class: TestClass1_Inner2 62.738 + * Method: vmn2 62.739 + * Signature: (I)V 62.740 + */ 62.741 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2 62.742 + (JNIEnv *, jobject, jint); 62.743 + 62.744 +/* 62.745 + * Class: TestClass1_Inner2 62.746 + * Method: mbn 62.747 + * Signature: (B)V 62.748 + */ 62.749 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn 62.750 + (JNIEnv *, jobject, jbyte); 62.751 + 62.752 +/* 62.753 + * Class: TestClass1_Inner2 62.754 + * Method: msn 62.755 + * Signature: (S)V 62.756 + */ 62.757 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn 62.758 + (JNIEnv *, jobject, jshort); 62.759 + 62.760 +/* 62.761 + * Class: TestClass1_Inner2 62.762 + * Method: min 62.763 + * Signature: (I)V 62.764 + */ 62.765 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min 62.766 + (JNIEnv *, jobject, jint); 62.767 + 62.768 +/* 62.769 + * Class: TestClass1_Inner2 62.770 + * Method: mln 62.771 + * Signature: (J)V 62.772 + */ 62.773 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln 62.774 + (JNIEnv *, jobject, jlong); 62.775 + 62.776 +/* 62.777 + * Class: TestClass1_Inner2 62.778 + * Method: mfn 62.779 + * Signature: (F)V 62.780 + */ 62.781 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn 62.782 + (JNIEnv *, jobject, jfloat); 62.783 + 62.784 +/* 62.785 + * Class: TestClass1_Inner2 62.786 + * Method: mdn 62.787 + * Signature: (D)V 62.788 + */ 62.789 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn 62.790 + (JNIEnv *, jobject, jdouble); 62.791 + 62.792 +/* 62.793 + * Class: TestClass1_Inner2 62.794 + * Method: mon 62.795 + * Signature: (Ljava/lang/Object;)V 62.796 + */ 62.797 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon 62.798 + (JNIEnv *, jobject, jobject); 62.799 + 62.800 +/* 62.801 + * Class: TestClass1_Inner2 62.802 + * Method: mtn 62.803 + * Signature: (Ljava/lang/String;)V 62.804 + */ 62.805 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn 62.806 + (JNIEnv *, jobject, jstring); 62.807 + 62.808 +/* 62.809 + * Class: TestClass1_Inner2 62.810 + * Method: mgn 62.811 + * Signature: (Ljava/util/List;)V 62.812 + */ 62.813 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mgn 62.814 + (JNIEnv *, jobject, jobject); 62.815 + 62.816 +#ifdef __cplusplus 62.817 +} 62.818 +#endif 62.819 +#endif 62.820 +/* Header for class TestClass1_Inner1 */ 62.821 + 62.822 +#ifndef _Included_TestClass1_Inner1 62.823 +#define _Included_TestClass1_Inner1 62.824 +#ifdef __cplusplus 62.825 +extern "C" { 62.826 +#endif 62.827 +#undef TestClass1_Inner1_bc 62.828 +#define TestClass1_Inner1_bc 0L 62.829 +#undef TestClass1_Inner1_sc 62.830 +#define TestClass1_Inner1_sc 0L 62.831 +#undef TestClass1_Inner1_ic 62.832 +#define TestClass1_Inner1_ic 0L 62.833 +#undef TestClass1_Inner1_lc 62.834 +#define TestClass1_Inner1_lc 0LL 62.835 +#undef TestClass1_Inner1_fc 62.836 +#define TestClass1_Inner1_fc 0.0f 62.837 +#undef TestClass1_Inner1_dc 62.838 +#define TestClass1_Inner1_dc 0.0 62.839 +/* 62.840 + * Class: TestClass1_Inner1 62.841 + * Method: bmn 62.842 + * Signature: ()B 62.843 + */ 62.844 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn 62.845 + (JNIEnv *, jobject); 62.846 + 62.847 +/* 62.848 + * Class: TestClass1_Inner1 62.849 + * Method: smn 62.850 + * Signature: ()S 62.851 + */ 62.852 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn 62.853 + (JNIEnv *, jobject); 62.854 + 62.855 +/* 62.856 + * Class: TestClass1_Inner1 62.857 + * Method: imn 62.858 + * Signature: ()I 62.859 + */ 62.860 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn 62.861 + (JNIEnv *, jobject); 62.862 + 62.863 +/* 62.864 + * Class: TestClass1_Inner1 62.865 + * Method: lmn 62.866 + * Signature: ()J 62.867 + */ 62.868 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn 62.869 + (JNIEnv *, jobject); 62.870 + 62.871 +/* 62.872 + * Class: TestClass1_Inner1 62.873 + * Method: fmn 62.874 + * Signature: ()F 62.875 + */ 62.876 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn 62.877 + (JNIEnv *, jobject); 62.878 + 62.879 +/* 62.880 + * Class: TestClass1_Inner1 62.881 + * Method: dmn 62.882 + * Signature: ()D 62.883 + */ 62.884 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn 62.885 + (JNIEnv *, jobject); 62.886 + 62.887 +/* 62.888 + * Class: TestClass1_Inner1 62.889 + * Method: omn 62.890 + * Signature: ()Ljava/lang/Object; 62.891 + */ 62.892 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn 62.893 + (JNIEnv *, jobject); 62.894 + 62.895 +/* 62.896 + * Class: TestClass1_Inner1 62.897 + * Method: tmn 62.898 + * Signature: ()Ljava/lang/String; 62.899 + */ 62.900 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn 62.901 + (JNIEnv *, jobject); 62.902 + 62.903 +/* 62.904 + * Class: TestClass1_Inner1 62.905 + * Method: gmn 62.906 + * Signature: ()Ljava/util/List; 62.907 + */ 62.908 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn 62.909 + (JNIEnv *, jobject); 62.910 + 62.911 +/* 62.912 + * Class: TestClass1_Inner1 62.913 + * Method: vmn 62.914 + * Signature: ()V 62.915 + */ 62.916 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn 62.917 + (JNIEnv *, jobject); 62.918 + 62.919 +/* 62.920 + * Class: TestClass1_Inner1 62.921 + * Method: bmn1 62.922 + * Signature: ()B 62.923 + */ 62.924 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1 62.925 + (JNIEnv *, jobject); 62.926 + 62.927 +/* 62.928 + * Class: TestClass1_Inner1 62.929 + * Method: smn1 62.930 + * Signature: ()S 62.931 + */ 62.932 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1 62.933 + (JNIEnv *, jobject); 62.934 + 62.935 +/* 62.936 + * Class: TestClass1_Inner1 62.937 + * Method: imn1 62.938 + * Signature: ()I 62.939 + */ 62.940 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1 62.941 + (JNIEnv *, jobject); 62.942 + 62.943 +/* 62.944 + * Class: TestClass1_Inner1 62.945 + * Method: lmn1 62.946 + * Signature: ()J 62.947 + */ 62.948 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1 62.949 + (JNIEnv *, jobject); 62.950 + 62.951 +/* 62.952 + * Class: TestClass1_Inner1 62.953 + * Method: fmn1 62.954 + * Signature: ()F 62.955 + */ 62.956 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1 62.957 + (JNIEnv *, jobject); 62.958 + 62.959 +/* 62.960 + * Class: TestClass1_Inner1 62.961 + * Method: dmn1 62.962 + * Signature: ()D 62.963 + */ 62.964 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1 62.965 + (JNIEnv *, jobject); 62.966 + 62.967 +/* 62.968 + * Class: TestClass1_Inner1 62.969 + * Method: omn1 62.970 + * Signature: ()Ljava/lang/Object; 62.971 + */ 62.972 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1 62.973 + (JNIEnv *, jobject); 62.974 + 62.975 +/* 62.976 + * Class: TestClass1_Inner1 62.977 + * Method: tmn1 62.978 + * Signature: ()Ljava/lang/String; 62.979 + */ 62.980 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1 62.981 + (JNIEnv *, jobject); 62.982 + 62.983 +/* 62.984 + * Class: TestClass1_Inner1 62.985 + * Method: gmn1 62.986 + * Signature: ()Ljava/util/List; 62.987 + */ 62.988 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1 62.989 + (JNIEnv *, jobject); 62.990 + 62.991 +/* 62.992 + * Class: TestClass1_Inner1 62.993 + * Method: vmn1 62.994 + * Signature: ()V 62.995 + */ 62.996 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1 62.997 + (JNIEnv *, jobject); 62.998 + 62.999 +/* 62.1000 + * Class: TestClass1_Inner1 62.1001 + * Method: bmn2 62.1002 + * Signature: (I)B 62.1003 + */ 62.1004 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2 62.1005 + (JNIEnv *, jobject, jint); 62.1006 + 62.1007 +/* 62.1008 + * Class: TestClass1_Inner1 62.1009 + * Method: smn2 62.1010 + * Signature: (I)S 62.1011 + */ 62.1012 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2 62.1013 + (JNIEnv *, jobject, jint); 62.1014 + 62.1015 +/* 62.1016 + * Class: TestClass1_Inner1 62.1017 + * Method: imn2 62.1018 + * Signature: (I)I 62.1019 + */ 62.1020 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2 62.1021 + (JNIEnv *, jobject, jint); 62.1022 + 62.1023 +/* 62.1024 + * Class: TestClass1_Inner1 62.1025 + * Method: lmn2 62.1026 + * Signature: (I)J 62.1027 + */ 62.1028 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2 62.1029 + (JNIEnv *, jobject, jint); 62.1030 + 62.1031 +/* 62.1032 + * Class: TestClass1_Inner1 62.1033 + * Method: fmn2 62.1034 + * Signature: (I)F 62.1035 + */ 62.1036 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2 62.1037 + (JNIEnv *, jobject, jint); 62.1038 + 62.1039 +/* 62.1040 + * Class: TestClass1_Inner1 62.1041 + * Method: dmn2 62.1042 + * Signature: (I)D 62.1043 + */ 62.1044 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2 62.1045 + (JNIEnv *, jobject, jint); 62.1046 + 62.1047 +/* 62.1048 + * Class: TestClass1_Inner1 62.1049 + * Method: omn2 62.1050 + * Signature: (I)Ljava/lang/Object; 62.1051 + */ 62.1052 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2 62.1053 + (JNIEnv *, jobject, jint); 62.1054 + 62.1055 +/* 62.1056 + * Class: TestClass1_Inner1 62.1057 + * Method: tmn2 62.1058 + * Signature: (I)Ljava/lang/String; 62.1059 + */ 62.1060 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2 62.1061 + (JNIEnv *, jobject, jint); 62.1062 + 62.1063 +/* 62.1064 + * Class: TestClass1_Inner1 62.1065 + * Method: gmn2 62.1066 + * Signature: (I)Ljava/util/List; 62.1067 + */ 62.1068 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2 62.1069 + (JNIEnv *, jobject, jint); 62.1070 + 62.1071 +/* 62.1072 + * Class: TestClass1_Inner1 62.1073 + * Method: vmn2 62.1074 + * Signature: (I)V 62.1075 + */ 62.1076 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2 62.1077 + (JNIEnv *, jobject, jint); 62.1078 + 62.1079 +/* 62.1080 + * Class: TestClass1_Inner1 62.1081 + * Method: mbn 62.1082 + * Signature: (B)V 62.1083 + */ 62.1084 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn 62.1085 + (JNIEnv *, jobject, jbyte); 62.1086 + 62.1087 +/* 62.1088 + * Class: TestClass1_Inner1 62.1089 + * Method: msn 62.1090 + * Signature: (S)V 62.1091 + */ 62.1092 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn 62.1093 + (JNIEnv *, jobject, jshort); 62.1094 + 62.1095 +/* 62.1096 + * Class: TestClass1_Inner1 62.1097 + * Method: min 62.1098 + * Signature: (I)V 62.1099 + */ 62.1100 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min 62.1101 + (JNIEnv *, jobject, jint); 62.1102 + 62.1103 +/* 62.1104 + * Class: TestClass1_Inner1 62.1105 + * Method: mln 62.1106 + * Signature: (J)V 62.1107 + */ 62.1108 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln 62.1109 + (JNIEnv *, jobject, jlong); 62.1110 + 62.1111 +/* 62.1112 + * Class: TestClass1_Inner1 62.1113 + * Method: mfn 62.1114 + * Signature: (F)V 62.1115 + */ 62.1116 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn 62.1117 + (JNIEnv *, jobject, jfloat); 62.1118 + 62.1119 +/* 62.1120 + * Class: TestClass1_Inner1 62.1121 + * Method: mdn 62.1122 + * Signature: (D)V 62.1123 + */ 62.1124 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn 62.1125 + (JNIEnv *, jobject, jdouble); 62.1126 + 62.1127 +/* 62.1128 + * Class: TestClass1_Inner1 62.1129 + * Method: mon 62.1130 + * Signature: (Ljava/lang/Object;)V 62.1131 + */ 62.1132 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon 62.1133 + (JNIEnv *, jobject, jobject); 62.1134 + 62.1135 +/* 62.1136 + * Class: TestClass1_Inner1 62.1137 + * Method: mtn 62.1138 + * Signature: (Ljava/lang/String;)V 62.1139 + */ 62.1140 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn 62.1141 + (JNIEnv *, jobject, jstring); 62.1142 + 62.1143 +/* 62.1144 + * Class: TestClass1_Inner1 62.1145 + * Method: mgn 62.1146 + * Signature: (Ljava/util/List;)V 62.1147 + */ 62.1148 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn 62.1149 + (JNIEnv *, jobject, jobject); 62.1150 + 62.1151 +#ifdef __cplusplus 62.1152 +} 62.1153 +#endif 62.1154 +#endif 62.1155 +/* Header for class TestClass2 */ 62.1156 + 62.1157 +#ifndef _Included_TestClass2 62.1158 +#define _Included_TestClass2 62.1159 +#ifdef __cplusplus 62.1160 +extern "C" { 62.1161 +#endif 62.1162 +#ifdef __cplusplus 62.1163 +} 62.1164 +#endif 62.1165 +#endif
63.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 63.2 +++ b/test/tools/javah/6572945/gold/jni.file.3 Wed Oct 07 14:14:45 2009 -0700 63.3 @@ -0,0 +1,79 @@ 63.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 63.5 +#include <jni.h> 63.6 +/* Header for class TestClass3 */ 63.7 + 63.8 +#ifndef _Included_TestClass3 63.9 +#define _Included_TestClass3 63.10 +#ifdef __cplusplus 63.11 +extern "C" { 63.12 +#endif 63.13 +#ifdef __cplusplus 63.14 +} 63.15 +#endif 63.16 +#endif 63.17 +/* Header for class TestClass3_Inner2 */ 63.18 + 63.19 +#ifndef _Included_TestClass3_Inner2 63.20 +#define _Included_TestClass3_Inner2 63.21 +#ifdef __cplusplus 63.22 +extern "C" { 63.23 +#endif 63.24 +#ifdef __cplusplus 63.25 +} 63.26 +#endif 63.27 +#endif 63.28 +/* Header for class TestClass3_Inner2_Inner2B */ 63.29 + 63.30 +#ifndef _Included_TestClass3_Inner2_Inner2B 63.31 +#define _Included_TestClass3_Inner2_Inner2B 63.32 +#ifdef __cplusplus 63.33 +extern "C" { 63.34 +#endif 63.35 +#ifdef __cplusplus 63.36 +} 63.37 +#endif 63.38 +#endif 63.39 +/* Header for class TestClass3_Inner2_Inner2A */ 63.40 + 63.41 +#ifndef _Included_TestClass3_Inner2_Inner2A 63.42 +#define _Included_TestClass3_Inner2_Inner2A 63.43 +#ifdef __cplusplus 63.44 +extern "C" { 63.45 +#endif 63.46 +#ifdef __cplusplus 63.47 +} 63.48 +#endif 63.49 +#endif 63.50 +/* Header for class TestClass3_Inner1 */ 63.51 + 63.52 +#ifndef _Included_TestClass3_Inner1 63.53 +#define _Included_TestClass3_Inner1 63.54 +#ifdef __cplusplus 63.55 +extern "C" { 63.56 +#endif 63.57 +#ifdef __cplusplus 63.58 +} 63.59 +#endif 63.60 +#endif 63.61 +/* Header for class TestClass3_Inner1_Inner1B */ 63.62 + 63.63 +#ifndef _Included_TestClass3_Inner1_Inner1B 63.64 +#define _Included_TestClass3_Inner1_Inner1B 63.65 +#ifdef __cplusplus 63.66 +extern "C" { 63.67 +#endif 63.68 +#ifdef __cplusplus 63.69 +} 63.70 +#endif 63.71 +#endif 63.72 +/* Header for class TestClass3_Inner1_Inner1A */ 63.73 + 63.74 +#ifndef _Included_TestClass3_Inner1_Inner1A 63.75 +#define _Included_TestClass3_Inner1_Inner1A 63.76 +#ifdef __cplusplus 63.77 +extern "C" { 63.78 +#endif 63.79 +#ifdef __cplusplus 63.80 +} 63.81 +#endif 63.82 +#endif
64.1 --- a/test/tools/javah/MissingParamClassTest.sh Fri Oct 02 11:26:53 2009 -0700 64.2 +++ b/test/tools/javah/MissingParamClassTest.sh Wed Oct 07 14:14:45 2009 -0700 64.3 @@ -77,10 +77,7 @@ 64.4 rm -f ParamClassTest.class MissingParamClassException.class ParamClassTest.h 64.5 rm -f ${TMP1} 64.6 64.7 -cp ${TESTSRC}${FS}ParamClassTest.java . 64.8 -cp ${TESTSRC}${FS}MissingParamClassException.java . 64.9 - 64.10 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" 64.11 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java" 64.12 64.13 # Before running javah remove dependent class file 64.14 rm -f MissingParamClassException.class 64.15 @@ -88,15 +85,12 @@ 64.16 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1} 64.17 64.18 if [ -f $GENERATED_HEADER_FILE ]; then 64.19 - echo "Failed" 64.20 - exit 1 64.21 + echo "1-- Failed: $GENERATED_HEADER_FILE found" 64.22 + rc=1 64.23 fi 64.24 -if [ ! -f ${TMP1} ]; then 64.25 - echo "Failed" 64.26 - exit 1 64.27 -else 64.28 - echo "Passed" 64.29 - exit 0 64.30 +if [ ! -s ${TMP1} ]; then 64.31 + echo "1-- Failed: ${TMP1} is empty" 64.32 + rc=1 64.33 fi 64.34 64.35 # Clean out work dir 64.36 @@ -104,7 +98,9 @@ 64.37 rm -f $GENERATED_HEADER_FILE $TMP1 64.38 64.39 # Re-compile everything 64.40 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}ParamClassTest.java 64.41 + 64.42 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java" 64.43 + 64.44 64.45 # Before re-run of javah remove dependent class file Param.class 64.46 rm -f Param.class 64.47 @@ -112,13 +108,17 @@ 64.48 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1} 64.49 64.50 if [ -f $GENERATED_HEADER_FILE ]; then 64.51 - echo "Failed" 64.52 - exit 1 64.53 + echo "2-- Failed: $GENERATED_HEADER_FILE found" 64.54 + rc=1 64.55 fi 64.56 -if [ ! -f ${TMP1} ]; then 64.57 - echo "Failed" 64.58 - exit 1 64.59 +if [ ! -s ${TMP1} ]; then 64.60 + echo "2-- Failed: ${TMP1} is empty" 64.61 + rc=1 64.62 +fi 64.63 + 64.64 +if [ "$rc" = "" ]; then 64.65 + echo Passed 64.66 else 64.67 - echo "Passed" 64.68 - exit 0 64.69 + echo Failed 64.70 + exit 1 64.71 fi
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 65.2 +++ b/test/tools/javah/compareTest/CompareTest.java Wed Oct 07 14:14:45 2009 -0700 65.3 @@ -0,0 +1,265 @@ 65.4 +/* 65.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 65.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 65.7 + * 65.8 + * This code is free software; you can redistribute it and/or modify it 65.9 + * under the terms of the GNU General Public License version 2 only, as 65.10 + * published by the Free Software Foundation. 65.11 + * 65.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 65.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 65.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 65.15 + * version 2 for more details (a copy is included in the LICENSE file that 65.16 + * accompanied this code). 65.17 + * 65.18 + * You should have received a copy of the GNU General Public License version 65.19 + * 2 along with this work; if not, write to the Free Software Foundation, 65.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 65.21 + * 65.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 65.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 65.24 + * have any questions. 65.25 + */ 65.26 + 65.27 +import java.io.DataInputStream; 65.28 +import java.io.File; 65.29 +import java.io.IOException; 65.30 +import java.io.InputStream; 65.31 +import java.io.PrintWriter; 65.32 +import java.io.StringWriter; 65.33 +import java.util.ArrayList; 65.34 +import java.util.Arrays; 65.35 +import java.util.Enumeration; 65.36 +import java.util.List; 65.37 +import java.util.Set; 65.38 +import java.util.TreeSet; 65.39 +import java.util.jar.JarEntry; 65.40 +import java.util.jar.JarFile; 65.41 + 65.42 +import com.sun.tools.classfile.AccessFlags; 65.43 +import com.sun.tools.classfile.ClassFile; 65.44 +import com.sun.tools.classfile.ConstantPoolException; 65.45 +import com.sun.tools.classfile.Method; 65.46 +import java.io.BufferedReader; 65.47 +import java.io.FileInputStream; 65.48 +import java.io.InputStreamReader; 65.49 +import java.util.LinkedHashSet; 65.50 + 65.51 +public class CompareTest { 65.52 + String[][] testCases = { 65.53 + { }, 65.54 + { "-jni" }, 65.55 +// { "-llni" }, 65.56 + }; 65.57 + 65.58 + public static void main(String... args) throws Exception { 65.59 + new CompareTest().run(args); 65.60 + } 65.61 + 65.62 + public void run(String... args) throws Exception { 65.63 + old_javah_cmd = new File(args[0]); 65.64 + rt_jar = new File(args[1]); 65.65 + 65.66 + Set<String> testClasses; 65.67 + if (args.length > 2) { 65.68 + testClasses = new LinkedHashSet<String>(Arrays.asList(Arrays.copyOfRange(args, 2, args.length))); 65.69 + } else 65.70 + testClasses = getNativeClasses(new JarFile(rt_jar)); 65.71 + 65.72 + for (String[] options: testCases) { 65.73 + for (String name: testClasses) { 65.74 + test(Arrays.asList(options), rt_jar, name); 65.75 + } 65.76 + } 65.77 + 65.78 + if (errors == 0) 65.79 + System.out.println(count + " tests passed"); 65.80 + else 65.81 + throw new Exception(errors + "/" + count + " tests failed"); 65.82 + } 65.83 + 65.84 + public void test(List<String> options, File bootclasspath, String className) 65.85 + throws IOException, InterruptedException { 65.86 + System.err.println("test: " + options + " " + className); 65.87 + count++; 65.88 + 65.89 + testOptions = options; 65.90 + testClassName = className; 65.91 + 65.92 + File oldOutDir = initDir(file(new File("old"), className)); 65.93 + int old_rc = old_javah(options, oldOutDir, bootclasspath, className); 65.94 + 65.95 + File newOutDir = initDir(file(new File("new"), className)); 65.96 + int new_rc = new_javah(options, newOutDir, bootclasspath, className); 65.97 + 65.98 + if (old_rc != new_rc) 65.99 + error("return codes differ; old: " + old_rc + ", new: " + new_rc); 65.100 + 65.101 + compare(oldOutDir, newOutDir); 65.102 + } 65.103 + 65.104 + int old_javah(List<String> options, File outDir, File bootclasspath, String className) 65.105 + throws IOException, InterruptedException { 65.106 + List<String> cmd = new ArrayList<String>(); 65.107 + cmd.add(old_javah_cmd.getPath()); 65.108 + cmd.addAll(options); 65.109 + cmd.add("-d"); 65.110 + cmd.add(outDir.getPath()); 65.111 + cmd.add("-bootclasspath"); 65.112 + cmd.add(bootclasspath.getPath()); 65.113 + cmd.add(className); 65.114 + System.err.println("old_javah: " + cmd); 65.115 + ProcessBuilder pb = new ProcessBuilder(cmd); 65.116 + pb.redirectErrorStream(true); 65.117 + Process p = pb.start(); 65.118 + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 65.119 + String line; 65.120 + StringBuilder sb = new StringBuilder(); 65.121 + while ((line = in.readLine()) != null) { 65.122 + sb.append(line); 65.123 + sb.append("\n"); 65.124 + } 65.125 + System.err.println("old javah out: " + sb.toString()); 65.126 + return p.waitFor(); 65.127 + } 65.128 + 65.129 + int new_javah(List<String> options, File outDir, File bootclasspath, String className) { 65.130 + List<String> args = new ArrayList<String>(); 65.131 + args.addAll(options); 65.132 + args.add("-d"); 65.133 + args.add(outDir.getPath()); 65.134 + args.add("-bootclasspath"); 65.135 + args.add(bootclasspath.getPath()); 65.136 + args.add(className); 65.137 + StringWriter sw = new StringWriter(); 65.138 + PrintWriter pw = new PrintWriter(sw); 65.139 + int rc = com.sun.tools.javah.Main.run(args.toArray(new String[args.size()]), pw); 65.140 + pw.close(); 65.141 + System.err.println("new javah out: " + sw.toString()); 65.142 + return rc; 65.143 + } 65.144 + 65.145 + Set<String> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException { 65.146 + System.err.println("getNativeClasses: " + jar.getName()); 65.147 + Set<String> results = new TreeSet<String>(); 65.148 + Enumeration<JarEntry> e = jar.entries(); 65.149 + while (e.hasMoreElements()) { 65.150 + JarEntry je = e.nextElement(); 65.151 + if (isNativeClass(jar, je)) { 65.152 + String name = je.getName(); 65.153 + results.add(name.substring(0, name.length() - 6).replace("/", ".")); 65.154 + } 65.155 + } 65.156 + return results; 65.157 + } 65.158 + 65.159 + boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException { 65.160 + String name = entry.getName(); 65.161 + if (name.startsWith("META-INF") || !name.endsWith(".class")) 65.162 + return false; 65.163 + //String className = name.substring(0, name.length() - 6).replace("/", "."); 65.164 + //System.err.println("check " + className); 65.165 + InputStream in = jar.getInputStream(entry); 65.166 + ClassFile cf = ClassFile.read(in); 65.167 + for (int i = 0; i < cf.methods.length; i++) { 65.168 + Method m = cf.methods[i]; 65.169 + if (m.access_flags.is(AccessFlags.ACC_NATIVE)) { 65.170 + // System.err.println(className); 65.171 + return true; 65.172 + } 65.173 + } 65.174 + return false; 65.175 + } 65.176 + 65.177 + void compare(File f1, File f2) throws IOException { 65.178 + if (f1.isFile() && f2.isFile()) 65.179 + compareFiles(f1, f2); 65.180 + else if (f1.isDirectory() && f2.isDirectory()) 65.181 + compareDirectories(f1, f2); 65.182 + else 65.183 + error("files differ: " 65.184 + + f1 + " (" + getFileType(f1) + "), " 65.185 + + f2 + " (" + getFileType(f2) + ")"); 65.186 + } 65.187 + 65.188 + void compareDirectories(File d1, File d2) throws IOException { 65.189 + Set<String> list = new TreeSet<String>(); 65.190 + list.addAll(Arrays.asList(d1.list())); 65.191 + list.addAll(Arrays.asList(d2.list())); 65.192 + for (String c: list) 65.193 + compare(new File(d1, c), new File(d2, c)); 65.194 + } 65.195 + 65.196 + void compareFiles(File f1, File f2) throws IOException { 65.197 + byte[] c1 = readFile(f1); 65.198 + byte[] c2 = readFile(f2); 65.199 + if (!Arrays.equals(c1, c2)) 65.200 + error("files differ: " + f1 + ", " + f2); 65.201 + } 65.202 + 65.203 + byte[] readFile(File file) throws IOException { 65.204 + int size = (int) file.length(); 65.205 + byte[] data = new byte[size]; 65.206 + DataInputStream in = new DataInputStream(new FileInputStream(file)); 65.207 + try { 65.208 + in.readFully(data); 65.209 + } finally { 65.210 + in.close(); 65.211 + } 65.212 + return data; 65.213 + } 65.214 + 65.215 + String getFileType(File f) { 65.216 + return f.isDirectory() ? "directory" 65.217 + : f.isFile() ? "file" 65.218 + : f.exists() ? "other" 65.219 + : "not found"; 65.220 + } 65.221 + 65.222 + /** 65.223 + * Set up an empty directory. 65.224 + */ 65.225 + public File initDir(File dir) { 65.226 + if (dir.exists()) 65.227 + deleteAll(dir); 65.228 + dir.mkdirs(); 65.229 + return dir; 65.230 + } 65.231 + 65.232 + /** 65.233 + * Delete a file or a directory (including all its contents). 65.234 + */ 65.235 + boolean deleteAll(File file) { 65.236 + if (file.isDirectory()) { 65.237 + for (File f: file.listFiles()) 65.238 + deleteAll(f); 65.239 + } 65.240 + return file.delete(); 65.241 + } 65.242 + 65.243 + File file(File dir, String... path) { 65.244 + File f = dir; 65.245 + for (String p: path) 65.246 + f = new File(f, p); 65.247 + return f; 65.248 + } 65.249 + 65.250 + /** 65.251 + * Report an error. 65.252 + */ 65.253 + void error(String msg, String... more) { 65.254 + System.err.println("test: " + testOptions + " " + testClassName); 65.255 + System.err.println("error: " + msg); 65.256 + for (String s: more) 65.257 + System.err.println(s); 65.258 + errors++; 65.259 + System.exit(1); 65.260 + } 65.261 + 65.262 + File old_javah_cmd; 65.263 + File rt_jar; 65.264 + List<String> testOptions; 65.265 + String testClassName; 65.266 + int count; 65.267 + int errors; 65.268 +}
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 66.2 +++ b/test/tools/javah/compareTest/CompareTest.sh Wed Oct 07 14:14:45 2009 -0700 66.3 @@ -0,0 +1,43 @@ 66.4 +#!/bin/sh 66.5 +# 66.6 +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 66.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 66.8 +# 66.9 +# This code is free software; you can redistribute it and/or modify it 66.10 +# under the terms of the GNU General Public License version 2 only, as 66.11 +# published by the Free Software Foundation. 66.12 +# 66.13 +# This code is distributed in the hope that it will be useful, but WITHOUT 66.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 66.15 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 66.16 +# version 2 for more details (a copy is included in the LICENSE file that 66.17 +# accompanied this code). 66.18 +# 66.19 +# You should have received a copy of the GNU General Public License version 66.20 +# 2 along with this work; if not, write to the Free Software Foundation, 66.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 66.22 +# 66.23 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 66.24 +# CA 95054 USA or visit www.sun.com if you need additional information or 66.25 +# have any questions. 66.26 +# 66.27 + 66.28 +jdk=${1:-/opt/jdk/1.6.0} 66.29 +javah=${jdk}/bin/javah 66.30 +rtjar=${jdk}/jre/lib/rt.jar 66.31 + 66.32 +# compile test 66.33 +mkdir -p build/compareTest 66.34 +/opt/jdk/1.7.0/bin/javac -classpath build/classes -d build/compareTest test/tools/javah/compareTest/*.java 66.35 + 66.36 +# run test 66.37 +/opt/jdk/1.7.0/bin/java -classpath build/compareTest:build/classes CompareTest $javah $rtjar 2>&1 | tee CompareTest.out 66.38 + 66.39 +# show diffs for tests that failed 66.40 +grep 'error:' CompareTest.out | sed -e 's|.*new/||' -e 's/\.h$//' -e 's|_|.|g' > CompareTest.classes.fail 66.41 + 66.42 +for i in $(cat CompareTest.classes.fail) ; do 66.43 + /opt/jdk/1.7.0/bin/java -classpath compareTest:build/classes CompareTest $javah $rtjar $i 66.44 + diff -r old new 66.45 +done 66.46 +
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 67.2 +++ b/test/tools/javah/compareTest/FindNativeFiles.java Wed Oct 07 14:14:45 2009 -0700 67.3 @@ -0,0 +1,86 @@ 67.4 +/* 67.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 67.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 67.7 + * 67.8 + * This code is free software; you can redistribute it and/or modify it 67.9 + * under the terms of the GNU General Public License version 2 only, as 67.10 + * published by the Free Software Foundation. 67.11 + * 67.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 67.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 67.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 67.15 + * version 2 for more details (a copy is included in the LICENSE file that 67.16 + * accompanied this code). 67.17 + * 67.18 + * You should have received a copy of the GNU General Public License version 67.19 + * 2 along with this work; if not, write to the Free Software Foundation, 67.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 67.21 + * 67.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 67.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 67.24 + * have any questions. 67.25 + */ 67.26 + 67.27 +import java.io.IOException; 67.28 +import java.io.InputStream; 67.29 +import java.util.Enumeration; 67.30 +import java.util.jar.JarEntry; 67.31 +import java.util.jar.JarFile; 67.32 + 67.33 +import com.sun.tools.classfile.AccessFlags; 67.34 +import com.sun.tools.classfile.ClassFile; 67.35 +import com.sun.tools.classfile.ConstantPoolException; 67.36 +import com.sun.tools.classfile.Method; 67.37 +import java.util.Comparator; 67.38 +import java.util.Set; 67.39 +import java.util.TreeSet; 67.40 + 67.41 +public class FindNativeFiles { 67.42 + public static void main(String[] args) throws IOException, ConstantPoolException { 67.43 + new FindNativeFiles().run(args); 67.44 + } 67.45 + 67.46 + public void run(String[] args) throws IOException, ConstantPoolException { 67.47 + JarFile jar = new JarFile(args[0]); 67.48 + Set<JarEntry> entries = getNativeClasses(jar); 67.49 + for (JarEntry e: entries) { 67.50 + String name = e.getName(); 67.51 + String className = name.substring(0, name.length() - 6).replace("/", "."); 67.52 + System.out.println(className); 67.53 + } 67.54 + } 67.55 + 67.56 + Set<JarEntry> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException { 67.57 + Set<JarEntry> results = new TreeSet<JarEntry>(new Comparator<JarEntry>() { 67.58 + public int compare(JarEntry o1, JarEntry o2) { 67.59 + return o1.getName().compareTo(o2.getName()); 67.60 + } 67.61 + }); 67.62 + Enumeration<JarEntry> e = jar.entries(); 67.63 + while (e.hasMoreElements()) { 67.64 + JarEntry je = e.nextElement(); 67.65 + if (isNativeClass(jar, je)) 67.66 + results.add(je); 67.67 + } 67.68 + return results; 67.69 + } 67.70 + 67.71 + boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException { 67.72 + String name = entry.getName(); 67.73 + if (name.startsWith("META-INF") || !name.endsWith(".class")) 67.74 + return false; 67.75 + //String className = name.substring(0, name.length() - 6).replace("/", "."); 67.76 + //System.err.println("check " + className); 67.77 + InputStream in = jar.getInputStream(entry); 67.78 + ClassFile cf = ClassFile.read(in); 67.79 + in.close(); 67.80 + for (int i = 0; i < cf.methods.length; i++) { 67.81 + Method m = cf.methods[i]; 67.82 + if (m.access_flags.is(AccessFlags.ACC_NATIVE)) { 67.83 + // System.err.println(className); 67.84 + return true; 67.85 + } 67.86 + } 67.87 + return false; 67.88 + } 67.89 +}
68.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 68.2 +++ b/test/tools/javah/compareTest/README Wed Oct 07 14:14:45 2009 -0700 68.3 @@ -0,0 +1,16 @@ 68.4 +test/tools/javah/compareTest/README 68.5 + 68.6 +This directory contains a program for comparing the output of new javah against the 68.7 +output of JDK 6 or other older versions of javah. 68.8 + 68.9 +It cannot be run automatically because of the need for the older version of javah 68.10 +to compare against. 68.11 + 68.12 +The test works by scanning a jar file, such as rt.jar, looking for all files with 68.13 +native methods. It then runs both the old and new versions of javah on those 68.14 +classes with native methods, and verifies that the results are character-for-character 68.15 +identical. 68.16 + 68.17 +To run the test, build langtools, then execute the script in the root langtools 68.18 +directory, providing the location of the JDK to be tested. The default is 68.19 +/opt/jdk/1.6.0.