Fri, 25 Sep 2009 22:04:43 -0700
Merge
1.1 --- a/make/build.xml Fri Sep 25 14:24:14 2009 -0700 1.2 +++ b/make/build.xml Fri Sep 25 22:04:43 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/mirror/util/SourcePositionImpl.java Fri Sep 25 14:24:14 2009 -0700 2.2 +++ b/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java Fri Sep 25 22:04:43 2009 -0700 2.3 @@ -67,15 +67,15 @@ 2.4 public String toString() { 2.5 int ln = line(); 2.6 return (ln == Position.NOPOS) 2.7 - ? sourcefile.toString() 2.8 - : sourcefile + ":" + ln; 2.9 + ? sourcefile.getName() 2.10 + : sourcefile.getName() + ":" + ln; 2.11 } 2.12 2.13 /** 2.14 * {@inheritDoc} 2.15 */ 2.16 public File file() { 2.17 - return new File(sourcefile.toString()); 2.18 + return new File(sourcefile.toUri()); 2.19 } 2.20 2.21 /**
3.1 --- a/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java Fri Sep 25 14:24:14 2009 -0700 3.2 +++ b/src/share/classes/com/sun/tools/javac/file/BaseFileObject.java Fri Sep 25 22:04:43 2009 -0700 3.3 @@ -34,6 +34,7 @@ 3.4 import java.nio.charset.CharsetDecoder; 3.5 import javax.lang.model.element.Modifier; 3.6 import javax.lang.model.element.NestingKind; 3.7 +import javax.tools.FileObject; 3.8 import javax.tools.JavaFileObject; 3.9 3.10 import static javax.tools.JavaFileObject.Kind.*; 3.11 @@ -49,33 +50,15 @@ 3.12 this.fileManager = fileManager; 3.13 } 3.14 3.15 - public JavaFileObject.Kind getKind() { 3.16 - String n = getName(); 3.17 - if (n.endsWith(CLASS.extension)) 3.18 - return CLASS; 3.19 - else if (n.endsWith(SOURCE.extension)) 3.20 - return SOURCE; 3.21 - else if (n.endsWith(HTML.extension)) 3.22 - return HTML; 3.23 - else 3.24 - return OTHER; 3.25 - } 3.26 + /** Return a short name for the object, such as for use in raw diagnostics 3.27 + */ 3.28 + public abstract String getShortName(); 3.29 3.30 @Override 3.31 public String toString() { 3.32 - return getPath(); 3.33 + return getClass().getSimpleName() + "[" + getName() + "]"; 3.34 } 3.35 3.36 - /** @deprecated see bug 6410637 */ 3.37 - @Deprecated 3.38 - public String getPath() { 3.39 - return getName(); 3.40 - } 3.41 - 3.42 - /** @deprecated see bug 6410637 */ 3.43 - @Deprecated 3.44 - abstract public String getName(); 3.45 - 3.46 public NestingKind getNestingKind() { return null; } 3.47 3.48 public Modifier getAccessLevel() { return null; } 3.49 @@ -90,6 +73,17 @@ 3.50 3.51 protected abstract String inferBinaryName(Iterable<? extends File> path); 3.52 3.53 + protected static JavaFileObject.Kind getKind(String filename) { 3.54 + if (filename.endsWith(CLASS.extension)) 3.55 + return CLASS; 3.56 + else if (filename.endsWith(SOURCE.extension)) 3.57 + return SOURCE; 3.58 + else if (filename.endsWith(HTML.extension)) 3.59 + return HTML; 3.60 + else 3.61 + return OTHER; 3.62 + } 3.63 + 3.64 protected static String removeExtension(String fileName) { 3.65 int lastDot = fileName.lastIndexOf("."); 3.66 return (lastDot == -1 ? fileName : fileName.substring(0, lastDot)); 3.67 @@ -115,6 +109,17 @@ 3.68 } 3.69 } 3.70 3.71 + /** Return the last component of a presumed hierarchical URI. 3.72 + * From the scheme specific part of the URI, it returns the substring 3.73 + * after the last "/" if any, or everything if no "/" is found. 3.74 + */ 3.75 + public static String getSimpleName(FileObject fo) { 3.76 + URI uri = fo.toUri(); 3.77 + String s = uri.getSchemeSpecificPart(); 3.78 + return s.substring(s.lastIndexOf("/") + 1); // safe when / not found 3.79 + 3.80 + } 3.81 + 3.82 /** The file manager that created this JavaFileObject. */ 3.83 protected final JavacFileManager fileManager; 3.84 }
4.1 --- a/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Sep 25 14:24:14 2009 -0700 4.2 +++ b/src/share/classes/com/sun/tools/javac/file/JavacFileManager.java Fri Sep 25 22:04:43 2009 -0700 4.3 @@ -1116,36 +1116,6 @@ 4.4 throw new IllegalArgumentException("Invalid relative path: " + file); 4.5 } 4.6 4.7 - @SuppressWarnings("deprecation") // bug 6410637 4.8 - public static String getJavacFileName(FileObject file) { 4.9 - if (file instanceof BaseFileObject) 4.10 - return ((BaseFileObject)file).getPath(); 4.11 - URI uri = file.toUri(); 4.12 - String scheme = uri.getScheme(); 4.13 - if (scheme == null || scheme.equals("file") || scheme.equals("jar")) 4.14 - return uri.getPath(); 4.15 - else 4.16 - return uri.toString(); 4.17 - } 4.18 - 4.19 - @SuppressWarnings("deprecation") // bug 6410637 4.20 - public static String getJavacBaseFileName(FileObject file) { 4.21 - if (file instanceof BaseFileObject) 4.22 - return ((BaseFileObject)file).getName(); 4.23 - URI uri = file.toUri(); 4.24 - String scheme = uri.getScheme(); 4.25 - if (scheme == null || scheme.equals("file") || scheme.equals("jar")) { 4.26 - String path = uri.getPath(); 4.27 - if (path == null) 4.28 - return null; 4.29 - if (scheme != null && scheme.equals("jar")) 4.30 - path = path.substring(path.lastIndexOf('!') + 1); 4.31 - return path.substring(path.lastIndexOf('/') + 1); 4.32 - } else { 4.33 - return uri.toString(); 4.34 - } 4.35 - } 4.36 - 4.37 private static <T> T nullCheck(T o) { 4.38 o.getClass(); // null check 4.39 return o;
5.1 --- a/src/share/classes/com/sun/tools/javac/file/Old199.java Fri Sep 25 14:24:14 2009 -0700 5.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 5.3 @@ -1,54 +0,0 @@ 5.4 -/* 5.5 - * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved. 5.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 5.7 - * 5.8 - * This code is free software; you can redistribute it and/or modify it 5.9 - * under the terms of the GNU General Public License version 2 only, as 5.10 - * published by the Free Software Foundation. Sun designates this 5.11 - * particular file as subject to the "Classpath" exception as provided 5.12 - * by Sun in the LICENSE file that accompanied this code. 5.13 - * 5.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 5.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 5.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 5.17 - * version 2 for more details (a copy is included in the LICENSE file that 5.18 - * accompanied this code). 5.19 - * 5.20 - * You should have received a copy of the GNU General Public License version 5.21 - * 2 along with this work; if not, write to the Free Software Foundation, 5.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 5.23 - * 5.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 5.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 5.26 - * have any questions. 5.27 - */ 5.28 - 5.29 -package com.sun.tools.javac.file; 5.30 - 5.31 -import javax.tools.FileObject; 5.32 - 5.33 -/** 5.34 - * Provides an easy migration to JSR 199 v3.3. The class is 5.35 - * deprecated as we should remove it as soon as possible. 5.36 - * 5.37 - * <p><b>This is NOT part of any API supported by Sun Microsystems. 5.38 - * If you write code that depends on this, you do so at your own 5.39 - * risk. This code and its internal interfaces are subject to change 5.40 - * or deletion without notice.</b></p> 5.41 - * 5.42 - * @author Peter von der Ah\u00e9 5.43 - */ 5.44 -@Deprecated 5.45 -public class Old199 { 5.46 - 5.47 - private Old199() {} 5.48 - 5.49 - public static String getPath(FileObject jfo) { 5.50 - return JavacFileManager.getJavacFileName(jfo); 5.51 - } 5.52 - 5.53 - public static String getName(FileObject jfo) { 5.54 - return JavacFileManager.getJavacBaseFileName(jfo); 5.55 - } 5.56 - 5.57 -}
6.1 --- a/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Fri Sep 25 14:24:14 2009 -0700 6.2 +++ b/src/share/classes/com/sun/tools/javac/file/RegularFileObject.java Fri Sep 25 22:04:43 2009 -0700 6.3 @@ -68,98 +68,38 @@ 6.4 this.f = f; 6.5 } 6.6 6.7 + @Override 6.8 + public URI toUri() { 6.9 + return f.toURI().normalize(); 6.10 + } 6.11 + 6.12 + @Override 6.13 + public String getName() { 6.14 + return f.getPath(); 6.15 + } 6.16 + 6.17 + @Override 6.18 + public String getShortName() { 6.19 + return name; 6.20 + } 6.21 + 6.22 + @Override 6.23 + public JavaFileObject.Kind getKind() { 6.24 + return getKind(name); 6.25 + } 6.26 + 6.27 + @Override 6.28 public InputStream openInputStream() throws IOException { 6.29 return new FileInputStream(f); 6.30 } 6.31 6.32 @Override 6.33 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 6.34 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 6.35 - } 6.36 - 6.37 public OutputStream openOutputStream() throws IOException { 6.38 ensureParentDirectoriesExist(); 6.39 return new FileOutputStream(f); 6.40 } 6.41 6.42 - public Writer openWriter() throws IOException { 6.43 - ensureParentDirectoriesExist(); 6.44 - return new OutputStreamWriter(new FileOutputStream(f), fileManager.getEncodingName()); 6.45 - } 6.46 - 6.47 @Override 6.48 - protected String inferBinaryName(Iterable<? extends File> path) { 6.49 - String fPath = f.getPath(); 6.50 - //System.err.println("RegularFileObject " + file + " " +r.getPath()); 6.51 - for (File dir: path) { 6.52 - //System.err.println("dir: " + dir); 6.53 - String dPath = dir.getPath(); 6.54 - if (dPath.length() == 0) 6.55 - dPath = System.getProperty("user.dir"); 6.56 - if (!dPath.endsWith(File.separator)) 6.57 - dPath += File.separator; 6.58 - if (fPath.regionMatches(true, 0, dPath, 0, dPath.length()) 6.59 - && new File(fPath.substring(0, dPath.length())).equals(new File(dPath))) { 6.60 - String relativeName = fPath.substring(dPath.length()); 6.61 - return removeExtension(relativeName).replace(File.separatorChar, '.'); 6.62 - } 6.63 - } 6.64 - return null; 6.65 - } 6.66 - 6.67 - private void ensureParentDirectoriesExist() throws IOException { 6.68 - if (!hasParents) { 6.69 - File parent = f.getParentFile(); 6.70 - if (parent != null && !parent.exists()) { 6.71 - if (!parent.mkdirs()) { 6.72 - if (!parent.exists() || !parent.isDirectory()) { 6.73 - throw new IOException("could not create parent directories"); 6.74 - } 6.75 - } 6.76 - } 6.77 - hasParents = true; 6.78 - } 6.79 - } 6.80 - 6.81 - @Deprecated 6.82 - public String getName() { 6.83 - return name; 6.84 - } 6.85 - 6.86 - public boolean isNameCompatible(String cn, JavaFileObject.Kind kind) { 6.87 - cn.getClass(); 6.88 - // null check 6.89 - if (kind == Kind.OTHER && getKind() != kind) { 6.90 - return false; 6.91 - } 6.92 - String n = cn + kind.extension; 6.93 - if (name.equals(n)) { 6.94 - return true; 6.95 - } 6.96 - if (name.equalsIgnoreCase(n)) { 6.97 - try { 6.98 - // allow for Windows 6.99 - return f.getCanonicalFile().getName().equals(n); 6.100 - } catch (IOException e) { 6.101 - } 6.102 - } 6.103 - return false; 6.104 - } 6.105 - 6.106 - @Deprecated 6.107 - @Override 6.108 - public String getPath() { 6.109 - return f.getPath(); 6.110 - } 6.111 - 6.112 - public long getLastModified() { 6.113 - return f.lastModified(); 6.114 - } 6.115 - 6.116 - public boolean delete() { 6.117 - return f.delete(); 6.118 - } 6.119 - 6.120 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 6.121 CharBuffer cb = fileManager.getCachedContent(this); 6.122 if (cb == null) { 6.123 @@ -184,6 +124,82 @@ 6.124 } 6.125 6.126 @Override 6.127 + public Writer openWriter() throws IOException { 6.128 + ensureParentDirectoriesExist(); 6.129 + return new OutputStreamWriter(new FileOutputStream(f), fileManager.getEncodingName()); 6.130 + } 6.131 + 6.132 + @Override 6.133 + public long getLastModified() { 6.134 + return f.lastModified(); 6.135 + } 6.136 + 6.137 + @Override 6.138 + public boolean delete() { 6.139 + return f.delete(); 6.140 + } 6.141 + 6.142 + @Override 6.143 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 6.144 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 6.145 + } 6.146 + 6.147 + @Override 6.148 + protected String inferBinaryName(Iterable<? extends File> path) { 6.149 + String fPath = f.getPath(); 6.150 + //System.err.println("RegularFileObject " + file + " " +r.getPath()); 6.151 + for (File dir: path) { 6.152 + //System.err.println("dir: " + dir); 6.153 + String dPath = dir.getPath(); 6.154 + if (dPath.length() == 0) 6.155 + dPath = System.getProperty("user.dir"); 6.156 + if (!dPath.endsWith(File.separator)) 6.157 + dPath += File.separator; 6.158 + if (fPath.regionMatches(true, 0, dPath, 0, dPath.length()) 6.159 + && new File(fPath.substring(0, dPath.length())).equals(new File(dPath))) { 6.160 + String relativeName = fPath.substring(dPath.length()); 6.161 + return removeExtension(relativeName).replace(File.separatorChar, '.'); 6.162 + } 6.163 + } 6.164 + return null; 6.165 + } 6.166 + 6.167 + @Override 6.168 + public boolean isNameCompatible(String cn, JavaFileObject.Kind kind) { 6.169 + cn.getClass(); 6.170 + // null check 6.171 + if (kind == Kind.OTHER && getKind() != kind) { 6.172 + return false; 6.173 + } 6.174 + String n = cn + kind.extension; 6.175 + if (name.equals(n)) { 6.176 + return true; 6.177 + } 6.178 + if (name.equalsIgnoreCase(n)) { 6.179 + try { 6.180 + // allow for Windows 6.181 + return f.getCanonicalFile().getName().equals(n); 6.182 + } catch (IOException e) { 6.183 + } 6.184 + } 6.185 + return false; 6.186 + } 6.187 + 6.188 + private void ensureParentDirectoriesExist() throws IOException { 6.189 + if (!hasParents) { 6.190 + File parent = f.getParentFile(); 6.191 + if (parent != null && !parent.exists()) { 6.192 + if (!parent.mkdirs()) { 6.193 + if (!parent.exists() || !parent.isDirectory()) { 6.194 + throw new IOException("could not create parent directories"); 6.195 + } 6.196 + } 6.197 + } 6.198 + hasParents = true; 6.199 + } 6.200 + } 6.201 + 6.202 + @Override 6.203 public boolean equals(Object other) { 6.204 if (!(other instanceof RegularFileObject)) { 6.205 return false; 6.206 @@ -200,8 +216,4 @@ 6.207 public int hashCode() { 6.208 return f.hashCode(); 6.209 } 6.210 - 6.211 - public URI toUri() { 6.212 - return f.toURI().normalize(); 6.213 - } 6.214 }
7.1 --- a/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java Fri Sep 25 14:24:14 2009 -0700 7.2 +++ b/src/share/classes/com/sun/tools/javac/file/SymbolArchive.java Fri Sep 25 22:04:43 2009 -0700 7.3 @@ -95,7 +95,7 @@ 7.4 7.5 @Override 7.6 protected String inferBinaryName(Iterable<? extends File> path) { 7.7 - String entryName = getZipEntryName(); 7.8 + String entryName = entry.getName(); 7.9 String prefix = ((SymbolArchive) zarch).prefix.path; 7.10 if (entryName.startsWith(prefix)) 7.11 entryName = entryName.substring(prefix.length());
8.1 --- a/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Fri Sep 25 14:24:14 2009 -0700 8.2 +++ b/src/share/classes/com/sun/tools/javac/file/ZipArchive.java Fri Sep 25 22:04:43 2009 -0700 8.3 @@ -147,51 +147,37 @@ 8.4 this.entry = entry; 8.5 } 8.6 8.7 + public URI toUri() { 8.8 + File zipFile = new File(zarch.zdir.getName()); 8.9 + return createJarUri(zipFile, entry.getName()); 8.10 + } 8.11 + 8.12 + @Override 8.13 + public String getName() { 8.14 + return zarch.zdir.getName() + "(" + entry.getName() + ")"; 8.15 + } 8.16 + 8.17 + @Override 8.18 + public String getShortName() { 8.19 + return new File(zarch.zdir.getName()).getName() + "(" + entry + ")"; 8.20 + } 8.21 + 8.22 + @Override 8.23 + public JavaFileObject.Kind getKind() { 8.24 + return getKind(entry.getName()); 8.25 + } 8.26 + 8.27 + @Override 8.28 public InputStream openInputStream() throws IOException { 8.29 return zarch.zdir.getInputStream(entry); 8.30 } 8.31 8.32 + @Override 8.33 public OutputStream openOutputStream() throws IOException { 8.34 throw new UnsupportedOperationException(); 8.35 } 8.36 8.37 @Override 8.38 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 8.39 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 8.40 - } 8.41 - 8.42 - public Writer openWriter() throws IOException { 8.43 - throw new UnsupportedOperationException(); 8.44 - } 8.45 - 8.46 - @Deprecated 8.47 - public String getName() { 8.48 - return name; 8.49 - } 8.50 - 8.51 - public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 8.52 - cn.getClass(); 8.53 - // null check 8.54 - if (k == Kind.OTHER && getKind() != k) { 8.55 - return false; 8.56 - } 8.57 - return name.equals(cn + k.extension); 8.58 - } 8.59 - 8.60 - @Deprecated 8.61 - @Override 8.62 - public String getPath() { 8.63 - return zarch.zdir.getName() + "(" + entry + ")"; 8.64 - } 8.65 - 8.66 - public long getLastModified() { 8.67 - return entry.getTime(); 8.68 - } 8.69 - 8.70 - public boolean delete() { 8.71 - throw new UnsupportedOperationException(); 8.72 - } 8.73 - 8.74 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 8.75 CharBuffer cb = fileManager.getCachedContent(this); 8.76 if (cb == null) { 8.77 @@ -216,6 +202,42 @@ 8.78 } 8.79 8.80 @Override 8.81 + public Writer openWriter() throws IOException { 8.82 + throw new UnsupportedOperationException(); 8.83 + } 8.84 + 8.85 + @Override 8.86 + public long getLastModified() { 8.87 + return entry.getTime(); 8.88 + } 8.89 + 8.90 + @Override 8.91 + public boolean delete() { 8.92 + throw new UnsupportedOperationException(); 8.93 + } 8.94 + 8.95 + @Override 8.96 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 8.97 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 8.98 + } 8.99 + 8.100 + @Override 8.101 + protected String inferBinaryName(Iterable<? extends File> path) { 8.102 + String entryName = entry.getName(); 8.103 + return removeExtension(entryName).replace('/', '.'); 8.104 + } 8.105 + 8.106 + @Override 8.107 + public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 8.108 + cn.getClass(); 8.109 + // null check 8.110 + if (k == Kind.OTHER && getKind() != k) { 8.111 + return false; 8.112 + } 8.113 + return name.equals(cn + k.extension); 8.114 + } 8.115 + 8.116 + @Override 8.117 public boolean equals(Object other) { 8.118 if (!(other instanceof ZipFileObject)) { 8.119 return false; 8.120 @@ -228,25 +250,6 @@ 8.121 public int hashCode() { 8.122 return zarch.zdir.hashCode() + name.hashCode(); 8.123 } 8.124 - 8.125 - public String getZipName() { 8.126 - return zarch.zdir.getName(); 8.127 - } 8.128 - 8.129 - public String getZipEntryName() { 8.130 - return entry.getName(); 8.131 - } 8.132 - 8.133 - public URI toUri() { 8.134 - File zipFile = new File(getZipName()); 8.135 - return createJarUri(zipFile, entry.getName()); 8.136 - } 8.137 - 8.138 - @Override 8.139 - protected String inferBinaryName(Iterable<? extends File> path) { 8.140 - String entryName = getZipEntryName(); 8.141 - return removeExtension(entryName).replace('/', '.'); 8.142 - } 8.143 } 8.144 8.145 }
9.1 --- a/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Fri Sep 25 14:24:14 2009 -0700 9.2 +++ b/src/share/classes/com/sun/tools/javac/file/ZipFileIndexArchive.java Fri Sep 25 22:04:43 2009 -0700 9.3 @@ -123,88 +123,41 @@ 9.4 this.zipName = zipFileName; 9.5 } 9.6 9.7 + @Override 9.8 + public URI toUri() { 9.9 + return createJarUri(zipName, getPrefixedEntryName()); 9.10 + } 9.11 + 9.12 + @Override 9.13 + public String getName() { 9.14 + return zipName + "(" + getPrefixedEntryName() + ")"; 9.15 + } 9.16 + 9.17 + @Override 9.18 + public String getShortName() { 9.19 + return zipName.getName() + "(" + entry.getName() + ")"; 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 - 9.30 if (inputStream == null) { 9.31 - inputStream = new ByteArrayInputStream(read()); 9.32 + assert entry != null; // see constructor 9.33 + inputStream = new ByteArrayInputStream(zfIndex.read(entry)); 9.34 } 9.35 return inputStream; 9.36 } 9.37 9.38 @Override 9.39 - protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 9.40 - return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 9.41 - } 9.42 - 9.43 public OutputStream openOutputStream() throws IOException { 9.44 throw new UnsupportedOperationException(); 9.45 } 9.46 9.47 - public Writer openWriter() throws IOException { 9.48 - throw new UnsupportedOperationException(); 9.49 - } 9.50 - 9.51 - /** @deprecated see bug 6410637 */ 9.52 - @Deprecated 9.53 - public String getName() { 9.54 - return name; 9.55 - } 9.56 - 9.57 - public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 9.58 - cn.getClass(); // null check 9.59 - if (k == Kind.OTHER && getKind() != k) 9.60 - return false; 9.61 - return name.equals(cn + k.extension); 9.62 - } 9.63 - 9.64 - /** @deprecated see bug 6410637 */ 9.65 - @Deprecated 9.66 @Override 9.67 - public String getPath() { 9.68 - return zipName + "(" + entry.getName() + ")"; 9.69 - } 9.70 - 9.71 - public long getLastModified() { 9.72 - return entry.getLastModified(); 9.73 - } 9.74 - 9.75 - public boolean delete() { 9.76 - throw new UnsupportedOperationException(); 9.77 - } 9.78 - 9.79 - @Override 9.80 - public boolean equals(Object other) { 9.81 - if (!(other instanceof ZipFileIndexFileObject)) 9.82 - return false; 9.83 - ZipFileIndexFileObject o = (ZipFileIndexFileObject) other; 9.84 - return entry.equals(o.entry); 9.85 - } 9.86 - 9.87 - @Override 9.88 - public int hashCode() { 9.89 - return zipName.hashCode() + (name.hashCode() << 10); 9.90 - } 9.91 - 9.92 - public String getZipName() { 9.93 - return zipName.getPath(); 9.94 - } 9.95 - 9.96 - public String getZipEntryName() { 9.97 - return entry.getName(); 9.98 - } 9.99 - 9.100 - public URI toUri() { 9.101 - if (zfIndex.symbolFilePrefix != null) 9.102 - return createJarUri(zipName, zfIndex.symbolFilePrefix.path + entry.getName()); 9.103 - else 9.104 - return createJarUri(zipName, entry.getName()); 9.105 - } 9.106 - 9.107 - private byte[] read() throws IOException { 9.108 - assert entry != null; // see constructor 9.109 - return zfIndex.read(entry); 9.110 - } 9.111 - 9.112 public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException { 9.113 CharBuffer cb = fileManager.getCachedContent(this); 9.114 if (cb == null) { 9.115 @@ -228,8 +181,28 @@ 9.116 } 9.117 9.118 @Override 9.119 + public Writer openWriter() throws IOException { 9.120 + throw new UnsupportedOperationException(); 9.121 + } 9.122 + 9.123 + @Override 9.124 + public long getLastModified() { 9.125 + return entry.getLastModified(); 9.126 + } 9.127 + 9.128 + @Override 9.129 + public boolean delete() { 9.130 + throw new UnsupportedOperationException(); 9.131 + } 9.132 + 9.133 + @Override 9.134 + protected CharsetDecoder getDecoder(boolean ignoreEncodingErrors) { 9.135 + return fileManager.getDecoder(fileManager.getEncodingName(), ignoreEncodingErrors); 9.136 + } 9.137 + 9.138 + @Override 9.139 protected String inferBinaryName(Iterable<? extends File> path) { 9.140 - String entryName = getZipEntryName(); 9.141 + String entryName = entry.getName(); 9.142 if (zfIndex.symbolFilePrefix != null) { 9.143 String prefix = zfIndex.symbolFilePrefix.path; 9.144 if (entryName.startsWith(prefix)) 9.145 @@ -237,6 +210,34 @@ 9.146 } 9.147 return removeExtension(entryName).replace('/', '.'); 9.148 } 9.149 + 9.150 + @Override 9.151 + public boolean isNameCompatible(String cn, JavaFileObject.Kind k) { 9.152 + cn.getClass(); // null check 9.153 + if (k == Kind.OTHER && getKind() != k) 9.154 + return false; 9.155 + return name.equals(cn + k.extension); 9.156 + } 9.157 + 9.158 + @Override 9.159 + public boolean equals(Object other) { 9.160 + if (!(other instanceof ZipFileIndexFileObject)) 9.161 + return false; 9.162 + ZipFileIndexFileObject o = (ZipFileIndexFileObject) other; 9.163 + return entry.equals(o.entry); 9.164 + } 9.165 + 9.166 + @Override 9.167 + public int hashCode() { 9.168 + return zipName.hashCode() + (name.hashCode() << 10); 9.169 + } 9.170 + 9.171 + private String getPrefixedEntryName() { 9.172 + if (zfIndex.symbolFilePrefix != null) 9.173 + return zfIndex.symbolFilePrefix.path + entry.getName(); 9.174 + else 9.175 + return entry.getName(); 9.176 + } 9.177 } 9.178 9.179 }
10.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri Sep 25 14:24:14 2009 -0700 10.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java Fri Sep 25 22:04:43 2009 -0700 10.3 @@ -2563,38 +2563,73 @@ 10.4 this.flatname = flatname; 10.5 } 10.6 10.7 + @Override 10.8 + public URI toUri() { 10.9 + try { 10.10 + return new URI(null, name.toString(), null); 10.11 + } catch (URISyntaxException e) { 10.12 + throw new CannotCreateUriError(name.toString(), e); 10.13 + } 10.14 + } 10.15 + 10.16 + @Override 10.17 + public String getName() { 10.18 + return name.toString(); 10.19 + } 10.20 + 10.21 + @Override 10.22 + public String getShortName() { 10.23 + return getName(); 10.24 + } 10.25 + 10.26 + @Override 10.27 + public JavaFileObject.Kind getKind() { 10.28 + return getKind(getName()); 10.29 + } 10.30 + 10.31 + @Override 10.32 public InputStream openInputStream() { 10.33 throw new UnsupportedOperationException(); 10.34 } 10.35 10.36 + @Override 10.37 public OutputStream openOutputStream() { 10.38 throw new UnsupportedOperationException(); 10.39 } 10.40 10.41 - public Reader openReader() { 10.42 + @Override 10.43 + public CharBuffer getCharContent(boolean ignoreEncodingErrors) { 10.44 throw new UnsupportedOperationException(); 10.45 } 10.46 10.47 + @Override 10.48 + public Reader openReader(boolean ignoreEncodingErrors) { 10.49 + throw new UnsupportedOperationException(); 10.50 + } 10.51 + 10.52 + @Override 10.53 public Writer openWriter() { 10.54 throw new UnsupportedOperationException(); 10.55 } 10.56 10.57 - /** @deprecated see bug 6410637 */ 10.58 - @Deprecated 10.59 - public String getName() { 10.60 - return name.toString(); 10.61 - } 10.62 - 10.63 + @Override 10.64 public long getLastModified() { 10.65 throw new UnsupportedOperationException(); 10.66 } 10.67 10.68 + @Override 10.69 public boolean delete() { 10.70 throw new UnsupportedOperationException(); 10.71 } 10.72 10.73 - public CharBuffer getCharContent(boolean ignoreEncodingErrors) { 10.74 - throw new UnsupportedOperationException(); 10.75 + @Override 10.76 + protected String inferBinaryName(Iterable<? extends File> path) { 10.77 + return flatname.toString(); 10.78 + } 10.79 + 10.80 + @Override 10.81 + public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) { 10.82 + return true; // fail-safe mode 10.83 } 10.84 10.85 @Override 10.86 @@ -2609,27 +2644,5 @@ 10.87 public int hashCode() { 10.88 return name.hashCode(); 10.89 } 10.90 - 10.91 - public boolean isNameCompatible(String simpleName, JavaFileObject.Kind kind) { 10.92 - return true; // fail-safe mode 10.93 - } 10.94 - 10.95 - public URI toUri() { 10.96 - try { 10.97 - return new URI(null, name.toString(), null); 10.98 - } catch (URISyntaxException e) { 10.99 - throw new CannotCreateUriError(name.toString(), e); 10.100 - } 10.101 - } 10.102 - 10.103 - @Override 10.104 - public Reader openReader(boolean ignoreEncodingErrors) throws IOException { 10.105 - throw new UnsupportedOperationException(); 10.106 - } 10.107 - 10.108 - @Override 10.109 - protected String inferBinaryName(Iterable<? extends File> path) { 10.110 - return flatname.toString(); 10.111 - } 10.112 } 10.113 }
11.1 --- a/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Fri Sep 25 14:24:14 2009 -0700 11.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java Fri Sep 25 22:04:43 2009 -0700 11.3 @@ -36,6 +36,7 @@ 11.4 import com.sun.tools.javac.code.*; 11.5 import com.sun.tools.javac.code.Symbol.*; 11.6 import com.sun.tools.javac.code.Type.*; 11.7 +import com.sun.tools.javac.file.BaseFileObject; 11.8 import com.sun.tools.javac.util.*; 11.9 11.10 import static com.sun.tools.javac.code.BoundKind.*; 11.11 @@ -1685,13 +1686,8 @@ 11.12 // the last possible moment because the sourcefile may be used 11.13 // elsewhere in error diagnostics. Fixes 4241573. 11.14 //databuf.appendChar(c.pool.put(c.sourcefile)); 11.15 - String filename = c.sourcefile.toString(); 11.16 - int sepIdx = filename.lastIndexOf(File.separatorChar); 11.17 - // Allow '/' as separator on all platforms, e.g., on Win32. 11.18 - int slashIdx = filename.lastIndexOf('/'); 11.19 - if (slashIdx > sepIdx) sepIdx = slashIdx; 11.20 - if (sepIdx >= 0) filename = filename.substring(sepIdx + 1); 11.21 - databuf.appendChar(c.pool.put(names.fromString(filename))); 11.22 + String simpleName = BaseFileObject.getSimpleName(c.sourcefile); 11.23 + databuf.appendChar(c.pool.put(names.fromString(simpleName))); 11.24 endAttr(alenIdx); 11.25 acount++; 11.26 }
12.1 --- a/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Sep 25 14:24:14 2009 -0700 12.2 +++ b/src/share/classes/com/sun/tools/javac/parser/JavacParser.java Fri Sep 25 22:04:43 2009 -0700 12.3 @@ -2236,7 +2236,7 @@ 12.4 12.5 /* AnnotationValue = ConditionalExpression 12.6 * | Annotation 12.7 - * | "{" [ AnnotationValue { "," AnnotationValue } ] "}" 12.8 + * | "{" [ AnnotationValue { "," AnnotationValue } ] [","] "}" 12.9 */ 12.10 JCExpression annotationValue() { 12.11 int pos; 12.12 @@ -2253,7 +2253,7 @@ 12.13 buf.append(annotationValue()); 12.14 while (S.token() == COMMA) { 12.15 S.nextToken(); 12.16 - if (S.token() == RPAREN) break; 12.17 + if (S.token() == RBRACE) break; 12.18 buf.append(annotationValue()); 12.19 } 12.20 }
13.1 --- a/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Fri Sep 25 14:24:14 2009 -0700 13.2 +++ b/src/share/classes/com/sun/tools/javac/util/AbstractDiagnosticFormatter.java Fri Sep 25 22:04:43 2009 -0700 13.3 @@ -42,8 +42,8 @@ 13.4 import com.sun.tools.javac.code.Symbol; 13.5 import com.sun.tools.javac.code.Type; 13.6 import com.sun.tools.javac.code.Type.CapturedType; 13.7 -import com.sun.tools.javac.file.JavacFileManager; 13.8 13.9 +import com.sun.tools.javac.file.BaseFileObject; 13.10 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*; 13.11 13.12 /** 13.13 @@ -133,8 +133,15 @@ 13.14 } 13.15 13.16 public String formatSource(JCDiagnostic d, boolean fullname, Locale l) { 13.17 - assert (d.getSource() != null); 13.18 - return fullname ? d.getSourceName() : d.getSource().getName(); 13.19 + JavaFileObject fo = d.getSource(); 13.20 + if (fo == null) 13.21 + throw new IllegalArgumentException(); // d should have source set 13.22 + if (fullname) 13.23 + return fo.getName(); 13.24 + else if (fo instanceof BaseFileObject) 13.25 + return ((BaseFileObject) fo).getShortName(); 13.26 + else 13.27 + return BaseFileObject.getSimpleName(fo); 13.28 } 13.29 13.30 /** 13.31 @@ -182,7 +189,7 @@ 13.32 return printer.visit((Symbol)arg, l); 13.33 } 13.34 else if (arg instanceof JavaFileObject) { 13.35 - return JavacFileManager.getJavacBaseFileName((JavaFileObject)arg); 13.36 + return ((JavaFileObject)arg).getName(); 13.37 } 13.38 else if (arg instanceof Formattable) { 13.39 return ((Formattable)arg).toString(l, messages);
14.1 --- a/src/share/classes/com/sun/tools/javac/util/Constants.java Fri Sep 25 14:24:14 2009 -0700 14.2 +++ b/src/share/classes/com/sun/tools/javac/util/Constants.java Fri Sep 25 22:04:43 2009 -0700 14.3 @@ -83,16 +83,28 @@ 14.4 */ 14.5 public static String format(Object value) { 14.6 if (value instanceof Byte) return formatByte((Byte) value); 14.7 + if (value instanceof Short) return formatShort((Short) value); 14.8 if (value instanceof Long) return formatLong((Long) value); 14.9 if (value instanceof Float) return formatFloat((Float) value); 14.10 if (value instanceof Double) return formatDouble((Double) value); 14.11 if (value instanceof Character) return formatChar((Character) value); 14.12 if (value instanceof String) return formatString((String) value); 14.13 - return value + ""; 14.14 + if (value instanceof Integer || 14.15 + value instanceof Boolean) return value.toString(); 14.16 + else 14.17 + throw new IllegalArgumentException("Argument is not a primitive type or a string; it " + 14.18 + ((value == null) ? 14.19 + "is a null value." : 14.20 + "has class " + 14.21 + value.getClass().getName()) + "." ); 14.22 } 14.23 14.24 private static String formatByte(byte b) { 14.25 - return String.format("0x%02x", b); 14.26 + return String.format("(byte)0x%02x", b); 14.27 + } 14.28 + 14.29 + private static String formatShort(short s) { 14.30 + return String.format("(short)%d", s); 14.31 } 14.32 14.33 private static String formatLong(long lng) {
15.1 --- a/src/share/classes/com/sun/tools/javac/util/Convert.java Fri Sep 25 14:24:14 2009 -0700 15.2 +++ b/src/share/classes/com/sun/tools/javac/util/Convert.java Fri Sep 25 22:04:43 2009 -0700 15.3 @@ -239,9 +239,9 @@ 15.4 case '\"': return "\\\""; 15.5 case '\\': return "\\\\"; 15.6 default: 15.7 - return (ch > 127 || isPrintableAscii(ch)) 15.8 + return (isPrintableAscii(ch)) 15.9 ? String.valueOf(ch) 15.10 - : String.format("\\%03o", (int) ch); 15.11 + : String.format("\\u%04x", (int) ch); 15.12 } 15.13 } 15.14
16.1 --- a/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java Fri Sep 25 14:24:14 2009 -0700 16.2 +++ b/src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java Fri Sep 25 22:04:43 2009 -0700 16.3 @@ -69,10 +69,6 @@ 16.4 return fileObject; 16.5 } 16.6 16.7 - public CharSequence getName() { 16.8 - return JavacFileManager.getJavacBaseFileName(fileObject); 16.9 - } 16.10 - 16.11 /** Return the one-based line number associated with a given pos 16.12 * for the current source file. Zero is returned if no line exists 16.13 * for the given position.
17.1 --- a/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Fri Sep 25 14:24:14 2009 -0700 17.2 +++ b/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java Fri Sep 25 22:04:43 2009 -0700 17.3 @@ -32,7 +32,6 @@ 17.4 import javax.tools.JavaFileObject; 17.5 17.6 import com.sun.tools.javac.api.DiagnosticFormatter; 17.7 -import com.sun.tools.javac.file.JavacFileManager; 17.8 import com.sun.tools.javac.tree.JCTree; 17.9 17.10 import static com.sun.tools.javac.util.JCDiagnostic.DiagnosticType.*; 17.11 @@ -354,15 +353,6 @@ 17.12 } 17.13 17.14 /** 17.15 - * Get the name of the source file referred to by this diagnostic. 17.16 - * @return the name of the source referred to with this diagnostic, or null if none 17.17 - */ 17.18 - public String getSourceName() { 17.19 - JavaFileObject s = getSource(); 17.20 - return s == null ? null : JavacFileManager.getJavacFileName(s); 17.21 - } 17.22 - 17.23 - /** 17.24 * Get the source referred to by this diagnostic. 17.25 * @return the source referred to with this diagnostic, or null if none 17.26 */ 17.27 @@ -437,6 +427,7 @@ 17.28 /** 17.29 * Return the standard presentation of this diagnostic. 17.30 */ 17.31 + @Override 17.32 public String toString() { 17.33 return defaultFormatter.format(this,Locale.getDefault()); 17.34 }
18.1 --- a/src/share/classes/com/sun/tools/javac/util/Log.java Fri Sep 25 14:24:14 2009 -0700 18.2 +++ b/src/share/classes/com/sun/tools/javac/util/Log.java Fri Sep 25 22:04:43 2009 -0700 18.3 @@ -33,7 +33,6 @@ 18.4 import javax.tools.DiagnosticListener; 18.5 import javax.tools.JavaFileObject; 18.6 18.7 -import com.sun.tools.javac.file.JavacFileManager; 18.8 import com.sun.tools.javac.tree.JCTree; 18.9 import com.sun.tools.javac.api.DiagnosticFormatter; 18.10 import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition; 18.11 @@ -428,7 +427,7 @@ 18.12 JavaFileObject file = source.getFile(); 18.13 if (file != null) 18.14 printLines(errWriter, 18.15 - JavacFileManager.getJavacFileName(file) + ":" + 18.16 + file.getName() + ":" + 18.17 line + ": " + msg); 18.18 printErrLine(pos, errWriter); 18.19 }
19.1 --- a/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Fri Sep 25 14:24:14 2009 -0700 19.2 +++ b/src/share/classes/com/sun/tools/javac/util/RawDiagnosticFormatter.java Fri Sep 25 22:04:43 2009 -0700 19.3 @@ -30,6 +30,7 @@ 19.4 19.5 import com.sun.tools.javac.api.DiagnosticFormatter.Configuration.*; 19.6 import com.sun.tools.javac.api.Formattable; 19.7 +import com.sun.tools.javac.file.BaseFileObject; 19.8 import com.sun.tools.javac.util.AbstractDiagnosticFormatter.SimpleConfiguration; 19.9 19.10 import static com.sun.tools.javac.api.DiagnosticFormatter.PositionKind.*; 19.11 @@ -109,6 +110,8 @@ 19.12 String s; 19.13 if (arg instanceof Formattable) 19.14 s = arg.toString(); 19.15 + else if (arg instanceof BaseFileObject) 19.16 + s = ((BaseFileObject) arg).getShortName(); 19.17 else 19.18 s = super.formatArgument(diag, arg, null); 19.19 if (arg instanceof JCDiagnostic)
20.1 --- a/src/share/classes/com/sun/tools/javadoc/SourcePositionImpl.java Fri Sep 25 14:24:14 2009 -0700 20.2 +++ b/src/share/classes/com/sun/tools/javadoc/SourcePositionImpl.java Fri Sep 25 22:04:43 2009 -0700 20.3 @@ -95,7 +95,7 @@ 20.4 public String toString() { 20.5 // Backwards compatibility hack. ZipFileObjects use the format 20.6 // zipfile(zipentry) but javadoc has been using zipfile/zipentry 20.7 - String fn = filename.toString(); 20.8 + String fn = filename.getName(); 20.9 if (fn.endsWith(")")) { 20.10 int paren = fn.lastIndexOf("("); 20.11 if (paren != -1)
21.1 --- a/src/share/classes/com/sun/tools/javah/Gen.java Fri Sep 25 14:24:14 2009 -0700 21.2 +++ b/src/share/classes/com/sun/tools/javah/Gen.java Fri Sep 25 22:04:43 2009 -0700 21.3 @@ -27,15 +27,32 @@ 21.4 21.5 import java.io.UnsupportedEncodingException; 21.6 import java.io.ByteArrayOutputStream; 21.7 +import java.io.FileNotFoundException; 21.8 import java.io.IOException; 21.9 +import java.io.InputStream; 21.10 import java.io.OutputStream; 21.11 +import java.io.OutputStreamWriter; 21.12 import java.io.PrintWriter; 21.13 -import com.sun.javadoc.*; 21.14 -import java.io.*; 21.15 +import java.util.ArrayList; 21.16 +import java.util.Arrays; 21.17 +import java.util.List; 21.18 +import java.util.Set; 21.19 import java.util.Stack; 21.20 -import java.util.Vector; 21.21 -import java.util.Arrays; 21.22 21.23 +import javax.annotation.processing.ProcessingEnvironment; 21.24 + 21.25 +import javax.lang.model.element.ExecutableElement; 21.26 +import javax.lang.model.element.Modifier; 21.27 +import javax.lang.model.element.TypeElement; 21.28 +import javax.lang.model.element.VariableElement; 21.29 +import javax.lang.model.util.ElementFilter; 21.30 +import javax.lang.model.util.Elements; 21.31 +import javax.lang.model.util.Types; 21.32 + 21.33 +import javax.tools.FileObject; 21.34 +import javax.tools.JavaFileManager; 21.35 +import javax.tools.JavaFileObject; 21.36 +import javax.tools.StandardLocation; 21.37 21.38 /** 21.39 * An abstraction for generating support files required by native methods. 21.40 @@ -43,31 +60,39 @@ 21.41 * original writing, this interface is rich enough to support JNI and the 21.42 * old 1.0-style native method interface. 21.43 * 21.44 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 21.45 + * If you write code that depends on this, you do so at your own 21.46 + * risk. This code and its internal interfaces are subject to change 21.47 + * or deletion without notice.</b></p> 21.48 + * 21.49 * @author Sucheta Dambalkar(Revised) 21.50 */ 21.51 - 21.52 - 21.53 public abstract class Gen { 21.54 protected String lineSep = System.getProperty("line.separator"); 21.55 21.56 - RootDoc root; 21.57 + protected ProcessingEnvironment processingEnvironment; 21.58 + protected Types types; 21.59 + protected Elements elems; 21.60 + protected Mangle mangler; 21.61 + protected Util util; 21.62 + 21.63 + protected Gen(Util util) { 21.64 + this.util = util; 21.65 + } 21.66 + 21.67 /* 21.68 * List of classes for which we must generate output. 21.69 */ 21.70 - protected ClassDoc[] classes; 21.71 + protected Set<TypeElement> classes; 21.72 static private final boolean isWindows = 21.73 System.getProperty("os.name").startsWith("Windows"); 21.74 21.75 - public Gen(RootDoc root){ 21.76 - this.root = root; 21.77 - } 21.78 21.79 /** 21.80 * Override this abstract method, generating content for the named 21.81 * class into the outputstream. 21.82 */ 21.83 - protected abstract void write(OutputStream o, ClassDoc clazz) 21.84 - throws ClassNotFoundException; 21.85 + protected abstract void write(OutputStream o, TypeElement clazz) throws Util.Exit; 21.86 21.87 /** 21.88 * Override this method to provide a list of #include statements 21.89 @@ -78,31 +103,29 @@ 21.90 /* 21.91 * Output location. 21.92 */ 21.93 - protected String outDir; 21.94 - protected String outFile; 21.95 + protected JavaFileManager fileManager; 21.96 + protected JavaFileObject outFile; 21.97 21.98 - public void setOutDir(String outDir) { 21.99 - /* Check important, otherwise concatenation of two null strings 21.100 - * produces the "nullnull" String. 21.101 - */ 21.102 - if (outDir != null) { 21.103 - this.outDir = outDir + System.getProperty("file.separator"); 21.104 - File d = new File(outDir); 21.105 - if (!d.exists()) 21.106 - if (!d.mkdirs()) 21.107 - Util.error("cant.create.dir", d.toString()); 21.108 - } 21.109 + public void setFileManager(JavaFileManager fm) { 21.110 + fileManager = fm; 21.111 } 21.112 21.113 - public void setOutFile(String outFile) { 21.114 + public void setOutFile(JavaFileObject outFile) { 21.115 this.outFile = outFile; 21.116 } 21.117 21.118 21.119 - public void setClasses(ClassDoc[] classes) { 21.120 + public void setClasses(Set<TypeElement> classes) { 21.121 this.classes = classes; 21.122 } 21.123 21.124 + void setProcessingEnvironment(ProcessingEnvironment pEnv) { 21.125 + processingEnvironment = pEnv; 21.126 + elems = pEnv.getElementUtils(); 21.127 + types = pEnv.getTypeUtils(); 21.128 + mangler = new Mangle(elems, types); 21.129 + } 21.130 + 21.131 /* 21.132 * Smartness with generated files. 21.133 */ 21.134 @@ -116,12 +139,11 @@ 21.135 * We explicitly need to write ASCII files because that is what C 21.136 * compilers understand. 21.137 */ 21.138 - protected PrintWriter wrapWriter(OutputStream o) { 21.139 + protected PrintWriter wrapWriter(OutputStream o) throws Util.Exit { 21.140 try { 21.141 - return new 21.142 - PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true); 21.143 + return new PrintWriter(new OutputStreamWriter(o, "ISO8859_1"), true); 21.144 } catch (UnsupportedEncodingException use) { 21.145 - Util.bug("encoding.iso8859_1.not.found"); 21.146 + util.bug("encoding.iso8859_1.not.found"); 21.147 return null; /* dead code */ 21.148 } 21.149 } 21.150 @@ -133,26 +155,25 @@ 21.151 * Buffer size chosen as an approximation from a single sampling of: 21.152 * expr `du -sk` / `ls *.h | wc -l` 21.153 */ 21.154 - public void run() throws IOException, ClassNotFoundException { 21.155 + public void run() throws IOException, ClassNotFoundException, Util.Exit { 21.156 int i = 0; 21.157 if (outFile != null) { 21.158 /* Everything goes to one big file... */ 21.159 ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); 21.160 writeFileTop(bout); /* only once */ 21.161 21.162 - for (i = 0; i < classes.length; i++) { 21.163 - write(bout, classes[i]); 21.164 + for (TypeElement t: classes) { 21.165 + write(bout, t); 21.166 } 21.167 21.168 writeIfChanged(bout.toByteArray(), outFile); 21.169 } else { 21.170 /* Each class goes to its own file... */ 21.171 - for (i = 0; i < classes.length; i++) { 21.172 + for (TypeElement t: classes) { 21.173 ByteArrayOutputStream bout = new ByteArrayOutputStream(8192); 21.174 writeFileTop(bout); 21.175 - ClassDoc clazz = classes[i]; 21.176 - write(bout, clazz); 21.177 - writeIfChanged(bout.toByteArray(), getFileName(clazz.qualifiedName())); 21.178 + write(bout, t); 21.179 + writeIfChanged(bout.toByteArray(), getFileObject(t.getQualifiedName())); 21.180 } 21.181 } 21.182 } 21.183 @@ -162,8 +183,7 @@ 21.184 * is done if either the file doesn't exist or if the contents are 21.185 * different. 21.186 */ 21.187 - private void writeIfChanged(byte[] b, String file) throws IOException { 21.188 - File f = new File(file); 21.189 + private void writeIfChanged(byte[] b, FileObject file) throws IOException { 21.190 boolean mustWrite = false; 21.191 String event = "[No need to update file "; 21.192 21.193 @@ -171,71 +191,80 @@ 21.194 mustWrite = true; 21.195 event = "[Forcefully writing file "; 21.196 } else { 21.197 - if (!f.exists()) { 21.198 + InputStream in; 21.199 + byte[] a; 21.200 + try { 21.201 + // regrettably, there's no API to get the length in bytes 21.202 + // for a FileObject, so we can't short-circuit reading the 21.203 + // file here 21.204 + in = file.openInputStream(); 21.205 + a = readBytes(in); 21.206 + if (!Arrays.equals(a, b)) { 21.207 + mustWrite = true; 21.208 + event = "[Overwriting file "; 21.209 + 21.210 + } 21.211 + } catch (FileNotFoundException e) { 21.212 mustWrite = true; 21.213 event = "[Creating file "; 21.214 - } else { 21.215 - int l = (int)f.length(); 21.216 - if (b.length != l) { 21.217 - mustWrite = true; 21.218 - event = "[Overwriting file "; 21.219 - } else { 21.220 - /* Lengths are equal, so read it. */ 21.221 - byte[] a = new byte[l]; 21.222 - FileInputStream in = new FileInputStream(f); 21.223 - if (in.read(a) != l) { 21.224 - in.close(); 21.225 - /* This can't happen, we already checked the length. */ 21.226 - Util.error("not.enough.bytes", Integer.toString(l), 21.227 - f.toString()); 21.228 - } 21.229 - in.close(); 21.230 - while (--l >= 0) { 21.231 - if (a[l] != b[l]) { 21.232 - mustWrite = true; 21.233 - event = "[Overwriting file "; 21.234 - } 21.235 - } 21.236 - } 21.237 } 21.238 } 21.239 - if (Util.verbose) 21.240 - Util.log(event + file + "]"); 21.241 + 21.242 + if (util.verbose) 21.243 + util.log(event + file + "]"); 21.244 + 21.245 if (mustWrite) { 21.246 - OutputStream out = new FileOutputStream(file); 21.247 + OutputStream out = file.openOutputStream(); 21.248 out.write(b); /* No buffering, just one big write! */ 21.249 out.close(); 21.250 } 21.251 } 21.252 21.253 - protected String defineForStatic(ClassDoc c, FieldDoc f){ 21.254 + protected byte[] readBytes(InputStream in) throws IOException { 21.255 + try { 21.256 + byte[] array = new byte[in.available() + 1]; 21.257 + int offset = 0; 21.258 + int n; 21.259 + while ((n = in.read(array, offset, array.length - offset)) != -1) { 21.260 + offset += n; 21.261 + if (offset == array.length) 21.262 + array = Arrays.copyOf(array, array.length * 2); 21.263 + } 21.264 21.265 - String cnamedoc = c.qualifiedName(); 21.266 - String fnamedoc = f.name(); 21.267 + return Arrays.copyOf(array, offset); 21.268 + } finally { 21.269 + in.close(); 21.270 + } 21.271 + } 21.272 21.273 - String cname = Mangle.mangle(cnamedoc, Mangle.Type.CLASS); 21.274 - String fname = Mangle.mangle(fnamedoc, Mangle.Type.FIELDSTUB); 21.275 + protected String defineForStatic(TypeElement c, VariableElement f) 21.276 + throws Util.Exit { 21.277 + CharSequence cnamedoc = c.getQualifiedName(); 21.278 + CharSequence fnamedoc = f.getSimpleName(); 21.279 21.280 - if (!f.isStatic()) 21.281 - Util.bug("tried.to.define.non.static"); 21.282 + String cname = mangler.mangle(cnamedoc, Mangle.Type.CLASS); 21.283 + String fname = mangler.mangle(fnamedoc, Mangle.Type.FIELDSTUB); 21.284 21.285 - if (f.isFinal()) { 21.286 + if (!f.getModifiers().contains(Modifier.STATIC)) 21.287 + util.bug("tried.to.define.non.static"); 21.288 + 21.289 + if (f.getModifiers().contains(Modifier.FINAL)) { 21.290 Object value = null; 21.291 21.292 - value = f.constantValue(); 21.293 + value = f.getConstantValue(); 21.294 21.295 if (value != null) { /* so it is a ConstantExpression */ 21.296 String constString = null; 21.297 if ((value instanceof Integer) 21.298 || (value instanceof Byte) 21.299 - || (value instanceof Character) 21.300 - || (value instanceof Short) 21.301 - || (value instanceof Boolean)) { 21.302 - /* covers byte, boolean, char, short, int */ 21.303 - if(value instanceof Boolean) 21.304 - constString = (value.toString() == "true") ? "1L" : "0L"; 21.305 - else 21.306 - constString = value.toString() + "L"; 21.307 + || (value instanceof Short)) { 21.308 + /* covers byte, short, int */ 21.309 + constString = value.toString() + "L"; 21.310 + } else if (value instanceof Boolean) { 21.311 + constString = ((Boolean) value) ? "1L" : "0L"; 21.312 + } else if (value instanceof Character) { 21.313 + Character ch = (Character) value; 21.314 + constString = String.valueOf(((int) ch) & 0xffff) + "L"; 21.315 } else if (value instanceof Long) { 21.316 // Visual C++ supports the i64 suffix, not LL. 21.317 if (isWindows) 21.318 @@ -294,24 +323,19 @@ 21.319 /* 21.320 * File name and file preamble related operations. 21.321 */ 21.322 - protected void writeFileTop(OutputStream o) { 21.323 + protected void writeFileTop(OutputStream o) throws Util.Exit { 21.324 PrintWriter pw = wrapWriter(o); 21.325 pw.println("/* DO NOT EDIT THIS FILE - it is machine generated */" + lineSep + 21.326 getIncludes()); 21.327 } 21.328 21.329 - protected String baseFileName(String clazz) { 21.330 - StringBuffer f = 21.331 - new StringBuffer(Mangle.mangle(clazz, 21.332 - Mangle.Type.CLASS)); 21.333 - if (outDir != null) { 21.334 - f.insert(0, outDir); 21.335 - } 21.336 - return f.toString(); 21.337 + protected String baseFileName(CharSequence className) { 21.338 + return mangler.mangle(className, Mangle.Type.CLASS); 21.339 } 21.340 21.341 - protected String getFileName(String clazz) { 21.342 - return baseFileName(clazz) + getFileSuffix(); 21.343 + protected FileObject getFileObject(CharSequence className) throws IOException { 21.344 + String name = baseFileName(className) + getFileSuffix(); 21.345 + return fileManager.getFileForOutput(StandardLocation.SOURCE_OUTPUT, "", name, null); 21.346 } 21.347 21.348 protected String getFileSuffix() { 21.349 @@ -322,26 +346,39 @@ 21.350 * Including super classes' fields. 21.351 */ 21.352 21.353 - FieldDoc[] getAllFields(ClassDoc subclazz) 21.354 - throws ClassNotFoundException { 21.355 - Vector<FieldDoc> fields = new Vector<FieldDoc>(); 21.356 - ClassDoc cd = null; 21.357 - Stack<Object> s = new Stack<Object>(); 21.358 + List<VariableElement> getAllFields(TypeElement subclazz) { 21.359 + List<VariableElement> fields = new ArrayList<VariableElement>(); 21.360 + TypeElement cd = null; 21.361 + Stack<TypeElement> s = new Stack<TypeElement>(); 21.362 21.363 cd = subclazz; 21.364 while (true) { 21.365 s.push(cd); 21.366 - ClassDoc c = cd.superclass(); 21.367 + TypeElement c = (TypeElement) (types.asElement(cd.getSuperclass())); 21.368 if (c == null) 21.369 break; 21.370 cd = c; 21.371 } 21.372 21.373 while (!s.empty()) { 21.374 - cd = (ClassDoc)s.pop(); 21.375 - fields.addAll(Arrays.asList(cd.fields())); 21.376 + cd = s.pop(); 21.377 + fields.addAll(ElementFilter.fieldsIn(cd.getEnclosedElements())); 21.378 } 21.379 21.380 - return fields.toArray(new FieldDoc[fields.size()]); 21.381 + return fields; 21.382 + } 21.383 + 21.384 + // c.f. MethodDoc.signature 21.385 + String signature(ExecutableElement e) { 21.386 + StringBuffer sb = new StringBuffer("("); 21.387 + String sep = ""; 21.388 + for (VariableElement p: e.getParameters()) { 21.389 + sb.append(sep); 21.390 + sb.append(types.erasure(p.asType()).toString()); 21.391 + sep = ","; 21.392 + } 21.393 + sb.append(")"); 21.394 + return sb.toString(); 21.395 } 21.396 } 21.397 +
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 22.2 +++ b/src/share/classes/com/sun/tools/javah/InternalError.java Fri Sep 25 22:04:43 2009 -0700 22.3 @@ -0,0 +1,40 @@ 22.4 +/* 22.5 + * Copyright 2007-2008 Sun Microsystems, Inc. All Rights Reserved. 22.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 22.7 + * 22.8 + * This code is free software; you can redistribute it and/or modify it 22.9 + * under the terms of the GNU General Public License version 2 only, as 22.10 + * published by the Free Software Foundation. Sun designates this 22.11 + * particular file as subject to the "Classpath" exception as provided 22.12 + * by Sun in the LICENSE file that accompanied this code. 22.13 + * 22.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 22.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 22.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 22.17 + * version 2 for more details (a copy is included in the LICENSE file that 22.18 + * accompanied this code). 22.19 + * 22.20 + * You should have received a copy of the GNU General Public License version 22.21 + * 2 along with this work; if not, write to the Free Software Foundation, 22.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 22.23 + * 22.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 22.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 22.26 + * have any questions. 22.27 + */ 22.28 + 22.29 +package com.sun.tools.javah; 22.30 + 22.31 +/** 22.32 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 22.33 + * you write code that depends on this, you do so at your own risk. 22.34 + * This code and its internal interfaces are subject to change or 22.35 + * deletion without notice.</b> 22.36 + */ 22.37 +public class InternalError extends Error { 22.38 + private static final long serialVersionUID = 8411861562497165022L; 22.39 + InternalError(String msg, Throwable cause) { 22.40 + super("Internal error: " + msg); 22.41 + initCause(cause); 22.42 + } 22.43 +}
23.1 --- a/src/share/classes/com/sun/tools/javah/JNI.java Fri Sep 25 14:24:14 2009 -0700 23.2 +++ b/src/share/classes/com/sun/tools/javah/JNI.java Fri Sep 25 22:04:43 2009 -0700 23.3 @@ -1,5 +1,5 @@ 23.4 /* 23.5 - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. 23.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 23.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 23.8 * 23.9 * This code is free software; you can redistribute it and/or modify it 23.10 @@ -27,95 +27,98 @@ 23.11 23.12 import java.io.OutputStream; 23.13 import java.io.PrintWriter; 23.14 -import java.util.Vector; 23.15 -import java.util.Enumeration; 23.16 -import com.sun.javadoc.*; 23.17 +import java.util.ArrayList; 23.18 +import java.util.List; 23.19 +import javax.lang.model.element.Element; 23.20 +import javax.lang.model.element.ExecutableElement; 23.21 +import javax.lang.model.element.Modifier; 23.22 +import javax.lang.model.element.TypeElement; 23.23 +import javax.lang.model.element.VariableElement; 23.24 +import javax.lang.model.type.ArrayType; 23.25 +import javax.lang.model.type.TypeMirror; 23.26 +import javax.lang.model.util.ElementFilter; 23.27 23.28 23.29 /** 23.30 * Header file generator for JNI. 23.31 * 23.32 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 23.33 + * If you write code that depends on this, you do so at your own 23.34 + * risk. This code and its internal interfaces are subject to change 23.35 + * or deletion without notice.</b></p> 23.36 + * 23.37 * @author Sucheta Dambalkar(Revised) 23.38 */ 23.39 - 23.40 public class JNI extends Gen { 23.41 - 23.42 - public JNI(RootDoc root){ 23.43 - super(root); 23.44 + JNI(Util util) { 23.45 + super(util); 23.46 } 23.47 23.48 public String getIncludes() { 23.49 return "#include <jni.h>"; 23.50 } 23.51 23.52 - public void write(OutputStream o, ClassDoc clazz) 23.53 - throws ClassNotFoundException { 23.54 - 23.55 - String cname = Mangle.mangle(clazz.qualifiedName(), Mangle.Type.CLASS); 23.56 + public void write(OutputStream o, TypeElement clazz) throws Util.Exit { 23.57 + String cname = mangler.mangle(clazz.getQualifiedName(), Mangle.Type.CLASS); 23.58 PrintWriter pw = wrapWriter(o); 23.59 pw.println(guardBegin(cname)); 23.60 pw.println(cppGuardBegin()); 23.61 23.62 /* Write statics. */ 23.63 - FieldDoc[] classfields = getAllFields(clazz); 23.64 + List<VariableElement> classfields = getAllFields(clazz); 23.65 23.66 - for (int i = 0; i < classfields.length; i++) { 23.67 - if (!classfields[i].isStatic()) 23.68 + for (VariableElement v: classfields) { 23.69 + if (!v.getModifiers().contains(Modifier.STATIC)) 23.70 continue; 23.71 String s = null; 23.72 - s = defineForStatic(clazz, classfields[i]); 23.73 + s = defineForStatic(clazz, v); 23.74 if (s != null) { 23.75 pw.println(s); 23.76 } 23.77 } 23.78 23.79 /* Write methods. */ 23.80 - MethodDoc[] classmethods = clazz.methods(); 23.81 - for (int i = 0; i < classmethods.length; i++) { 23.82 - if(classmethods[i].isNative()){ 23.83 - MethodDoc md = classmethods[i]; 23.84 - Type mtr = classmethods[i].returnType(); 23.85 - String sig = md.signature(); 23.86 - TypeSignature newtypesig = new TypeSignature(root); 23.87 - String methodName = md.name(); 23.88 + List<ExecutableElement> classmethods = ElementFilter.methodsIn(clazz.getEnclosedElements()); 23.89 + for (ExecutableElement md: classmethods) { 23.90 + if(md.getModifiers().contains(Modifier.NATIVE)){ 23.91 + TypeMirror mtr = types.erasure(md.getReturnType()); 23.92 + String sig = signature(md); 23.93 + TypeSignature newtypesig = new TypeSignature(elems); 23.94 + CharSequence methodName = md.getSimpleName(); 23.95 boolean longName = false; 23.96 - for (int j = 0; j < classmethods.length; j++) { 23.97 - if ((classmethods[j] != md) 23.98 - && (methodName.equals(classmethods[j].name())) 23.99 - && (classmethods[j].isNative())) 23.100 + for (ExecutableElement md2: classmethods) { 23.101 + if ((md2 != md) 23.102 + && (methodName.equals(md2.getSimpleName())) 23.103 + && (md2.getModifiers().contains(Modifier.NATIVE))) 23.104 longName = true; 23.105 23.106 } 23.107 pw.println("/*"); 23.108 pw.println(" * Class: " + cname); 23.109 pw.println(" * Method: " + 23.110 - Mangle.mangle(methodName, Mangle.Type.FIELDSTUB)); 23.111 + mangler.mangle(methodName, Mangle.Type.FIELDSTUB)); 23.112 pw.println(" * Signature: " + newtypesig.getTypeSignature(sig, mtr)); 23.113 pw.println(" */"); 23.114 pw.println("JNIEXPORT " + jniType(mtr) + 23.115 " JNICALL " + 23.116 - Mangle.mangleMethod(md, root,clazz, 23.117 + mangler.mangleMethod(md, clazz, 23.118 (longName) ? 23.119 Mangle.Type.METHOD_JNI_LONG : 23.120 Mangle.Type.METHOD_JNI_SHORT)); 23.121 pw.print(" (JNIEnv *, "); 23.122 - Parameter[] paramargs = md.parameters(); 23.123 - Type []args =new Type[ paramargs.length]; 23.124 - for(int p = 0; p < paramargs.length; p++){ 23.125 - args[p] = paramargs[p].type(); 23.126 + List<? extends VariableElement> paramargs = md.getParameters(); 23.127 + List<TypeMirror> args = new ArrayList<TypeMirror>(); 23.128 + for (VariableElement p: paramargs) { 23.129 + args.add(types.erasure(p.asType())); 23.130 } 23.131 - if (md.isStatic()) 23.132 + if (md.getModifiers().contains(Modifier.STATIC)) 23.133 pw.print("jclass"); 23.134 else 23.135 pw.print("jobject"); 23.136 - if (args.length > 0) 23.137 + 23.138 + for (TypeMirror arg: args) { 23.139 pw.print(", "); 23.140 - 23.141 - for (int j = 0; j < args.length; j++) { 23.142 - pw.print(jniType(args[j])); 23.143 - if (j != (args.length - 1)) { 23.144 - pw.print(", "); 23.145 - } 23.146 + pw.print(jniType(arg)); 23.147 } 23.148 pw.println(");" + lineSep); 23.149 } 23.150 @@ -125,42 +128,54 @@ 23.151 } 23.152 23.153 23.154 - protected final String jniType(Type t){ 23.155 + protected final String jniType(TypeMirror t) throws Util.Exit { 23.156 + TypeElement throwable = elems.getTypeElement("java.lang.Throwable"); 23.157 + TypeElement jClass = elems.getTypeElement("java.lang.Class"); 23.158 + TypeElement jString = elems.getTypeElement("java.lang.String"); 23.159 + Element tclassDoc = types.asElement(t); 23.160 23.161 - String elmT = t.typeName(); 23.162 - ClassDoc throwable = root.classNamed("java.lang.Throwable"); 23.163 - ClassDoc jClass = root.classNamed("java.lang.Class"); 23.164 - ClassDoc tclassDoc = t.asClassDoc(); 23.165 23.166 - if((t.dimension()).indexOf("[]") != -1){ 23.167 - if((t.dimension().indexOf("[][]") != -1) 23.168 - || (tclassDoc != null)) return "jobjectArray"; 23.169 - else if(elmT.equals("boolean"))return "jbooleanArray"; 23.170 - else if(elmT.equals("byte"))return "jbyteArray"; 23.171 - else if(elmT.equals("char"))return "jcharArray"; 23.172 - else if(elmT.equals("short"))return "jshortArray"; 23.173 - else if(elmT.equals("int"))return "jintArray"; 23.174 - else if(elmT.equals("long"))return "jlongArray"; 23.175 - else if(elmT.equals("float"))return "jfloatArray"; 23.176 - else if(elmT.equals("double"))return "jdoubleArray"; 23.177 - }else{ 23.178 - if(elmT.equals("void"))return "void"; 23.179 - else if(elmT.equals("String"))return "jstring"; 23.180 - else if(elmT.equals("boolean"))return "jboolean"; 23.181 - else if(elmT.equals("byte"))return "jbyte"; 23.182 - else if(elmT.equals("char"))return "jchar"; 23.183 - else if(elmT.equals("short"))return "jshort"; 23.184 - else if(elmT.equals("int"))return "jint"; 23.185 - else if(elmT.equals("long"))return "jlong"; 23.186 - else if(elmT.equals("float"))return "jfloat"; 23.187 - else if(elmT.equals("double"))return "jdouble"; 23.188 - else if(tclassDoc != null){ 23.189 - if(tclassDoc.subclassOf(throwable)) return "jthrowable"; 23.190 - else if(tclassDoc.subclassOf(jClass)) return "jclass"; 23.191 - else return "jobject"; 23.192 + switch (t.getKind()) { 23.193 + case ARRAY: { 23.194 + TypeMirror ct = ((ArrayType) t).getComponentType(); 23.195 + switch (ct.getKind()) { 23.196 + case BOOLEAN: return "jbooleanArray"; 23.197 + case BYTE: return "jbyteArray"; 23.198 + case CHAR: return "jcharArray"; 23.199 + case SHORT: return "jshortArray"; 23.200 + case INT: return "jintArray"; 23.201 + case LONG: return "jlongArray"; 23.202 + case FLOAT: return "jfloatArray"; 23.203 + case DOUBLE: return "jdoubleArray"; 23.204 + case ARRAY: 23.205 + case DECLARED: return "jobjectArray"; 23.206 + default: throw new Error(ct.toString()); 23.207 + } 23.208 + } 23.209 + 23.210 + case VOID: return "void"; 23.211 + case BOOLEAN: return "jboolean"; 23.212 + case BYTE: return "jbyte"; 23.213 + case CHAR: return "jchar"; 23.214 + case SHORT: return "jshort"; 23.215 + case INT: return "jint"; 23.216 + case LONG: return "jlong"; 23.217 + case FLOAT: return "jfloat"; 23.218 + case DOUBLE: return "jdouble"; 23.219 + 23.220 + case DECLARED: { 23.221 + if (tclassDoc.equals(jString)) 23.222 + return "jstring"; 23.223 + else if (types.isAssignable(t, throwable.asType())) 23.224 + return "jthrowable"; 23.225 + else if (types.isAssignable(t, jClass.asType())) 23.226 + return "jclass"; 23.227 + else 23.228 + return "jobject"; 23.229 } 23.230 } 23.231 - Util.bug("jni.unknown.type"); 23.232 + 23.233 + util.bug("jni.unknown.type"); 23.234 return null; /* dead code. */ 23.235 } 23.236 }
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 24.2 +++ b/src/share/classes/com/sun/tools/javah/JavahFileManager.java Fri Sep 25 22:04:43 2009 -0700 24.3 @@ -0,0 +1,63 @@ 24.4 +/* 24.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. 24.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 24.7 + * 24.8 + * This code is free software; you can redistribute it and/or modify it 24.9 + * under the terms of the GNU General Public License version 2 only, as 24.10 + * published by the Free Software Foundation. Sun designates this 24.11 + * particular file as subject to the "Classpath" exception as provided 24.12 + * by Sun in the LICENSE file that accompanied this code. 24.13 + * 24.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 24.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 24.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 24.17 + * version 2 for more details (a copy is included in the LICENSE file that 24.18 + * accompanied this code). 24.19 + * 24.20 + * You should have received a copy of the GNU General Public License version 24.21 + * 2 along with this work; if not, write to the Free Software Foundation, 24.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 24.23 + * 24.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 24.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 24.26 + * have any questions. 24.27 + */ 24.28 + 24.29 +package com.sun.tools.javah; 24.30 + 24.31 +import java.io.PrintWriter; 24.32 +import java.nio.charset.Charset; 24.33 +import javax.tools.DiagnosticListener; 24.34 +import javax.tools.JavaFileObject; 24.35 + 24.36 +import com.sun.tools.javac.file.JavacFileManager; 24.37 +import com.sun.tools.javac.util.Context; 24.38 + 24.39 +/** 24.40 + * javah's implementation of JavaFileManager. 24.41 + * 24.42 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 24.43 + * you write code that depends on this, you do so at your own risk. 24.44 + * This code and its internal interfaces are subject to change or 24.45 + * deletion without notice.</b> 24.46 + */ 24.47 +class JavahFileManager extends JavacFileManager { 24.48 + private JavahFileManager(Context context, Charset charset) { 24.49 + super(context, true, charset); 24.50 + setIgnoreSymbolFile(true); 24.51 + } 24.52 + 24.53 + static JavahFileManager create(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { 24.54 + Context javac_context = new Context(); 24.55 + 24.56 + if (dl != null) 24.57 + javac_context.put(DiagnosticListener.class, dl); 24.58 + javac_context.put(com.sun.tools.javac.util.Log.outKey, log); 24.59 + 24.60 + return new JavahFileManager(javac_context, null); 24.61 + } 24.62 + 24.63 + void setIgnoreSymbolFile(boolean b) { 24.64 + ignoreSymbolFile = b; 24.65 + } 24.66 +}
25.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 25.2 +++ b/src/share/classes/com/sun/tools/javah/JavahTask.java Fri Sep 25 22:04:43 2009 -0700 25.3 @@ -0,0 +1,724 @@ 25.4 +/* 25.5 + * Copyright 2002-2009 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.File; 25.32 +import java.io.IOException; 25.33 +import java.io.OutputStream; 25.34 +import java.io.PrintWriter; 25.35 +import java.io.Writer; 25.36 +import java.text.MessageFormat; 25.37 +import java.util.ArrayList; 25.38 +import java.util.Arrays; 25.39 +import java.util.Collections; 25.40 +import java.util.HashMap; 25.41 +import java.util.Iterator; 25.42 +import java.util.LinkedHashSet; 25.43 +import java.util.List; 25.44 +import java.util.Locale; 25.45 +import java.util.Map; 25.46 +import java.util.MissingResourceException; 25.47 +import java.util.ResourceBundle; 25.48 +import java.util.Set; 25.49 + 25.50 +import javax.annotation.processing.AbstractProcessor; 25.51 +import javax.annotation.processing.Messager; 25.52 +import javax.annotation.processing.RoundEnvironment; 25.53 +import javax.annotation.processing.SupportedAnnotationTypes; 25.54 +import javax.annotation.processing.SupportedSourceVersion; 25.55 + 25.56 +import javax.lang.model.SourceVersion; 25.57 +import javax.lang.model.element.ExecutableElement; 25.58 +import javax.lang.model.element.TypeElement; 25.59 +import javax.lang.model.element.VariableElement; 25.60 +import javax.lang.model.type.ArrayType; 25.61 +import javax.lang.model.type.DeclaredType; 25.62 +import javax.lang.model.type.TypeMirror; 25.63 +import javax.lang.model.type.TypeVisitor; 25.64 +import javax.lang.model.util.ElementFilter; 25.65 +import javax.lang.model.util.SimpleTypeVisitor6; 25.66 +import javax.lang.model.util.Types; 25.67 + 25.68 +import javax.tools.Diagnostic; 25.69 +import javax.tools.DiagnosticListener; 25.70 +import javax.tools.JavaCompiler; 25.71 +import javax.tools.JavaCompiler.CompilationTask; 25.72 +import javax.tools.JavaFileManager; 25.73 +import javax.tools.JavaFileObject; 25.74 +import javax.tools.StandardJavaFileManager; 25.75 +import javax.tools.StandardLocation; 25.76 +import javax.tools.ToolProvider; 25.77 + 25.78 +/** 25.79 + * Javah generates support files for native methods. 25.80 + * Parse commandline options & Invokes javadoc to execute those commands. 25.81 + * 25.82 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 25.83 + * If you write code that depends on this, you do so at your own 25.84 + * risk. This code and its internal interfaces are subject to change 25.85 + * or deletion without notice.</b></p> 25.86 + * 25.87 + * @author Sucheta Dambalkar 25.88 + * @author Jonathan Gibbons 25.89 + */ 25.90 +public class JavahTask implements NativeHeaderTool.NativeHeaderTask { 25.91 + public class BadArgs extends Exception { 25.92 + private static final long serialVersionUID = 1479361270874789045L; 25.93 + BadArgs(String key, Object... args) { 25.94 + super(JavahTask.this.getMessage(key, args)); 25.95 + this.key = key; 25.96 + this.args = args; 25.97 + } 25.98 + 25.99 + BadArgs showUsage(boolean b) { 25.100 + showUsage = b; 25.101 + return this; 25.102 + } 25.103 + 25.104 + final String key; 25.105 + final Object[] args; 25.106 + boolean showUsage; 25.107 + } 25.108 + 25.109 + static abstract class Option { 25.110 + Option(boolean hasArg, String... aliases) { 25.111 + this.hasArg = hasArg; 25.112 + this.aliases = aliases; 25.113 + } 25.114 + 25.115 + boolean isHidden() { 25.116 + return false; 25.117 + } 25.118 + 25.119 + boolean matches(String opt) { 25.120 + for (String a: aliases) { 25.121 + if (a.equals(opt)) 25.122 + return true; 25.123 + } 25.124 + return false; 25.125 + } 25.126 + 25.127 + boolean ignoreRest() { 25.128 + return false; 25.129 + } 25.130 + 25.131 + abstract void process(JavahTask task, String opt, String arg) throws BadArgs; 25.132 + 25.133 + final boolean hasArg; 25.134 + final String[] aliases; 25.135 + } 25.136 + 25.137 + static abstract class HiddenOption extends Option { 25.138 + HiddenOption(boolean hasArg, String... aliases) { 25.139 + super(hasArg, aliases); 25.140 + } 25.141 + 25.142 + @Override 25.143 + boolean isHidden() { 25.144 + return true; 25.145 + } 25.146 + } 25.147 + 25.148 + static Option[] recognizedOptions = { 25.149 + new Option(true, "-o") { 25.150 + void process(JavahTask task, String opt, String arg) { 25.151 + task.ofile = new File(arg); 25.152 + } 25.153 + }, 25.154 + 25.155 + new Option(true, "-d") { 25.156 + void process(JavahTask task, String opt, String arg) { 25.157 + task.odir = new File(arg); 25.158 + } 25.159 + }, 25.160 + 25.161 + new HiddenOption(true, "-td") { 25.162 + void process(JavahTask task, String opt, String arg) { 25.163 + // ignored; for backwards compatibility 25.164 + } 25.165 + }, 25.166 + 25.167 + new HiddenOption(false, "-stubs") { 25.168 + void process(JavahTask task, String opt, String arg) { 25.169 + // ignored; for backwards compatibility 25.170 + } 25.171 + }, 25.172 + 25.173 + new Option(false, "-v", "-verbose") { 25.174 + void process(JavahTask task, String opt, String arg) { 25.175 + task.verbose = true; 25.176 + } 25.177 + }, 25.178 + 25.179 + new Option(false, "-help", "--help", "-?") { 25.180 + void process(JavahTask task, String opt, String arg) { 25.181 + task.help = true; 25.182 + } 25.183 + }, 25.184 + 25.185 + new HiddenOption(false, "-trace") { 25.186 + void process(JavahTask task, String opt, String arg) { 25.187 + task.trace = true; 25.188 + } 25.189 + }, 25.190 + 25.191 + new Option(false, "-version") { 25.192 + void process(JavahTask task, String opt, String arg) { 25.193 + task.version = true; 25.194 + } 25.195 + }, 25.196 + 25.197 + new HiddenOption(false, "-fullversion") { 25.198 + void process(JavahTask task, String opt, String arg) { 25.199 + task.fullVersion = true; 25.200 + } 25.201 + }, 25.202 + 25.203 + new Option(false, "-jni") { 25.204 + void process(JavahTask task, String opt, String arg) { 25.205 + task.jni = true; 25.206 + } 25.207 + }, 25.208 + 25.209 + new Option(false, "-force") { 25.210 + void process(JavahTask task, String opt, String arg) { 25.211 + task.force = true; 25.212 + } 25.213 + }, 25.214 + 25.215 + new HiddenOption(false, "-Xnew") { 25.216 + void process(JavahTask task, String opt, String arg) { 25.217 + // we're already using the new javah 25.218 + } 25.219 + }, 25.220 + 25.221 + new HiddenOption(false, "-old") { 25.222 + void process(JavahTask task, String opt, String arg) { 25.223 + task.old = true; 25.224 + } 25.225 + }, 25.226 + 25.227 + new HiddenOption(false, "-llni", "-Xllni") { 25.228 + void process(JavahTask task, String opt, String arg) { 25.229 + task.llni = true; 25.230 + } 25.231 + }, 25.232 + 25.233 + new HiddenOption(false, "-llnidouble") { 25.234 + void process(JavahTask task, String opt, String arg) { 25.235 + task.llni = true; 25.236 + task.doubleAlign = true; 25.237 + } 25.238 + }, 25.239 + }; 25.240 + 25.241 + JavahTask() { 25.242 + } 25.243 + 25.244 + JavahTask(Writer out, 25.245 + JavaFileManager fileManager, 25.246 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 25.247 + Iterable<String> options, 25.248 + Iterable<String> classes) { 25.249 + this(); 25.250 + this.log = getPrintWriterForWriter(out); 25.251 + this.fileManager = fileManager; 25.252 + this.diagnosticListener = diagnosticListener; 25.253 + 25.254 + try { 25.255 + handleOptions(options, false); 25.256 + } catch (BadArgs e) { 25.257 + throw new IllegalArgumentException(e.getMessage()); 25.258 + } 25.259 + 25.260 + this.classes = new ArrayList<String>(); 25.261 + for (String classname: classes) { 25.262 + classname.getClass(); // null-check 25.263 + this.classes.add(classname); 25.264 + } 25.265 + } 25.266 + 25.267 + public void setLocale(Locale locale) { 25.268 + if (locale == null) 25.269 + locale = Locale.getDefault(); 25.270 + task_locale = locale; 25.271 + } 25.272 + 25.273 + public void setLog(PrintWriter log) { 25.274 + this.log = log; 25.275 + } 25.276 + 25.277 + public void setLog(OutputStream s) { 25.278 + setLog(getPrintWriterForStream(s)); 25.279 + } 25.280 + 25.281 + static PrintWriter getPrintWriterForStream(OutputStream s) { 25.282 + return new PrintWriter(s, true); 25.283 + } 25.284 + 25.285 + static PrintWriter getPrintWriterForWriter(Writer w) { 25.286 + if (w == null) 25.287 + return getPrintWriterForStream(null); 25.288 + else if (w instanceof PrintWriter) 25.289 + return (PrintWriter) w; 25.290 + else 25.291 + return new PrintWriter(w, true); 25.292 + } 25.293 + 25.294 + public void setDiagnosticListener(DiagnosticListener<? super JavaFileObject> dl) { 25.295 + diagnosticListener = dl; 25.296 + } 25.297 + 25.298 + public void setDiagnosticListener(OutputStream s) { 25.299 + setDiagnosticListener(getDiagnosticListenerForStream(s)); 25.300 + } 25.301 + 25.302 + private DiagnosticListener<JavaFileObject> getDiagnosticListenerForStream(OutputStream s) { 25.303 + return getDiagnosticListenerForWriter(getPrintWriterForStream(s)); 25.304 + } 25.305 + 25.306 + private DiagnosticListener<JavaFileObject> getDiagnosticListenerForWriter(Writer w) { 25.307 + final PrintWriter pw = getPrintWriterForWriter(w); 25.308 + return new DiagnosticListener<JavaFileObject> () { 25.309 + public void report(Diagnostic<? extends JavaFileObject> diagnostic) { 25.310 + if (diagnostic.getKind() == Diagnostic.Kind.ERROR) { 25.311 + pw.print(getMessage("err.prefix")); 25.312 + pw.print(" "); 25.313 + } 25.314 + pw.println(diagnostic.getMessage(null)); 25.315 + } 25.316 + }; 25.317 + } 25.318 + 25.319 + int run(String[] args) { 25.320 + try { 25.321 + handleOptions(args); 25.322 + boolean ok = run(); 25.323 + return ok ? 0 : 1; 25.324 + } catch (BadArgs e) { 25.325 + diagnosticListener.report(createDiagnostic(e.key, e.args)); 25.326 + return 1; 25.327 + } catch (InternalError e) { 25.328 + diagnosticListener.report(createDiagnostic("err.internal.error", e.getMessage())); 25.329 + return 1; 25.330 + } finally { 25.331 + log.flush(); 25.332 + } 25.333 + } 25.334 + 25.335 + public void handleOptions(String[] args) throws BadArgs { 25.336 + handleOptions(Arrays.asList(args), true); 25.337 + } 25.338 + 25.339 + private void handleOptions(Iterable<String> args, boolean allowClasses) throws BadArgs { 25.340 + if (log == null) { 25.341 + log = getPrintWriterForStream(System.out); 25.342 + if (diagnosticListener == null) 25.343 + diagnosticListener = getDiagnosticListenerForStream(System.err); 25.344 + } else { 25.345 + if (diagnosticListener == null) 25.346 + diagnosticListener = getDiagnosticListenerForWriter(log); 25.347 + } 25.348 + 25.349 + if (fileManager == null) 25.350 + fileManager = getDefaultFileManager(diagnosticListener, log); 25.351 + 25.352 + Iterator<String> iter = args.iterator(); 25.353 + if (!iter.hasNext()) 25.354 + help = true; 25.355 + 25.356 + while (iter.hasNext()) { 25.357 + String arg = iter.next(); 25.358 + if (arg.startsWith("-")) 25.359 + handleOption(arg, iter); 25.360 + else if (allowClasses) { 25.361 + if (classes == null) 25.362 + classes = new ArrayList<String>(); 25.363 + classes.add(arg); 25.364 + while (iter.hasNext()) 25.365 + classes.add(iter.next()); 25.366 + } else 25.367 + throw new BadArgs("err.unknown.option", arg).showUsage(true); 25.368 + } 25.369 + 25.370 + if ((classes == null || classes.size() == 0) && 25.371 + !(help || version || fullVersion)) { 25.372 + throw new BadArgs("err.no.classes.specified"); 25.373 + } 25.374 + 25.375 + if (jni && llni) 25.376 + throw new BadArgs("jni.llni.mixed"); 25.377 + 25.378 + if (odir != null && ofile != null) 25.379 + throw new BadArgs("dir.file.mixed"); 25.380 + } 25.381 + 25.382 + private void handleOption(String name, Iterator<String> rest) throws BadArgs { 25.383 + for (Option o: recognizedOptions) { 25.384 + if (o.matches(name)) { 25.385 + if (o.hasArg) { 25.386 + if (rest.hasNext()) 25.387 + o.process(this, name, rest.next()); 25.388 + else 25.389 + throw new BadArgs("err.missing.arg", name).showUsage(true); 25.390 + } else 25.391 + o.process(this, name, null); 25.392 + 25.393 + if (o.ignoreRest()) { 25.394 + while (rest.hasNext()) 25.395 + rest.next(); 25.396 + } 25.397 + return; 25.398 + } 25.399 + } 25.400 + 25.401 + if (fileManager.handleOption(name, rest)) 25.402 + return; 25.403 + 25.404 + throw new BadArgs("err.unknown.option", name).showUsage(true); 25.405 + } 25.406 + 25.407 + public Boolean call() { 25.408 + return run(); 25.409 + } 25.410 + 25.411 + public boolean run() throws Util.Exit { 25.412 + 25.413 + Util util = new Util(log, diagnosticListener); 25.414 + 25.415 + if (help) { 25.416 + showHelp(); 25.417 + return true; 25.418 + } 25.419 + 25.420 + if (version || fullVersion) { 25.421 + showVersion(fullVersion); 25.422 + return true; 25.423 + } 25.424 + 25.425 + util.verbose = verbose; 25.426 + 25.427 + Gen g; 25.428 + 25.429 + if (llni) 25.430 + g = new LLNI(doubleAlign, util); 25.431 + else { 25.432 +// if (stubs) 25.433 +// throw new BadArgs("jni.no.stubs"); 25.434 + g = new JNI(util); 25.435 + } 25.436 + 25.437 + if (ofile != null) { 25.438 + if (!(fileManager instanceof StandardJavaFileManager)) { 25.439 + diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-o")); 25.440 + return false; 25.441 + } 25.442 + Iterable<? extends JavaFileObject> iter = 25.443 + ((StandardJavaFileManager) fileManager).getJavaFileObjectsFromFiles(Collections.singleton(ofile)); 25.444 + JavaFileObject fo = iter.iterator().next(); 25.445 + g.setOutFile(fo); 25.446 + } else { 25.447 + if (odir != null) { 25.448 + if (!(fileManager instanceof StandardJavaFileManager)) { 25.449 + diagnosticListener.report(createDiagnostic("err.cant.use.option.for.fm", "-d")); 25.450 + return false; 25.451 + } 25.452 + 25.453 + if (!odir.exists()) 25.454 + if (!odir.mkdirs()) 25.455 + util.error("cant.create.dir", odir.toString()); 25.456 + try { 25.457 + ((StandardJavaFileManager) fileManager).setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(odir)); 25.458 + } catch (IOException e) { 25.459 + Object msg = e.getLocalizedMessage(); 25.460 + if (msg == null) { 25.461 + msg = e; 25.462 + } 25.463 + diagnosticListener.report(createDiagnostic("err.ioerror", odir, msg)); 25.464 + return false; 25.465 + } 25.466 + } 25.467 + g.setFileManager(fileManager); 25.468 + } 25.469 + 25.470 + /* 25.471 + * Force set to false will turn off smarts about checking file 25.472 + * content before writing. 25.473 + */ 25.474 + g.setForce(force); 25.475 + 25.476 + if (fileManager instanceof JavahFileManager) 25.477 + ((JavahFileManager) fileManager).setIgnoreSymbolFile(true); 25.478 + 25.479 + JavaCompiler c = ToolProvider.getSystemJavaCompiler(); 25.480 + List<String> opts = Arrays.asList("-proc:only"); 25.481 + CompilationTask t = c.getTask(log, fileManager, diagnosticListener, opts, internalize(classes), null); 25.482 + JavahProcessor p = new JavahProcessor(g); 25.483 + t.setProcessors(Collections.singleton(p)); 25.484 + 25.485 + boolean ok = t.call(); 25.486 + if (p.exit != null) 25.487 + throw new Util.Exit(p.exit); 25.488 + return ok; 25.489 + } 25.490 + 25.491 + private List<String> internalize(List<String> classes) { 25.492 + List<String> l = new ArrayList<String>(); 25.493 + for (String c: classes) { 25.494 + l.add(c.replace('$', '.')); 25.495 + } 25.496 + return l; 25.497 + } 25.498 + 25.499 + private List<File> pathToFiles(String path) { 25.500 + List<File> files = new ArrayList<File>(); 25.501 + for (String f: path.split(File.pathSeparator)) { 25.502 + if (f.length() > 0) 25.503 + files.add(new File(f)); 25.504 + } 25.505 + return files; 25.506 + } 25.507 + 25.508 + static StandardJavaFileManager getDefaultFileManager(final DiagnosticListener<? super JavaFileObject> dl, PrintWriter log) { 25.509 + return JavahFileManager.create(dl, log); 25.510 + } 25.511 + 25.512 + private void showHelp() { 25.513 + log.println(getMessage("main.usage", progname)); 25.514 + for (Option o: recognizedOptions) { 25.515 + if (o.isHidden()) 25.516 + continue; 25.517 + String name = o.aliases[0].substring(1); // there must always be at least one name 25.518 + log.println(getMessage("main.opt." + name)); 25.519 + } 25.520 + String[] fmOptions = { "-classpath", "-bootclasspath" }; 25.521 + for (String o: fmOptions) { 25.522 + if (fileManager.isSupportedOption(o) == -1) 25.523 + continue; 25.524 + String name = o.substring(1); 25.525 + log.println(getMessage("main.opt." + name)); 25.526 + } 25.527 + log.println(getMessage("main.usage.foot")); 25.528 + } 25.529 + 25.530 + private void showVersion(boolean full) { 25.531 + log.println(version(full ? "full" : "release")); 25.532 + } 25.533 + 25.534 + private static final String versionRBName = "com.sun.tools.javah.resources.version"; 25.535 + private static ResourceBundle versionRB; 25.536 + 25.537 + private String version(String key) { 25.538 + // key=version: mm.nn.oo[-milestone] 25.539 + // key=full: mm.mm.oo[-milestone]-build 25.540 + if (versionRB == null) { 25.541 + try { 25.542 + versionRB = ResourceBundle.getBundle(versionRBName); 25.543 + } catch (MissingResourceException e) { 25.544 + return getMessage("version.resource.missing", System.getProperty("java.version")); 25.545 + } 25.546 + } 25.547 + try { 25.548 + return versionRB.getString(key); 25.549 + } 25.550 + catch (MissingResourceException e) { 25.551 + return getMessage("version.unknown", System.getProperty("java.version")); 25.552 + } 25.553 + } 25.554 + 25.555 + private Diagnostic<JavaFileObject> createDiagnostic(final String key, final Object... args) { 25.556 + return new Diagnostic<JavaFileObject>() { 25.557 + public Kind getKind() { 25.558 + return Diagnostic.Kind.ERROR; 25.559 + } 25.560 + 25.561 + public JavaFileObject getSource() { 25.562 + return null; 25.563 + } 25.564 + 25.565 + public long getPosition() { 25.566 + return Diagnostic.NOPOS; 25.567 + } 25.568 + 25.569 + public long getStartPosition() { 25.570 + return Diagnostic.NOPOS; 25.571 + } 25.572 + 25.573 + public long getEndPosition() { 25.574 + return Diagnostic.NOPOS; 25.575 + } 25.576 + 25.577 + public long getLineNumber() { 25.578 + return Diagnostic.NOPOS; 25.579 + } 25.580 + 25.581 + public long getColumnNumber() { 25.582 + return Diagnostic.NOPOS; 25.583 + } 25.584 + 25.585 + public String getCode() { 25.586 + return key; 25.587 + } 25.588 + 25.589 + public String getMessage(Locale locale) { 25.590 + return JavahTask.this.getMessage(locale, key, args); 25.591 + } 25.592 + 25.593 + }; 25.594 + 25.595 + } 25.596 + private String getMessage(String key, Object... args) { 25.597 + return getMessage(task_locale, key, args); 25.598 + } 25.599 + 25.600 + private String getMessage(Locale locale, String key, Object... args) { 25.601 + if (bundles == null) { 25.602 + // could make this a HashMap<Locale,SoftReference<ResourceBundle>> 25.603 + // and for efficiency, keep a hard reference to the bundle for the task 25.604 + // locale 25.605 + bundles = new HashMap<Locale, ResourceBundle>(); 25.606 + } 25.607 + 25.608 + if (locale == null) 25.609 + locale = Locale.getDefault(); 25.610 + 25.611 + ResourceBundle b = bundles.get(locale); 25.612 + if (b == null) { 25.613 + try { 25.614 + b = ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n", locale); 25.615 + bundles.put(locale, b); 25.616 + } catch (MissingResourceException e) { 25.617 + throw new InternalError("Cannot find javah resource bundle for locale " + locale, e); 25.618 + } 25.619 + } 25.620 + 25.621 + try { 25.622 + return MessageFormat.format(b.getString(key), args); 25.623 + } catch (MissingResourceException e) { 25.624 + return key; 25.625 + //throw new InternalError(e, key); 25.626 + } 25.627 + } 25.628 + 25.629 + File ofile; 25.630 + File odir; 25.631 + String bootcp; 25.632 + String usercp; 25.633 + List<String> classes; 25.634 + boolean verbose; 25.635 + boolean help; 25.636 + boolean trace; 25.637 + boolean version; 25.638 + boolean fullVersion; 25.639 + boolean jni; 25.640 + boolean llni; 25.641 + boolean doubleAlign; 25.642 + boolean force; 25.643 + boolean old; 25.644 + 25.645 + PrintWriter log; 25.646 + JavaFileManager fileManager; 25.647 + DiagnosticListener<? super JavaFileObject> diagnosticListener; 25.648 + Locale task_locale; 25.649 + Map<Locale, ResourceBundle> bundles; 25.650 + 25.651 + private static final String progname = "javah"; 25.652 + 25.653 + @SupportedAnnotationTypes("*") 25.654 + @SupportedSourceVersion(SourceVersion.RELEASE_7) 25.655 + class JavahProcessor extends AbstractProcessor { 25.656 + JavahProcessor(Gen g) { 25.657 + this.g = g; 25.658 + } 25.659 + 25.660 + public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { 25.661 + Messager messager = processingEnv.getMessager(); 25.662 + Set<TypeElement> classes = getAllClasses(ElementFilter.typesIn(roundEnv.getRootElements())); 25.663 + if (classes.size() > 0) { 25.664 + checkMethodParameters(classes); 25.665 + g.setProcessingEnvironment(processingEnv); 25.666 + g.setClasses(classes); 25.667 + 25.668 + try { 25.669 + g.run(); 25.670 + } catch (ClassNotFoundException cnfe) { 25.671 + messager.printMessage(Diagnostic.Kind.ERROR, getMessage("class.not.found", cnfe.getMessage())); 25.672 + } catch (IOException ioe) { 25.673 + messager.printMessage(Diagnostic.Kind.ERROR, getMessage("io.exception", ioe.getMessage())); 25.674 + } catch (Util.Exit e) { 25.675 + exit = e; 25.676 + } 25.677 + } 25.678 + return true; 25.679 + } 25.680 + 25.681 + private Set<TypeElement> getAllClasses(Set<? extends TypeElement> classes) { 25.682 + Set<TypeElement> allClasses = new LinkedHashSet<TypeElement>(); 25.683 + getAllClasses0(classes, allClasses); 25.684 + return allClasses; 25.685 + } 25.686 + 25.687 + private void getAllClasses0(Iterable<? extends TypeElement> classes, Set<TypeElement> allClasses) { 25.688 + for (TypeElement c: classes) { 25.689 + allClasses.add(c); 25.690 + getAllClasses0(ElementFilter.typesIn(c.getEnclosedElements()), allClasses); 25.691 + } 25.692 + } 25.693 + 25.694 + // 4942232: 25.695 + // check that classes exist for all the parameters of native methods 25.696 + private void checkMethodParameters(Set<TypeElement> classes) { 25.697 + Types types = processingEnv.getTypeUtils(); 25.698 + for (TypeElement te: classes) { 25.699 + for (ExecutableElement ee: ElementFilter.methodsIn(te.getEnclosedElements())) { 25.700 + for (VariableElement ve: ee.getParameters()) { 25.701 + TypeMirror tm = ve.asType(); 25.702 + checkMethodParametersVisitor.visit(tm, types); 25.703 + } 25.704 + } 25.705 + } 25.706 + } 25.707 + 25.708 + private TypeVisitor<Void,Types> checkMethodParametersVisitor = 25.709 + new SimpleTypeVisitor6<Void,Types>() { 25.710 + @Override 25.711 + public Void visitArray(ArrayType t, Types types) { 25.712 + visit(t.getComponentType(), types); 25.713 + return null; 25.714 + } 25.715 + @Override 25.716 + public Void visitDeclared(DeclaredType t, Types types) { 25.717 + t.asElement().getKind(); // ensure class exists 25.718 + for (TypeMirror st: types.directSupertypes(t)) 25.719 + visit(st, types); 25.720 + return null; 25.721 + } 25.722 + }; 25.723 + 25.724 + private Gen g; 25.725 + private Util.Exit exit; 25.726 + } 25.727 +}
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 26.2 +++ b/src/share/classes/com/sun/tools/javah/JavahTool.java Fri Sep 25 22:04:43 2009 -0700 26.3 @@ -0,0 +1,84 @@ 26.4 +/* 26.5 + * Copyright 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.InputStream; 26.32 +import java.io.OutputStream; 26.33 +import java.io.Writer; 26.34 +import java.nio.charset.Charset; 26.35 +import java.util.Arrays; 26.36 +import java.util.EnumSet; 26.37 +import java.util.Locale; 26.38 +import java.util.Set; 26.39 +import javax.lang.model.SourceVersion; 26.40 +import javax.tools.DiagnosticListener; 26.41 +import javax.tools.JavaFileManager; 26.42 +import javax.tools.JavaFileObject; 26.43 +import javax.tools.StandardJavaFileManager; 26.44 + 26.45 +/* 26.46 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 26.47 + * If you write code that depends on this, you do so at your own 26.48 + * risk. This code and its internal interfaces are subject to change 26.49 + * or deletion without notice.</b></p> 26.50 + */ 26.51 +public class JavahTool implements NativeHeaderTool { 26.52 + 26.53 + public NativeHeaderTask getTask(Writer out, 26.54 + JavaFileManager fileManager, 26.55 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 26.56 + Iterable<String> options, 26.57 + Iterable<String> classes) { 26.58 + return new JavahTask(out, fileManager, diagnosticListener, options, classes); 26.59 + } 26.60 + 26.61 + public StandardJavaFileManager getStandardFileManager(DiagnosticListener<? super JavaFileObject> diagnosticListener, Locale locale, Charset charset) { 26.62 + return JavahTask.getDefaultFileManager(diagnosticListener, null); 26.63 + } 26.64 + 26.65 + public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) { 26.66 + JavahTask t = new JavahTask( 26.67 + JavahTask.getPrintWriterForStream(out), 26.68 + null, 26.69 + null, 26.70 + Arrays.asList(arguments), 26.71 + null); 26.72 + return (t.run() ? 0 : 1); 26.73 + } 26.74 + 26.75 + public Set<SourceVersion> getSourceVersions() { 26.76 + return EnumSet.allOf(SourceVersion.class); 26.77 + } 26.78 + 26.79 + public int isSupportedOption(String option) { 26.80 + JavahTask.Option[] options = JavahTask.recognizedOptions; 26.81 + for (int i = 0; i < options.length; i++) { 26.82 + if (options[i].matches(option)) 26.83 + return (options[i].hasArg ? 1 : 0); 26.84 + } 26.85 + return -1; 26.86 + } 26.87 +}
27.1 --- a/src/share/classes/com/sun/tools/javah/LLNI.java Fri Sep 25 14:24:14 2009 -0700 27.2 +++ b/src/share/classes/com/sun/tools/javah/LLNI.java Fri Sep 25 22:04:43 2009 -0700 27.3 @@ -1,5 +1,5 @@ 27.4 /* 27.5 - * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. 27.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 27.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 27.8 * 27.9 * This code is free software; you can redistribute it and/or modify it 27.10 @@ -26,49 +26,65 @@ 27.11 27.12 package com.sun.tools.javah; 27.13 27.14 -import java.io.File; 27.15 import java.io.OutputStream; 27.16 import java.io.PrintWriter; 27.17 -import java.util.Hashtable; 27.18 -import com.sun.javadoc.*; 27.19 +import java.util.ArrayList; 27.20 +import java.util.HashSet; 27.21 +import java.util.List; 27.22 27.23 - /* 27.24 - * @author Sucheta Dambalkar(Revised) 27.25 - */ 27.26 +import java.util.Set; 27.27 +import javax.lang.model.element.Element; 27.28 +import javax.lang.model.element.ExecutableElement; 27.29 +import javax.lang.model.element.Modifier; 27.30 +import javax.lang.model.element.Name; 27.31 +import javax.lang.model.element.TypeElement; 27.32 +import javax.lang.model.element.VariableElement; 27.33 +import javax.lang.model.type.ArrayType; 27.34 +import javax.lang.model.type.PrimitiveType; 27.35 +import javax.lang.model.type.TypeKind; 27.36 +import javax.lang.model.type.TypeMirror; 27.37 +import javax.lang.model.type.TypeVisitor; 27.38 +import javax.lang.model.util.ElementFilter; 27.39 +import javax.lang.model.util.SimpleTypeVisitor6; 27.40 + 27.41 +/* 27.42 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 27.43 + * If you write code that depends on this, you do so at your own 27.44 + * risk. This code and its internal interfaces are subject to change 27.45 + * or deletion without notice.</b></p> 27.46 + * 27.47 + * @author Sucheta Dambalkar(Revised) 27.48 + */ 27.49 public class LLNI extends Gen { 27.50 27.51 - protected final char pathChar = File.separatorChar; 27.52 protected final char innerDelim = '$'; /* For inner classes */ 27.53 - protected Hashtable<Object, Object> doneHandleTypes; 27.54 - MemberDoc []fields; 27.55 - MemberDoc [] methods; 27.56 + protected Set<String> doneHandleTypes; 27.57 + List<VariableElement> fields; 27.58 + List<ExecutableElement> methods; 27.59 private boolean doubleAlign; 27.60 private int padFieldNum = 0; 27.61 27.62 - 27.63 - LLNI(boolean doubleAlign, RootDoc root) { 27.64 - super(root); 27.65 + LLNI(boolean doubleAlign, Util util) { 27.66 + super(util); 27.67 this.doubleAlign = doubleAlign; 27.68 } 27.69 27.70 - 27.71 protected String getIncludes() { 27.72 return ""; 27.73 } 27.74 27.75 - protected void write(OutputStream o, ClassDoc clazz) 27.76 - throws ClassNotFoundException { 27.77 - String cname = mangleClassName(clazz.qualifiedName()); 27.78 + protected void write(OutputStream o, TypeElement clazz) throws Util.Exit { 27.79 + String cname = mangleClassName(clazz.getQualifiedName().toString()); 27.80 PrintWriter pw = wrapWriter(o); 27.81 - fields = clazz.fields(); 27.82 - methods = clazz.methods(); 27.83 + fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 27.84 + methods = ElementFilter.methodsIn(clazz.getEnclosedElements()); 27.85 generateDeclsForClass(pw, clazz, cname); 27.86 + // FIXME check if errors occurred on the PrintWriter and throw exception if so 27.87 } 27.88 27.89 protected void generateDeclsForClass(PrintWriter pw, 27.90 - ClassDoc clazz, String cname) 27.91 - throws ClassNotFoundException { 27.92 - doneHandleTypes = new Hashtable<Object, Object>(); 27.93 + TypeElement clazz, String cname) throws Util.Exit { 27.94 + doneHandleTypes = new HashSet<String>(); 27.95 /* The following handle types are predefined in "typedefs.h". Suppress 27.96 inclusion in the output by generating them "into the blue" here. */ 27.97 genHandleType(null, "java.lang.Class"); 27.98 @@ -79,7 +95,7 @@ 27.99 genHandleType(null, "java.lang.ThreadGroup"); 27.100 genHandleType(null, "java.lang.Throwable"); 27.101 27.102 - pw.println("/* LLNI Header for class " + clazz.qualifiedName() + " */" + lineSep); 27.103 + pw.println("/* LLNI Header for class " + clazz.getQualifiedName() + " */" + lineSep); 27.104 pw.println("#ifndef _Included_" + cname); 27.105 pw.println("#define _Included_" + cname); 27.106 pw.println("#include \"typedefs.h\""); 27.107 @@ -94,8 +110,8 @@ 27.108 27.109 protected void genHandleType(PrintWriter pw, String clazzname) { 27.110 String cname = mangleClassName(clazzname); 27.111 - if (!doneHandleTypes.containsKey(cname)) { 27.112 - doneHandleTypes.put(cname, cname); 27.113 + if (!doneHandleTypes.contains(cname)) { 27.114 + doneHandleTypes.add(cname); 27.115 if (pw != null) { 27.116 pw.println("#ifndef DEFINED_" + cname); 27.117 pw.println(" #define DEFINED_" + cname); 27.118 @@ -107,31 +123,29 @@ 27.119 27.120 protected String mangleClassName(String s) { 27.121 return s.replace('.', '_') 27.122 - .replace(pathChar, '_') 27.123 + .replace('/', '_') 27.124 .replace(innerDelim, '_'); 27.125 } 27.126 27.127 - protected void forwardDecls(PrintWriter pw, ClassDoc clazz) 27.128 - throws ClassNotFoundException { 27.129 - ClassDoc clazzfield = null; 27.130 + protected void forwardDecls(PrintWriter pw, TypeElement clazz) { 27.131 + TypeElement object = elems.getTypeElement("java.lang.Object"); 27.132 + if (clazz.equals(object)) 27.133 + return; 27.134 27.135 - if (clazz.qualifiedName().equals("java.lang.Object")) 27.136 - return; 27.137 - genHandleType(pw, clazz.qualifiedName()); 27.138 - ClassDoc superClass = clazz.superclass(); 27.139 + genHandleType(pw, clazz.getQualifiedName().toString()); 27.140 + TypeElement superClass = (TypeElement) (types.asElement(clazz.getSuperclass())); 27.141 27.142 - if(superClass != null){ 27.143 - String superClassName = superClass.qualifiedName(); 27.144 + if (superClass != null) { 27.145 + String superClassName = superClass.getQualifiedName().toString(); 27.146 forwardDecls(pw, superClass); 27.147 } 27.148 27.149 - for (int i = 0; i < fields.length; i++) { 27.150 - FieldDoc field = (FieldDoc)fields[i]; 27.151 + for (VariableElement field: fields) { 27.152 27.153 - if (!field.isStatic()) { 27.154 - Type t = field.type(); 27.155 - String tname = t.qualifiedTypeName(); 27.156 - TypeSignature newTypeSig = new TypeSignature(root); 27.157 + if (!field.getModifiers().contains(Modifier.STATIC)) { 27.158 + TypeMirror t = types.erasure(field.asType()); 27.159 + TypeSignature newTypeSig = new TypeSignature(elems); 27.160 + String tname = newTypeSig.qualifiedTypeName(t); 27.161 String sig = newTypeSig.getTypeSignature(tname); 27.162 27.163 if (sig.charAt(0) != '[') 27.164 @@ -139,13 +153,12 @@ 27.165 } 27.166 } 27.167 27.168 - for (int i = 0; i < methods.length; i++) { 27.169 - MethodDoc method = (MethodDoc)methods[i]; 27.170 + for (ExecutableElement method: methods) { 27.171 27.172 - if (method.isNative()) { 27.173 - Type retType = method.returnType(); 27.174 - String typesig = method.signature(); 27.175 - TypeSignature newTypeSig = new TypeSignature(root); 27.176 + if (method.getModifiers().contains(Modifier.NATIVE)) { 27.177 + TypeMirror retType = types.erasure(method.getReturnType()); 27.178 + String typesig = signature(method); 27.179 + TypeSignature newTypeSig = new TypeSignature(elems); 27.180 String sig = newTypeSig.getTypeSignature(typesig, retType); 27.181 27.182 if (sig.charAt(0) != '[') 27.183 @@ -173,10 +186,9 @@ 27.184 } 27.185 27.186 protected void structSectionForClass(PrintWriter pw, 27.187 - ClassDoc jclazz, String cname) 27.188 - throws ClassNotFoundException { 27.189 + TypeElement jclazz, String cname) { 27.190 27.191 - String jname = jclazz.qualifiedName(); 27.192 + String jname = jclazz.getQualifiedName().toString(); 27.193 27.194 if (cname.equals("java_lang_Object")) { 27.195 pw.println("/* struct java_lang_Object is defined in typedefs.h. */"); 27.196 @@ -207,8 +219,8 @@ 27.197 public boolean bottomMost; 27.198 public boolean printedOne = false; 27.199 27.200 - FieldDefsRes(ClassDoc clazz, FieldDefsRes parent, boolean bottomMost) { 27.201 - this.className = clazz.qualifiedName(); 27.202 + FieldDefsRes(TypeElement clazz, FieldDefsRes parent, boolean bottomMost) { 27.203 + this.className = clazz.getQualifiedName().toString(); 27.204 this.parent = parent; 27.205 this.bottomMost = bottomMost; 27.206 int byteSize = 0; 27.207 @@ -218,9 +230,8 @@ 27.208 } 27.209 27.210 /* Returns "true" iff added a field. */ 27.211 - private boolean doField(FieldDefsRes res, FieldDoc field, 27.212 - String cname, boolean padWord) 27.213 - throws ClassNotFoundException { 27.214 + private boolean doField(FieldDefsRes res, VariableElement field, 27.215 + String cname, boolean padWord) { 27.216 27.217 String fieldDef = addStructMember(field, cname, padWord); 27.218 if (fieldDef != null) { 27.219 @@ -242,16 +253,14 @@ 27.220 return false; 27.221 } 27.222 27.223 - private int doTwoWordFields(FieldDefsRes res, ClassDoc clazz, 27.224 - int offset, String cname, boolean padWord) 27.225 - throws ClassNotFoundException { 27.226 + private int doTwoWordFields(FieldDefsRes res, TypeElement clazz, 27.227 + int offset, String cname, boolean padWord) { 27.228 boolean first = true; 27.229 - FieldDoc[] fields = clazz.fields(); 27.230 + List<VariableElement> fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 27.231 27.232 - for (int i = 0; i <fields.length; i++) { 27.233 - FieldDoc field = fields[i]; 27.234 - String tc =field.type().typeName(); 27.235 - boolean twoWords = (tc.equals("long") || tc.equals("double")); 27.236 + for (VariableElement field: fields) { 27.237 + TypeKind tk = field.asType().getKind(); 27.238 + boolean twoWords = (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 27.239 if (twoWords && doField(res, field, cname, first && padWord)) { 27.240 offset += 8; first = false; 27.241 } 27.242 @@ -259,22 +268,21 @@ 27.243 return offset; 27.244 } 27.245 27.246 - protected String fieldDefs(ClassDoc clazz, String cname) 27.247 - throws ClassNotFoundException { 27.248 + String fieldDefs(TypeElement clazz, String cname) { 27.249 FieldDefsRes res = fieldDefs(clazz, cname, true); 27.250 return res.s; 27.251 } 27.252 27.253 - protected FieldDefsRes fieldDefs(ClassDoc clazz, String cname, 27.254 - boolean bottomMost) 27.255 - throws ClassNotFoundException { 27.256 + FieldDefsRes fieldDefs(TypeElement clazz, String cname, 27.257 + boolean bottomMost){ 27.258 FieldDefsRes res; 27.259 int offset; 27.260 boolean didTwoWordFields = false; 27.261 - ClassDoc superclazz = clazz.superclass(); 27.262 + 27.263 + TypeElement superclazz = (TypeElement) types.asElement(clazz.getSuperclass()); 27.264 27.265 if (superclazz != null) { 27.266 - String supername = superclazz.qualifiedName(); 27.267 + String supername = superclazz.getQualifiedName().toString(); 27.268 res = new FieldDefsRes(clazz, 27.269 fieldDefs(superclazz, cname, false), 27.270 bottomMost); 27.271 @@ -284,18 +292,17 @@ 27.272 offset = 0; 27.273 } 27.274 27.275 - FieldDoc[] fields = clazz.fields(); 27.276 + List<VariableElement> fields = ElementFilter.fieldsIn(clazz.getEnclosedElements()); 27.277 27.278 - for (int i = 0; i < fields.length; i++) { 27.279 - FieldDoc field = fields[i]; 27.280 + for (VariableElement field: fields) { 27.281 27.282 if (doubleAlign && !didTwoWordFields && (offset % 8) == 0) { 27.283 offset = doTwoWordFields(res, clazz, offset, cname, false); 27.284 didTwoWordFields = true; 27.285 } 27.286 27.287 - String tc = field.type().typeName(); 27.288 - boolean twoWords = (tc.equals("long") ||tc.equals("double")); 27.289 + TypeKind tk = field.asType().getKind(); 27.290 + boolean twoWords = (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 27.291 27.292 if (!doubleAlign || !twoWords) { 27.293 if (doField(res, field, cname, false)) offset += 4; 27.294 @@ -313,19 +320,19 @@ 27.295 } 27.296 27.297 /* OVERRIDE: This method handles instance fields */ 27.298 - protected String addStructMember(FieldDoc member, String cname, 27.299 - boolean padWord) 27.300 - throws ClassNotFoundException { 27.301 + protected String addStructMember(VariableElement member, String cname, 27.302 + boolean padWord) { 27.303 String res = null; 27.304 27.305 - if (member.isStatic()) { 27.306 + if (member.getModifiers().contains(Modifier.STATIC)) { 27.307 res = addStaticStructMember(member, cname); 27.308 // if (res == null) /* JNI didn't handle it, print comment. */ 27.309 // res = " /* Inaccessible static: " + member + " */" + lineSep; 27.310 } else { 27.311 + TypeMirror mt = types.erasure(member.asType()); 27.312 if (padWord) res = " java_int padWord" + padFieldNum++ + ";" + lineSep; 27.313 - res = " " + llniType(member.type(), false, false) + " " + llniFieldName(member); 27.314 - if (isLongOrDouble(member.type())) res = res + "[2]"; 27.315 + res = " " + llniType(mt, false, false) + " " + llniFieldName(member); 27.316 + if (isLongOrDouble(mt)) res = res + "[2]"; 27.317 res = res + ";" + lineSep; 27.318 } 27.319 return res; 27.320 @@ -337,36 +344,42 @@ 27.321 /* 27.322 * This method only handles static final fields. 27.323 */ 27.324 - protected String addStaticStructMember(FieldDoc field, String cname) 27.325 - throws ClassNotFoundException { 27.326 + protected String addStaticStructMember(VariableElement field, String cname) { 27.327 String res = null; 27.328 Object exp = null; 27.329 27.330 - if (!field.isStatic()) 27.331 + if (!field.getModifiers().contains(Modifier.STATIC)) 27.332 return res; 27.333 - if (!field.isFinal()) 27.334 + if (!field.getModifiers().contains(Modifier.FINAL)) 27.335 return res; 27.336 27.337 - exp = field.constantValue(); 27.338 + exp = field.getConstantValue(); 27.339 27.340 if (exp != null) { 27.341 /* Constant. */ 27.342 27.343 - String cn = cname + "_" + field.name(); 27.344 + String cn = cname + "_" + field.getSimpleName(); 27.345 String suffix = null; 27.346 long val = 0; 27.347 /* Can only handle int, long, float, and double fields. */ 27.348 - if (exp instanceof Integer) { 27.349 + if (exp instanceof Byte 27.350 + || exp instanceof Short 27.351 + || exp instanceof Integer) { 27.352 suffix = "L"; 27.353 - val = ((Integer)exp).intValue(); 27.354 + val = ((Number)exp).intValue(); 27.355 } 27.356 - if (exp instanceof Long) { 27.357 + else if (exp instanceof Long) { 27.358 // Visual C++ supports the i64 suffix, not LL 27.359 suffix = isWindows ? "i64" : "LL"; 27.360 val = ((Long)exp).longValue(); 27.361 } 27.362 - if (exp instanceof Float) suffix = "f"; 27.363 - if (exp instanceof Double) suffix = ""; 27.364 + else if (exp instanceof Float) suffix = "f"; 27.365 + else if (exp instanceof Double) suffix = ""; 27.366 + else if (exp instanceof Character) { 27.367 + suffix = "L"; 27.368 + Character ch = (Character) exp; 27.369 + val = ((int) ch) & 0xffff; 27.370 + } 27.371 if (suffix != null) { 27.372 // Some compilers will generate a spurious warning 27.373 // for the integer constants for Integer.MIN_VALUE 27.374 @@ -376,9 +389,12 @@ 27.375 res = " #undef " + cn + lineSep 27.376 + " #define " + cn 27.377 + " (" + (val + 1) + suffix + "-1)" + lineSep; 27.378 + } else if (suffix.equals("L") || suffix.endsWith("LL")) { 27.379 + res = " #undef " + cn + lineSep 27.380 + + " #define " + cn + " " + val + suffix + lineSep; 27.381 } else { 27.382 res = " #undef " + cn + lineSep 27.383 - + " #define " + cn + " "+ exp.toString() + suffix + lineSep; 27.384 + + " #define " + cn + " " + exp + suffix + lineSep; 27.385 } 27.386 } 27.387 } 27.388 @@ -386,8 +402,8 @@ 27.389 } 27.390 27.391 protected void methodSectionForClass(PrintWriter pw, 27.392 - ClassDoc clazz, String cname) 27.393 - throws ClassNotFoundException { 27.394 + TypeElement clazz, String cname) 27.395 + throws Util.Exit { 27.396 String methods = methodDecls(clazz, cname); 27.397 27.398 if (methods.length() != 0) { 27.399 @@ -402,81 +418,77 @@ 27.400 } 27.401 } 27.402 27.403 - protected String methodDecls(ClassDoc clazz, String cname) 27.404 - throws ClassNotFoundException { 27.405 + protected String methodDecls(TypeElement clazz, String cname) throws Util.Exit { 27.406 27.407 String res = ""; 27.408 - for (int i = 0; i < methods.length; i++) { 27.409 - MethodDoc method = (MethodDoc)methods[i]; 27.410 - if (method.isNative()) 27.411 + for (ExecutableElement method: methods) { 27.412 + if (method.getModifiers().contains(Modifier.NATIVE)) 27.413 res = res + methodDecl(method, clazz, cname); 27.414 } 27.415 return res; 27.416 } 27.417 27.418 - protected String methodDecl(MethodDoc method, 27.419 - ClassDoc clazz, String cname) 27.420 - throws ClassNotFoundException { 27.421 + protected String methodDecl(ExecutableElement method, 27.422 + TypeElement clazz, String cname) 27.423 + throws Util.Exit { 27.424 String res = null; 27.425 27.426 - Type retType = method.returnType(); 27.427 - String typesig = method.signature(); 27.428 - TypeSignature newTypeSig = new TypeSignature(root); 27.429 + TypeMirror retType = types.erasure(method.getReturnType()); 27.430 + String typesig = signature(method); 27.431 + TypeSignature newTypeSig = new TypeSignature(elems); 27.432 String sig = newTypeSig.getTypeSignature(typesig, retType); 27.433 boolean longName = needLongName(method, clazz); 27.434 27.435 if (sig.charAt(0) != '(') 27.436 - Util.error("invalid.method.signature", sig); 27.437 + util.error("invalid.method.signature", sig); 27.438 27.439 27.440 res = "JNIEXPORT " + jniType(retType) + " JNICALL" + lineSep + jniMethodName(method, cname, longName) 27.441 + "(JNIEnv *, " + cRcvrDecl(method, cname); 27.442 - Parameter[] params = method.parameters(); 27.443 - Type argTypes[] = new Type[params.length]; 27.444 - for(int p = 0; p < params.length; p++){ 27.445 - argTypes[p] = params[p].type(); 27.446 + List<? extends VariableElement> params = method.getParameters(); 27.447 + List<TypeMirror> argTypes = new ArrayList<TypeMirror>(); 27.448 + for (VariableElement p: params){ 27.449 + argTypes.add(types.erasure(p.asType())); 27.450 } 27.451 27.452 /* It would have been nice to include the argument names in the 27.453 declaration, but there seems to be a bug in the "BinaryField" 27.454 class, causing the getArguments() method to return "null" for 27.455 most (non-constructor) methods. */ 27.456 - for (int i = 0; i < argTypes.length; i++) 27.457 - res = res + ", " + jniType(argTypes[i]); 27.458 + for (TypeMirror argType: argTypes) 27.459 + res = res + ", " + jniType(argType); 27.460 res = res + ");" + lineSep; 27.461 return res; 27.462 } 27.463 27.464 - protected final boolean needLongName(MethodDoc method, 27.465 - ClassDoc clazz) 27.466 - throws ClassNotFoundException { 27.467 - String methodName = method.name(); 27.468 - for (int i = 0; i < methods.length; i++) { 27.469 - MethodDoc memberMethod = (MethodDoc) methods[i]; 27.470 + protected final boolean needLongName(ExecutableElement method, 27.471 + TypeElement clazz) { 27.472 + Name methodName = method.getSimpleName(); 27.473 + for (ExecutableElement memberMethod: methods) { 27.474 if ((memberMethod != method) && 27.475 - memberMethod.isNative() && (methodName == memberMethod.name())) 27.476 + memberMethod.getModifiers().contains(Modifier.NATIVE) && 27.477 + (methodName.equals(memberMethod.getSimpleName()))) 27.478 return true; 27.479 } 27.480 return false; 27.481 } 27.482 27.483 - protected final String jniMethodName(MethodDoc method, String cname, 27.484 + protected final String jniMethodName(ExecutableElement method, String cname, 27.485 boolean longName) { 27.486 - String res = "Java_" + cname + "_" + method.name(); 27.487 + String res = "Java_" + cname + "_" + method.getSimpleName(); 27.488 27.489 if (longName) { 27.490 - Type mType = method.returnType(); 27.491 - Parameter[] params = method.parameters(); 27.492 - Type argTypes[] = new Type[params.length]; 27.493 - for(int p = 0; p < params.length; p++){ 27.494 - argTypes[p] = params[p].type(); 27.495 + TypeMirror mType = types.erasure(method.getReturnType()); 27.496 + List<? extends VariableElement> params = method.getParameters(); 27.497 + List<TypeMirror> argTypes = new ArrayList<TypeMirror>(); 27.498 + for (VariableElement param: params) { 27.499 + argTypes.add(types.erasure(param.asType())); 27.500 } 27.501 27.502 res = res + "__"; 27.503 - for (int i = 0; i < argTypes.length; i++){ 27.504 - Type t = argTypes[i]; 27.505 - String tname = t.typeName(); 27.506 - TypeSignature newTypeSig = new TypeSignature(root); 27.507 + for (TypeMirror t: argTypes) { 27.508 + String tname = t.toString(); 27.509 + TypeSignature newTypeSig = new TypeSignature(elems); 27.510 String sig = newTypeSig.getTypeSignature(tname); 27.511 res = res + nameToIdentifier(sig); 27.512 } 27.513 @@ -484,88 +496,143 @@ 27.514 return res; 27.515 } 27.516 27.517 - protected final String jniType(Type t) { 27.518 - String elmT =t.typeName(); 27.519 - if (t.dimension().indexOf("[]") != -1) { 27.520 - if(elmT.equals("boolean"))return "jbooleanArray"; 27.521 - else if(elmT.equals("byte"))return "jbyteArray"; 27.522 - else if(elmT.equals("char"))return "jcharArray"; 27.523 - else if(elmT.equals("short"))return "jshortArray"; 27.524 - else if(elmT.equals("int"))return "jintArray"; 27.525 - else if(elmT.equals("long"))return "jlongArray"; 27.526 - else if(elmT.equals("float"))return "jfloatArray"; 27.527 - else if(elmT.equals("double"))return "jdoubleArray"; 27.528 - else if((t.dimension().indexOf("[][]") != -1) || (t.asClassDoc() != null)) return "jobjectArray"; 27.529 - } else { 27.530 - if(elmT.equals("void"))return "void"; 27.531 - else if(elmT.equals("boolean"))return "jboolean"; 27.532 - else if(elmT.equals("byte"))return "jbyte"; 27.533 - else if(elmT.equals("char"))return "jchar"; 27.534 - else if(elmT.equals("short"))return "jshort"; 27.535 - else if(elmT.equals("int"))return "jint"; 27.536 - else if(elmT.equals("long"))return "jlong"; 27.537 - else if(elmT.equals("float"))return "jfloat"; 27.538 - else if(elmT.equals("double"))return "jdouble"; 27.539 - else if (t.asClassDoc() != null) { 27.540 - if (elmT.equals("String")) 27.541 + // copied from JNI.java 27.542 + protected final String jniType(TypeMirror t) throws Util.Exit { 27.543 + TypeElement throwable = elems.getTypeElement("java.lang.Throwable"); 27.544 + TypeElement jClass = elems.getTypeElement("java.lang.Class"); 27.545 + TypeElement jString = elems.getTypeElement("java.lang.String"); 27.546 + Element tclassDoc = types.asElement(t); 27.547 + 27.548 + switch (t.getKind()) { 27.549 + case ARRAY: { 27.550 + TypeMirror ct = ((ArrayType) t).getComponentType(); 27.551 + switch (ct.getKind()) { 27.552 + case BOOLEAN: return "jbooleanArray"; 27.553 + case BYTE: return "jbyteArray"; 27.554 + case CHAR: return "jcharArray"; 27.555 + case SHORT: return "jshortArray"; 27.556 + case INT: return "jintArray"; 27.557 + case LONG: return "jlongArray"; 27.558 + case FLOAT: return "jfloatArray"; 27.559 + case DOUBLE: return "jdoubleArray"; 27.560 + case ARRAY: 27.561 + case DECLARED: return "jobjectArray"; 27.562 + default: throw new Error(ct.toString()); 27.563 + } 27.564 + } 27.565 + 27.566 + case VOID: return "void"; 27.567 + case BOOLEAN: return "jboolean"; 27.568 + case BYTE: return "jbyte"; 27.569 + case CHAR: return "jchar"; 27.570 + case SHORT: return "jshort"; 27.571 + case INT: return "jint"; 27.572 + case LONG: return "jlong"; 27.573 + case FLOAT: return "jfloat"; 27.574 + case DOUBLE: return "jdouble"; 27.575 + 27.576 + case DECLARED: { 27.577 + if (tclassDoc.equals(jString)) 27.578 return "jstring"; 27.579 - else if (t.asClassDoc().subclassOf(root.classNamed("java.lang.Class"))) 27.580 + else if (types.isAssignable(t, throwable.asType())) 27.581 + return "jthrowable"; 27.582 + else if (types.isAssignable(t, jClass.asType())) 27.583 return "jclass"; 27.584 else 27.585 return "jobject"; 27.586 } 27.587 } 27.588 - Util.bug("jni.unknown.type"); 27.589 + 27.590 + util.bug("jni.unknown.type"); 27.591 return null; /* dead code. */ 27.592 } 27.593 27.594 - protected String llniType(Type t, boolean handleize, boolean longDoubleOK) { 27.595 + protected String llniType(TypeMirror t, boolean handleize, boolean longDoubleOK) { 27.596 String res = null; 27.597 - String elmt = t.typeName(); 27.598 - if (t.dimension().indexOf("[]") != -1) { 27.599 - if((t.dimension().indexOf("[][]") != -1) 27.600 - || (t.asClassDoc() != null)) res = "IArrayOfRef"; 27.601 - else if(elmt.equals("boolean")) res = "IArrayOfBoolean"; 27.602 - else if(elmt.equals("byte")) res = "IArrayOfByte"; 27.603 - else if(elmt.equals("char")) res = "IArrayOfChar"; 27.604 - else if(elmt.equals("int")) res = "IArrayOfInt"; 27.605 - else if(elmt.equals("long")) res = "IArrayOfLong"; 27.606 - else if(elmt.equals("float")) res = "IArrayOfFloat"; 27.607 - else if(elmt.equals("double")) res = "IArrayOfDouble"; 27.608 - if (!handleize) res = "DEREFERENCED_" + res; 27.609 - } else { 27.610 - if(elmt.equals("void")) res = "void"; 27.611 - else if( (elmt.equals("boolean")) || (elmt.equals("byte")) 27.612 - ||(elmt.equals("char")) || (elmt.equals("short")) 27.613 - || (elmt.equals("int"))) res = "java_int"; 27.614 - else if(elmt.equals("long")) res = longDoubleOK 27.615 - ? "java_long" : "val32 /* java_long */"; 27.616 - else if(elmt.equals("float")) res = "java_float"; 27.617 - else if(elmt.equals("double")) res = res = longDoubleOK 27.618 - ? "java_double" : "val32 /* java_double */"; 27.619 - else if(t.asClassDoc() != null) { 27.620 - res = "I" + mangleClassName(t.asClassDoc().qualifiedName()); 27.621 + 27.622 + switch (t.getKind()) { 27.623 + case ARRAY: { 27.624 + TypeMirror ct = ((ArrayType) t).getComponentType(); 27.625 + switch (ct.getKind()) { 27.626 + case BOOLEAN: res = "IArrayOfBoolean"; break; 27.627 + case BYTE: res = "IArrayOfByte"; break; 27.628 + case CHAR: res = "IArrayOfChar"; break; 27.629 + case SHORT: res = "IArrayOfShort"; break; 27.630 + case INT: res = "IArrayOfInt"; break; 27.631 + case LONG: res = "IArrayOfLong"; break; 27.632 + case FLOAT: res = "IArrayOfFloat"; break; 27.633 + case DOUBLE: res = "IArrayOfDouble"; break; 27.634 + case ARRAY: 27.635 + case DECLARED: res = "IArrayOfRef"; break; 27.636 + default: throw new Error(ct.getKind() + " " + ct); 27.637 + } 27.638 if (!handleize) res = "DEREFERENCED_" + res; 27.639 + break; 27.640 } 27.641 + 27.642 + case VOID: 27.643 + res = "void"; 27.644 + break; 27.645 + 27.646 + case BOOLEAN: 27.647 + case BYTE: 27.648 + case CHAR: 27.649 + case SHORT: 27.650 + case INT: 27.651 + res = "java_int" ; 27.652 + break; 27.653 + 27.654 + case LONG: 27.655 + res = longDoubleOK ? "java_long" : "val32 /* java_long */"; 27.656 + break; 27.657 + 27.658 + case FLOAT: 27.659 + res = "java_float"; 27.660 + break; 27.661 + 27.662 + case DOUBLE: 27.663 + res = longDoubleOK ? "java_double" : "val32 /* java_double */"; 27.664 + break; 27.665 + 27.666 + case DECLARED: 27.667 + TypeElement e = (TypeElement) types.asElement(t); 27.668 + res = "I" + mangleClassName(e.getQualifiedName().toString()); 27.669 + if (!handleize) res = "DEREFERENCED_" + res; 27.670 + break; 27.671 + 27.672 + default: 27.673 + throw new Error(t.getKind() + " " + t); // FIXME 27.674 } 27.675 + 27.676 return res; 27.677 } 27.678 27.679 - protected final String cRcvrDecl(MemberDoc field, String cname) { 27.680 - return (field.isStatic() ? "jclass" : "jobject"); 27.681 + protected final String cRcvrDecl(Element field, String cname) { 27.682 + return (field.getModifiers().contains(Modifier.STATIC) ? "jclass" : "jobject"); 27.683 } 27.684 27.685 protected String maskName(String s) { 27.686 return "LLNI_mask(" + s + ")"; 27.687 } 27.688 27.689 - protected String llniFieldName(MemberDoc field) { 27.690 - return maskName(field.name()); 27.691 + protected String llniFieldName(VariableElement field) { 27.692 + return maskName(field.getSimpleName().toString()); 27.693 } 27.694 27.695 - protected final boolean isLongOrDouble(Type t) { 27.696 - String tc = t.typeName(); 27.697 - return (tc.equals("long") || tc.equals("double")); 27.698 + protected final boolean isLongOrDouble(TypeMirror t) { 27.699 + TypeVisitor<Boolean,Void> v = new SimpleTypeVisitor6<Boolean,Void>() { 27.700 + public Boolean defaultAction(TypeMirror t, Void p){ 27.701 + return false; 27.702 + } 27.703 + public Boolean visitArray(ArrayType t, Void p) { 27.704 + return visit(t.getComponentType(), p); 27.705 + } 27.706 + public Boolean visitPrimitive(PrimitiveType t, Void p) { 27.707 + TypeKind tk = t.getKind(); 27.708 + return (tk == TypeKind.LONG || tk == TypeKind.DOUBLE); 27.709 + } 27.710 + }; 27.711 + return v.visit(t, null); 27.712 } 27.713 27.714 /* Do unicode to ansi C identifier conversion. 27.715 @@ -602,3 +669,4 @@ 27.716 return false; 27.717 } 27.718 } 27.719 +
28.1 --- a/src/share/classes/com/sun/tools/javah/Main.java Fri Sep 25 14:24:14 2009 -0700 28.2 +++ b/src/share/classes/com/sun/tools/javah/Main.java Fri Sep 25 22:04:43 2009 -0700 28.3 @@ -1,5 +1,5 @@ 28.4 /* 28.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 28.6 + * Copyright 2007-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 @@ -23,134 +23,39 @@ 28.11 * have any questions. 28.12 */ 28.13 28.14 - 28.15 package com.sun.tools.javah; 28.16 28.17 - 28.18 -import java.io.*; 28.19 +import java.io.PrintWriter; 28.20 28.21 /** 28.22 - * Javah generates support files for native methods. 28.23 - * Parse commandline options & Invokes javadoc to execute those commands. 28.24 + * Main entry point. 28.25 * 28.26 - * @author Sucheta Dambalkar 28.27 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 28.28 + * you write code that depends on this, you do so at your own risk. 28.29 + * This code and its internal interfaces are subject to change or 28.30 + * deletion without notice.</b> 28.31 */ 28.32 -public class Main{ 28.33 - /* 28.34 - * Parse arguments given for javah to give proper error messages. 28.35 +public class Main { 28.36 + /** 28.37 + * Main entry point for the launcher. 28.38 + * Note: This method calls System.exit. 28.39 + * @param args command line arguments 28.40 */ 28.41 - public static void main(String[] args){ 28.42 - 28.43 - if (args.length == 0) { 28.44 - Util.usage(1); 28.45 - } 28.46 - for ( int i = 0; i < args.length; i++) { 28.47 - if (args[i].equals("-o")) { 28.48 - i++; 28.49 - if(i >= args.length){ 28.50 - Util.usage(1); 28.51 - }else if(args[i].charAt(0) == '-'){ 28.52 - Util.error("no.outputfile.specified"); 28.53 - }else if((i+1) >= args.length){ 28.54 - Util.error("no.classes.specified"); 28.55 - } 28.56 - } else if (args[i].equals("-d")) { 28.57 - i++; 28.58 - if(i >= args.length){ 28.59 - Util.usage(1); 28.60 - }else if(args[i].charAt(0) == '-') { 28.61 - Util.error("no.outputdir.specified"); 28.62 - }else if((i+1) >= args.length){ 28.63 - Util.error("no.classes.specified"); 28.64 - } 28.65 - } else if (args[i].equals("-td")) { 28.66 - /* Ignored. Generate tmp files to memory. */ 28.67 - i++; 28.68 - if (i == args.length) 28.69 - Util.usage(1); 28.70 - } else if (args[i].equals("-stubs")) { 28.71 - if((i+1) >= args.length){ 28.72 - Util.error("no.classes.specified"); 28.73 - } 28.74 - } else if (args[i].equals("-v") || args[i].equals("-verbose")) { 28.75 - if((i+1) >= args.length){ 28.76 - Util.error("no.classes.specified"); 28.77 - } 28.78 - args[i] = "-verbose"; 28.79 - } else if ((args[i].equals("-help")) || (args[i].equals("--help")) 28.80 - || (args[i].equals("-?")) || (args[i].equals("-h"))) { 28.81 - Util.usage(0); 28.82 - } else if (args[i].equals("-trace")) { 28.83 - System.err.println(Util.getText("tracing.not.supported")); 28.84 - } else if (args[i].equals("-version")) { 28.85 - if((i+1) >= args.length){ 28.86 - Util.version(); 28.87 - } 28.88 - } else if (args[i].equals("-jni")) { 28.89 - if((i+1) >= args.length){ 28.90 - Util.error("no.classes.specified"); 28.91 - } 28.92 - } else if (args[i].equals("-force")) { 28.93 - if((i+1) >= args.length){ 28.94 - Util.error("no.classes.specified"); 28.95 - } 28.96 - } else if (args[i].equals("-Xnew")) { 28.97 - // we're already using the new javah 28.98 - } else if (args[i].equals("-old")) { 28.99 - System.err.println(Util.getText("old.not.supported")); 28.100 - Util.usage(1); 28.101 - } else if (args[i].equals("-Xllni")) { 28.102 - if((i+1) >= args.length){ 28.103 - Util.error("no.classes.specified"); 28.104 - } 28.105 - } else if (args[i].equals("-llni")) { 28.106 - if((i+1) >= args.length){ 28.107 - Util.error("no.classes.specified"); 28.108 - } 28.109 - } else if (args[i].equals("-llniDouble")) { 28.110 - if((i+1) >= args.length){ 28.111 - Util.error("no.classes.specified"); 28.112 - } 28.113 - } else if (args[i].equals("-classpath")) { 28.114 - i++; 28.115 - if(i >= args.length){ 28.116 - Util.usage(1); 28.117 - }else if(args[i].charAt(0) == '-') { 28.118 - Util.error("no.classpath.specified"); 28.119 - }else if((i+1) >= args.length){ 28.120 - Util.error("no.classes.specified"); 28.121 - } 28.122 - } else if (args[i].equals("-bootclasspath")) { 28.123 - i++; 28.124 - if(i >= args.length){ 28.125 - Util.usage(1); 28.126 - }else if(args[i].charAt(0) == '-'){ 28.127 - Util.error("no.bootclasspath.specified"); 28.128 - }else if((i+1) >= args.length){ 28.129 - Util.error("no.classes.specified"); 28.130 - } 28.131 - } else if (args[i].charAt(0) == '-') { 28.132 - Util.error("unknown.option", args[i], null, true); 28.133 - 28.134 - } else { 28.135 - //break; /* The rest must be classes. */ 28.136 - } 28.137 - } 28.138 - 28.139 - /* Invoke javadoc */ 28.140 - 28.141 - String[] javadocargs = new String[args.length + 2]; 28.142 - int i = 0; 28.143 - 28.144 - for(; i < args.length; i++) { 28.145 - javadocargs[i] = args[i]; 28.146 - } 28.147 - 28.148 - javadocargs[i] = "-private"; 28.149 - i++; 28.150 - javadocargs[i] = "-Xclasses"; 28.151 - 28.152 - int rc = com.sun.tools.javadoc.Main.execute("javadoc", "com.sun.tools.javah.MainDoclet", javadocargs); 28.153 + public static void main(String[] args) { 28.154 + JavahTask t = new JavahTask(); 28.155 + int rc = t.run(args); 28.156 System.exit(rc); 28.157 } 28.158 + 28.159 + /** 28.160 + * Entry point that does <i>not</i> call System.exit. 28.161 + * @param args command line arguments 28.162 + * @param out output stream 28.163 + * @return an exit code. 0 means success, non-zero means an error occurred. 28.164 + */ 28.165 + public static int run(String[] args, PrintWriter out) { 28.166 + JavahTask t = new JavahTask(); 28.167 + t.setLog(out); 28.168 + return t.run(args); 28.169 + } 28.170 }
29.1 --- a/src/share/classes/com/sun/tools/javah/MainDoclet.java Fri Sep 25 14:24:14 2009 -0700 29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 29.3 @@ -1,218 +0,0 @@ 29.4 -/* 29.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 29.6 - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 29.7 - * 29.8 - * This code is free software; you can redistribute it and/or modify it 29.9 - * under the terms of the GNU General Public License version 2 only, as 29.10 - * published by the Free Software Foundation. Sun designates this 29.11 - * particular file as subject to the "Classpath" exception as provided 29.12 - * by Sun in the LICENSE file that accompanied this code. 29.13 - * 29.14 - * This code is distributed in the hope that it will be useful, but WITHOUT 29.15 - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 29.16 - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 29.17 - * version 2 for more details (a copy is included in the LICENSE file that 29.18 - * accompanied this code). 29.19 - * 29.20 - * You should have received a copy of the GNU General Public License version 29.21 - * 2 along with this work; if not, write to the Free Software Foundation, 29.22 - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 29.23 - * 29.24 - * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 29.25 - * CA 95054 USA or visit www.sun.com if you need additional information or 29.26 - * have any questions. 29.27 - */ 29.28 - 29.29 - 29.30 -package com.sun.tools.javah; 29.31 - 29.32 -import com.sun.javadoc.*; 29.33 -import java.io.*; 29.34 - 29.35 -/** 29.36 - * A doclet to parse and execute commandline options. 29.37 - * 29.38 - * @author Sucheta Dambalkar(using code from old javap) 29.39 - */ 29.40 -public class MainDoclet{ 29.41 - 29.42 - public static String odir = null; 29.43 - public static String ofile = null; 29.44 - public static boolean stubs = false; 29.45 - public static boolean jni = false; 29.46 - public static boolean llni = false; 29.47 - public static boolean doubleAlign = false; 29.48 - public static boolean force = false; 29.49 - public static String genclass = null; 29.50 - 29.51 - 29.52 - /** 29.53 - * Entry point. 29.54 - */ 29.55 - public static boolean start(RootDoc root) { 29.56 - 29.57 - int j = 0; 29.58 - int k = 0; 29.59 - /** 29.60 - * Command line options. 29.61 - */ 29.62 - String [][] cmdoptions = root.options(); 29.63 - /** 29.64 - * Classes specified on command line. 29.65 - */ 29.66 - ClassDoc[] classes = root.classes(); 29.67 - /** 29.68 - * Generator used by javah. Default is JNI. 29.69 - */ 29.70 - Gen g = new JNI(root); 29.71 - 29.72 - validateOptions(cmdoptions); 29.73 - 29.74 - /* 29.75 - * Select native interface. 29.76 - */ 29.77 - if (jni && llni) Util.error("jni.llni.mixed"); 29.78 - 29.79 - if (llni) 29.80 - g = new LLNI(doubleAlign, root); 29.81 - 29.82 - if (g instanceof JNI && stubs) Util.error("jni.no.stubs"); 29.83 - 29.84 - /* 29.85 - * Arrange for output destination. 29.86 - */ 29.87 - if (odir != null && ofile != null) 29.88 - Util.error("dir.file.mixed"); 29.89 - 29.90 - if (odir != null) 29.91 - g.setOutDir(odir); 29.92 - 29.93 - if (ofile != null) 29.94 - g.setOutFile(ofile); 29.95 - 29.96 - /* 29.97 - * Force set to false will turn off smarts about checking file 29.98 - * content before writing. 29.99 - */ 29.100 - g.setForce(force); 29.101 - 29.102 - /* 29.103 - * Grab the rest of argv[] ... this must be the classes. 29.104 - */ 29.105 - if (classes.length == 0){ 29.106 - Util.error("no.classes.specified"); 29.107 - } 29.108 - /* 29.109 - * Set classes. 29.110 - */ 29.111 - g.setClasses(classes); 29.112 - 29.113 - try { 29.114 - g.run(); 29.115 - } catch (ClassNotFoundException cnfe) { 29.116 - Util.error("class.not.found", cnfe.getMessage()); 29.117 - } catch (IOException ioe) { 29.118 - Util.error("io.exception", ioe.getMessage()); 29.119 - } 29.120 - 29.121 - return true; 29.122 - } 29.123 - 29.124 - /** 29.125 - * Required doclet method. 29.126 - */ 29.127 - public static int optionLength(String option) { 29.128 - if (option.equals("-o")) { 29.129 - return 2; 29.130 - } else if(option.equals("-d")){ 29.131 - return 2; 29.132 - } else if (option.equals("-td")) { 29.133 - return 1; 29.134 - } else if (option.equals("-stubs")) { 29.135 - return 1; 29.136 - } else if(option.equals("-help")){ 29.137 - return 1; 29.138 - } else if(option.equals("--help")){ 29.139 - return 1; 29.140 - } else if(option.equals("-?")){ 29.141 - return 1; 29.142 - } else if(option.equals("-h")){ 29.143 - return 1; 29.144 - } else if(option.equals("-trace")){ 29.145 - return 1; 29.146 - } else if(option.equals("-version")) { 29.147 - return 1; 29.148 - } else if(option.equals("-jni")){ 29.149 - return 1; 29.150 - } else if(option.equals("-force")){ 29.151 - return 1; 29.152 - } else if(option.equals("-Xllni")){ 29.153 - return 1; 29.154 - } else if(option.equals("-llni")){ 29.155 - return 1; 29.156 - } else if(option.equals("-llniDouble")){ 29.157 - return 1; 29.158 - } else return 0; 29.159 - } 29.160 - 29.161 - /** 29.162 - * Parse the command line options. 29.163 - */ 29.164 - public static void validateOptions(String cmdoptions[][]) { 29.165 - /* Default values for options, overridden by user options. */ 29.166 - String bootcp = System.getProperty("sun.boot.class.path"); 29.167 - String usercp = System.getProperty("env.class.path"); 29.168 - 29.169 - for(int p = 0; p < cmdoptions.length; p++){ 29.170 - 29.171 - if (cmdoptions[p][0].equals("-o")) { 29.172 - ofile = cmdoptions[p][1]; 29.173 - } else if(cmdoptions[p][0].equals("-d")){ 29.174 - odir = cmdoptions[p][1]; 29.175 - } else if (cmdoptions[p][0].equals("-td")) { 29.176 - if (p ==cmdoptions.length) 29.177 - Util.usage(1); 29.178 - } else if (cmdoptions[p][0].equals("-stubs")) { 29.179 - stubs = true; 29.180 - } else if (cmdoptions[p][0].equals("-verbose")) { 29.181 - Util.verbose = true; 29.182 - } else if((cmdoptions[p][0].equals("-help")) 29.183 - || (cmdoptions[p][0].equals("--help")) 29.184 - || (cmdoptions[p][0].equals("-?")) 29.185 - || (cmdoptions[p][0].equals("-h"))) { 29.186 - Util.usage(0); 29.187 - } else if (cmdoptions[p][0].equals("-trace")) { 29.188 - System.err.println(Util.getText("tracing.not.supported")); 29.189 - } else if (cmdoptions[p][0].equals("-version")) { 29.190 - Util.version(); 29.191 - } else if (cmdoptions[p][0].equals("-jni")) { 29.192 - jni = true; 29.193 - } else if (cmdoptions[p][0].equals("-force")) { 29.194 - force = true; 29.195 - } else if (cmdoptions[p][0].equals("-Xllni")) { 29.196 - llni = true; 29.197 - } else if (cmdoptions[p][0].equals("-llni")) { 29.198 - llni = true; 29.199 - } else if (cmdoptions[p][0].equals("-llniDouble")) { 29.200 - llni = true; doubleAlign = true; 29.201 - } else if (cmdoptions[p][0].equals("-classpath")) { 29.202 - usercp = cmdoptions[p][1]; 29.203 - } else if (cmdoptions[p][0].equals("-bootclasspath")) { 29.204 - bootcp = cmdoptions[p][1]; 29.205 - } else if((cmdoptions[p][0].charAt(0) == '-') 29.206 - && (!cmdoptions[p][0].equals("-private"))){ 29.207 - Util.error("unknown.option", cmdoptions[p][0], null, true); 29.208 - } else { 29.209 - break; /* The rest must be classes. */ 29.210 - } 29.211 - } 29.212 - 29.213 - 29.214 - if (Util.verbose) { 29.215 - System.err.println("[ Search Path: " 29.216 - + bootcp 29.217 - + System.getProperty("file.separator") 29.218 - + usercp + " ]"); 29.219 - } 29.220 - } 29.221 -}
30.1 --- a/src/share/classes/com/sun/tools/javah/Mangle.java Fri Sep 25 14:24:14 2009 -0700 30.2 +++ b/src/share/classes/com/sun/tools/javah/Mangle.java Fri Sep 25 22:04:43 2009 -0700 30.3 @@ -1,5 +1,5 @@ 30.4 /* 30.5 - * Copyright 2002-2006 Sun Microsystems, Inc. All Rights Reserved. 30.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 30.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 30.8 * 30.9 * This code is free software; you can redistribute it and/or modify it 30.10 @@ -26,22 +26,30 @@ 30.11 30.12 package com.sun.tools.javah; 30.13 30.14 -import com.sun.javadoc.*; 30.15 +import javax.lang.model.element.ExecutableElement; 30.16 +import javax.lang.model.element.TypeElement; 30.17 +import javax.lang.model.element.VariableElement; 30.18 +import javax.lang.model.util.Elements; 30.19 +import javax.lang.model.util.Types; 30.20 30.21 /** 30.22 * A utility for mangling java identifiers into C names. Should make 30.23 * this more fine grained and distribute the functionality to the 30.24 * generators. 30.25 * 30.26 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 30.27 + * If you write code that depends on this, you do so at your own 30.28 + * risk. This code and its internal interfaces are subject to change 30.29 + * or deletion without notice.</b></p> 30.30 + * 30.31 * @author Sucheta Dambalkar(Revised) 30.32 */ 30.33 -class Mangle { 30.34 +public class Mangle { 30.35 30.36 public static class Type { 30.37 - 30.38 public static final int CLASS = 1; 30.39 public static final int FIELDSTUB = 2; 30.40 - public static final int FIELD = 3; 30.41 + public static final int FIELD = 3; 30.42 public static final int JNI = 4; 30.43 public static final int SIGNATURE = 5; 30.44 public static final int METHOD_JDK_1 = 6; 30.45 @@ -49,8 +57,15 @@ 30.46 public static final int METHOD_JNI_LONG = 8; 30.47 }; 30.48 30.49 + private Elements elems; 30.50 + private Types types; 30.51 30.52 - public static final String mangle(String name, int mtype) { 30.53 + Mangle(Elements elems, Types types) { 30.54 + this.elems = elems; 30.55 + this.types = types; 30.56 + } 30.57 + 30.58 + public final String mangle(CharSequence name, int mtype) { 30.59 StringBuffer result = new StringBuffer(100); 30.60 int length = name.length(); 30.61 30.62 @@ -98,15 +113,15 @@ 30.63 return result.toString(); 30.64 } 30.65 30.66 - public static String mangleMethod(MethodDoc method, RootDoc root, ClassDoc clazz, 30.67 + public String mangleMethod(ExecutableElement method, TypeElement clazz, 30.68 int mtype) { 30.69 StringBuffer result = new StringBuffer(100); 30.70 result.append("Java_"); 30.71 30.72 if (mtype == Mangle.Type.METHOD_JDK_1) { 30.73 - result.append(mangle(clazz.qualifiedName(), Mangle.Type.CLASS)); 30.74 + result.append(mangle(clazz.getQualifiedName(), Mangle.Type.CLASS)); 30.75 result.append('_'); 30.76 - result.append(mangle(method.name(), 30.77 + result.append(mangle(method.getSimpleName(), 30.78 Mangle.Type.FIELD)); 30.79 result.append("_stub"); 30.80 return result.toString(); 30.81 @@ -115,13 +130,13 @@ 30.82 /* JNI */ 30.83 result.append(mangle(getInnerQualifiedName(clazz), Mangle.Type.JNI)); 30.84 result.append('_'); 30.85 - result.append(mangle(method.name(), 30.86 + result.append(mangle(method.getSimpleName(), 30.87 Mangle.Type.JNI)); 30.88 if (mtype == Mangle.Type.METHOD_JNI_LONG) { 30.89 result.append("__"); 30.90 - String typesig = method.signature(); 30.91 - TypeSignature newTypeSig = new TypeSignature(root); 30.92 - String sig = newTypeSig.getTypeSignature(typesig, method.returnType()); 30.93 + String typesig = signature(method); 30.94 + TypeSignature newTypeSig = new TypeSignature(elems); 30.95 + String sig = newTypeSig.getTypeSignature(typesig, method.getReturnType()); 30.96 sig = sig.substring(1); 30.97 sig = sig.substring(0, sig.lastIndexOf(')')); 30.98 sig = sig.replace('/', '.'); 30.99 @@ -131,15 +146,11 @@ 30.100 return result.toString(); 30.101 } 30.102 //where 30.103 - private static String getInnerQualifiedName(ClassDoc clazz) { 30.104 - ClassDoc encl = clazz.containingClass(); 30.105 - if (encl == null) 30.106 - return clazz.qualifiedName(); 30.107 - else 30.108 - return getInnerQualifiedName(encl) + '$' + clazz.simpleTypeName(); 30.109 + private String getInnerQualifiedName(TypeElement clazz) { 30.110 + return elems.getBinaryName(clazz).toString(); 30.111 } 30.112 30.113 - public static final String mangleChar(char ch) { 30.114 + public final String mangleChar(char ch) { 30.115 String s = Integer.toHexString(ch); 30.116 int nzeros = 5 - s.length(); 30.117 char[] result = new char[6]; 30.118 @@ -151,6 +162,19 @@ 30.119 return new String(result); 30.120 } 30.121 30.122 + // Warning: duplicated in Gen 30.123 + private String signature(ExecutableElement e) { 30.124 + StringBuffer sb = new StringBuffer(); 30.125 + String sep = "("; 30.126 + for (VariableElement p: e.getParameters()) { 30.127 + sb.append(sep); 30.128 + sb.append(types.erasure(p.asType()).toString()); 30.129 + sep = ","; 30.130 + } 30.131 + sb.append(")"); 30.132 + return sb.toString(); 30.133 + } 30.134 + 30.135 /* Warning: Intentional ASCII operation. */ 30.136 private static final boolean isalnum(char ch) { 30.137 return ch <= 0x7f && /* quick test */
31.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 31.2 +++ b/src/share/classes/com/sun/tools/javah/NativeHeaderTool.java Fri Sep 25 22:04:43 2009 -0700 31.3 @@ -0,0 +1,147 @@ 31.4 +/* 31.5 + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. 31.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 31.7 + * 31.8 + * This code is free software; you can redistribute it and/or modify it 31.9 + * under the terms of the GNU General Public License version 2 only, as 31.10 + * published by the Free Software Foundation. Sun designates this 31.11 + * particular file as subject to the "Classpath" exception as provided 31.12 + * by Sun in the LICENSE file that accompanied this code. 31.13 + * 31.14 + * This code is distributed in the hope that it will be useful, but WITHOUT 31.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 31.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 31.17 + * version 2 for more details (a copy is included in the LICENSE file that 31.18 + * accompanied this code). 31.19 + * 31.20 + * You should have received a copy of the GNU General Public License version 31.21 + * 2 along with this work; if not, write to the Free Software Foundation, 31.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 31.23 + * 31.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 31.25 + * CA 95054 USA or visit www.sun.com if you need additional information or 31.26 + * have any questions. 31.27 + */ 31.28 + 31.29 +package com.sun.tools.javah; //javax.tools; 31.30 + 31.31 +import java.io.Writer; 31.32 +import java.nio.charset.Charset; 31.33 +import java.util.Locale; 31.34 +import java.util.concurrent.Callable; 31.35 +import javax.tools.DiagnosticListener; 31.36 +import javax.tools.JavaFileManager; 31.37 +import javax.tools.JavaFileObject; 31.38 +import javax.tools.OptionChecker; 31.39 +import javax.tools.StandardJavaFileManager; 31.40 +import javax.tools.Tool; 31.41 + 31.42 +/** 31.43 + * This class is intended to be put in javax.tools. 31.44 + * 31.45 + * @see DiagnosticListener 31.46 + * @see Diagnostic 31.47 + * @see JavaFileManager 31.48 + * @since 1.7 31.49 + * 31.50 + * <p><b>This is NOT part of any API supported by Sun Microsystems. If 31.51 + * you write code that depends on this, you do so at your own risk. 31.52 + * This code and its internal interfaces are subject to change or 31.53 + * deletion without notice.</b> 31.54 + */ 31.55 +public interface NativeHeaderTool extends Tool, OptionChecker { 31.56 + 31.57 + /** 31.58 + * Creates a future for a native header task with the given 31.59 + * components and arguments. The task might not have 31.60 + * completed as described in the NativeHeaderTask interface. 31.61 + * 31.62 + * <p>If a file manager is provided, it must be able to handle all 31.63 + * locations defined in {@link StandardLocation}. 31.64 + * 31.65 + * @param out a Writer for additional output from the task; 31.66 + * use {@code System.err} if {@code null} 31.67 + * @param fileManager a file manager; if {@code null} use the 31.68 + * task's standard filemanager 31.69 + * @param diagnosticListener a diagnostic listener; if {@code 31.70 + * null} use the compiler's default method for reporting 31.71 + * diagnostics 31.72 + * @param options task options, {@code null} means no options 31.73 + * @param classes class names for which native headers should be generated 31.74 + * @return an object representing the task to be done 31.75 + * @throws RuntimeException if an unrecoverable error 31.76 + * occurred in a user supplied component. The 31.77 + * {@linkplain Throwable#getCause() cause} will be the error in 31.78 + * user code. 31.79 + * @throws IllegalArgumentException if any of the given 31.80 + * compilation units are of other kind than 31.81 + * {@linkplain JavaFileObject.Kind#SOURCE source} 31.82 + */ 31.83 + NativeHeaderTask getTask(Writer out, 31.84 + JavaFileManager fileManager, 31.85 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 31.86 + Iterable<String> options, 31.87 + Iterable<String> classes); 31.88 + 31.89 + /** 31.90 + * Gets a new instance of the standard file manager implementation 31.91 + * for this tool. The file manager will use the given diagnostic 31.92 + * listener for producing any non-fatal diagnostics. Fatal errors 31.93 + * will be signalled with the appropriate exceptions. 31.94 + * 31.95 + * <p>The standard file manager will be automatically reopened if 31.96 + * it is accessed after calls to {@code flush} or {@code close}. 31.97 + * The standard file manager must be usable with other tools. 31.98 + * 31.99 + * @param diagnosticListener a diagnostic listener for non-fatal 31.100 + * diagnostics; if {@code null} use the tool's default method 31.101 + * for reporting diagnostics 31.102 + * @param locale the locale to apply when formatting diagnostics; 31.103 + * {@code null} means the {@linkplain Locale#getDefault() default locale}. 31.104 + * @param charset the character set used for decoding bytes; if 31.105 + * {@code null} use the platform default 31.106 + * @return the standard file manager 31.107 + */ 31.108 + StandardJavaFileManager getStandardFileManager( 31.109 + DiagnosticListener<? super JavaFileObject> diagnosticListener, 31.110 + Locale locale, 31.111 + Charset charset); 31.112 + 31.113 + /** 31.114 + * Interface representing a future for a native header task. The 31.115 + * task has not yet started. To start the task, call 31.116 + * the {@linkplain #call call} method. 31.117 + * 31.118 + * <p>Before calling the call method, additional aspects of the 31.119 + * task can be configured, for example, by calling the 31.120 + * {@linkplain #setLocale setLocale} method. 31.121 + */ 31.122 + interface NativeHeaderTask extends Callable<Boolean> { 31.123 + 31.124 + /** 31.125 + * Set the locale to be applied when formatting diagnostics and 31.126 + * other localized data. 31.127 + * 31.128 + * @param locale the locale to apply; {@code null} means apply no 31.129 + * locale 31.130 + * @throws IllegalStateException if the task has started 31.131 + */ 31.132 + void setLocale(Locale locale); 31.133 + 31.134 + /** 31.135 + * Performs this native header task. The task may only 31.136 + * be performed once. Subsequent calls to this method throw 31.137 + * IllegalStateException. 31.138 + * 31.139 + * @return true if and only all the files were processed without errors; 31.140 + * false otherwise 31.141 + * 31.142 + * @throws RuntimeException if an unrecoverable error occurred 31.143 + * in a user-supplied component. The 31.144 + * {@linkplain Throwable#getCause() cause} will be the error 31.145 + * in user code. 31.146 + * @throws IllegalStateException if called more than once 31.147 + */ 31.148 + Boolean call(); 31.149 + } 31.150 +}
32.1 --- a/src/share/classes/com/sun/tools/javah/TypeSignature.java Fri Sep 25 14:24:14 2009 -0700 32.2 +++ b/src/share/classes/com/sun/tools/javah/TypeSignature.java Fri Sep 25 22:04:43 2009 -0700 32.3 @@ -1,5 +1,5 @@ 32.4 /* 32.5 - * Copyright 2002-2003 Sun Microsystems, Inc. All Rights Reserved. 32.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved. 32.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 32.8 * 32.9 * This code is free software; you can redistribute it and/or modify it 32.10 @@ -26,19 +26,34 @@ 32.11 32.12 package com.sun.tools.javah; 32.13 32.14 -import com.sun.javadoc.*; 32.15 -import java.io.*; 32.16 import java.util.*; 32.17 +import javax.lang.model.element.Name; 32.18 +import javax.lang.model.element.TypeElement; 32.19 +import javax.lang.model.type.ArrayType; 32.20 +import javax.lang.model.type.DeclaredType; 32.21 +import javax.lang.model.type.NoType; 32.22 +import javax.lang.model.type.PrimitiveType; 32.23 +import javax.lang.model.type.TypeKind; 32.24 +import javax.lang.model.type.TypeMirror; 32.25 +import javax.lang.model.type.TypeVariable; 32.26 +import javax.lang.model.type.TypeVisitor; 32.27 +import javax.lang.model.util.Elements; 32.28 +import javax.lang.model.util.SimpleTypeVisitor6; 32.29 32.30 /** 32.31 * Returns internal type signature. 32.32 * 32.33 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 32.34 + * If you write code that depends on this, you do so at your own 32.35 + * risk. This code and its internal interfaces are subject to change 32.36 + * or deletion without notice.</b></p> 32.37 + * 32.38 * @author Sucheta Dambalkar 32.39 */ 32.40 32.41 public class TypeSignature{ 32.42 32.43 - RootDoc root = null; 32.44 + Elements elems; 32.45 32.46 /* Signature Characters */ 32.47 32.48 @@ -56,8 +71,8 @@ 32.49 32.50 32.51 32.52 - public TypeSignature(RootDoc root){ 32.53 - this.root = root; 32.54 + public TypeSignature(Elements elems){ 32.55 + this.elems = elems; 32.56 } 32.57 32.58 /* 32.59 @@ -70,16 +85,15 @@ 32.60 /* 32.61 * Returns the type signature of a method according to JVM specs 32.62 */ 32.63 - public String getTypeSignature(String javasignature, Type returnType){ 32.64 - 32.65 + public String getTypeSignature(String javasignature, TypeMirror returnType){ 32.66 String signature = null; //Java type signature. 32.67 String typeSignature = null; //Internal type signature. 32.68 - Vector<Object> params = new Vector<Object>(); //List of parameters. 32.69 + List<String> params = new ArrayList<String>(); //List of parameters. 32.70 String paramsig = null; //Java parameter signature. 32.71 String paramJVMSig = null; //Internal parameter signature. 32.72 String returnSig = null; //Java return type signature. 32.73 String returnJVMType = null; //Internal return type signature. 32.74 - String dimension = null; //Array dimension. 32.75 + int dimensions = 0; //Array dimension. 32.76 32.77 int startIndex = -1; 32.78 int endIndex = -1; 32.79 @@ -87,28 +101,27 @@ 32.80 int i = 0; 32.81 32.82 // Gets the actual java signature without parentheses. 32.83 - if(javasignature != null){ 32.84 + if (javasignature != null) { 32.85 startIndex = javasignature.indexOf("("); 32.86 endIndex = javasignature.indexOf(")"); 32.87 } 32.88 32.89 - if(((startIndex != -1) && (endIndex != -1)) 32.90 - &&(startIndex+1 < javasignature.length()) 32.91 - &&(endIndex < javasignature.length())) { 32.92 - 32.93 + if (((startIndex != -1) && (endIndex != -1)) 32.94 + &&(startIndex+1 < javasignature.length()) 32.95 + &&(endIndex < javasignature.length())) { 32.96 signature = javasignature.substring(startIndex+1, endIndex); 32.97 } 32.98 32.99 // Separates parameters. 32.100 - if(signature != null){ 32.101 - if(signature.indexOf(",") != -1){ 32.102 + if (signature != null) { 32.103 + if (signature.indexOf(",") != -1) { 32.104 st = new StringTokenizer(signature, ","); 32.105 - if(st != null){ 32.106 + if (st != null) { 32.107 while (st.hasMoreTokens()) { 32.108 params.add(st.nextToken()); 32.109 } 32.110 } 32.111 - }else { 32.112 + } else { 32.113 params.add(signature); 32.114 } 32.115 } 32.116 @@ -117,10 +130,10 @@ 32.117 typeSignature = "("; 32.118 32.119 // Gets indivisual internal parameter signature. 32.120 - while(params.isEmpty() != true){ 32.121 - paramsig =((String)params.remove(i)).trim(); 32.122 + while (params.isEmpty() != true) { 32.123 + paramsig = params.remove(i).trim(); 32.124 paramJVMSig = getParamJVMSignature(paramsig); 32.125 - if(paramJVMSig != null){ 32.126 + if (paramJVMSig != null) { 32.127 typeSignature += paramJVMSig; 32.128 } 32.129 } 32.130 @@ -130,36 +143,30 @@ 32.131 // Get internal return type signature. 32.132 32.133 returnJVMType = ""; 32.134 - if(returnType != null){ 32.135 - dimension = returnType.dimension(); 32.136 + if (returnType != null) { 32.137 + dimensions = dimensions(returnType); 32.138 } 32.139 32.140 - if(dimension != null){ 32.141 - 32.142 - //Gets array dimension of return type. 32.143 - while(dimension.indexOf("[]") != -1){ 32.144 - returnJVMType += "["; 32.145 - int stindex = dimension.indexOf("]") + 1; 32.146 - if(stindex <= dimension.length()){ 32.147 - dimension = dimension.substring(stindex); 32.148 - }else dimension = ""; 32.149 - } 32.150 + //Gets array dimension of return type. 32.151 + while (dimensions-- > 0) { 32.152 + returnJVMType += "["; 32.153 } 32.154 - if(returnType != null){ 32.155 - returnSig = returnType.qualifiedTypeName(); 32.156 + if (returnType != null) { 32.157 + returnSig = qualifiedTypeName(returnType); 32.158 returnJVMType += getComponentType(returnSig); 32.159 - }else { 32.160 + } else { 32.161 System.out.println("Invalid return type."); 32.162 } 32.163 32.164 typeSignature += returnJVMType; 32.165 + 32.166 return typeSignature; 32.167 } 32.168 32.169 /* 32.170 * Returns internal signature of a parameter. 32.171 */ 32.172 - private String getParamJVMSignature(String paramsig){ 32.173 + private String getParamJVMSignature(String paramsig) { 32.174 String paramJVMSig = ""; 32.175 String componentType =""; 32.176 32.177 @@ -206,12 +213,13 @@ 32.178 else if(componentType.equals("double")) JVMSig += SIG_DOUBLE ; 32.179 else { 32.180 if(!componentType.equals("")){ 32.181 - ClassDoc classNameDoc = root.classNamed(componentType); 32.182 + TypeElement classNameDoc = elems.getTypeElement(componentType); 32.183 32.184 if(classNameDoc == null){ 32.185 - System.out.println("Invalid class type"); 32.186 + System.out.println("Invalid class type for " + componentType); 32.187 + new Exception().printStackTrace(); 32.188 }else { 32.189 - String classname = classNameDoc.qualifiedName(); 32.190 + String classname = classNameDoc.getQualifiedName().toString(); 32.191 String newclassname = classname.replace('.', '/'); 32.192 JVMSig += "L"; 32.193 JVMSig += newclassname; 32.194 @@ -222,4 +230,43 @@ 32.195 } 32.196 return JVMSig; 32.197 } 32.198 + 32.199 + int dimensions(TypeMirror t) { 32.200 + if (t.getKind() != TypeKind.ARRAY) 32.201 + return 0; 32.202 + return 1 + dimensions(((ArrayType) t).getComponentType()); 32.203 + } 32.204 + 32.205 + 32.206 + String qualifiedTypeName(TypeMirror type) { 32.207 + TypeVisitor<Name, Void> v = new SimpleTypeVisitor6<Name, Void>() { 32.208 + @Override 32.209 + public Name visitArray(ArrayType t, Void p) { 32.210 + return t.getComponentType().accept(this, p); 32.211 + } 32.212 + 32.213 + @Override 32.214 + public Name visitDeclared(DeclaredType t, Void p) { 32.215 + return ((TypeElement) t.asElement()).getQualifiedName(); 32.216 + } 32.217 + 32.218 + @Override 32.219 + public Name visitPrimitive(PrimitiveType t, Void p) { 32.220 + return elems.getName(t.toString()); 32.221 + } 32.222 + 32.223 + @Override 32.224 + public Name visitNoType(NoType t, Void p) { 32.225 + if (t.getKind() == TypeKind.VOID) 32.226 + return elems.getName("void"); 32.227 + return defaultAction(t, p); 32.228 + } 32.229 + 32.230 + @Override 32.231 + public Name visitTypeVariable(TypeVariable t, Void p) { 32.232 + return t.getUpperBound().accept(this, p); 32.233 + } 32.234 + }; 32.235 + return v.visit(type).toString(); 32.236 + } 32.237 }
33.1 --- a/src/share/classes/com/sun/tools/javah/Util.java Fri Sep 25 14:24:14 2009 -0700 33.2 +++ b/src/share/classes/com/sun/tools/javah/Util.java Fri Sep 25 22:04:43 2009 -0700 33.3 @@ -1,5 +1,5 @@ 33.4 /* 33.5 - * Copyright 2002-2004 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,12 +26,15 @@ 33.11 33.12 package com.sun.tools.javah; 33.13 33.14 -import java.io.File; 33.15 -import java.io.FileInputStream; 33.16 -import java.io.IOException; 33.17 +import java.io.PrintWriter; 33.18 +import java.text.MessageFormat; 33.19 +import java.util.Locale; 33.20 import java.util.ResourceBundle; 33.21 -import java.text.MessageFormat; 33.22 import java.util.MissingResourceException; 33.23 +import javax.tools.Diagnostic; 33.24 +import javax.tools.Diagnostic.Kind; 33.25 +import javax.tools.DiagnosticListener; 33.26 +import javax.tools.JavaFileObject; 33.27 33.28 /** 33.29 * Messages, verbose and error handling support. 33.30 @@ -41,42 +44,70 @@ 33.31 * bug -- Bug has occurred in javah 33.32 * fatal -- We can't even find resources, so bail fast, don't localize 33.33 * 33.34 + * <p><b>This is NOT part of any API supported by Sun Microsystems. 33.35 + * If you write code that depends on this, you do so at your own 33.36 + * risk. This code and its internal interfaces are subject to change 33.37 + * or deletion without notice.</b></p> 33.38 */ 33.39 public class Util { 33.40 + /** Exit is used to replace the use of System.exit in the original javah. 33.41 + */ 33.42 + public static class Exit extends Error { 33.43 + private static final long serialVersionUID = 430820978114067221L; 33.44 + Exit(int exitValue) { 33.45 + this(exitValue, null); 33.46 + } 33.47 + 33.48 + Exit(int exitValue, Throwable cause) { 33.49 + super(cause); 33.50 + this.exitValue = exitValue; 33.51 + this.cause = cause; 33.52 + } 33.53 + 33.54 + Exit(Exit e) { 33.55 + this(e.exitValue, e.cause); 33.56 + } 33.57 + 33.58 + public final int exitValue; 33.59 + public final Throwable cause; 33.60 + } 33.61 33.62 /* 33.63 * Help for verbosity. 33.64 */ 33.65 - public static boolean verbose = false; 33.66 + public boolean verbose = false; 33.67 33.68 - public static void log(String s) { 33.69 - System.out.println(s); 33.70 + public PrintWriter log; 33.71 + public DiagnosticListener<? super JavaFileObject> dl; 33.72 + 33.73 + Util(PrintWriter log, DiagnosticListener<? super JavaFileObject> dl) { 33.74 + this.log = log; 33.75 + this.dl = dl; 33.76 + } 33.77 + 33.78 + public void log(String s) { 33.79 + log.println(s); 33.80 } 33.81 33.82 33.83 /* 33.84 * Help for loading localized messages. 33.85 */ 33.86 - private static ResourceBundle m; 33.87 + private ResourceBundle m; 33.88 33.89 - private static void initMessages() { 33.90 + private void initMessages() throws Exit { 33.91 try { 33.92 - m=ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n"); 33.93 + m = ResourceBundle.getBundle("com.sun.tools.javah.resources.l10n"); 33.94 } catch (MissingResourceException mre) { 33.95 fatal("Error loading resources. Please file a bug report.", mre); 33.96 } 33.97 } 33.98 33.99 - public static String getText(String key) { 33.100 - return getText(key, null, null); 33.101 - } 33.102 - 33.103 - private static String getText(String key, String a1, String a2){ 33.104 + private String getText(String key, Object... args) throws Exit { 33.105 if (m == null) 33.106 initMessages(); 33.107 try { 33.108 - return MessageFormat.format(m.getString(key), 33.109 - new Object[] { a1, a2 }); 33.110 + return MessageFormat.format(m.getString(key), args); 33.111 } catch (MissingResourceException e) { 33.112 fatal("Key " + key + " not found in resources.", e); 33.113 } 33.114 @@ -86,107 +117,74 @@ 33.115 /* 33.116 * Usage message. 33.117 */ 33.118 - public static void usage(int exitValue) { 33.119 - if (exitValue == 0) { 33.120 - System.out.println(getText("usage")); 33.121 - } else { 33.122 - System.err.println(getText("usage")); 33.123 - } 33.124 - System.exit(exitValue); 33.125 + public void usage() throws Exit { 33.126 + log.println(getText("usage")); 33.127 } 33.128 33.129 - public static void version() { 33.130 - System.out.println(getText("javah.version", 33.131 + public void version() throws Exit { 33.132 + log.println(getText("javah.version", 33.133 System.getProperty("java.version"), null)); 33.134 - System.exit(0); 33.135 } 33.136 33.137 /* 33.138 * Failure modes. 33.139 */ 33.140 - public static void bug(String key) { 33.141 + public void bug(String key) throws Exit { 33.142 bug(key, null); 33.143 } 33.144 33.145 - public static void bug(String key, Exception e) { 33.146 - if (e != null) 33.147 - e.printStackTrace(); 33.148 - System.err.println(getText(key)); 33.149 - System.err.println(getText("bug.report")); 33.150 - System.exit(11); 33.151 + public void bug(String key, Exception e) throws Exit { 33.152 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key)); 33.153 + dl.report(createDiagnostic(Diagnostic.Kind.NOTE, "bug.report")); 33.154 + throw new Exit(11, e); 33.155 } 33.156 33.157 - public static void error(String key) { 33.158 - error(key, null); 33.159 + public void error(String key, Object... args) throws Exit { 33.160 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, key, args)); 33.161 + throw new Exit(15); 33.162 } 33.163 33.164 - public static void error(String key, String a1) { 33.165 - error(key, a1, null); 33.166 - } 33.167 - 33.168 - public static void error(String key, String a1, String a2) { 33.169 - error(key, a1, a2, false); 33.170 - } 33.171 - 33.172 - public static void error(String key, String a1, String a2, 33.173 - boolean showUsage) { 33.174 - System.err.println("Error: " + getText(key, a1, a2)); 33.175 - if (showUsage) 33.176 - usage(15); 33.177 - System.exit(15); 33.178 - } 33.179 - 33.180 - 33.181 - private static void fatal(String msg) { 33.182 + private void fatal(String msg) throws Exit { 33.183 fatal(msg, null); 33.184 } 33.185 33.186 - private static void fatal(String msg, Exception e) { 33.187 - if (e != null) { 33.188 - e.printStackTrace(); 33.189 - } 33.190 - System.err.println(msg); 33.191 - System.exit(10); 33.192 + private void fatal(String msg, Exception e) throws Exit { 33.193 + dl.report(createDiagnostic(Diagnostic.Kind.ERROR, "", msg)); 33.194 + throw new Exit(10, e); 33.195 } 33.196 33.197 - /* 33.198 - * Support for platform specific things in javah, such as pragma 33.199 - * directives, exported symbols etc. 33.200 - */ 33.201 - static private ResourceBundle platform = null; 33.202 - 33.203 - /* 33.204 - * Set when platform has been initialized. 33.205 - */ 33.206 - static private boolean platformInit = false; 33.207 - 33.208 - static String getPlatformString(String key) { 33.209 - if (!platformInit) { 33.210 - initPlatform(); 33.211 - platformInit = true; 33.212 - } 33.213 - if (platform == null) 33.214 - return null; 33.215 - try { 33.216 - return platform.getString(key); 33.217 - } catch (MissingResourceException mre) { 33.218 - return null; 33.219 - } 33.220 - } 33.221 - 33.222 - private static void initPlatform() { 33.223 - String os = System.getProperty("os.name"); 33.224 - if (os.startsWith("Windows")) { 33.225 - os = "win32"; 33.226 - } else if (os.indexOf("Linux") >= 0) { 33.227 - os = "Linux"; 33.228 - } 33.229 - String arch = System.getProperty("os.arch"); 33.230 - String resname = "com.sun.tools.javah.resources." + os + "_" + arch; 33.231 - try { 33.232 - platform=ResourceBundle.getBundle(resname); 33.233 - } catch (MissingResourceException mre) { 33.234 - // fatal("Error loading resources. Please file a bug report.", mre); 33.235 - } 33.236 + private Diagnostic<JavaFileObject> createDiagnostic( 33.237 + final Diagnostic.Kind kind, final String code, final Object... args) { 33.238 + return new Diagnostic<JavaFileObject>() { 33.239 + public String getCode() { 33.240 + return code; 33.241 + } 33.242 + public long getColumnNumber() { 33.243 + return Diagnostic.NOPOS; 33.244 + } 33.245 + public long getEndPosition() { 33.246 + return Diagnostic.NOPOS; 33.247 + } 33.248 + public Kind getKind() { 33.249 + return kind; 33.250 + } 33.251 + public long getLineNumber() { 33.252 + return Diagnostic.NOPOS; 33.253 + } 33.254 + public String getMessage(Locale locale) { 33.255 + if (code.length() == 0) 33.256 + return (String) args[0]; 33.257 + return getText(code, args); // FIXME locale 33.258 + } 33.259 + public long getPosition() { 33.260 + return Diagnostic.NOPOS; 33.261 + } 33.262 + public JavaFileObject getSource() { 33.263 + return null; 33.264 + } 33.265 + public long getStartPosition() { 33.266 + return Diagnostic.NOPOS; 33.267 + } 33.268 + }; 33.269 } 33.270 }
34.1 --- a/src/share/classes/com/sun/tools/javah/resources/Linux_ppc.properties Fri Sep 25 14:24:14 2009 -0700 34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 34.3 @@ -1,27 +0,0 @@ 34.4 -# 34.5 -# Copyright 2000 Sun Microsystems, Inc. All Rights Reserved. 34.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 34.7 -# 34.8 -# This code is free software; you can redistribute it and/or modify it 34.9 -# under the terms of the GNU General Public License version 2 only, as 34.10 -# published by the Free Software Foundation. Sun designates this 34.11 -# particular file as subject to the "Classpath" exception as provided 34.12 -# by Sun in the LICENSE file that accompanied this code. 34.13 -# 34.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 34.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 34.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 34.17 -# version 2 for more details (a copy is included in the LICENSE file that 34.18 -# accompanied this code). 34.19 -# 34.20 -# You should have received a copy of the GNU General Public License version 34.21 -# 2 along with this work; if not, write to the Free Software Foundation, 34.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 34.23 -# 34.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 34.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 34.26 -# have any questions. 34.27 -# 34.28 - 34.29 -pack.pragma.start=\#pragma pack(4)\n 34.30 -pack.pragma.end=\#pragma pack()\n
35.1 --- a/src/share/classes/com/sun/tools/javah/resources/Linux_sparc.properties Fri Sep 25 14:24:14 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/SunOS_sparc.properties Fri Sep 25 14:24:14 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 1998 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_sparcv9.properties Fri Sep 25 14:24:14 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 2001 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/l10n.properties Fri Sep 25 14:24:14 2009 -0700 38.2 +++ b/src/share/classes/com/sun/tools/javah/resources/l10n.properties Fri Sep 25 22:04:43 2009 -0700 38.3 @@ -21,47 +21,47 @@ 38.4 # Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 38.5 # CA 95054 USA or visit www.sun.com if you need additional information or 38.6 # have any questions. 38.7 -# 38.8 +# 38.9 38.10 # 38.11 # User errors, command line errors. 38.12 # 38.13 cant.create.dir=\ 38.14 - The directory {0} could not be create for output. 38.15 + The directory {0} could not be create for output. 38.16 at.args.cant.read=\ 38.17 - Can''t read command line arguments from file {1}. 38.18 + Can''t read command line arguments from file {1}. 38.19 at.args.io.exception=\ 38.20 - The following I/O problem was encountered when processing an @ \ 38.21 + The following I/O problem was encountered when processing an @ \ 38.22 argument on the command line: {0}. 38.23 old.jni.mixed=\ 38.24 - Can''t mix options -jni and -old. Try -help. 38.25 + Can''t mix options -jni and -old. Try -help. 38.26 old.llni.mixed=\ 38.27 - Can''t mix options -old and -llni. Try -help. 38.28 + Can''t mix options -old and -llni. Try -help. 38.29 old.not.supported=\ 38.30 - Option -old not supported by this version of javah. 38.31 + Option -old not supported by this version of javah. 38.32 invalid.method.signature=\ 38.33 - Invalid method signature: {0} 38.34 + Invalid method signature: {0} 38.35 jni.llni.mixed=\ 38.36 - Can''t mix options -jni and -llni. Try -help. 38.37 + Can''t mix options -jni and -llni. Try -help. 38.38 jni.no.stubs=\ 38.39 - JNI does not require stubs, please refer to the JNI documentation. 38.40 + JNI does not require stubs, please refer to the JNI documentation. 38.41 dir.file.mixed=\ 38.42 - Can''t mix options -d and -o. Try -help. 38.43 + Can''t mix options -d and -o. Try -help. 38.44 no.classes.specified=\ 38.45 - No classes were specified on the command line. Try -help. 38.46 + No classes were specified on the command line. Try -help. 38.47 no.outputfile.specified=\ 38.48 - No outputfile was specified on the command line. Try -help. 38.49 + No outputfile was specified on the command line. Try -help. 38.50 no.outputdir.specified=\ 38.51 - No output directory was specified on the command line. Try -help. 38.52 + No output directory was specified on the command line. Try -help. 38.53 no.classpath.specified=\ 38.54 - No classpath was specified on the command line. Try -help. 38.55 + No classpath was specified on the command line. Try -help. 38.56 no.bootclasspath.specified=\ 38.57 - No bootclasspath was specified on the command line. Try -help. 38.58 + No bootclasspath was specified on the command line. Try -help. 38.59 unknown.option=\ 38.60 - {0} is an illegal argument\n 38.61 + {0} is an illegal argument\n 38.62 tracing.not.supported=\ 38.63 - Warning: Tracing is no longer supported. Instead, use\ 38.64 - -verbose:jni option of the virtual machine. 38.65 + Warning: Tracing is no longer supported. Instead, use\ 38.66 + -verbose:jni option of the virtual machine. 38.67 38.68 # 38.69 # Usage message. 38.70 @@ -79,11 +79,37 @@ 38.71 -jni Generate JNI-style header file (default)\n\t\ 38.72 -version Print version information\n\t\ 38.73 -verbose Enable verbose output\n\t\ 38.74 --force Always write output files\n\ 38.75 +-force Always write output files\n\ 38.76 \n\ 38.77 <classes> are specified with their fully qualified names (for\n\ 38.78 instance, java.lang.Object).\n 38.79 38.80 +main.usage=\ 38.81 +Usage: \n\ 38.82 +\ javah [options] <classes>\n\ 38.83 +where [options] include: 38.84 +main.opt.o=\ 38.85 +\ -o <file> Output file (only one of -d or -o may be used) 38.86 +main.opt.d=\ 38.87 +\ -d <dir> Output directory 38.88 +main.opt.v=\ 38.89 +\ -v -verbose Enable verbose output 38.90 +main.opt.help=\ 38.91 +\ -h --help -? Print this message 38.92 +main.opt.version=\ 38.93 +\ -version Print version information 38.94 +main.opt.jni=\ 38.95 +\ -jni Generate JNI-style header file (default) 38.96 +main.opt.force=\ 38.97 +\ -force Always write output files 38.98 +main.opt.classpath=\ 38.99 +\ -classpath <path> Path from which to load classes 38.100 +main.opt.bootclasspath=\ 38.101 +\ -bootclasspath <path> Path from which to load bootstrap classes 38.102 +main.usage.foot=\ 38.103 +<classes> are specified with their fully qualified names\n\ 38.104 +(for example, java.lang.Object). 38.105 + 38.106 # 38.107 # Version string. 38.108 # 38.109 @@ -93,26 +119,35 @@ 38.110 # These should have better diagnostics. 38.111 # 38.112 super.class.not.found=\ 38.113 - A required super class {0} could not be found. 38.114 + A required super class {0} could not be found. 38.115 class.not.found=\ 38.116 - Class {0} could not be found. 38.117 + Class {0} could not be found. 38.118 io.exception=\ 38.119 - Can''t recover from an I/O error with the following message: \ 38.120 - {0}. 38.121 + Can''t recover from an I/O error with the following message: \ 38.122 + {0}. 38.123 38.124 # 38.125 # Problems in the guts of javah. 38.126 # 38.127 encoding.iso8859_1.not.found=\ 38.128 - ISO8859_1 converter was not found for output. This is \ 38.129 + ISO8859_1 converter was not found for output. This is \ 38.130 probably due to an error in the installation installation. 38.131 tried.to.define.non.static=\ 38.132 - Tried to generate #define for non-static field. 38.133 + Tried to generate #define for non-static field. 38.134 jni.unknown.type=\ 38.135 - An unknown type encountered (JNI). 38.136 + An unknown type encountered (JNI). 38.137 unknown.array.type=\ 38.138 - An unknown array type encountered when generating old style headers. 38.139 + An unknown array type encountered when generating old style headers. 38.140 unknown.type.for.field=\ 38.141 - An unknown type encountered when generating old style headers. 38.142 + An unknown type encountered when generating old style headers. 38.143 unknown.type.in.method.signature=\ 38.144 - An unknown type eccountered when generating old style stubs. 38.145 + An unknown type eccountered when generating old style stubs. 38.146 + 38.147 + 38.148 +err.prefix=Error: 38.149 +err.cant.use.option.for.fm=Can't use {0} option with given file manager 38.150 +err.internal.error=Internal error: {0} 38.151 +err.ioerror=IO error: {0} 38.152 +err.missing.arg=value missing for {0} 38.153 +err.no.classes.specified=no classes specified 38.154 +err.unknown.option=unknown option: {0}
39.1 --- a/src/share/classes/com/sun/tools/javah/resources/win32_x86.properties Fri Sep 25 14:24:14 2009 -0700 39.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 39.3 @@ -1,28 +0,0 @@ 39.4 -# 39.5 -# Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. 39.6 -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 39.7 -# 39.8 -# This code is free software; you can redistribute it and/or modify it 39.9 -# under the terms of the GNU General Public License version 2 only, as 39.10 -# published by the Free Software Foundation. Sun designates this 39.11 -# particular file as subject to the "Classpath" exception as provided 39.12 -# by Sun in the LICENSE file that accompanied this code. 39.13 -# 39.14 -# This code is distributed in the hope that it will be useful, but WITHOUT 39.15 -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 39.16 -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 39.17 -# version 2 for more details (a copy is included in the LICENSE file that 39.18 -# accompanied this code). 39.19 -# 39.20 -# You should have received a copy of the GNU General Public License version 39.21 -# 2 along with this work; if not, write to the Free Software Foundation, 39.22 -# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 39.23 -# 39.24 -# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 39.25 -# CA 95054 USA or visit www.sun.com if you need additional information or 39.26 -# have any questions. 39.27 -# 39.28 - 39.29 -dll.export=__declspec(dllexport) 39.30 -pack.pragma.start=\#pragma pack(4)\n 39.31 -pack.pragma.end=\#pragma pack()\n
40.1 --- a/src/share/classes/com/sun/tools/javap/DisassemblerTool.java Fri Sep 25 14:24:14 2009 -0700 40.2 +++ b/src/share/classes/com/sun/tools/javap/DisassemblerTool.java Fri Sep 25 22:04:43 2009 -0700 40.3 @@ -42,7 +42,7 @@ 40.4 * @see DiagnosticListener 40.5 * @see Diagnostic 40.6 * @see JavaFileManager 40.7 - * @since 1.6 40.8 + * @since 1.7 40.9 * 40.10 * <p><b>This is NOT part of any API supported by Sun Microsystems. If 40.11 * you write code that depends on this, you do so at your own risk.
41.1 --- a/src/share/classes/javax/tools/SimpleJavaFileObject.java Fri Sep 25 14:24:14 2009 -0700 41.2 +++ b/src/share/classes/javax/tools/SimpleJavaFileObject.java Fri Sep 25 22:04:43 2009 -0700 41.3 @@ -27,7 +27,6 @@ 41.4 41.5 import java.io.*; 41.6 import java.net.URI; 41.7 -import java.net.URISyntaxException; 41.8 import java.nio.CharBuffer; 41.9 import javax.lang.model.element.Modifier; 41.10 import javax.lang.model.element.NestingKind;
42.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 42.2 +++ b/test/tools/javac/4241573/T4241573.java Fri Sep 25 22:04:43 2009 -0700 42.3 @@ -0,0 +1,225 @@ 42.4 +/* 42.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 42.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 42.7 + * 42.8 + * This code is free software; you can redistribute it and/or modify it 42.9 + * under the terms of the GNU General Public License version 2 only, as 42.10 + * published by the Free Software Foundation. 42.11 + * 42.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 42.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 42.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 42.15 + * version 2 for more details (a copy is included in the LICENSE file that 42.16 + * accompanied this code). 42.17 + * 42.18 + * You should have received a copy of the GNU General Public License version 42.19 + * 2 along with this work; if not, write to the Free Software Foundation, 42.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 42.21 + * 42.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 42.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 42.24 + * have any questions. 42.25 + */ 42.26 + 42.27 +/* 42.28 + * @test 42.29 + * @bug 4241573 42.30 + * @summary SourceFile attribute includes full path 42.31 + */ 42.32 + 42.33 +import com.sun.tools.classfile.Attribute; 42.34 +import com.sun.tools.classfile.ClassFile; 42.35 +import com.sun.tools.classfile.SourceFile_attribute; 42.36 +import java.io.*; 42.37 +import java.util.*; 42.38 +import java.util.jar.*; 42.39 + 42.40 +public class T4241573 { 42.41 + public static void main(String... args) throws Exception { 42.42 + new T4241573().run(); 42.43 + } 42.44 + 42.45 + public void run() throws Exception { 42.46 + // Selection of files to be compiled 42.47 + File absJar = createJar(new File("abs.jar").getAbsoluteFile(), "j.A"); 42.48 + File relJar = createJar(new File("rel.jar"), "j.R"); 42.49 + File absDir = createDir(new File("abs.dir").getAbsoluteFile(), "d.A"); 42.50 + File relDir = createDir(new File("rel.dir"), "d.R"); 42.51 + File absTestFile = writeFile(new File("AbsTest.java").getAbsoluteFile(), "class AbsTest { class Inner { } }"); 42.52 + File relTestFile = writeFile(new File("RelTest.java"), "class RelTest { class Inner { } }"); 42.53 + File relTest2File = writeFile(new File("p/RelTest2.java"), "package p; class RelTest2 { class Inner { } }"); 42.54 + // This next class references other classes that will be found on the source path 42.55 + // and which will therefore need to be compiled as well. 42.56 + File mainFile = writeFile(new File("Main.java"), 42.57 + "class Main { j.A ja; j.R jr; d.A da; d.R dr; }" + 42.58 + ""); 42.59 + 42.60 + String sourcePath = createPath(absJar, relJar, absDir, relDir); 42.61 + File outDir = new File("classes"); 42.62 + outDir.mkdirs(); 42.63 + 42.64 + String[] args = { 42.65 + "-sourcepath", sourcePath, 42.66 + "-d", outDir.getPath(), 42.67 + absTestFile.getPath(), 42.68 + relTestFile.getPath(), 42.69 + relTest2File.getPath(), 42.70 + mainFile.getPath(), 42.71 + }; 42.72 + System.err.println("compile: " + Arrays.asList(args)); 42.73 + StringWriter sw = new StringWriter(); 42.74 + PrintWriter pw = new PrintWriter(sw); 42.75 + int rc = com.sun.tools.javac.Main.compile(args, pw); 42.76 + pw.close(); 42.77 + if (rc != 0) { 42.78 + System.err.println(sw.toString()); 42.79 + throw new Exception("unexpected exit from javac: " + rc); 42.80 + } 42.81 + 42.82 + Set<File> expect = getFiles(outDir, 42.83 + "d/A.class", "d/A$Inner.class", 42.84 + "d/R.class", "d/R$Inner.class", 42.85 + "j/A.class", "j/A$Inner.class", 42.86 + "j/R.class", "j/R$Inner.class", 42.87 + "AbsTest.class", "AbsTest$Inner.class", 42.88 + "RelTest.class", "RelTest$Inner.class", 42.89 + "p/RelTest2.class", "p/RelTest2$Inner.class", 42.90 + "Main.class" ); 42.91 + 42.92 + Set<File> found = findFiles(outDir); 42.93 + 42.94 + if (!found.equals(expect)) { 42.95 + if (found.containsAll(expect)) 42.96 + throw new Exception("unexpected files found: " + diff(found, expect)); 42.97 + else if (expect.containsAll(found)) 42.98 + throw new Exception("expected files not found: " + diff(expect, found)); 42.99 + } 42.100 + 42.101 + for (File f: found) 42.102 + verifySourceFileAttribute(f); 42.103 + 42.104 + if (errors > 0) 42.105 + throw new Exception(errors + " errors occurred"); 42.106 + } 42.107 + 42.108 + /** Check the SourceFileAttribute is the simple name of the original source file. */ 42.109 + void verifySourceFileAttribute(File f) { 42.110 + System.err.println("verify: " + f); 42.111 + try { 42.112 + ClassFile cf = ClassFile.read(f); 42.113 + SourceFile_attribute sfa = (SourceFile_attribute) cf.getAttribute(Attribute.SourceFile); 42.114 + String found = sfa.getSourceFile(cf.constant_pool); 42.115 + String expect = f.getName().replaceAll("([$.].*)?\\.class", ".java"); 42.116 + if (!expect.equals(found)) { 42.117 + error("bad value found: " + found + ", expected: " + expect); 42.118 + } 42.119 + } catch (Exception e) { 42.120 + error("error reading " + f +": " + e); 42.121 + } 42.122 + } 42.123 + 42.124 + /** Create a directory containing one or more files. */ 42.125 + File createDir(File dir, String... entries) throws Exception { 42.126 + if (!dir.mkdirs()) 42.127 + throw new Exception("cannot create directories " + dir); 42.128 + for (String e: entries) { 42.129 + writeFile(new File(dir, getPathForEntry(e)), getBodyForEntry(e)); 42.130 + } 42.131 + return dir; 42.132 + } 42.133 + 42.134 + /** Create a jar file containing one or more entries. */ 42.135 + File createJar(File jar, String... entries) throws IOException { 42.136 + OutputStream out = new FileOutputStream(jar); 42.137 + try { 42.138 + JarOutputStream jos = new JarOutputStream(out); 42.139 + for (String e: entries) { 42.140 + jos.putNextEntry(new JarEntry(getPathForEntry(e))); 42.141 + jos.write(getBodyForEntry(e).getBytes()); 42.142 + } 42.143 + jos.close(); 42.144 + } finally { 42.145 + out.close(); 42.146 + } 42.147 + return jar; 42.148 + } 42.149 + 42.150 + /** Return the path for an entry given to createDir or createJar. */ 42.151 + String getPathForEntry(String e) { 42.152 + return e.replace(".", File.separator) + ".java"; 42.153 + } 42.154 + 42.155 + /** Return the body text for an entry given to createDir or createJar. */ 42.156 + String getBodyForEntry(String e) { 42.157 + int sep = e.lastIndexOf("."); 42.158 + String pkgName = e.substring(0, sep); 42.159 + String className = e.substring(sep + 1); 42.160 + return "package " + pkgName + "; public class " + className + "{ class Inner { } }"; 42.161 + } 42.162 + 42.163 + /** Write a file containing the given string. Parent directories are 42.164 + * created as needed. */ 42.165 + File writeFile(File f, String s) throws IOException { 42.166 + if (f.getParentFile() != null) 42.167 + f.getParentFile().mkdirs(); 42.168 + FileWriter out = new FileWriter(f); 42.169 + try { 42.170 + out.write(s); 42.171 + } finally { 42.172 + out.close(); 42.173 + } 42.174 + return f; 42.175 + } 42.176 + 42.177 + /** Create a path value from a list of directories and jar files. */ 42.178 + String createPath(File... files) { 42.179 + StringBuilder sb = new StringBuilder(); 42.180 + for (File f: files) { 42.181 + if (sb.length() > 0) 42.182 + sb.append(File.pathSeparatorChar); 42.183 + sb.append(f.getPath()); 42.184 + } 42.185 + return sb.toString(); 42.186 + } 42.187 + 42.188 + /** Create a set of files from a base directory and a set of relative paths. */ 42.189 + Set<File> getFiles(File dir, String... paths) { 42.190 + Set<File> files = new LinkedHashSet<File>(); 42.191 + for (String p: paths) 42.192 + files.add(new File(dir, p)); 42.193 + return files; 42.194 + } 42.195 + 42.196 + /** Find all the files in a directory and its subdirectories. */ 42.197 + Set<File> findFiles(File dir) { 42.198 + Set<File> files = new LinkedHashSet<File>(); 42.199 + findFiles(dir, files); 42.200 + return files; 42.201 + } 42.202 + // where 42.203 + void findFiles(File dir, Set<File> files) { 42.204 + for (File f: dir.listFiles()) { 42.205 + if (f.isDirectory()) 42.206 + findFiles(f, files); 42.207 + else 42.208 + files.add(f); 42.209 + } 42.210 + } 42.211 + 42.212 + /** Return the difference of two sets, a - b. */ 42.213 + <T> Set<T> diff(Set<T> a, Set<T> b) { 42.214 + if (b.isEmpty()) 42.215 + return a; 42.216 + Set<T> result = new LinkedHashSet<T>(a); 42.217 + result.removeAll(b); 42.218 + return result; 42.219 + } 42.220 + 42.221 + /** Report an error. */ 42.222 + void error(String msg) { 42.223 + System.err.println(msg); 42.224 + errors++; 42.225 + } 42.226 + 42.227 + int errors; 42.228 +}
43.1 --- a/test/tools/javac/6589361/T6589361.java Fri Sep 25 14:24:14 2009 -0700 43.2 +++ b/test/tools/javac/6589361/T6589361.java Fri Sep 25 22:04:43 2009 -0700 43.3 @@ -25,7 +25,7 @@ 43.4 for (JavaFileObject file : files) { 43.5 // Note: Zip/Jar entry names use '/', not File.separator, but just to be sure, 43.6 // we normalize the filename as well. 43.7 - if (file.toString().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { 43.8 + if (file.getName().replace(File.separatorChar, '/').contains("java/lang/Object.class")) { 43.9 String str = fm.inferBinaryName(StandardLocation.CLASS_PATH, file); 43.10 if (!str.equals("java.lang.Object")) { 43.11 throw new AssertionError("Error in JavacFileManager.inferBinaryName method!");
44.1 --- a/test/tools/javac/Diagnostics/6769027/T6769027.java Fri Sep 25 14:24:14 2009 -0700 44.2 +++ b/test/tools/javac/Diagnostics/6769027/T6769027.java Fri Sep 25 22:04:43 2009 -0700 44.3 @@ -261,7 +261,7 @@ 44.4 44.5 enum PositionKind { 44.6 NOPOS(Position.NOPOS, "- ", "error: "), 44.7 - POS(5, "/Test.java:1:6: ", "myfo:/Test.java:1: "); 44.8 + POS(5, "Test.java:1:6: ", "/Test.java:1: "); 44.9 44.10 int pos; 44.11 String rawOutput;
45.1 --- a/test/tools/javac/T6705935.java Fri Sep 25 14:24:14 2009 -0700 45.2 +++ b/test/tools/javac/T6705935.java Fri Sep 25 22:04:43 2009 -0700 45.3 @@ -48,7 +48,7 @@ 45.4 "java.lang", 45.5 Collections.singleton(JavaFileObject.Kind.CLASS), 45.6 false)) { 45.7 - String p = ((BaseFileObject)fo).getPath(); 45.8 + String p = fo.getName(); 45.9 int bra = p.indexOf("("); 45.10 int ket = p.indexOf(")"); 45.11 //System.err.println(bra + "," + ket + "," + p.length());
46.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 46.2 +++ b/test/tools/javac/annotations/pos/TrailingComma.java Fri Sep 25 22:04:43 2009 -0700 46.3 @@ -0,0 +1,43 @@ 46.4 +/* 46.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 46.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 46.7 + * 46.8 + * This code is free software; you can redistribute it and/or modify it 46.9 + * under the terms of the GNU General Public License version 2 only, as 46.10 + * published by the Free Software Foundation. 46.11 + * 46.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 46.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 46.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 46.15 + * version 2 for more details (a copy is included in the LICENSE file that 46.16 + * accompanied this code). 46.17 + * 46.18 + * You should have received a copy of the GNU General Public License version 46.19 + * 2 along with this work; if not, write to the Free Software Foundation, 46.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 46.21 + * 46.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 46.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 46.24 + * have any questions. 46.25 + */ 46.26 + 46.27 +/* 46.28 + * @test 46.29 + * @bug 6337964 46.30 + * @summary javac incorrectly disallows trailing comma in annotation arrays 46.31 + * @author darcy 46.32 + * @compile TrailingComma.java 46.33 + */ 46.34 + 46.35 +import java.lang.annotation.*; 46.36 + 46.37 +@interface TestAnnotation { 46.38 + SuppressWarnings[] value() default {@SuppressWarnings({"",})}; 46.39 +} 46.40 + 46.41 + 46.42 +@TestAnnotation({@SuppressWarnings(), 46.43 + @SuppressWarnings({"Beware the ides of March.",}), 46.44 + @SuppressWarnings({"Look both ways", "Before Crossing",}), }) 46.45 +public class TrailingComma { 46.46 +}
47.1 --- a/test/tools/javac/api/6411310/T6411310.java Fri Sep 25 14:24:14 2009 -0700 47.2 +++ b/test/tools/javac/api/6411310/T6411310.java Fri Sep 25 22:04:43 2009 -0700 47.3 @@ -37,7 +37,7 @@ 47.4 import static javax.tools.StandardLocation.CLASS_PATH; 47.5 import static javax.tools.JavaFileObject.Kind.CLASS; 47.6 47.7 -// Limited test while we wait for 6419926 47.8 +// Limited test while we wait for 6419926: 6419926 is now closed 47.9 47.10 public class T6411310 extends ToolTester { 47.11 47.12 @@ -45,8 +45,11 @@ 47.13 JavaFileObject file = fm.getJavaFileForInput(PLATFORM_CLASS_PATH, 47.14 "java.lang.Object", 47.15 CLASS); 47.16 - if (!file.getName().equals("Object.class")) 47.17 + String fileName = file.getName(); 47.18 + if (!fileName.matches(".*java/lang/Object.class\\)?")) { 47.19 + System.err.println(fileName); 47.20 throw new AssertionError(file); 47.21 + } 47.22 } 47.23 47.24 public static void main(String... args) throws IOException {
48.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 48.2 +++ b/test/tools/javac/api/6411310/Test.java Fri Sep 25 22:04:43 2009 -0700 48.3 @@ -0,0 +1,254 @@ 48.4 +/* 48.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 48.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 48.7 + * 48.8 + * This code is free software; you can redistribute it and/or modify it 48.9 + * under the terms of the GNU General Public License version 2 only, as 48.10 + * published by the Free Software Foundation. 48.11 + * 48.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 48.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 48.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 48.15 + * version 2 for more details (a copy is included in the LICENSE file that 48.16 + * accompanied this code). 48.17 + * 48.18 + * You should have received a copy of the GNU General Public License version 48.19 + * 2 along with this work; if not, write to the Free Software Foundation, 48.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 48.21 + * 48.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 48.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 48.24 + * have any questions. 48.25 + */ 48.26 + 48.27 +/* 48.28 + * @test 48.29 + * @bug 6410367 6411310 48.30 + * @summary FileObject should support user-friendly names via getName() 48.31 + */ 48.32 + 48.33 +import java.io.*; 48.34 +import java.util.*; 48.35 +import java.util.jar.*; 48.36 +import java.util.zip.*; 48.37 +import javax.tools.*; 48.38 + 48.39 +import com.sun.tools.javac.file.JavacFileManager; 48.40 +import com.sun.tools.javac.util.Context; 48.41 +import com.sun.tools.javac.util.Options; 48.42 + 48.43 +// Test FileObject.getName returned from JavacFileManager and its support classes. 48.44 + 48.45 +public class Test { 48.46 + public static void main(String... args) throws Exception { 48.47 + new Test().run(); 48.48 + } 48.49 + 48.50 + Set<String> foundClasses = new TreeSet<String>(); 48.51 + Set<String> foundJars = new TreeSet<String>(); 48.52 + 48.53 + void run() throws Exception { 48.54 + File rt_jar = findRtJar(); 48.55 + 48.56 + // names for entries to be created in directories and jar files 48.57 + String[] entries = { "p/A.java", "p/A.class", "p/resources/A-1.html" }; 48.58 + 48.59 + // test various combinations of directories and jar files, intended to 48.60 + // cover all sources of file objects within JavacFileManager's support classes 48.61 + 48.62 + test(createFileManager(), createDir("dir", entries), "p", entries); 48.63 + test(createFileManager(), createDir("a b/dir", entries), "p", entries); 48.64 + 48.65 + for (boolean useJavaUtilZip: new boolean[] { false, true }) { 48.66 + test(createFileManager(useJavaUtilZip), createJar("jar", entries), "p", entries); 48.67 + test(createFileManager(useJavaUtilZip), createJar("jar jar", entries), "p", entries); 48.68 + 48.69 + for (boolean useSymbolFile: new boolean[] { false, true }) { 48.70 + test(createFileManager(useJavaUtilZip, useSymbolFile), rt_jar, "java.lang.ref", null); 48.71 + } 48.72 + } 48.73 + 48.74 + if (errors > 0) 48.75 + throw new Exception(errors + " errors found"); 48.76 + 48.77 + // Verify that we hit all the impl classes we intended 48.78 + checkCoverage("classes", foundClasses, 48.79 + "RegularFileObject", "SymbolFileObject", "ZipFileIndexFileObject", "ZipFileObject"); 48.80 + 48.81 + // Verify that we hit the jar files we intended, specifically ct.sym as well as rt.jar 48.82 + checkCoverage("jar files", foundJars, 48.83 + "ct.sym", "jar", "jar jar", "rt.jar"); 48.84 + } 48.85 + 48.86 + // use a new file manager for each test 48.87 + void test(StandardJavaFileManager fm, File f, String pkg, String[] entries) throws Exception { 48.88 + System.err.println("Test " + f); 48.89 + try { 48.90 + if (f.isDirectory()) { 48.91 + for (File dir: new File[] { f, f.getAbsoluteFile() }) { 48.92 + for (String e: entries) { 48.93 + JavaFileObject fo = fm.getJavaFileObjects(new File(dir, e)).iterator().next(); 48.94 + test(fo, dir, e); 48.95 + } 48.96 + } 48.97 + } 48.98 + 48.99 + fm.setLocation(StandardLocation.CLASS_PATH, Collections.singleton(f)); 48.100 + fm.setLocation(StandardLocation.SOURCE_PATH, Collections.singleton(f.getAbsoluteFile())); 48.101 + for (StandardLocation l: EnumSet.of(StandardLocation.CLASS_PATH, StandardLocation.SOURCE_PATH)) { 48.102 + for (JavaFileObject fo: fm.list(l, pkg, EnumSet.allOf(JavaFileObject.Kind.class), true)) { 48.103 + // we could use fm.getLocation but the following guarantees we preserve the original filename 48.104 + File dir = (l == StandardLocation.CLASS_PATH ? f : f.getAbsoluteFile()); 48.105 + char sep = (dir.isDirectory() ? File.separatorChar : '/'); 48.106 + String b = fm.inferBinaryName(l, fo); 48.107 + String e = fo.getKind().extension; 48.108 + test(fo, dir, b.replace('.', sep) + e); 48.109 + } 48.110 + } 48.111 + } finally { 48.112 + fm.close(); 48.113 + } 48.114 + } 48.115 + 48.116 + void test(JavaFileObject fo, File dir, String p) { 48.117 + System.err.println("Test: " + fo); 48.118 + String expect = dir.isDirectory() ? new File(dir, p).getPath() : (dir.getPath() + "(" + p + ")"); 48.119 + String found = fo.getName(); 48.120 + // if ct.sym is found, replace it with the equivalent rt.jar 48.121 + String found2 = found.replaceAll("lib([\\\\/])ct.sym\\(META-INF/sym/rt.jar/", "jre$1lib$1rt.jar("); 48.122 + if (!expect.equals(found2)) { 48.123 + System.err.println("expected: " + expect); 48.124 + System.err.println(" found: " + found); 48.125 + if (!found.equals(found2)) 48.126 + System.err.println(" found2: " + found2); 48.127 + error("Failed: " + fo); 48.128 + } 48.129 + 48.130 + // record the file object class name for coverage checks later 48.131 + foundClasses.add(fo.getClass().getSimpleName()); 48.132 + 48.133 + if (found.contains("(")) { 48.134 + // record access to the jar file for coverage checks later 48.135 + foundJars.add(new File(found.substring(0, found.indexOf("("))).getName()); 48.136 + } 48.137 + } 48.138 + 48.139 + void checkCoverage(String label, Set<String> found, String... expect) throws Exception { 48.140 + Set<String> e = new TreeSet<String>(Arrays.asList(expect)); 48.141 + if (!found.equals(e)) { 48.142 + e.removeAll(found); 48.143 + throw new Exception("expected " + label + " not used: " + e); 48.144 + } 48.145 + } 48.146 + 48.147 + JavacFileManager createFileManager() { 48.148 + return createFileManager(false, false); 48.149 + } 48.150 + 48.151 + JavacFileManager createFileManager(boolean useJavaUtilZip) { 48.152 + return createFileManager(useJavaUtilZip, false); 48.153 + } 48.154 + 48.155 + JavacFileManager createFileManager(boolean useJavaUtilZip, boolean useSymbolFile) { 48.156 + // javac should really not be using system properties like this 48.157 + // -- it should really be using (hidden) options -- but until then 48.158 + // take care to leave system properties as we find them, so as not 48.159 + // to adversely affect other tests that might follow. 48.160 + String prev = System.getProperty("useJavaUtilZip"); 48.161 + boolean resetProperties = false; 48.162 + try { 48.163 + if (useJavaUtilZip) { 48.164 + System.setProperty("useJavaUtilZip", "true"); 48.165 + resetProperties = true; 48.166 + } else if (System.getProperty("useJavaUtilZip") != null) { 48.167 + System.getProperties().remove("useJavaUtilZip"); 48.168 + resetProperties = true; 48.169 + } 48.170 + 48.171 + Context c = new Context(); 48.172 + if (!useSymbolFile) { 48.173 + Options options = Options.instance(c); 48.174 + options.put("ignore.symbol.file", "true"); 48.175 + } 48.176 + 48.177 + return new JavacFileManager(c, false, null); 48.178 + } finally { 48.179 + if (resetProperties) { 48.180 + if (prev == null) { 48.181 + System.getProperties().remove("useJavaUtilZip"); 48.182 + } else { 48.183 + System.setProperty("useJavaUtilZip", prev); 48.184 + } 48.185 + } 48.186 + } 48.187 + } 48.188 + 48.189 + File createDir(String name, String... entries) throws Exception { 48.190 + File dir = new File(name); 48.191 + if (!dir.mkdirs()) 48.192 + throw new Exception("cannot create directories " + dir); 48.193 + for (String e: entries) { 48.194 + writeFile(new File(dir, e), e); 48.195 + } 48.196 + return dir; 48.197 + } 48.198 + 48.199 + File createJar(String name, String... entries) throws IOException { 48.200 + File jar = new File(name); 48.201 + OutputStream out = new FileOutputStream(jar); 48.202 + try { 48.203 + JarOutputStream jos = new JarOutputStream(out); 48.204 + for (String e: entries) { 48.205 + jos.putNextEntry(new ZipEntry(e)); 48.206 + jos.write(e.getBytes()); 48.207 + } 48.208 + jos.close(); 48.209 + } finally { 48.210 + out.close(); 48.211 + } 48.212 + return jar; 48.213 + } 48.214 + 48.215 + File findRtJar() throws Exception { 48.216 + File java_home = new File(System.getProperty("java.home")); 48.217 + if (java_home.getName().equals("jre")) 48.218 + java_home = java_home.getParentFile(); 48.219 + File rt_jar = new File(new File(new File(java_home, "jre"), "lib"), "rt.jar"); 48.220 + if (!rt_jar.exists()) 48.221 + throw new Exception("can't find rt.jar"); 48.222 + return rt_jar; 48.223 + } 48.224 + 48.225 + byte[] read(InputStream in) throws IOException { 48.226 + byte[] data = new byte[1024]; 48.227 + int offset = 0; 48.228 + try { 48.229 + int n; 48.230 + while ((n = in.read(data, offset, data.length - offset)) != -1) { 48.231 + offset += n; 48.232 + if (offset == data.length) 48.233 + data = Arrays.copyOf(data, 2 * data.length); 48.234 + } 48.235 + } finally { 48.236 + in.close(); 48.237 + } 48.238 + return Arrays.copyOf(data, offset); 48.239 + } 48.240 + 48.241 + void writeFile(File f, String s) throws IOException { 48.242 + f.getParentFile().mkdirs(); 48.243 + FileWriter out = new FileWriter(f); 48.244 + try { 48.245 + out.write(s); 48.246 + } finally { 48.247 + out.close(); 48.248 + } 48.249 + } 48.250 + 48.251 + void error(String msg) { 48.252 + System.err.println(msg); 48.253 + errors++; 48.254 + } 48.255 + 48.256 + int errors; 48.257 +}
49.1 --- a/test/tools/javac/api/6733837/T6733837.java Fri Sep 25 14:24:14 2009 -0700 49.2 +++ b/test/tools/javac/api/6733837/T6733837.java Fri Sep 25 22:04:43 2009 -0700 49.3 @@ -46,14 +46,10 @@ 49.4 } 49.5 49.6 public void exec() { 49.7 - JavaFileObject sfo = new SimpleJavaFileObject(URI.create(""),Kind.SOURCE) { 49.8 + JavaFileObject sfo = new SimpleJavaFileObject(URI.create("myfo:/Test.java"),Kind.SOURCE) { 49.9 public CharSequence getCharContent(boolean ignoreEncodingErrors) { 49.10 return "\tclass ErroneousWithTab"; 49.11 } 49.12 - @Override 49.13 - public String getName() { 49.14 - return "RELATIVEPATH"; 49.15 - } 49.16 }; 49.17 StringWriter sw = new StringWriter(); 49.18 PrintWriter out = new PrintWriter(sw); 49.19 @@ -66,7 +62,7 @@ 49.20 throw new Error("Compiler threw an exception"); 49.21 } 49.22 System.err.println(sw.toString()); 49.23 - if (sw.toString().contains("RELATIVEPATH")) 49.24 + if (!sw.toString().contains("/Test.java")) 49.25 throw new Error("Bad source name in diagnostic"); 49.26 } 49.27 }
50.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 50.2 +++ b/test/tools/javac/processing/model/util/elements/Foo.java Fri Sep 25 22:04:43 2009 -0700 50.3 @@ -0,0 +1,29 @@ 50.4 + 50.5 +/* 50.6 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 50.7 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 50.8 + * 50.9 + * This code is free software; you can redistribute it and/or modify it 50.10 + * under the terms of the GNU General Public License version 2 only, as 50.11 + * published by the Free Software Foundation. 50.12 + * 50.13 + * This code is distributed in the hope that it will be useful, but WITHOUT 50.14 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 50.15 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 50.16 + * version 2 for more details (a copy is included in the LICENSE file that 50.17 + * accompanied this code). 50.18 + * 50.19 + * You should have received a copy of the GNU General Public License version 50.20 + * 2 along with this work; if not, write to the Free Software Foundation, 50.21 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 50.22 + * 50.23 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 50.24 + * CA 95054 USA or visit www.sun.com if you need additional information or 50.25 + * have any questions. 50.26 + */ 50.27 + 50.28 +/** 50.29 + * Dummy type to compile. 50.30 + */ 50.31 +public class Foo { 50.32 +} 50.33 \ No newline at end of file
51.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 51.2 +++ b/test/tools/javac/processing/model/util/elements/TestGetConstantExpression.java Fri Sep 25 22:04:43 2009 -0700 51.3 @@ -0,0 +1,143 @@ 51.4 +/* 51.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 51.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 51.7 + * 51.8 + * This code is free software; you can redistribute it and/or modify it 51.9 + * under the terms of the GNU General Public License version 2 only, as 51.10 + * published by the Free Software Foundation. 51.11 + * 51.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 51.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 51.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 51.15 + * version 2 for more details (a copy is included in the LICENSE file that 51.16 + * accompanied this code). 51.17 + * 51.18 + * You should have received a copy of the GNU General Public License version 51.19 + * 2 along with this work; if not, write to the Free Software Foundation, 51.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 51.21 + * 51.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 51.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 51.24 + * have any questions. 51.25 + */ 51.26 + 51.27 +/* 51.28 + * @test 51.29 + * @bug 6471577 6517779 51.30 + * @summary Test Elements.getConstantExpression 51.31 + * @author Joseph D. Darcy 51.32 + * @build TestGetConstantExpression 51.33 + * @compile -processor TestGetConstantExpression Foo.java 51.34 + */ 51.35 + 51.36 +import java.util.Set; 51.37 +import javax.annotation.processing.*; 51.38 +import javax.lang.model.SourceVersion; 51.39 +import static javax.lang.model.SourceVersion.*; 51.40 +import javax.lang.model.element.*; 51.41 +import javax.lang.model.util.*; 51.42 +import static javax.lang.model.util.ElementFilter.*; 51.43 +import static javax.tools.Diagnostic.Kind.*; 51.44 +import static javax.tools.StandardLocation.*; 51.45 +import java.io.*; 51.46 + 51.47 +/** 51.48 + * Test basic workings of Elements.getConstantExpression. 51.49 + */ 51.50 +@SupportedAnnotationTypes("*") 51.51 +public class TestGetConstantExpression extends AbstractProcessor { 51.52 + private Elements eltUtils; 51.53 + private Filer filer; 51.54 + private int round = 1; 51.55 + 51.56 + /** 51.57 + * Check expected behavior on classes and packages. 51.58 + */ 51.59 + public boolean process(Set<? extends TypeElement> annotations, 51.60 + RoundEnvironment roundEnv) { 51.61 + int errors = 0; 51.62 + boolean processingOver = roundEnv.processingOver(); 51.63 + 51.64 + if (!processingOver && round == 1) { 51.65 + errors += expectIllegalArgumentException(null); 51.66 + errors += expectIllegalArgumentException(this); 51.67 + 51.68 + // Generate source code with various constant values and 51.69 + // make sure it compiles. 51.70 + 51.71 + try { 51.72 + PrintWriter pw = new PrintWriter(filer.createSourceFile("ConstantTest").openWriter()); 51.73 + try { 51.74 + Boolean[] booleans = {true, false}; 51.75 + Byte[] bytes = {Byte.MIN_VALUE, -1, 0, 1, Byte.MAX_VALUE}; 51.76 + Short[] shorts = {Short.MIN_VALUE, -1, 0, 1, Short.MAX_VALUE}; 51.77 + Integer[] ints = {Integer.MIN_VALUE, -1, 0, 1, Integer.MAX_VALUE}; 51.78 + Long[] longs = {Long.MIN_VALUE, -1L, 0L,1L, Long.MAX_VALUE}; 51.79 + Character[] chars = {Character.MIN_VALUE, ' ', '\t', 'a', 'b', 'c', '~', Character.MAX_VALUE}; 51.80 + Float[] floats = {Float.NaN, Float.NEGATIVE_INFINITY, -1.0f, -0.0f, 0.0f, 1.0f, Float.POSITIVE_INFINITY}; 51.81 + Double[] doubles = {Double.NaN, Double.NEGATIVE_INFINITY, -1.0, -0.0, 0.0, 1.0, Double.POSITIVE_INFINITY}; 51.82 + 51.83 + pw.println("class ConstantTest {"); 51.84 + pw.println(String.format(" private static boolean[] booleans = {%s};", 51.85 + printConstants(booleans))); 51.86 + pw.println(String.format(" private static byte[] bytes = {%s};", 51.87 + printConstants(bytes))); 51.88 + pw.println(String.format(" private static short[] shorts = {%s};", 51.89 + printConstants(shorts))); 51.90 + pw.println(String.format(" private static int[] ints = {%s};", 51.91 + printConstants(ints))); 51.92 + pw.println(String.format(" private static long[] longs = {%s};", 51.93 + printConstants(longs))); 51.94 + pw.println(String.format(" private static char[] chars = {%s};", 51.95 + printConstants(chars))); 51.96 + pw.println(String.format(" private static float[] floats = {%s};", 51.97 + printConstants(floats))); 51.98 + pw.println(String.format(" private static double[] doubles = {%s};", 51.99 + printConstants(doubles))); 51.100 + pw.println("}"); 51.101 + } finally { 51.102 + pw.close(); 51.103 + } 51.104 + } catch(IOException io) { 51.105 + throw new RuntimeException(io); 51.106 + } 51.107 + round++; 51.108 + } else if (processingOver) { 51.109 + if (errors > 0) { 51.110 + throw new RuntimeException(); 51.111 + } 51.112 + } 51.113 + return true; 51.114 + } 51.115 + 51.116 + String printConstants(Object[] constants) { 51.117 + StringBuilder sb = new StringBuilder(); 51.118 + 51.119 + for(Object o : constants) { 51.120 + sb.append(eltUtils.getConstantExpression(o)); 51.121 + sb.append(", "); 51.122 + } 51.123 + return sb.toString(); 51.124 + } 51.125 + 51.126 + int expectIllegalArgumentException(Object o) { 51.127 + String s = ""; 51.128 + try { 51.129 + s = eltUtils.getConstantExpression(o); 51.130 + System.err.println("Unexpected string returned: " + s); 51.131 + return 1; 51.132 + } catch (IllegalArgumentException iae) { 51.133 + return 0; 51.134 + } 51.135 + } 51.136 + 51.137 + public SourceVersion getSupportedSourceVersion() { 51.138 + return SourceVersion.latest(); 51.139 + } 51.140 + 51.141 + public void init(ProcessingEnvironment processingEnv) { 51.142 + super.init(processingEnv); 51.143 + eltUtils = processingEnv.getElementUtils(); 51.144 + filer = processingEnv.getFiler(); 51.145 + } 51.146 +}
52.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 52.2 +++ b/test/tools/javah/6572945/T6572945.java Fri Sep 25 22:04:43 2009 -0700 52.3 @@ -0,0 +1,239 @@ 52.4 +/* 52.5 + * Copyright 2007 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 6572945 52.30 + * @summary rewrite javah as an annotation processor, instead of as a doclet 52.31 + * @build TestClass1 TestClass2 TestClass3 52.32 + * @run main T6572945 52.33 + */ 52.34 + 52.35 +import java.io.*; 52.36 +import java.util.*; 52.37 +import com.sun.tools.javah.Main; 52.38 + 52.39 +public class T6572945 52.40 +{ 52.41 + static File testSrc = new File(System.getProperty("test.src", ".")); 52.42 + static File testClasses = new File(System.getProperty("test.classes", ".")); 52.43 + static boolean isWindows = System.getProperty("os.name").startsWith("Windows"); 52.44 + 52.45 + public static void main(String... args) 52.46 + throws IOException, InterruptedException 52.47 + { 52.48 + boolean ok = new T6572945().run(args); 52.49 + if (!ok) 52.50 + throw new Error("Test Failed"); 52.51 + } 52.52 + 52.53 + public boolean run(String[] args) 52.54 + throws IOException, InterruptedException 52.55 + { 52.56 + if (args.length == 1) 52.57 + jdk = new File(args[0]); 52.58 + 52.59 + test("-o", "jni.file.1", "-jni", "TestClass1"); 52.60 + test("-o", "jni.file.2", "-jni", "TestClass1", "TestClass2"); 52.61 + test("-d", "jni.dir.1", "-jni", "TestClass1", "TestClass2"); 52.62 + test("-o", "jni.file.3", "-jni", "TestClass3"); 52.63 + 52.64 + // The following tests are disabled because llni support has been 52.65 + // discontinued, and because bugs in old javah means that character 52.66 + // for character testing against output from old javah does not work. 52.67 + // In fact, the LLNI impl in new javah is actually better than the 52.68 + // impl in old javah because of a couple of significant bug fixes. 52.69 + 52.70 +// test("-o", "llni.file.1", "-llni", "TestClass1"); 52.71 +// test("-o", "llni.file.2", "-llni", "TestClass1", "TestClass2"); 52.72 +// test("-d", "llni.dir.1", "-llni", "TestClass1", "TestClass2"); 52.73 +// test("-o", "llni.file.3", "-llni", "TestClass3"); 52.74 + 52.75 + return (errors == 0); 52.76 + } 52.77 + 52.78 + void test(String... args) 52.79 + throws IOException, InterruptedException 52.80 + { 52.81 + String[] cp_args = new String[args.length + 2]; 52.82 + cp_args[0] = "-classpath"; 52.83 + cp_args[1] = testClasses.getPath(); 52.84 + System.arraycopy(args, 0, cp_args, 2, args.length); 52.85 + 52.86 + if (jdk != null) 52.87 + init(cp_args); 52.88 + 52.89 + File out = null; 52.90 + for (int i = 0; i < args.length; i++) { 52.91 + if (args[i].equals("-o")) { 52.92 + out = new File(args[++i]); 52.93 + break; 52.94 + } else if (args[i].equals("-d")) { 52.95 + out = new File(args[++i]); 52.96 + out.mkdirs(); 52.97 + break; 52.98 + } 52.99 + } 52.100 + 52.101 + try { 52.102 + System.out.println("test: " + Arrays.asList(cp_args)); 52.103 + 52.104 +// // Uncomment and use the following lines to execute javah via the 52.105 +// // command line -- for example, to run old javah and set up the golden files 52.106 +// List<String> cmd = new ArrayList<String>(); 52.107 +// File javaHome = new File(System.getProperty("java.home")); 52.108 +// if (javaHome.getName().equals("jre")) 52.109 +// javaHome = javaHome.getParentFile(); 52.110 +// File javah = new File(new File(javaHome, "bin"), "javah"); 52.111 +// cmd.add(javah.getPath()); 52.112 +// cmd.addAll(Arrays.asList(cp_args)); 52.113 +// ProcessBuilder pb = new ProcessBuilder(cmd); 52.114 +// pb.redirectErrorStream(true); 52.115 +// pb.start(); 52.116 +// Process p = pb.start(); 52.117 +// String line; 52.118 +// BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 52.119 +// while ((line = in.readLine()) != null) 52.120 +// System.err.println(line); 52.121 +// in.close(); 52.122 +// int rc = p.waitFor(); 52.123 + 52.124 + // Use new javah 52.125 + PrintWriter err = new PrintWriter(System.err, true); 52.126 + int rc = Main.run(cp_args, err); 52.127 + 52.128 + if (rc != 0) { 52.129 + error("javah failed: rc=" + rc); 52.130 + return; 52.131 + } 52.132 + 52.133 + // The golden files use the LL suffix for long constants, which 52.134 + // is used on Linux and Solaris. On Windows, the suffix is i64, 52.135 + // so compare will update the golden files on the fly before the 52.136 + // final comparison. 52.137 + compare(new File(new File(testSrc, "gold"), out.getName()), out); 52.138 + } catch (Throwable t) { 52.139 + t.printStackTrace(); 52.140 + error("javah threw exception"); 52.141 + } 52.142 + } 52.143 + 52.144 + void init(String[] args) throws IOException, InterruptedException { 52.145 + String[] cmdArgs = new String[args.length + 1]; 52.146 + cmdArgs[0] = new File(new File(jdk, "bin"), "javah").getPath(); 52.147 + System.arraycopy(args, 0, cmdArgs, 1, args.length); 52.148 + 52.149 + System.out.println("init: " + Arrays.asList(cmdArgs)); 52.150 + 52.151 + ProcessBuilder pb = new ProcessBuilder(cmdArgs); 52.152 + pb.directory(new File(testSrc, "gold")); 52.153 + pb.redirectErrorStream(true); 52.154 + Process p = pb.start(); 52.155 + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 52.156 + String line; 52.157 + while ((line = in.readLine()) != null) 52.158 + System.out.println("javah: " + line); 52.159 + int rc = p.waitFor(); 52.160 + if (rc != 0) 52.161 + error("javah: exit code " + rc); 52.162 + } 52.163 + 52.164 + /** Compare two directories. 52.165 + * @param f1 The golden directory 52.166 + * @param f2 The directory to be compared 52.167 + */ 52.168 + void compare(File f1, File f2) { 52.169 + compare(f1, f2, null); 52.170 + } 52.171 + 52.172 + /** Compare two files or directories 52.173 + * @param f1 The golden directory 52.174 + * @param f2 The directory to be compared 52.175 + * @param p An optional path identifying a file within the two directories 52.176 + */ 52.177 + void compare(File f1, File f2, String p) { 52.178 + File f1p = (p == null ? f1 : new File(f1, p)); 52.179 + File f2p = (p == null ? f2 : new File(f2, p)); 52.180 + System.out.println("compare " + f1p + " " + f2p); 52.181 + if (f1p.isDirectory() && f2p.isDirectory()) { 52.182 + Set<String> children = new HashSet<String>(); 52.183 + children.addAll(Arrays.asList(f1p.list())); 52.184 + children.addAll(Arrays.asList(f2p.list())); 52.185 + for (String c: children) { 52.186 + compare(f1, f2, new File(p, c).getPath()); // null-safe for p 52.187 + } 52.188 + } 52.189 + else if (f1p.isFile() && f2p.isFile()) { 52.190 + String s1 = read(f1p); 52.191 + if (isWindows) { 52.192 + // f1/s1 is the golden file 52.193 + // on Windows, long constants use the i64 suffix, not LL 52.194 + s1 = s1.replaceAll("( [0-9]+)LL\n", "$1i64\n"); 52.195 + } 52.196 + String s2 = read(f2p); 52.197 + if (!s1.equals(s2)) { 52.198 + System.out.println("File: " + f1p + "\n" + s1); 52.199 + System.out.println("File: " + f2p + "\n" + s2); 52.200 + error("Files differ: " + f1p + " " + f2p); 52.201 + } 52.202 + } 52.203 + else if (f1p.exists() && !f2p.exists()) 52.204 + error("Only in " + f1 + ": " + p); 52.205 + else if (f2p.exists() && !f1p.exists()) 52.206 + error("Only in " + f2 + ": " + p); 52.207 + else 52.208 + error("Files differ: " + f1p + " " + f2p); 52.209 + } 52.210 + 52.211 + private String read(File f) { 52.212 + try { 52.213 + BufferedReader in = new BufferedReader(new FileReader(f)); 52.214 + try { 52.215 + StringBuilder sb = new StringBuilder((int) f.length()); 52.216 + String line; 52.217 + while ((line = in.readLine()) != null) { 52.218 + sb.append(line); 52.219 + sb.append("\n"); 52.220 + } 52.221 + return sb.toString(); 52.222 + } finally { 52.223 + try { 52.224 + in.close(); 52.225 + } catch (IOException e) { 52.226 + } 52.227 + } 52.228 + } catch (IOException e) { 52.229 + error("error reading " + f + ": " + e); 52.230 + return ""; 52.231 + } 52.232 + } 52.233 + 52.234 + 52.235 + private void error(String msg) { 52.236 + System.out.println(msg); 52.237 + errors++; 52.238 + } 52.239 + 52.240 + private int errors; 52.241 + private File jdk; 52.242 +}
53.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 53.2 +++ b/test/tools/javah/6572945/TestClass1.java Fri Sep 25 22:04:43 2009 -0700 53.3 @@ -0,0 +1,475 @@ 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 +import java.util.List; 53.28 + 53.29 +public class TestClass1 { 53.30 + // simple types 53.31 + byte b; 53.32 + short s; 53.33 + int i; 53.34 + long l; 53.35 + float f; 53.36 + double d; 53.37 + Object o; 53.38 + String t; 53.39 + List<String> g; 53.40 + 53.41 + // constants 53.42 + static final byte bc = 0; 53.43 + static final short sc = 0; 53.44 + static final int ic = 0; 53.45 + static final long lc = 0; 53.46 + static final float fc = 0; 53.47 + static final double dc = 0; 53.48 + static final Object oc = null; 53.49 + static final String tc = ""; 53.50 + static final List<String> gc = null; 53.51 + 53.52 + // simple arrays 53.53 + byte[] ba; 53.54 + short[] sa; // not handled corrected by javah v6 53.55 + int[] ia; 53.56 + long[] la; 53.57 + float[] fa; 53.58 + double[] da; 53.59 + Object[] oa; 53.60 + String[] ta; 53.61 + List<String>[] ga; 53.62 + 53.63 + // multidimensional arrays 53.64 + byte[][] baa; 53.65 + short[][] saa; 53.66 + int[][] iaa; 53.67 + long[][] laa; 53.68 + float[][] faa; 53.69 + double[][] daa; 53.70 + Object[][] oaa; 53.71 + String[][] taa; 53.72 + List<String>[] gaa; 53.73 + 53.74 + // simple Java methods 53.75 + byte bm() { return 0; } 53.76 + short sm() { return 0; } 53.77 + int im() { return 0; } 53.78 + long lm() { return 0; } 53.79 + float fm() { return 0; } 53.80 + double dm() { return 0; } 53.81 + Object om() { return null; } 53.82 + String tm() { return ""; } 53.83 + List<String> gm() { return null; } 53.84 + void vm() { } 53.85 + byte[] bam() { return null; } 53.86 + short[] sam() { return null; } 53.87 + int[] iam() { return null; } 53.88 + long[] lam() { return null; } 53.89 + float[] fam() { return null; } 53.90 + double[] dam() { return null; } 53.91 + Object[] oam() { return null; } 53.92 + String[] tam() { return null; } 53.93 + List<String>[] gam() { return null; } 53.94 + byte[][] baam() { return null; } 53.95 + short[][] saam() { return null; } 53.96 + int[][] iaam() { return null; } 53.97 + long[][] laam() { return null; } 53.98 + float[][] faam() { return null; } 53.99 + double[][] daam() { return null; } 53.100 + Object[][] oaam() { return null; } 53.101 + String[][] taam() { return null; } 53.102 + List<String>[] gaam() { return null; } 53.103 + 53.104 + // simple native methods 53.105 + native byte bmn(); 53.106 + native short smn(); 53.107 + native int imn(); 53.108 + native long lmn(); 53.109 + native float fmn(); 53.110 + native double dmn(); 53.111 + native Object omn(); 53.112 + native String tmn(); 53.113 + native List<String> gmn(); 53.114 + native void vmn(); 53.115 + native byte[] bamn(); 53.116 + native short[] samn(); 53.117 + native int[] iamn(); 53.118 + native long[] lamn(); 53.119 + native float[] famn(); 53.120 + native double[] damn(); 53.121 + native Object[] oamn(); 53.122 + native String[] tamn(); 53.123 + native List<String>[] gamn(); 53.124 + native byte[][] baamn(); 53.125 + native short[][] saamn(); 53.126 + native int[][] iaamn(); 53.127 + native long[][] laamn(); 53.128 + native float[][] faamn(); 53.129 + native double[][] daamn(); 53.130 + native Object[][] oaamn(); 53.131 + native String[][] taamn(); 53.132 + native List<String>[] gaamn(); 53.133 + 53.134 + // overloaded Java methods 53.135 + byte bm1() { return 0; } 53.136 + short sm1() { return 0; } 53.137 + int im1() { return 0; } 53.138 + long lm1() { return 0; } 53.139 + float fm1() { return 0; } 53.140 + double dm1() { return 0; } 53.141 + Object om1() { return null; } 53.142 + String tm1() { return ""; } 53.143 + List<String> gm1() { return null; } 53.144 + void vm1() { } 53.145 + 53.146 + byte bm2(int i) { return 0; } 53.147 + short sm2(int i) { return 0; } 53.148 + int im2(int i) { return 0; } 53.149 + long lm2(int i) { return 0; } 53.150 + float fm2(int i) { return 0; } 53.151 + double dm2(int i) { return 0; } 53.152 + Object om2(int i) { return null; } 53.153 + String tm2(int i) { return ""; } 53.154 + List<String> gm2(int i) { return null; } 53.155 + void vm2(int i) { } 53.156 + 53.157 + // overloaded native methods 53.158 + native byte bmn1(); 53.159 + native short smn1(); 53.160 + native int imn1(); 53.161 + native long lmn1(); 53.162 + native float fmn1(); 53.163 + native double dmn1(); 53.164 + native Object omn1(); 53.165 + native String tmn1(); 53.166 + native List<String> gmn1(); 53.167 + native void vmn1(); 53.168 + 53.169 + native byte bmn2(int i); 53.170 + native short smn2(int i); 53.171 + native int imn2(int i); 53.172 + native long lmn2(int i); 53.173 + native float fmn2(int i); 53.174 + native double dmn2(int i); 53.175 + native Object omn2(int i); 53.176 + native String tmn2(int i); 53.177 + native List<String> gmn2(int i); 53.178 + native void vmn2(int i); 53.179 + 53.180 + // arg types for Java methods 53.181 + void mb(byte b) { } 53.182 + void ms(short s) { } 53.183 + void mi(int i) { } 53.184 + void ml(long l) { } 53.185 + void mf(float f) { } 53.186 + void md(double d) { } 53.187 + void mo(Object o) { } 53.188 + void mt(String t) { } 53.189 + void mg(List<String> g) { } 53.190 + 53.191 + // arg types for native methods 53.192 + native void mbn(byte b); 53.193 + native void msn(short s); 53.194 + native void min(int i); 53.195 + native void mln(long l); 53.196 + native void mfn(float f); 53.197 + native void mdn(double d); 53.198 + native void mon(Object o); 53.199 + native void mtn(String t); 53.200 + native void mgn(List<String> g); 53.201 + 53.202 + static class Inner1 { 53.203 + // simple types 53.204 + byte b; 53.205 + short s; 53.206 + int i; 53.207 + long l; 53.208 + float f; 53.209 + double d; 53.210 + Object o; 53.211 + String t; 53.212 + List<String> g; 53.213 + 53.214 + // constants 53.215 + static final byte bc = 0; 53.216 + static final short sc = 0; 53.217 + static final int ic = 0; 53.218 + static final long lc = 0; 53.219 + static final float fc = 0; 53.220 + static final double dc = 0; 53.221 + static final Object oc = null; 53.222 + static final String tc = ""; 53.223 + static final List<String> gc = null; 53.224 + 53.225 + // simple arrays 53.226 + byte[] ba; 53.227 + // short[] sa; // not handled corrected by javah v6 53.228 + int[] ia; 53.229 + long[] la; 53.230 + float[] fa; 53.231 + double[] da; 53.232 + Object[] oa; 53.233 + String[] ta; 53.234 + List<String>[] ga; 53.235 + 53.236 + // multidimensional arrays 53.237 + byte[][] baa; 53.238 + short[][] saa; 53.239 + int[][] iaa; 53.240 + long[][] laa; 53.241 + float[][] faa; 53.242 + double[][] daa; 53.243 + Object[][] oaa; 53.244 + String[][] taa; 53.245 + List<String>[] gaa; 53.246 + 53.247 + // simple Java methods 53.248 + byte bm() { return 0; } 53.249 + short sm() { return 0; } 53.250 + int im() { return 0; } 53.251 + long lm() { return 0; } 53.252 + float fm() { return 0; } 53.253 + double dm() { return 0; } 53.254 + Object om() { return null; } 53.255 + String tm() { return ""; } 53.256 + List<String> gm() { return null; } 53.257 + void vm() { } 53.258 + 53.259 + // simple native methods 53.260 + native byte bmn(); 53.261 + native short smn(); 53.262 + native int imn(); 53.263 + native long lmn(); 53.264 + native float fmn(); 53.265 + native double dmn(); 53.266 + native Object omn(); 53.267 + native String tmn(); 53.268 + native List<String> gmn(); 53.269 + native void vmn(); 53.270 + 53.271 + // overloaded Java methods 53.272 + byte bm1() { return 0; } 53.273 + short sm1() { return 0; } 53.274 + int im1() { return 0; } 53.275 + long lm1() { return 0; } 53.276 + float fm1() { return 0; } 53.277 + double dm1() { return 0; } 53.278 + Object om1() { return null; } 53.279 + String tm1() { return ""; } 53.280 + List<String> gm1() { return null; } 53.281 + void vm1() { } 53.282 + 53.283 + byte bm2(int i) { return 0; } 53.284 + short sm2(int i) { return 0; } 53.285 + int im2(int i) { return 0; } 53.286 + long lm2(int i) { return 0; } 53.287 + float fm2(int i) { return 0; } 53.288 + double dm2(int i) { return 0; } 53.289 + Object om2(int i) { return null; } 53.290 + String tm2(int i) { return ""; } 53.291 + List<String> gm2(int i) { return null; } 53.292 + void vm2(int i) { } 53.293 + 53.294 + // overloaded native methods 53.295 + native byte bmn1(); 53.296 + native short smn1(); 53.297 + native int imn1(); 53.298 + native long lmn1(); 53.299 + native float fmn1(); 53.300 + native double dmn1(); 53.301 + native Object omn1(); 53.302 + native String tmn1(); 53.303 + native List<String> gmn1(); 53.304 + native void vmn1(); 53.305 + 53.306 + native byte bmn2(int i); 53.307 + native short smn2(int i); 53.308 + native int imn2(int i); 53.309 + native long lmn2(int i); 53.310 + native float fmn2(int i); 53.311 + native double dmn2(int i); 53.312 + native Object omn2(int i); 53.313 + native String tmn2(int i); 53.314 + native List<String> gmn2(int i); 53.315 + native void vmn2(int i); 53.316 + 53.317 + // arg types for Java methods 53.318 + void mb(byte b) { } 53.319 + void ms(short s) { } 53.320 + void mi(int i) { } 53.321 + void ml(long l) { } 53.322 + void mf(float f) { } 53.323 + void md(double d) { } 53.324 + void mo(Object o) { } 53.325 + void mt(String t) { } 53.326 + void mg(List<String> g) { } 53.327 + 53.328 + // arg types for native methods 53.329 + native void mbn(byte b); 53.330 + native void msn(short s); 53.331 + native void min(int i); 53.332 + native void mln(long l); 53.333 + native void mfn(float f); 53.334 + native void mdn(double d); 53.335 + native void mon(Object o); 53.336 + native void mtn(String t); 53.337 + native void mgn(List<String> g); 53.338 + } 53.339 + 53.340 + class Inner2 { 53.341 + // simple types 53.342 + byte b; 53.343 + short s; 53.344 + int i; 53.345 + long l; 53.346 + float f; 53.347 + double d; 53.348 + Object o; 53.349 + String t; 53.350 + List<String> g; 53.351 + 53.352 + // constants 53.353 + static final byte bc = 0; 53.354 + static final short sc = 0; 53.355 + static final int ic = 0; 53.356 + static final long lc = 0; 53.357 + static final float fc = 0; 53.358 + static final double dc = 0; 53.359 + //static final Object oc = null; 53.360 + static final String tc = ""; 53.361 + //static final List<String> gc = null; 53.362 + 53.363 + // simple arrays 53.364 + byte[] ba; 53.365 + // short[] sa; // not handled corrected by javah v6 53.366 + int[] ia; 53.367 + long[] la; 53.368 + float[] fa; 53.369 + double[] da; 53.370 + Object[] oa; 53.371 + String[] ta; 53.372 + List<String>[] ga; 53.373 + 53.374 + // multidimensional arrays 53.375 + byte[][] baa; 53.376 + short[][] saa; 53.377 + int[][] iaa; 53.378 + long[][] laa; 53.379 + float[][] faa; 53.380 + double[][] daa; 53.381 + Object[][] oaa; 53.382 + String[][] taa; 53.383 + List<String>[] gaa; 53.384 + 53.385 + // simple Java methods 53.386 + byte bm() { return 0; } 53.387 + short sm() { return 0; } 53.388 + int im() { return 0; } 53.389 + long lm() { return 0; } 53.390 + float fm() { return 0; } 53.391 + double dm() { return 0; } 53.392 + Object om() { return null; } 53.393 + String tm() { return ""; } 53.394 + List<String> gm() { return null; } 53.395 + void vm() { } 53.396 + 53.397 + // simple native methods 53.398 + native byte bmn(); 53.399 + native short smn(); 53.400 + native int imn(); 53.401 + native long lmn(); 53.402 + native float fmn(); 53.403 + native double dmn(); 53.404 + native Object omn(); 53.405 + native String tmn(); 53.406 + native List<String> gmn(); 53.407 + native void vmn(); 53.408 + 53.409 + // overloaded Java methods 53.410 + byte bm1() { return 0; } 53.411 + short sm1() { return 0; } 53.412 + int im1() { return 0; } 53.413 + long lm1() { return 0; } 53.414 + float fm1() { return 0; } 53.415 + double dm1() { return 0; } 53.416 + Object om1() { return null; } 53.417 + String tm1() { return ""; } 53.418 + List<String> gm1() { return null; } 53.419 + void vm1() { } 53.420 + 53.421 + byte bm2(int i) { return 0; } 53.422 + short sm2(int i) { return 0; } 53.423 + int im2(int i) { return 0; } 53.424 + long lm2(int i) { return 0; } 53.425 + float fm2(int i) { return 0; } 53.426 + double dm2(int i) { return 0; } 53.427 + Object om2(int i) { return null; } 53.428 + String tm2(int i) { return ""; } 53.429 + List<String> gm2(int i) { return null; } 53.430 + void vm2(int i) { } 53.431 + 53.432 + // overloaded native methods 53.433 + native byte bmn1(); 53.434 + native short smn1(); 53.435 + native int imn1(); 53.436 + native long lmn1(); 53.437 + native float fmn1(); 53.438 + native double dmn1(); 53.439 + native Object omn1(); 53.440 + native String tmn1(); 53.441 + native List<String> gmn1(); 53.442 + native void vmn1(); 53.443 + 53.444 + native byte bmn2(int i); 53.445 + native short smn2(int i); 53.446 + native int imn2(int i); 53.447 + native long lmn2(int i); 53.448 + native float fmn2(int i); 53.449 + native double dmn2(int i); 53.450 + native Object omn2(int i); 53.451 + native String tmn2(int i); 53.452 + native List<String> gmn2(int i); 53.453 + native void vmn2(int i); 53.454 + 53.455 + // arg types for Java methods 53.456 + void mb(byte b) { } 53.457 + void ms(short s) { } 53.458 + void mi(int i) { } 53.459 + void ml(long l) { } 53.460 + void mf(float f) { } 53.461 + void md(double d) { } 53.462 + void mo(Object o) { } 53.463 + void mt(String t) { } 53.464 + void mg(List<String> g) { } 53.465 + 53.466 + // arg types for native methods 53.467 + native void mbn(byte b); 53.468 + native void msn(short s); 53.469 + native void min(int i); 53.470 + native void mln(long l); 53.471 + native void mfn(float f); 53.472 + native void mdn(double d); 53.473 + native void mon(Object o); 53.474 + native void mtn(String t); 53.475 + native void mgn(List<String> g); 53.476 + } 53.477 + 53.478 +}
54.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 54.2 +++ b/test/tools/javah/6572945/TestClass2.java Fri Sep 25 22:04:43 2009 -0700 54.3 @@ -0,0 +1,33 @@ 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 +public class TestClass2 { 54.28 + byte b; 54.29 + short s; 54.30 + int i; 54.31 + long l; 54.32 + float f; 54.33 + double d; 54.34 + Object o; 54.35 + String t; 54.36 +}
55.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 55.2 +++ b/test/tools/javah/6572945/TestClass3.java Fri Sep 25 22:04:43 2009 -0700 55.3 @@ -0,0 +1,51 @@ 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 TestClass3 { 55.28 + public int tc3; 55.29 + 55.30 + public class Inner1 { 55.31 + public int tc3i1; 55.32 + 55.33 + public class Inner1A { 55.34 + public int tc3i1i1a; 55.35 + } 55.36 + 55.37 + public class Inner1B { 55.38 + public int tc3i1i1b; 55.39 + } 55.40 + } 55.41 + 55.42 + public class Inner2 { 55.43 + public int tc321; 55.44 + 55.45 + public class Inner2A { 55.46 + public int tc3i2i2a; 55.47 + } 55.48 + 55.49 + public class Inner2B { 55.50 + public int tc3i2i2b; 55.51 + } 55.52 + } 55.53 +} 55.54 +
56.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 56.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass1.h Fri Sep 25 22:04:43 2009 -0700 56.3 @@ -0,0 +1,481 @@ 56.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 56.5 +#include <jni.h> 56.6 +/* Header for class TestClass1 */ 56.7 + 56.8 +#ifndef _Included_TestClass1 56.9 +#define _Included_TestClass1 56.10 +#ifdef __cplusplus 56.11 +extern "C" { 56.12 +#endif 56.13 +#undef TestClass1_bc 56.14 +#define TestClass1_bc 0L 56.15 +#undef TestClass1_sc 56.16 +#define TestClass1_sc 0L 56.17 +#undef TestClass1_ic 56.18 +#define TestClass1_ic 0L 56.19 +#undef TestClass1_lc 56.20 +#define TestClass1_lc 0LL 56.21 +#undef TestClass1_fc 56.22 +#define TestClass1_fc 0.0f 56.23 +#undef TestClass1_dc 56.24 +#define TestClass1_dc 0.0 56.25 +/* 56.26 + * Class: TestClass1 56.27 + * Method: bmn 56.28 + * Signature: ()B 56.29 + */ 56.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn 56.31 + (JNIEnv *, jobject); 56.32 + 56.33 +/* 56.34 + * Class: TestClass1 56.35 + * Method: smn 56.36 + * Signature: ()S 56.37 + */ 56.38 +JNIEXPORT jshort JNICALL Java_TestClass1_smn 56.39 + (JNIEnv *, jobject); 56.40 + 56.41 +/* 56.42 + * Class: TestClass1 56.43 + * Method: imn 56.44 + * Signature: ()I 56.45 + */ 56.46 +JNIEXPORT jint JNICALL Java_TestClass1_imn 56.47 + (JNIEnv *, jobject); 56.48 + 56.49 +/* 56.50 + * Class: TestClass1 56.51 + * Method: lmn 56.52 + * Signature: ()J 56.53 + */ 56.54 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn 56.55 + (JNIEnv *, jobject); 56.56 + 56.57 +/* 56.58 + * Class: TestClass1 56.59 + * Method: fmn 56.60 + * Signature: ()F 56.61 + */ 56.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn 56.63 + (JNIEnv *, jobject); 56.64 + 56.65 +/* 56.66 + * Class: TestClass1 56.67 + * Method: dmn 56.68 + * Signature: ()D 56.69 + */ 56.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn 56.71 + (JNIEnv *, jobject); 56.72 + 56.73 +/* 56.74 + * Class: TestClass1 56.75 + * Method: omn 56.76 + * Signature: ()Ljava/lang/Object; 56.77 + */ 56.78 +JNIEXPORT jobject JNICALL Java_TestClass1_omn 56.79 + (JNIEnv *, jobject); 56.80 + 56.81 +/* 56.82 + * Class: TestClass1 56.83 + * Method: tmn 56.84 + * Signature: ()Ljava/lang/String; 56.85 + */ 56.86 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn 56.87 + (JNIEnv *, jobject); 56.88 + 56.89 +/* 56.90 + * Class: TestClass1 56.91 + * Method: gmn 56.92 + * Signature: ()Ljava/util/List; 56.93 + */ 56.94 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn 56.95 + (JNIEnv *, jobject); 56.96 + 56.97 +/* 56.98 + * Class: TestClass1 56.99 + * Method: vmn 56.100 + * Signature: ()V 56.101 + */ 56.102 +JNIEXPORT void JNICALL Java_TestClass1_vmn 56.103 + (JNIEnv *, jobject); 56.104 + 56.105 +/* 56.106 + * Class: TestClass1 56.107 + * Method: bamn 56.108 + * Signature: ()[B 56.109 + */ 56.110 +JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn 56.111 + (JNIEnv *, jobject); 56.112 + 56.113 +/* 56.114 + * Class: TestClass1 56.115 + * Method: samn 56.116 + * Signature: ()[S 56.117 + */ 56.118 +JNIEXPORT jshortArray JNICALL Java_TestClass1_samn 56.119 + (JNIEnv *, jobject); 56.120 + 56.121 +/* 56.122 + * Class: TestClass1 56.123 + * Method: iamn 56.124 + * Signature: ()[I 56.125 + */ 56.126 +JNIEXPORT jintArray JNICALL Java_TestClass1_iamn 56.127 + (JNIEnv *, jobject); 56.128 + 56.129 +/* 56.130 + * Class: TestClass1 56.131 + * Method: lamn 56.132 + * Signature: ()[J 56.133 + */ 56.134 +JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn 56.135 + (JNIEnv *, jobject); 56.136 + 56.137 +/* 56.138 + * Class: TestClass1 56.139 + * Method: famn 56.140 + * Signature: ()[F 56.141 + */ 56.142 +JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn 56.143 + (JNIEnv *, jobject); 56.144 + 56.145 +/* 56.146 + * Class: TestClass1 56.147 + * Method: damn 56.148 + * Signature: ()[D 56.149 + */ 56.150 +JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn 56.151 + (JNIEnv *, jobject); 56.152 + 56.153 +/* 56.154 + * Class: TestClass1 56.155 + * Method: oamn 56.156 + * Signature: ()[Ljava/lang/Object; 56.157 + */ 56.158 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn 56.159 + (JNIEnv *, jobject); 56.160 + 56.161 +/* 56.162 + * Class: TestClass1 56.163 + * Method: tamn 56.164 + * Signature: ()[Ljava/lang/String; 56.165 + */ 56.166 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn 56.167 + (JNIEnv *, jobject); 56.168 + 56.169 +/* 56.170 + * Class: TestClass1 56.171 + * Method: gamn 56.172 + * Signature: ()[Ljava/util/List; 56.173 + */ 56.174 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn 56.175 + (JNIEnv *, jobject); 56.176 + 56.177 +/* 56.178 + * Class: TestClass1 56.179 + * Method: baamn 56.180 + * Signature: ()[[B 56.181 + */ 56.182 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn 56.183 + (JNIEnv *, jobject); 56.184 + 56.185 +/* 56.186 + * Class: TestClass1 56.187 + * Method: saamn 56.188 + * Signature: ()[[S 56.189 + */ 56.190 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn 56.191 + (JNIEnv *, jobject); 56.192 + 56.193 +/* 56.194 + * Class: TestClass1 56.195 + * Method: iaamn 56.196 + * Signature: ()[[I 56.197 + */ 56.198 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn 56.199 + (JNIEnv *, jobject); 56.200 + 56.201 +/* 56.202 + * Class: TestClass1 56.203 + * Method: laamn 56.204 + * Signature: ()[[J 56.205 + */ 56.206 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn 56.207 + (JNIEnv *, jobject); 56.208 + 56.209 +/* 56.210 + * Class: TestClass1 56.211 + * Method: faamn 56.212 + * Signature: ()[[F 56.213 + */ 56.214 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn 56.215 + (JNIEnv *, jobject); 56.216 + 56.217 +/* 56.218 + * Class: TestClass1 56.219 + * Method: daamn 56.220 + * Signature: ()[[D 56.221 + */ 56.222 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn 56.223 + (JNIEnv *, jobject); 56.224 + 56.225 +/* 56.226 + * Class: TestClass1 56.227 + * Method: oaamn 56.228 + * Signature: ()[[Ljava/lang/Object; 56.229 + */ 56.230 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn 56.231 + (JNIEnv *, jobject); 56.232 + 56.233 +/* 56.234 + * Class: TestClass1 56.235 + * Method: taamn 56.236 + * Signature: ()[[Ljava/lang/String; 56.237 + */ 56.238 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn 56.239 + (JNIEnv *, jobject); 56.240 + 56.241 +/* 56.242 + * Class: TestClass1 56.243 + * Method: gaamn 56.244 + * Signature: ()[Ljava/util/List; 56.245 + */ 56.246 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn 56.247 + (JNIEnv *, jobject); 56.248 + 56.249 +/* 56.250 + * Class: TestClass1 56.251 + * Method: bmn1 56.252 + * Signature: ()B 56.253 + */ 56.254 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1 56.255 + (JNIEnv *, jobject); 56.256 + 56.257 +/* 56.258 + * Class: TestClass1 56.259 + * Method: smn1 56.260 + * Signature: ()S 56.261 + */ 56.262 +JNIEXPORT jshort JNICALL Java_TestClass1_smn1 56.263 + (JNIEnv *, jobject); 56.264 + 56.265 +/* 56.266 + * Class: TestClass1 56.267 + * Method: imn1 56.268 + * Signature: ()I 56.269 + */ 56.270 +JNIEXPORT jint JNICALL Java_TestClass1_imn1 56.271 + (JNIEnv *, jobject); 56.272 + 56.273 +/* 56.274 + * Class: TestClass1 56.275 + * Method: lmn1 56.276 + * Signature: ()J 56.277 + */ 56.278 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn1 56.279 + (JNIEnv *, jobject); 56.280 + 56.281 +/* 56.282 + * Class: TestClass1 56.283 + * Method: fmn1 56.284 + * Signature: ()F 56.285 + */ 56.286 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1 56.287 + (JNIEnv *, jobject); 56.288 + 56.289 +/* 56.290 + * Class: TestClass1 56.291 + * Method: dmn1 56.292 + * Signature: ()D 56.293 + */ 56.294 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1 56.295 + (JNIEnv *, jobject); 56.296 + 56.297 +/* 56.298 + * Class: TestClass1 56.299 + * Method: omn1 56.300 + * Signature: ()Ljava/lang/Object; 56.301 + */ 56.302 +JNIEXPORT jobject JNICALL Java_TestClass1_omn1 56.303 + (JNIEnv *, jobject); 56.304 + 56.305 +/* 56.306 + * Class: TestClass1 56.307 + * Method: tmn1 56.308 + * Signature: ()Ljava/lang/String; 56.309 + */ 56.310 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn1 56.311 + (JNIEnv *, jobject); 56.312 + 56.313 +/* 56.314 + * Class: TestClass1 56.315 + * Method: gmn1 56.316 + * Signature: ()Ljava/util/List; 56.317 + */ 56.318 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn1 56.319 + (JNIEnv *, jobject); 56.320 + 56.321 +/* 56.322 + * Class: TestClass1 56.323 + * Method: vmn1 56.324 + * Signature: ()V 56.325 + */ 56.326 +JNIEXPORT void JNICALL Java_TestClass1_vmn1 56.327 + (JNIEnv *, jobject); 56.328 + 56.329 +/* 56.330 + * Class: TestClass1 56.331 + * Method: bmn2 56.332 + * Signature: (I)B 56.333 + */ 56.334 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2 56.335 + (JNIEnv *, jobject, jint); 56.336 + 56.337 +/* 56.338 + * Class: TestClass1 56.339 + * Method: smn2 56.340 + * Signature: (I)S 56.341 + */ 56.342 +JNIEXPORT jshort JNICALL Java_TestClass1_smn2 56.343 + (JNIEnv *, jobject, jint); 56.344 + 56.345 +/* 56.346 + * Class: TestClass1 56.347 + * Method: imn2 56.348 + * Signature: (I)I 56.349 + */ 56.350 +JNIEXPORT jint JNICALL Java_TestClass1_imn2 56.351 + (JNIEnv *, jobject, jint); 56.352 + 56.353 +/* 56.354 + * Class: TestClass1 56.355 + * Method: lmn2 56.356 + * Signature: (I)J 56.357 + */ 56.358 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn2 56.359 + (JNIEnv *, jobject, jint); 56.360 + 56.361 +/* 56.362 + * Class: TestClass1 56.363 + * Method: fmn2 56.364 + * Signature: (I)F 56.365 + */ 56.366 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2 56.367 + (JNIEnv *, jobject, jint); 56.368 + 56.369 +/* 56.370 + * Class: TestClass1 56.371 + * Method: dmn2 56.372 + * Signature: (I)D 56.373 + */ 56.374 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2 56.375 + (JNIEnv *, jobject, jint); 56.376 + 56.377 +/* 56.378 + * Class: TestClass1 56.379 + * Method: omn2 56.380 + * Signature: (I)Ljava/lang/Object; 56.381 + */ 56.382 +JNIEXPORT jobject JNICALL Java_TestClass1_omn2 56.383 + (JNIEnv *, jobject, jint); 56.384 + 56.385 +/* 56.386 + * Class: TestClass1 56.387 + * Method: tmn2 56.388 + * Signature: (I)Ljava/lang/String; 56.389 + */ 56.390 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn2 56.391 + (JNIEnv *, jobject, jint); 56.392 + 56.393 +/* 56.394 + * Class: TestClass1 56.395 + * Method: gmn2 56.396 + * Signature: (I)Ljava/util/List; 56.397 + */ 56.398 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn2 56.399 + (JNIEnv *, jobject, jint); 56.400 + 56.401 +/* 56.402 + * Class: TestClass1 56.403 + * Method: vmn2 56.404 + * Signature: (I)V 56.405 + */ 56.406 +JNIEXPORT void JNICALL Java_TestClass1_vmn2 56.407 + (JNIEnv *, jobject, jint); 56.408 + 56.409 +/* 56.410 + * Class: TestClass1 56.411 + * Method: mbn 56.412 + * Signature: (B)V 56.413 + */ 56.414 +JNIEXPORT void JNICALL Java_TestClass1_mbn 56.415 + (JNIEnv *, jobject, jbyte); 56.416 + 56.417 +/* 56.418 + * Class: TestClass1 56.419 + * Method: msn 56.420 + * Signature: (S)V 56.421 + */ 56.422 +JNIEXPORT void JNICALL Java_TestClass1_msn 56.423 + (JNIEnv *, jobject, jshort); 56.424 + 56.425 +/* 56.426 + * Class: TestClass1 56.427 + * Method: min 56.428 + * Signature: (I)V 56.429 + */ 56.430 +JNIEXPORT void JNICALL Java_TestClass1_min 56.431 + (JNIEnv *, jobject, jint); 56.432 + 56.433 +/* 56.434 + * Class: TestClass1 56.435 + * Method: mln 56.436 + * Signature: (J)V 56.437 + */ 56.438 +JNIEXPORT void JNICALL Java_TestClass1_mln 56.439 + (JNIEnv *, jobject, jlong); 56.440 + 56.441 +/* 56.442 + * Class: TestClass1 56.443 + * Method: mfn 56.444 + * Signature: (F)V 56.445 + */ 56.446 +JNIEXPORT void JNICALL Java_TestClass1_mfn 56.447 + (JNIEnv *, jobject, jfloat); 56.448 + 56.449 +/* 56.450 + * Class: TestClass1 56.451 + * Method: mdn 56.452 + * Signature: (D)V 56.453 + */ 56.454 +JNIEXPORT void JNICALL Java_TestClass1_mdn 56.455 + (JNIEnv *, jobject, jdouble); 56.456 + 56.457 +/* 56.458 + * Class: TestClass1 56.459 + * Method: mon 56.460 + * Signature: (Ljava/lang/Object;)V 56.461 + */ 56.462 +JNIEXPORT void JNICALL Java_TestClass1_mon 56.463 + (JNIEnv *, jobject, jobject); 56.464 + 56.465 +/* 56.466 + * Class: TestClass1 56.467 + * Method: mtn 56.468 + * Signature: (Ljava/lang/String;)V 56.469 + */ 56.470 +JNIEXPORT void JNICALL Java_TestClass1_mtn 56.471 + (JNIEnv *, jobject, jstring); 56.472 + 56.473 +/* 56.474 + * Class: TestClass1 56.475 + * Method: mgn 56.476 + * Signature: (Ljava/util/List;)V 56.477 + */ 56.478 +JNIEXPORT void JNICALL Java_TestClass1_mgn 56.479 + (JNIEnv *, jobject, jobject); 56.480 + 56.481 +#ifdef __cplusplus 56.482 +} 56.483 +#endif 56.484 +#endif
57.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 57.2 +++ b/test/tools/javah/6572945/gold/jni.dir.1/TestClass1_Inner1.h Fri Sep 25 22:04:43 2009 -0700 57.3 @@ -0,0 +1,337 @@ 57.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 57.5 +#include <jni.h> 57.6 +/* Header for class TestClass1_Inner1 */ 57.7 + 57.8 +#ifndef _Included_TestClass1_Inner1 57.9 +#define _Included_TestClass1_Inner1 57.10 +#ifdef __cplusplus 57.11 +extern "C" { 57.12 +#endif 57.13 +#undef TestClass1_Inner1_bc 57.14 +#define TestClass1_Inner1_bc 0L 57.15 +#undef TestClass1_Inner1_sc 57.16 +#define TestClass1_Inner1_sc 0L 57.17 +#undef TestClass1_Inner1_ic 57.18 +#define TestClass1_Inner1_ic 0L 57.19 +#undef TestClass1_Inner1_lc 57.20 +#define TestClass1_Inner1_lc 0LL 57.21 +#undef TestClass1_Inner1_fc 57.22 +#define TestClass1_Inner1_fc 0.0f 57.23 +#undef TestClass1_Inner1_dc 57.24 +#define TestClass1_Inner1_dc 0.0 57.25 +/* 57.26 + * Class: TestClass1_Inner1 57.27 + * Method: bmn 57.28 + * Signature: ()B 57.29 + */ 57.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn 57.31 + (JNIEnv *, jobject); 57.32 + 57.33 +/* 57.34 + * Class: TestClass1_Inner1 57.35 + * Method: smn 57.36 + * Signature: ()S 57.37 + */ 57.38 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn 57.39 + (JNIEnv *, jobject); 57.40 + 57.41 +/* 57.42 + * Class: TestClass1_Inner1 57.43 + * Method: imn 57.44 + * Signature: ()I 57.45 + */ 57.46 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn 57.47 + (JNIEnv *, jobject); 57.48 + 57.49 +/* 57.50 + * Class: TestClass1_Inner1 57.51 + * Method: lmn 57.52 + * Signature: ()J 57.53 + */ 57.54 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn 57.55 + (JNIEnv *, jobject); 57.56 + 57.57 +/* 57.58 + * Class: TestClass1_Inner1 57.59 + * Method: fmn 57.60 + * Signature: ()F 57.61 + */ 57.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn 57.63 + (JNIEnv *, jobject); 57.64 + 57.65 +/* 57.66 + * Class: TestClass1_Inner1 57.67 + * Method: dmn 57.68 + * Signature: ()D 57.69 + */ 57.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn 57.71 + (JNIEnv *, jobject); 57.72 + 57.73 +/* 57.74 + * Class: TestClass1_Inner1 57.75 + * Method: omn 57.76 + * Signature: ()Ljava/lang/Object; 57.77 + */ 57.78 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn 57.79 + (JNIEnv *, jobject); 57.80 + 57.81 +/* 57.82 + * Class: TestClass1_Inner1 57.83 + * Method: tmn 57.84 + * Signature: ()Ljava/lang/String; 57.85 + */ 57.86 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn 57.87 + (JNIEnv *, jobject); 57.88 + 57.89 +/* 57.90 + * Class: TestClass1_Inner1 57.91 + * Method: gmn 57.92 + * Signature: ()Ljava/util/List; 57.93 + */ 57.94 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn 57.95 + (JNIEnv *, jobject); 57.96 + 57.97 +/* 57.98 + * Class: TestClass1_Inner1 57.99 + * Method: vmn 57.100 + * Signature: ()V 57.101 + */ 57.102 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn 57.103 + (JNIEnv *, jobject); 57.104 + 57.105 +/* 57.106 + * Class: TestClass1_Inner1 57.107 + * Method: bmn1 57.108 + * Signature: ()B 57.109 + */ 57.110 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1 57.111 + (JNIEnv *, jobject); 57.112 + 57.113 +/* 57.114 + * Class: TestClass1_Inner1 57.115 + * Method: smn1 57.116 + * Signature: ()S 57.117 + */ 57.118 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1 57.119 + (JNIEnv *, jobject); 57.120 + 57.121 +/* 57.122 + * Class: TestClass1_Inner1 57.123 + * Method: imn1 57.124 + * Signature: ()I 57.125 + */ 57.126 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1 57.127 + (JNIEnv *, jobject); 57.128 + 57.129 +/* 57.130 + * Class: TestClass1_Inner1 57.131 + * Method: lmn1 57.132 + * Signature: ()J 57.133 + */ 57.134 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1 57.135 + (JNIEnv *, jobject); 57.136 + 57.137 +/* 57.138 + * Class: TestClass1_Inner1 57.139 + * Method: fmn1 57.140 + * Signature: ()F 57.141 + */ 57.142 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1 57.143 + (JNIEnv *, jobject); 57.144 + 57.145 +/* 57.146 + * Class: TestClass1_Inner1 57.147 + * Method: dmn1 57.148 + * Signature: ()D 57.149 + */ 57.150 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1 57.151 + (JNIEnv *, jobject); 57.152 + 57.153 +/* 57.154 + * Class: TestClass1_Inner1 57.155 + * Method: omn1 57.156 + * Signature: ()Ljava/lang/Object; 57.157 + */ 57.158 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1 57.159 + (JNIEnv *, jobject); 57.160 + 57.161 +/* 57.162 + * Class: TestClass1_Inner1 57.163 + * Method: tmn1 57.164 + * Signature: ()Ljava/lang/String; 57.165 + */ 57.166 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1 57.167 + (JNIEnv *, jobject); 57.168 + 57.169 +/* 57.170 + * Class: TestClass1_Inner1 57.171 + * Method: gmn1 57.172 + * Signature: ()Ljava/util/List; 57.173 + */ 57.174 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1 57.175 + (JNIEnv *, jobject); 57.176 + 57.177 +/* 57.178 + * Class: TestClass1_Inner1 57.179 + * Method: vmn1 57.180 + * Signature: ()V 57.181 + */ 57.182 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1 57.183 + (JNIEnv *, jobject); 57.184 + 57.185 +/* 57.186 + * Class: TestClass1_Inner1 57.187 + * Method: bmn2 57.188 + * Signature: (I)B 57.189 + */ 57.190 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2 57.191 + (JNIEnv *, jobject, jint); 57.192 + 57.193 +/* 57.194 + * Class: TestClass1_Inner1 57.195 + * Method: smn2 57.196 + * Signature: (I)S 57.197 + */ 57.198 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2 57.199 + (JNIEnv *, jobject, jint); 57.200 + 57.201 +/* 57.202 + * Class: TestClass1_Inner1 57.203 + * Method: imn2 57.204 + * Signature: (I)I 57.205 + */ 57.206 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2 57.207 + (JNIEnv *, jobject, jint); 57.208 + 57.209 +/* 57.210 + * Class: TestClass1_Inner1 57.211 + * Method: lmn2 57.212 + * Signature: (I)J 57.213 + */ 57.214 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2 57.215 + (JNIEnv *, jobject, jint); 57.216 + 57.217 +/* 57.218 + * Class: TestClass1_Inner1 57.219 + * Method: fmn2 57.220 + * Signature: (I)F 57.221 + */ 57.222 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2 57.223 + (JNIEnv *, jobject, jint); 57.224 + 57.225 +/* 57.226 + * Class: TestClass1_Inner1 57.227 + * Method: dmn2 57.228 + * Signature: (I)D 57.229 + */ 57.230 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2 57.231 + (JNIEnv *, jobject, jint); 57.232 + 57.233 +/* 57.234 + * Class: TestClass1_Inner1 57.235 + * Method: omn2 57.236 + * Signature: (I)Ljava/lang/Object; 57.237 + */ 57.238 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2 57.239 + (JNIEnv *, jobject, jint); 57.240 + 57.241 +/* 57.242 + * Class: TestClass1_Inner1 57.243 + * Method: tmn2 57.244 + * Signature: (I)Ljava/lang/String; 57.245 + */ 57.246 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2 57.247 + (JNIEnv *, jobject, jint); 57.248 + 57.249 +/* 57.250 + * Class: TestClass1_Inner1 57.251 + * Method: gmn2 57.252 + * Signature: (I)Ljava/util/List; 57.253 + */ 57.254 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2 57.255 + (JNIEnv *, jobject, jint); 57.256 + 57.257 +/* 57.258 + * Class: TestClass1_Inner1 57.259 + * Method: vmn2 57.260 + * Signature: (I)V 57.261 + */ 57.262 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2 57.263 + (JNIEnv *, jobject, jint); 57.264 + 57.265 +/* 57.266 + * Class: TestClass1_Inner1 57.267 + * Method: mbn 57.268 + * Signature: (B)V 57.269 + */ 57.270 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn 57.271 + (JNIEnv *, jobject, jbyte); 57.272 + 57.273 +/* 57.274 + * Class: TestClass1_Inner1 57.275 + * Method: msn 57.276 + * Signature: (S)V 57.277 + */ 57.278 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn 57.279 + (JNIEnv *, jobject, jshort); 57.280 + 57.281 +/* 57.282 + * Class: TestClass1_Inner1 57.283 + * Method: min 57.284 + * Signature: (I)V 57.285 + */ 57.286 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min 57.287 + (JNIEnv *, jobject, jint); 57.288 + 57.289 +/* 57.290 + * Class: TestClass1_Inner1 57.291 + * Method: mln 57.292 + * Signature: (J)V 57.293 + */ 57.294 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln 57.295 + (JNIEnv *, jobject, jlong); 57.296 + 57.297 +/* 57.298 + * Class: TestClass1_Inner1 57.299 + * Method: mfn 57.300 + * Signature: (F)V 57.301 + */ 57.302 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn 57.303 + (JNIEnv *, jobject, jfloat); 57.304 + 57.305 +/* 57.306 + * Class: TestClass1_Inner1 57.307 + * Method: mdn 57.308 + * Signature: (D)V 57.309 + */ 57.310 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn 57.311 + (JNIEnv *, jobject, jdouble); 57.312 + 57.313 +/* 57.314 + * Class: TestClass1_Inner1 57.315 + * Method: mon 57.316 + * Signature: (Ljava/lang/Object;)V 57.317 + */ 57.318 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon 57.319 + (JNIEnv *, jobject, jobject); 57.320 + 57.321 +/* 57.322 + * Class: TestClass1_Inner1 57.323 + * Method: mtn 57.324 + * Signature: (Ljava/lang/String;)V 57.325 + */ 57.326 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn 57.327 + (JNIEnv *, jobject, jstring); 57.328 + 57.329 +/* 57.330 + * Class: TestClass1_Inner1 57.331 + * Method: mgn 57.332 + * Signature: (Ljava/util/List;)V 57.333 + */ 57.334 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn 57.335 + (JNIEnv *, jobject, jobject); 57.336 + 57.337 +#ifdef __cplusplus 57.338 +} 57.339 +#endif 57.340 +#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_Inner2.h Fri Sep 25 22:04:43 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_Inner2 */ 58.7 + 58.8 +#ifndef _Included_TestClass1_Inner2 58.9 +#define _Included_TestClass1_Inner2 58.10 +#ifdef __cplusplus 58.11 +extern "C" { 58.12 +#endif 58.13 +#undef TestClass1_Inner2_bc 58.14 +#define TestClass1_Inner2_bc 0L 58.15 +#undef TestClass1_Inner2_sc 58.16 +#define TestClass1_Inner2_sc 0L 58.17 +#undef TestClass1_Inner2_ic 58.18 +#define TestClass1_Inner2_ic 0L 58.19 +#undef TestClass1_Inner2_lc 58.20 +#define TestClass1_Inner2_lc 0LL 58.21 +#undef TestClass1_Inner2_fc 58.22 +#define TestClass1_Inner2_fc 0.0f 58.23 +#undef TestClass1_Inner2_dc 58.24 +#define TestClass1_Inner2_dc 0.0 58.25 +/* 58.26 + * Class: TestClass1_Inner2 58.27 + * Method: bmn 58.28 + * Signature: ()B 58.29 + */ 58.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn 58.31 + (JNIEnv *, jobject); 58.32 + 58.33 +/* 58.34 + * Class: TestClass1_Inner2 58.35 + * Method: smn 58.36 + * Signature: ()S 58.37 + */ 58.38 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn 58.39 + (JNIEnv *, jobject); 58.40 + 58.41 +/* 58.42 + * Class: TestClass1_Inner2 58.43 + * Method: imn 58.44 + * Signature: ()I 58.45 + */ 58.46 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn 58.47 + (JNIEnv *, jobject); 58.48 + 58.49 +/* 58.50 + * Class: TestClass1_Inner2 58.51 + * Method: lmn 58.52 + * Signature: ()J 58.53 + */ 58.54 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn 58.55 + (JNIEnv *, jobject); 58.56 + 58.57 +/* 58.58 + * Class: TestClass1_Inner2 58.59 + * Method: fmn 58.60 + * Signature: ()F 58.61 + */ 58.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn 58.63 + (JNIEnv *, jobject); 58.64 + 58.65 +/* 58.66 + * Class: TestClass1_Inner2 58.67 + * Method: dmn 58.68 + * Signature: ()D 58.69 + */ 58.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn 58.71 + (JNIEnv *, jobject); 58.72 + 58.73 +/* 58.74 + * Class: TestClass1_Inner2 58.75 + * Method: omn 58.76 + * Signature: ()Ljava/lang/Object; 58.77 + */ 58.78 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn 58.79 + (JNIEnv *, jobject); 58.80 + 58.81 +/* 58.82 + * Class: TestClass1_Inner2 58.83 + * Method: tmn 58.84 + * Signature: ()Ljava/lang/String; 58.85 + */ 58.86 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn 58.87 + (JNIEnv *, jobject); 58.88 + 58.89 +/* 58.90 + * Class: TestClass1_Inner2 58.91 + * Method: gmn 58.92 + * Signature: ()Ljava/util/List; 58.93 + */ 58.94 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn 58.95 + (JNIEnv *, jobject); 58.96 + 58.97 +/* 58.98 + * Class: TestClass1_Inner2 58.99 + * Method: vmn 58.100 + * Signature: ()V 58.101 + */ 58.102 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn 58.103 + (JNIEnv *, jobject); 58.104 + 58.105 +/* 58.106 + * Class: TestClass1_Inner2 58.107 + * Method: bmn1 58.108 + * Signature: ()B 58.109 + */ 58.110 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1 58.111 + (JNIEnv *, jobject); 58.112 + 58.113 +/* 58.114 + * Class: TestClass1_Inner2 58.115 + * Method: smn1 58.116 + * Signature: ()S 58.117 + */ 58.118 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1 58.119 + (JNIEnv *, jobject); 58.120 + 58.121 +/* 58.122 + * Class: TestClass1_Inner2 58.123 + * Method: imn1 58.124 + * Signature: ()I 58.125 + */ 58.126 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1 58.127 + (JNIEnv *, jobject); 58.128 + 58.129 +/* 58.130 + * Class: TestClass1_Inner2 58.131 + * Method: lmn1 58.132 + * Signature: ()J 58.133 + */ 58.134 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1 58.135 + (JNIEnv *, jobject); 58.136 + 58.137 +/* 58.138 + * Class: TestClass1_Inner2 58.139 + * Method: fmn1 58.140 + * Signature: ()F 58.141 + */ 58.142 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1 58.143 + (JNIEnv *, jobject); 58.144 + 58.145 +/* 58.146 + * Class: TestClass1_Inner2 58.147 + * Method: dmn1 58.148 + * Signature: ()D 58.149 + */ 58.150 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1 58.151 + (JNIEnv *, jobject); 58.152 + 58.153 +/* 58.154 + * Class: TestClass1_Inner2 58.155 + * Method: omn1 58.156 + * Signature: ()Ljava/lang/Object; 58.157 + */ 58.158 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1 58.159 + (JNIEnv *, jobject); 58.160 + 58.161 +/* 58.162 + * Class: TestClass1_Inner2 58.163 + * Method: tmn1 58.164 + * Signature: ()Ljava/lang/String; 58.165 + */ 58.166 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1 58.167 + (JNIEnv *, jobject); 58.168 + 58.169 +/* 58.170 + * Class: TestClass1_Inner2 58.171 + * Method: gmn1 58.172 + * Signature: ()Ljava/util/List; 58.173 + */ 58.174 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1 58.175 + (JNIEnv *, jobject); 58.176 + 58.177 +/* 58.178 + * Class: TestClass1_Inner2 58.179 + * Method: vmn1 58.180 + * Signature: ()V 58.181 + */ 58.182 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1 58.183 + (JNIEnv *, jobject); 58.184 + 58.185 +/* 58.186 + * Class: TestClass1_Inner2 58.187 + * Method: bmn2 58.188 + * Signature: (I)B 58.189 + */ 58.190 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2 58.191 + (JNIEnv *, jobject, jint); 58.192 + 58.193 +/* 58.194 + * Class: TestClass1_Inner2 58.195 + * Method: smn2 58.196 + * Signature: (I)S 58.197 + */ 58.198 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2 58.199 + (JNIEnv *, jobject, jint); 58.200 + 58.201 +/* 58.202 + * Class: TestClass1_Inner2 58.203 + * Method: imn2 58.204 + * Signature: (I)I 58.205 + */ 58.206 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2 58.207 + (JNIEnv *, jobject, jint); 58.208 + 58.209 +/* 58.210 + * Class: TestClass1_Inner2 58.211 + * Method: lmn2 58.212 + * Signature: (I)J 58.213 + */ 58.214 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2 58.215 + (JNIEnv *, jobject, jint); 58.216 + 58.217 +/* 58.218 + * Class: TestClass1_Inner2 58.219 + * Method: fmn2 58.220 + * Signature: (I)F 58.221 + */ 58.222 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2 58.223 + (JNIEnv *, jobject, jint); 58.224 + 58.225 +/* 58.226 + * Class: TestClass1_Inner2 58.227 + * Method: dmn2 58.228 + * Signature: (I)D 58.229 + */ 58.230 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2 58.231 + (JNIEnv *, jobject, jint); 58.232 + 58.233 +/* 58.234 + * Class: TestClass1_Inner2 58.235 + * Method: omn2 58.236 + * Signature: (I)Ljava/lang/Object; 58.237 + */ 58.238 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2 58.239 + (JNIEnv *, jobject, jint); 58.240 + 58.241 +/* 58.242 + * Class: TestClass1_Inner2 58.243 + * Method: tmn2 58.244 + * Signature: (I)Ljava/lang/String; 58.245 + */ 58.246 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2 58.247 + (JNIEnv *, jobject, jint); 58.248 + 58.249 +/* 58.250 + * Class: TestClass1_Inner2 58.251 + * Method: gmn2 58.252 + * Signature: (I)Ljava/util/List; 58.253 + */ 58.254 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2 58.255 + (JNIEnv *, jobject, jint); 58.256 + 58.257 +/* 58.258 + * Class: TestClass1_Inner2 58.259 + * Method: vmn2 58.260 + * Signature: (I)V 58.261 + */ 58.262 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2 58.263 + (JNIEnv *, jobject, jint); 58.264 + 58.265 +/* 58.266 + * Class: TestClass1_Inner2 58.267 + * Method: mbn 58.268 + * Signature: (B)V 58.269 + */ 58.270 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn 58.271 + (JNIEnv *, jobject, jbyte); 58.272 + 58.273 +/* 58.274 + * Class: TestClass1_Inner2 58.275 + * Method: msn 58.276 + * Signature: (S)V 58.277 + */ 58.278 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn 58.279 + (JNIEnv *, jobject, jshort); 58.280 + 58.281 +/* 58.282 + * Class: TestClass1_Inner2 58.283 + * Method: min 58.284 + * Signature: (I)V 58.285 + */ 58.286 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min 58.287 + (JNIEnv *, jobject, jint); 58.288 + 58.289 +/* 58.290 + * Class: TestClass1_Inner2 58.291 + * Method: mln 58.292 + * Signature: (J)V 58.293 + */ 58.294 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln 58.295 + (JNIEnv *, jobject, jlong); 58.296 + 58.297 +/* 58.298 + * Class: TestClass1_Inner2 58.299 + * Method: mfn 58.300 + * Signature: (F)V 58.301 + */ 58.302 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn 58.303 + (JNIEnv *, jobject, jfloat); 58.304 + 58.305 +/* 58.306 + * Class: TestClass1_Inner2 58.307 + * Method: mdn 58.308 + * Signature: (D)V 58.309 + */ 58.310 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn 58.311 + (JNIEnv *, jobject, jdouble); 58.312 + 58.313 +/* 58.314 + * Class: TestClass1_Inner2 58.315 + * Method: mon 58.316 + * Signature: (Ljava/lang/Object;)V 58.317 + */ 58.318 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon 58.319 + (JNIEnv *, jobject, jobject); 58.320 + 58.321 +/* 58.322 + * Class: TestClass1_Inner2 58.323 + * Method: mtn 58.324 + * Signature: (Ljava/lang/String;)V 58.325 + */ 58.326 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn 58.327 + (JNIEnv *, jobject, jstring); 58.328 + 58.329 +/* 58.330 + * Class: TestClass1_Inner2 58.331 + * Method: mgn 58.332 + * Signature: (Ljava/util/List;)V 58.333 + */ 58.334 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_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/TestClass2.h Fri Sep 25 22:04:43 2009 -0700 59.3 @@ -0,0 +1,13 @@ 59.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 59.5 +#include <jni.h> 59.6 +/* Header for class TestClass2 */ 59.7 + 59.8 +#ifndef _Included_TestClass2 59.9 +#define _Included_TestClass2 59.10 +#ifdef __cplusplus 59.11 +extern "C" { 59.12 +#endif 59.13 +#ifdef __cplusplus 59.14 +} 59.15 +#endif 59.16 +#endif
60.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 60.2 +++ b/test/tools/javah/6572945/gold/jni.file.1 Fri Sep 25 22:04:43 2009 -0700 60.3 @@ -0,0 +1,1151 @@ 60.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 60.5 +#include <jni.h> 60.6 +/* Header for class TestClass1 */ 60.7 + 60.8 +#ifndef _Included_TestClass1 60.9 +#define _Included_TestClass1 60.10 +#ifdef __cplusplus 60.11 +extern "C" { 60.12 +#endif 60.13 +#undef TestClass1_bc 60.14 +#define TestClass1_bc 0L 60.15 +#undef TestClass1_sc 60.16 +#define TestClass1_sc 0L 60.17 +#undef TestClass1_ic 60.18 +#define TestClass1_ic 0L 60.19 +#undef TestClass1_lc 60.20 +#define TestClass1_lc 0LL 60.21 +#undef TestClass1_fc 60.22 +#define TestClass1_fc 0.0f 60.23 +#undef TestClass1_dc 60.24 +#define TestClass1_dc 0.0 60.25 +/* 60.26 + * Class: TestClass1 60.27 + * Method: bmn 60.28 + * Signature: ()B 60.29 + */ 60.30 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn 60.31 + (JNIEnv *, jobject); 60.32 + 60.33 +/* 60.34 + * Class: TestClass1 60.35 + * Method: smn 60.36 + * Signature: ()S 60.37 + */ 60.38 +JNIEXPORT jshort JNICALL Java_TestClass1_smn 60.39 + (JNIEnv *, jobject); 60.40 + 60.41 +/* 60.42 + * Class: TestClass1 60.43 + * Method: imn 60.44 + * Signature: ()I 60.45 + */ 60.46 +JNIEXPORT jint JNICALL Java_TestClass1_imn 60.47 + (JNIEnv *, jobject); 60.48 + 60.49 +/* 60.50 + * Class: TestClass1 60.51 + * Method: lmn 60.52 + * Signature: ()J 60.53 + */ 60.54 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn 60.55 + (JNIEnv *, jobject); 60.56 + 60.57 +/* 60.58 + * Class: TestClass1 60.59 + * Method: fmn 60.60 + * Signature: ()F 60.61 + */ 60.62 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn 60.63 + (JNIEnv *, jobject); 60.64 + 60.65 +/* 60.66 + * Class: TestClass1 60.67 + * Method: dmn 60.68 + * Signature: ()D 60.69 + */ 60.70 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn 60.71 + (JNIEnv *, jobject); 60.72 + 60.73 +/* 60.74 + * Class: TestClass1 60.75 + * Method: omn 60.76 + * Signature: ()Ljava/lang/Object; 60.77 + */ 60.78 +JNIEXPORT jobject JNICALL Java_TestClass1_omn 60.79 + (JNIEnv *, jobject); 60.80 + 60.81 +/* 60.82 + * Class: TestClass1 60.83 + * Method: tmn 60.84 + * Signature: ()Ljava/lang/String; 60.85 + */ 60.86 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn 60.87 + (JNIEnv *, jobject); 60.88 + 60.89 +/* 60.90 + * Class: TestClass1 60.91 + * Method: gmn 60.92 + * Signature: ()Ljava/util/List; 60.93 + */ 60.94 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn 60.95 + (JNIEnv *, jobject); 60.96 + 60.97 +/* 60.98 + * Class: TestClass1 60.99 + * Method: vmn 60.100 + * Signature: ()V 60.101 + */ 60.102 +JNIEXPORT void JNICALL Java_TestClass1_vmn 60.103 + (JNIEnv *, jobject); 60.104 + 60.105 +/* 60.106 + * Class: TestClass1 60.107 + * Method: bamn 60.108 + * Signature: ()[B 60.109 + */ 60.110 +JNIEXPORT jbyteArray JNICALL Java_TestClass1_bamn 60.111 + (JNIEnv *, jobject); 60.112 + 60.113 +/* 60.114 + * Class: TestClass1 60.115 + * Method: samn 60.116 + * Signature: ()[S 60.117 + */ 60.118 +JNIEXPORT jshortArray JNICALL Java_TestClass1_samn 60.119 + (JNIEnv *, jobject); 60.120 + 60.121 +/* 60.122 + * Class: TestClass1 60.123 + * Method: iamn 60.124 + * Signature: ()[I 60.125 + */ 60.126 +JNIEXPORT jintArray JNICALL Java_TestClass1_iamn 60.127 + (JNIEnv *, jobject); 60.128 + 60.129 +/* 60.130 + * Class: TestClass1 60.131 + * Method: lamn 60.132 + * Signature: ()[J 60.133 + */ 60.134 +JNIEXPORT jlongArray JNICALL Java_TestClass1_lamn 60.135 + (JNIEnv *, jobject); 60.136 + 60.137 +/* 60.138 + * Class: TestClass1 60.139 + * Method: famn 60.140 + * Signature: ()[F 60.141 + */ 60.142 +JNIEXPORT jfloatArray JNICALL Java_TestClass1_famn 60.143 + (JNIEnv *, jobject); 60.144 + 60.145 +/* 60.146 + * Class: TestClass1 60.147 + * Method: damn 60.148 + * Signature: ()[D 60.149 + */ 60.150 +JNIEXPORT jdoubleArray JNICALL Java_TestClass1_damn 60.151 + (JNIEnv *, jobject); 60.152 + 60.153 +/* 60.154 + * Class: TestClass1 60.155 + * Method: oamn 60.156 + * Signature: ()[Ljava/lang/Object; 60.157 + */ 60.158 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oamn 60.159 + (JNIEnv *, jobject); 60.160 + 60.161 +/* 60.162 + * Class: TestClass1 60.163 + * Method: tamn 60.164 + * Signature: ()[Ljava/lang/String; 60.165 + */ 60.166 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_tamn 60.167 + (JNIEnv *, jobject); 60.168 + 60.169 +/* 60.170 + * Class: TestClass1 60.171 + * Method: gamn 60.172 + * Signature: ()[Ljava/util/List; 60.173 + */ 60.174 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gamn 60.175 + (JNIEnv *, jobject); 60.176 + 60.177 +/* 60.178 + * Class: TestClass1 60.179 + * Method: baamn 60.180 + * Signature: ()[[B 60.181 + */ 60.182 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_baamn 60.183 + (JNIEnv *, jobject); 60.184 + 60.185 +/* 60.186 + * Class: TestClass1 60.187 + * Method: saamn 60.188 + * Signature: ()[[S 60.189 + */ 60.190 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_saamn 60.191 + (JNIEnv *, jobject); 60.192 + 60.193 +/* 60.194 + * Class: TestClass1 60.195 + * Method: iaamn 60.196 + * Signature: ()[[I 60.197 + */ 60.198 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_iaamn 60.199 + (JNIEnv *, jobject); 60.200 + 60.201 +/* 60.202 + * Class: TestClass1 60.203 + * Method: laamn 60.204 + * Signature: ()[[J 60.205 + */ 60.206 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_laamn 60.207 + (JNIEnv *, jobject); 60.208 + 60.209 +/* 60.210 + * Class: TestClass1 60.211 + * Method: faamn 60.212 + * Signature: ()[[F 60.213 + */ 60.214 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_faamn 60.215 + (JNIEnv *, jobject); 60.216 + 60.217 +/* 60.218 + * Class: TestClass1 60.219 + * Method: daamn 60.220 + * Signature: ()[[D 60.221 + */ 60.222 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_daamn 60.223 + (JNIEnv *, jobject); 60.224 + 60.225 +/* 60.226 + * Class: TestClass1 60.227 + * Method: oaamn 60.228 + * Signature: ()[[Ljava/lang/Object; 60.229 + */ 60.230 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_oaamn 60.231 + (JNIEnv *, jobject); 60.232 + 60.233 +/* 60.234 + * Class: TestClass1 60.235 + * Method: taamn 60.236 + * Signature: ()[[Ljava/lang/String; 60.237 + */ 60.238 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_taamn 60.239 + (JNIEnv *, jobject); 60.240 + 60.241 +/* 60.242 + * Class: TestClass1 60.243 + * Method: gaamn 60.244 + * Signature: ()[Ljava/util/List; 60.245 + */ 60.246 +JNIEXPORT jobjectArray JNICALL Java_TestClass1_gaamn 60.247 + (JNIEnv *, jobject); 60.248 + 60.249 +/* 60.250 + * Class: TestClass1 60.251 + * Method: bmn1 60.252 + * Signature: ()B 60.253 + */ 60.254 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn1 60.255 + (JNIEnv *, jobject); 60.256 + 60.257 +/* 60.258 + * Class: TestClass1 60.259 + * Method: smn1 60.260 + * Signature: ()S 60.261 + */ 60.262 +JNIEXPORT jshort JNICALL Java_TestClass1_smn1 60.263 + (JNIEnv *, jobject); 60.264 + 60.265 +/* 60.266 + * Class: TestClass1 60.267 + * Method: imn1 60.268 + * Signature: ()I 60.269 + */ 60.270 +JNIEXPORT jint JNICALL Java_TestClass1_imn1 60.271 + (JNIEnv *, jobject); 60.272 + 60.273 +/* 60.274 + * Class: TestClass1 60.275 + * Method: lmn1 60.276 + * Signature: ()J 60.277 + */ 60.278 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn1 60.279 + (JNIEnv *, jobject); 60.280 + 60.281 +/* 60.282 + * Class: TestClass1 60.283 + * Method: fmn1 60.284 + * Signature: ()F 60.285 + */ 60.286 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn1 60.287 + (JNIEnv *, jobject); 60.288 + 60.289 +/* 60.290 + * Class: TestClass1 60.291 + * Method: dmn1 60.292 + * Signature: ()D 60.293 + */ 60.294 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn1 60.295 + (JNIEnv *, jobject); 60.296 + 60.297 +/* 60.298 + * Class: TestClass1 60.299 + * Method: omn1 60.300 + * Signature: ()Ljava/lang/Object; 60.301 + */ 60.302 +JNIEXPORT jobject JNICALL Java_TestClass1_omn1 60.303 + (JNIEnv *, jobject); 60.304 + 60.305 +/* 60.306 + * Class: TestClass1 60.307 + * Method: tmn1 60.308 + * Signature: ()Ljava/lang/String; 60.309 + */ 60.310 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn1 60.311 + (JNIEnv *, jobject); 60.312 + 60.313 +/* 60.314 + * Class: TestClass1 60.315 + * Method: gmn1 60.316 + * Signature: ()Ljava/util/List; 60.317 + */ 60.318 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn1 60.319 + (JNIEnv *, jobject); 60.320 + 60.321 +/* 60.322 + * Class: TestClass1 60.323 + * Method: vmn1 60.324 + * Signature: ()V 60.325 + */ 60.326 +JNIEXPORT void JNICALL Java_TestClass1_vmn1 60.327 + (JNIEnv *, jobject); 60.328 + 60.329 +/* 60.330 + * Class: TestClass1 60.331 + * Method: bmn2 60.332 + * Signature: (I)B 60.333 + */ 60.334 +JNIEXPORT jbyte JNICALL Java_TestClass1_bmn2 60.335 + (JNIEnv *, jobject, jint); 60.336 + 60.337 +/* 60.338 + * Class: TestClass1 60.339 + * Method: smn2 60.340 + * Signature: (I)S 60.341 + */ 60.342 +JNIEXPORT jshort JNICALL Java_TestClass1_smn2 60.343 + (JNIEnv *, jobject, jint); 60.344 + 60.345 +/* 60.346 + * Class: TestClass1 60.347 + * Method: imn2 60.348 + * Signature: (I)I 60.349 + */ 60.350 +JNIEXPORT jint JNICALL Java_TestClass1_imn2 60.351 + (JNIEnv *, jobject, jint); 60.352 + 60.353 +/* 60.354 + * Class: TestClass1 60.355 + * Method: lmn2 60.356 + * Signature: (I)J 60.357 + */ 60.358 +JNIEXPORT jlong JNICALL Java_TestClass1_lmn2 60.359 + (JNIEnv *, jobject, jint); 60.360 + 60.361 +/* 60.362 + * Class: TestClass1 60.363 + * Method: fmn2 60.364 + * Signature: (I)F 60.365 + */ 60.366 +JNIEXPORT jfloat JNICALL Java_TestClass1_fmn2 60.367 + (JNIEnv *, jobject, jint); 60.368 + 60.369 +/* 60.370 + * Class: TestClass1 60.371 + * Method: dmn2 60.372 + * Signature: (I)D 60.373 + */ 60.374 +JNIEXPORT jdouble JNICALL Java_TestClass1_dmn2 60.375 + (JNIEnv *, jobject, jint); 60.376 + 60.377 +/* 60.378 + * Class: TestClass1 60.379 + * Method: omn2 60.380 + * Signature: (I)Ljava/lang/Object; 60.381 + */ 60.382 +JNIEXPORT jobject JNICALL Java_TestClass1_omn2 60.383 + (JNIEnv *, jobject, jint); 60.384 + 60.385 +/* 60.386 + * Class: TestClass1 60.387 + * Method: tmn2 60.388 + * Signature: (I)Ljava/lang/String; 60.389 + */ 60.390 +JNIEXPORT jstring JNICALL Java_TestClass1_tmn2 60.391 + (JNIEnv *, jobject, jint); 60.392 + 60.393 +/* 60.394 + * Class: TestClass1 60.395 + * Method: gmn2 60.396 + * Signature: (I)Ljava/util/List; 60.397 + */ 60.398 +JNIEXPORT jobject JNICALL Java_TestClass1_gmn2 60.399 + (JNIEnv *, jobject, jint); 60.400 + 60.401 +/* 60.402 + * Class: TestClass1 60.403 + * Method: vmn2 60.404 + * Signature: (I)V 60.405 + */ 60.406 +JNIEXPORT void JNICALL Java_TestClass1_vmn2 60.407 + (JNIEnv *, jobject, jint); 60.408 + 60.409 +/* 60.410 + * Class: TestClass1 60.411 + * Method: mbn 60.412 + * Signature: (B)V 60.413 + */ 60.414 +JNIEXPORT void JNICALL Java_TestClass1_mbn 60.415 + (JNIEnv *, jobject, jbyte); 60.416 + 60.417 +/* 60.418 + * Class: TestClass1 60.419 + * Method: msn 60.420 + * Signature: (S)V 60.421 + */ 60.422 +JNIEXPORT void JNICALL Java_TestClass1_msn 60.423 + (JNIEnv *, jobject, jshort); 60.424 + 60.425 +/* 60.426 + * Class: TestClass1 60.427 + * Method: min 60.428 + * Signature: (I)V 60.429 + */ 60.430 +JNIEXPORT void JNICALL Java_TestClass1_min 60.431 + (JNIEnv *, jobject, jint); 60.432 + 60.433 +/* 60.434 + * Class: TestClass1 60.435 + * Method: mln 60.436 + * Signature: (J)V 60.437 + */ 60.438 +JNIEXPORT void JNICALL Java_TestClass1_mln 60.439 + (JNIEnv *, jobject, jlong); 60.440 + 60.441 +/* 60.442 + * Class: TestClass1 60.443 + * Method: mfn 60.444 + * Signature: (F)V 60.445 + */ 60.446 +JNIEXPORT void JNICALL Java_TestClass1_mfn 60.447 + (JNIEnv *, jobject, jfloat); 60.448 + 60.449 +/* 60.450 + * Class: TestClass1 60.451 + * Method: mdn 60.452 + * Signature: (D)V 60.453 + */ 60.454 +JNIEXPORT void JNICALL Java_TestClass1_mdn 60.455 + (JNIEnv *, jobject, jdouble); 60.456 + 60.457 +/* 60.458 + * Class: TestClass1 60.459 + * Method: mon 60.460 + * Signature: (Ljava/lang/Object;)V 60.461 + */ 60.462 +JNIEXPORT void JNICALL Java_TestClass1_mon 60.463 + (JNIEnv *, jobject, jobject); 60.464 + 60.465 +/* 60.466 + * Class: TestClass1 60.467 + * Method: mtn 60.468 + * Signature: (Ljava/lang/String;)V 60.469 + */ 60.470 +JNIEXPORT void JNICALL Java_TestClass1_mtn 60.471 + (JNIEnv *, jobject, jstring); 60.472 + 60.473 +/* 60.474 + * Class: TestClass1 60.475 + * Method: mgn 60.476 + * Signature: (Ljava/util/List;)V 60.477 + */ 60.478 +JNIEXPORT void JNICALL Java_TestClass1_mgn 60.479 + (JNIEnv *, jobject, jobject); 60.480 + 60.481 +#ifdef __cplusplus 60.482 +} 60.483 +#endif 60.484 +#endif 60.485 +/* Header for class TestClass1_Inner2 */ 60.486 + 60.487 +#ifndef _Included_TestClass1_Inner2 60.488 +#define _Included_TestClass1_Inner2 60.489 +#ifdef __cplusplus 60.490 +extern "C" { 60.491 +#endif 60.492 +#undef TestClass1_Inner2_bc 60.493 +#define TestClass1_Inner2_bc 0L 60.494 +#undef TestClass1_Inner2_sc 60.495 +#define TestClass1_Inner2_sc 0L 60.496 +#undef TestClass1_Inner2_ic 60.497 +#define TestClass1_Inner2_ic 0L 60.498 +#undef TestClass1_Inner2_lc 60.499 +#define TestClass1_Inner2_lc 0LL 60.500 +#undef TestClass1_Inner2_fc 60.501 +#define TestClass1_Inner2_fc 0.0f 60.502 +#undef TestClass1_Inner2_dc 60.503 +#define TestClass1_Inner2_dc 0.0 60.504 +/* 60.505 + * Class: TestClass1_Inner2 60.506 + * Method: bmn 60.507 + * Signature: ()B 60.508 + */ 60.509 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn 60.510 + (JNIEnv *, jobject); 60.511 + 60.512 +/* 60.513 + * Class: TestClass1_Inner2 60.514 + * Method: smn 60.515 + * Signature: ()S 60.516 + */ 60.517 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn 60.518 + (JNIEnv *, jobject); 60.519 + 60.520 +/* 60.521 + * Class: TestClass1_Inner2 60.522 + * Method: imn 60.523 + * Signature: ()I 60.524 + */ 60.525 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn 60.526 + (JNIEnv *, jobject); 60.527 + 60.528 +/* 60.529 + * Class: TestClass1_Inner2 60.530 + * Method: lmn 60.531 + * Signature: ()J 60.532 + */ 60.533 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn 60.534 + (JNIEnv *, jobject); 60.535 + 60.536 +/* 60.537 + * Class: TestClass1_Inner2 60.538 + * Method: fmn 60.539 + * Signature: ()F 60.540 + */ 60.541 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn 60.542 + (JNIEnv *, jobject); 60.543 + 60.544 +/* 60.545 + * Class: TestClass1_Inner2 60.546 + * Method: dmn 60.547 + * Signature: ()D 60.548 + */ 60.549 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn 60.550 + (JNIEnv *, jobject); 60.551 + 60.552 +/* 60.553 + * Class: TestClass1_Inner2 60.554 + * Method: omn 60.555 + * Signature: ()Ljava/lang/Object; 60.556 + */ 60.557 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn 60.558 + (JNIEnv *, jobject); 60.559 + 60.560 +/* 60.561 + * Class: TestClass1_Inner2 60.562 + * Method: tmn 60.563 + * Signature: ()Ljava/lang/String; 60.564 + */ 60.565 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn 60.566 + (JNIEnv *, jobject); 60.567 + 60.568 +/* 60.569 + * Class: TestClass1_Inner2 60.570 + * Method: gmn 60.571 + * Signature: ()Ljava/util/List; 60.572 + */ 60.573 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn 60.574 + (JNIEnv *, jobject); 60.575 + 60.576 +/* 60.577 + * Class: TestClass1_Inner2 60.578 + * Method: vmn 60.579 + * Signature: ()V 60.580 + */ 60.581 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn 60.582 + (JNIEnv *, jobject); 60.583 + 60.584 +/* 60.585 + * Class: TestClass1_Inner2 60.586 + * Method: bmn1 60.587 + * Signature: ()B 60.588 + */ 60.589 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn1 60.590 + (JNIEnv *, jobject); 60.591 + 60.592 +/* 60.593 + * Class: TestClass1_Inner2 60.594 + * Method: smn1 60.595 + * Signature: ()S 60.596 + */ 60.597 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn1 60.598 + (JNIEnv *, jobject); 60.599 + 60.600 +/* 60.601 + * Class: TestClass1_Inner2 60.602 + * Method: imn1 60.603 + * Signature: ()I 60.604 + */ 60.605 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn1 60.606 + (JNIEnv *, jobject); 60.607 + 60.608 +/* 60.609 + * Class: TestClass1_Inner2 60.610 + * Method: lmn1 60.611 + * Signature: ()J 60.612 + */ 60.613 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn1 60.614 + (JNIEnv *, jobject); 60.615 + 60.616 +/* 60.617 + * Class: TestClass1_Inner2 60.618 + * Method: fmn1 60.619 + * Signature: ()F 60.620 + */ 60.621 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn1 60.622 + (JNIEnv *, jobject); 60.623 + 60.624 +/* 60.625 + * Class: TestClass1_Inner2 60.626 + * Method: dmn1 60.627 + * Signature: ()D 60.628 + */ 60.629 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn1 60.630 + (JNIEnv *, jobject); 60.631 + 60.632 +/* 60.633 + * Class: TestClass1_Inner2 60.634 + * Method: omn1 60.635 + * Signature: ()Ljava/lang/Object; 60.636 + */ 60.637 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn1 60.638 + (JNIEnv *, jobject); 60.639 + 60.640 +/* 60.641 + * Class: TestClass1_Inner2 60.642 + * Method: tmn1 60.643 + * Signature: ()Ljava/lang/String; 60.644 + */ 60.645 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn1 60.646 + (JNIEnv *, jobject); 60.647 + 60.648 +/* 60.649 + * Class: TestClass1_Inner2 60.650 + * Method: gmn1 60.651 + * Signature: ()Ljava/util/List; 60.652 + */ 60.653 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn1 60.654 + (JNIEnv *, jobject); 60.655 + 60.656 +/* 60.657 + * Class: TestClass1_Inner2 60.658 + * Method: vmn1 60.659 + * Signature: ()V 60.660 + */ 60.661 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn1 60.662 + (JNIEnv *, jobject); 60.663 + 60.664 +/* 60.665 + * Class: TestClass1_Inner2 60.666 + * Method: bmn2 60.667 + * Signature: (I)B 60.668 + */ 60.669 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner2_bmn2 60.670 + (JNIEnv *, jobject, jint); 60.671 + 60.672 +/* 60.673 + * Class: TestClass1_Inner2 60.674 + * Method: smn2 60.675 + * Signature: (I)S 60.676 + */ 60.677 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner2_smn2 60.678 + (JNIEnv *, jobject, jint); 60.679 + 60.680 +/* 60.681 + * Class: TestClass1_Inner2 60.682 + * Method: imn2 60.683 + * Signature: (I)I 60.684 + */ 60.685 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner2_imn2 60.686 + (JNIEnv *, jobject, jint); 60.687 + 60.688 +/* 60.689 + * Class: TestClass1_Inner2 60.690 + * Method: lmn2 60.691 + * Signature: (I)J 60.692 + */ 60.693 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner2_lmn2 60.694 + (JNIEnv *, jobject, jint); 60.695 + 60.696 +/* 60.697 + * Class: TestClass1_Inner2 60.698 + * Method: fmn2 60.699 + * Signature: (I)F 60.700 + */ 60.701 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner2_fmn2 60.702 + (JNIEnv *, jobject, jint); 60.703 + 60.704 +/* 60.705 + * Class: TestClass1_Inner2 60.706 + * Method: dmn2 60.707 + * Signature: (I)D 60.708 + */ 60.709 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner2_dmn2 60.710 + (JNIEnv *, jobject, jint); 60.711 + 60.712 +/* 60.713 + * Class: TestClass1_Inner2 60.714 + * Method: omn2 60.715 + * Signature: (I)Ljava/lang/Object; 60.716 + */ 60.717 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_omn2 60.718 + (JNIEnv *, jobject, jint); 60.719 + 60.720 +/* 60.721 + * Class: TestClass1_Inner2 60.722 + * Method: tmn2 60.723 + * Signature: (I)Ljava/lang/String; 60.724 + */ 60.725 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner2_tmn2 60.726 + (JNIEnv *, jobject, jint); 60.727 + 60.728 +/* 60.729 + * Class: TestClass1_Inner2 60.730 + * Method: gmn2 60.731 + * Signature: (I)Ljava/util/List; 60.732 + */ 60.733 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner2_gmn2 60.734 + (JNIEnv *, jobject, jint); 60.735 + 60.736 +/* 60.737 + * Class: TestClass1_Inner2 60.738 + * Method: vmn2 60.739 + * Signature: (I)V 60.740 + */ 60.741 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_vmn2 60.742 + (JNIEnv *, jobject, jint); 60.743 + 60.744 +/* 60.745 + * Class: TestClass1_Inner2 60.746 + * Method: mbn 60.747 + * Signature: (B)V 60.748 + */ 60.749 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mbn 60.750 + (JNIEnv *, jobject, jbyte); 60.751 + 60.752 +/* 60.753 + * Class: TestClass1_Inner2 60.754 + * Method: msn 60.755 + * Signature: (S)V 60.756 + */ 60.757 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_msn 60.758 + (JNIEnv *, jobject, jshort); 60.759 + 60.760 +/* 60.761 + * Class: TestClass1_Inner2 60.762 + * Method: min 60.763 + * Signature: (I)V 60.764 + */ 60.765 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_min 60.766 + (JNIEnv *, jobject, jint); 60.767 + 60.768 +/* 60.769 + * Class: TestClass1_Inner2 60.770 + * Method: mln 60.771 + * Signature: (J)V 60.772 + */ 60.773 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mln 60.774 + (JNIEnv *, jobject, jlong); 60.775 + 60.776 +/* 60.777 + * Class: TestClass1_Inner2 60.778 + * Method: mfn 60.779 + * Signature: (F)V 60.780 + */ 60.781 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mfn 60.782 + (JNIEnv *, jobject, jfloat); 60.783 + 60.784 +/* 60.785 + * Class: TestClass1_Inner2 60.786 + * Method: mdn 60.787 + * Signature: (D)V 60.788 + */ 60.789 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mdn 60.790 + (JNIEnv *, jobject, jdouble); 60.791 + 60.792 +/* 60.793 + * Class: TestClass1_Inner2 60.794 + * Method: mon 60.795 + * Signature: (Ljava/lang/Object;)V 60.796 + */ 60.797 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mon 60.798 + (JNIEnv *, jobject, jobject); 60.799 + 60.800 +/* 60.801 + * Class: TestClass1_Inner2 60.802 + * Method: mtn 60.803 + * Signature: (Ljava/lang/String;)V 60.804 + */ 60.805 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mtn 60.806 + (JNIEnv *, jobject, jstring); 60.807 + 60.808 +/* 60.809 + * Class: TestClass1_Inner2 60.810 + * Method: mgn 60.811 + * Signature: (Ljava/util/List;)V 60.812 + */ 60.813 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner2_mgn 60.814 + (JNIEnv *, jobject, jobject); 60.815 + 60.816 +#ifdef __cplusplus 60.817 +} 60.818 +#endif 60.819 +#endif 60.820 +/* Header for class TestClass1_Inner1 */ 60.821 + 60.822 +#ifndef _Included_TestClass1_Inner1 60.823 +#define _Included_TestClass1_Inner1 60.824 +#ifdef __cplusplus 60.825 +extern "C" { 60.826 +#endif 60.827 +#undef TestClass1_Inner1_bc 60.828 +#define TestClass1_Inner1_bc 0L 60.829 +#undef TestClass1_Inner1_sc 60.830 +#define TestClass1_Inner1_sc 0L 60.831 +#undef TestClass1_Inner1_ic 60.832 +#define TestClass1_Inner1_ic 0L 60.833 +#undef TestClass1_Inner1_lc 60.834 +#define TestClass1_Inner1_lc 0LL 60.835 +#undef TestClass1_Inner1_fc 60.836 +#define TestClass1_Inner1_fc 0.0f 60.837 +#undef TestClass1_Inner1_dc 60.838 +#define TestClass1_Inner1_dc 0.0 60.839 +/* 60.840 + * Class: TestClass1_Inner1 60.841 + * Method: bmn 60.842 + * Signature: ()B 60.843 + */ 60.844 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn 60.845 + (JNIEnv *, jobject); 60.846 + 60.847 +/* 60.848 + * Class: TestClass1_Inner1 60.849 + * Method: smn 60.850 + * Signature: ()S 60.851 + */ 60.852 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn 60.853 + (JNIEnv *, jobject); 60.854 + 60.855 +/* 60.856 + * Class: TestClass1_Inner1 60.857 + * Method: imn 60.858 + * Signature: ()I 60.859 + */ 60.860 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn 60.861 + (JNIEnv *, jobject); 60.862 + 60.863 +/* 60.864 + * Class: TestClass1_Inner1 60.865 + * Method: lmn 60.866 + * Signature: ()J 60.867 + */ 60.868 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn 60.869 + (JNIEnv *, jobject); 60.870 + 60.871 +/* 60.872 + * Class: TestClass1_Inner1 60.873 + * Method: fmn 60.874 + * Signature: ()F 60.875 + */ 60.876 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn 60.877 + (JNIEnv *, jobject); 60.878 + 60.879 +/* 60.880 + * Class: TestClass1_Inner1 60.881 + * Method: dmn 60.882 + * Signature: ()D 60.883 + */ 60.884 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn 60.885 + (JNIEnv *, jobject); 60.886 + 60.887 +/* 60.888 + * Class: TestClass1_Inner1 60.889 + * Method: omn 60.890 + * Signature: ()Ljava/lang/Object; 60.891 + */ 60.892 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn 60.893 + (JNIEnv *, jobject); 60.894 + 60.895 +/* 60.896 + * Class: TestClass1_Inner1 60.897 + * Method: tmn 60.898 + * Signature: ()Ljava/lang/String; 60.899 + */ 60.900 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn 60.901 + (JNIEnv *, jobject); 60.902 + 60.903 +/* 60.904 + * Class: TestClass1_Inner1 60.905 + * Method: gmn 60.906 + * Signature: ()Ljava/util/List; 60.907 + */ 60.908 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn 60.909 + (JNIEnv *, jobject); 60.910 + 60.911 +/* 60.912 + * Class: TestClass1_Inner1 60.913 + * Method: vmn 60.914 + * Signature: ()V 60.915 + */ 60.916 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn 60.917 + (JNIEnv *, jobject); 60.918 + 60.919 +/* 60.920 + * Class: TestClass1_Inner1 60.921 + * Method: bmn1 60.922 + * Signature: ()B 60.923 + */ 60.924 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn1 60.925 + (JNIEnv *, jobject); 60.926 + 60.927 +/* 60.928 + * Class: TestClass1_Inner1 60.929 + * Method: smn1 60.930 + * Signature: ()S 60.931 + */ 60.932 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn1 60.933 + (JNIEnv *, jobject); 60.934 + 60.935 +/* 60.936 + * Class: TestClass1_Inner1 60.937 + * Method: imn1 60.938 + * Signature: ()I 60.939 + */ 60.940 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn1 60.941 + (JNIEnv *, jobject); 60.942 + 60.943 +/* 60.944 + * Class: TestClass1_Inner1 60.945 + * Method: lmn1 60.946 + * Signature: ()J 60.947 + */ 60.948 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn1 60.949 + (JNIEnv *, jobject); 60.950 + 60.951 +/* 60.952 + * Class: TestClass1_Inner1 60.953 + * Method: fmn1 60.954 + * Signature: ()F 60.955 + */ 60.956 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn1 60.957 + (JNIEnv *, jobject); 60.958 + 60.959 +/* 60.960 + * Class: TestClass1_Inner1 60.961 + * Method: dmn1 60.962 + * Signature: ()D 60.963 + */ 60.964 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn1 60.965 + (JNIEnv *, jobject); 60.966 + 60.967 +/* 60.968 + * Class: TestClass1_Inner1 60.969 + * Method: omn1 60.970 + * Signature: ()Ljava/lang/Object; 60.971 + */ 60.972 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn1 60.973 + (JNIEnv *, jobject); 60.974 + 60.975 +/* 60.976 + * Class: TestClass1_Inner1 60.977 + * Method: tmn1 60.978 + * Signature: ()Ljava/lang/String; 60.979 + */ 60.980 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn1 60.981 + (JNIEnv *, jobject); 60.982 + 60.983 +/* 60.984 + * Class: TestClass1_Inner1 60.985 + * Method: gmn1 60.986 + * Signature: ()Ljava/util/List; 60.987 + */ 60.988 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn1 60.989 + (JNIEnv *, jobject); 60.990 + 60.991 +/* 60.992 + * Class: TestClass1_Inner1 60.993 + * Method: vmn1 60.994 + * Signature: ()V 60.995 + */ 60.996 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn1 60.997 + (JNIEnv *, jobject); 60.998 + 60.999 +/* 60.1000 + * Class: TestClass1_Inner1 60.1001 + * Method: bmn2 60.1002 + * Signature: (I)B 60.1003 + */ 60.1004 +JNIEXPORT jbyte JNICALL Java_TestClass1_00024Inner1_bmn2 60.1005 + (JNIEnv *, jobject, jint); 60.1006 + 60.1007 +/* 60.1008 + * Class: TestClass1_Inner1 60.1009 + * Method: smn2 60.1010 + * Signature: (I)S 60.1011 + */ 60.1012 +JNIEXPORT jshort JNICALL Java_TestClass1_00024Inner1_smn2 60.1013 + (JNIEnv *, jobject, jint); 60.1014 + 60.1015 +/* 60.1016 + * Class: TestClass1_Inner1 60.1017 + * Method: imn2 60.1018 + * Signature: (I)I 60.1019 + */ 60.1020 +JNIEXPORT jint JNICALL Java_TestClass1_00024Inner1_imn2 60.1021 + (JNIEnv *, jobject, jint); 60.1022 + 60.1023 +/* 60.1024 + * Class: TestClass1_Inner1 60.1025 + * Method: lmn2 60.1026 + * Signature: (I)J 60.1027 + */ 60.1028 +JNIEXPORT jlong JNICALL Java_TestClass1_00024Inner1_lmn2 60.1029 + (JNIEnv *, jobject, jint); 60.1030 + 60.1031 +/* 60.1032 + * Class: TestClass1_Inner1 60.1033 + * Method: fmn2 60.1034 + * Signature: (I)F 60.1035 + */ 60.1036 +JNIEXPORT jfloat JNICALL Java_TestClass1_00024Inner1_fmn2 60.1037 + (JNIEnv *, jobject, jint); 60.1038 + 60.1039 +/* 60.1040 + * Class: TestClass1_Inner1 60.1041 + * Method: dmn2 60.1042 + * Signature: (I)D 60.1043 + */ 60.1044 +JNIEXPORT jdouble JNICALL Java_TestClass1_00024Inner1_dmn2 60.1045 + (JNIEnv *, jobject, jint); 60.1046 + 60.1047 +/* 60.1048 + * Class: TestClass1_Inner1 60.1049 + * Method: omn2 60.1050 + * Signature: (I)Ljava/lang/Object; 60.1051 + */ 60.1052 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_omn2 60.1053 + (JNIEnv *, jobject, jint); 60.1054 + 60.1055 +/* 60.1056 + * Class: TestClass1_Inner1 60.1057 + * Method: tmn2 60.1058 + * Signature: (I)Ljava/lang/String; 60.1059 + */ 60.1060 +JNIEXPORT jstring JNICALL Java_TestClass1_00024Inner1_tmn2 60.1061 + (JNIEnv *, jobject, jint); 60.1062 + 60.1063 +/* 60.1064 + * Class: TestClass1_Inner1 60.1065 + * Method: gmn2 60.1066 + * Signature: (I)Ljava/util/List; 60.1067 + */ 60.1068 +JNIEXPORT jobject JNICALL Java_TestClass1_00024Inner1_gmn2 60.1069 + (JNIEnv *, jobject, jint); 60.1070 + 60.1071 +/* 60.1072 + * Class: TestClass1_Inner1 60.1073 + * Method: vmn2 60.1074 + * Signature: (I)V 60.1075 + */ 60.1076 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_vmn2 60.1077 + (JNIEnv *, jobject, jint); 60.1078 + 60.1079 +/* 60.1080 + * Class: TestClass1_Inner1 60.1081 + * Method: mbn 60.1082 + * Signature: (B)V 60.1083 + */ 60.1084 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mbn 60.1085 + (JNIEnv *, jobject, jbyte); 60.1086 + 60.1087 +/* 60.1088 + * Class: TestClass1_Inner1 60.1089 + * Method: msn 60.1090 + * Signature: (S)V 60.1091 + */ 60.1092 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_msn 60.1093 + (JNIEnv *, jobject, jshort); 60.1094 + 60.1095 +/* 60.1096 + * Class: TestClass1_Inner1 60.1097 + * Method: min 60.1098 + * Signature: (I)V 60.1099 + */ 60.1100 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_min 60.1101 + (JNIEnv *, jobject, jint); 60.1102 + 60.1103 +/* 60.1104 + * Class: TestClass1_Inner1 60.1105 + * Method: mln 60.1106 + * Signature: (J)V 60.1107 + */ 60.1108 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mln 60.1109 + (JNIEnv *, jobject, jlong); 60.1110 + 60.1111 +/* 60.1112 + * Class: TestClass1_Inner1 60.1113 + * Method: mfn 60.1114 + * Signature: (F)V 60.1115 + */ 60.1116 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mfn 60.1117 + (JNIEnv *, jobject, jfloat); 60.1118 + 60.1119 +/* 60.1120 + * Class: TestClass1_Inner1 60.1121 + * Method: mdn 60.1122 + * Signature: (D)V 60.1123 + */ 60.1124 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mdn 60.1125 + (JNIEnv *, jobject, jdouble); 60.1126 + 60.1127 +/* 60.1128 + * Class: TestClass1_Inner1 60.1129 + * Method: mon 60.1130 + * Signature: (Ljava/lang/Object;)V 60.1131 + */ 60.1132 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mon 60.1133 + (JNIEnv *, jobject, jobject); 60.1134 + 60.1135 +/* 60.1136 + * Class: TestClass1_Inner1 60.1137 + * Method: mtn 60.1138 + * Signature: (Ljava/lang/String;)V 60.1139 + */ 60.1140 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mtn 60.1141 + (JNIEnv *, jobject, jstring); 60.1142 + 60.1143 +/* 60.1144 + * Class: TestClass1_Inner1 60.1145 + * Method: mgn 60.1146 + * Signature: (Ljava/util/List;)V 60.1147 + */ 60.1148 +JNIEXPORT void JNICALL Java_TestClass1_00024Inner1_mgn 60.1149 + (JNIEnv *, jobject, jobject); 60.1150 + 60.1151 +#ifdef __cplusplus 60.1152 +} 60.1153 +#endif 60.1154 +#endif
61.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 61.2 +++ b/test/tools/javah/6572945/gold/jni.file.2 Fri Sep 25 22:04:43 2009 -0700 61.3 @@ -0,0 +1,1162 @@ 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 61.1155 +/* Header for class TestClass2 */ 61.1156 + 61.1157 +#ifndef _Included_TestClass2 61.1158 +#define _Included_TestClass2 61.1159 +#ifdef __cplusplus 61.1160 +extern "C" { 61.1161 +#endif 61.1162 +#ifdef __cplusplus 61.1163 +} 61.1164 +#endif 61.1165 +#endif
62.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 62.2 +++ b/test/tools/javah/6572945/gold/jni.file.3 Fri Sep 25 22:04:43 2009 -0700 62.3 @@ -0,0 +1,79 @@ 62.4 +/* DO NOT EDIT THIS FILE - it is machine generated */ 62.5 +#include <jni.h> 62.6 +/* Header for class TestClass3 */ 62.7 + 62.8 +#ifndef _Included_TestClass3 62.9 +#define _Included_TestClass3 62.10 +#ifdef __cplusplus 62.11 +extern "C" { 62.12 +#endif 62.13 +#ifdef __cplusplus 62.14 +} 62.15 +#endif 62.16 +#endif 62.17 +/* Header for class TestClass3_Inner2 */ 62.18 + 62.19 +#ifndef _Included_TestClass3_Inner2 62.20 +#define _Included_TestClass3_Inner2 62.21 +#ifdef __cplusplus 62.22 +extern "C" { 62.23 +#endif 62.24 +#ifdef __cplusplus 62.25 +} 62.26 +#endif 62.27 +#endif 62.28 +/* Header for class TestClass3_Inner2_Inner2B */ 62.29 + 62.30 +#ifndef _Included_TestClass3_Inner2_Inner2B 62.31 +#define _Included_TestClass3_Inner2_Inner2B 62.32 +#ifdef __cplusplus 62.33 +extern "C" { 62.34 +#endif 62.35 +#ifdef __cplusplus 62.36 +} 62.37 +#endif 62.38 +#endif 62.39 +/* Header for class TestClass3_Inner2_Inner2A */ 62.40 + 62.41 +#ifndef _Included_TestClass3_Inner2_Inner2A 62.42 +#define _Included_TestClass3_Inner2_Inner2A 62.43 +#ifdef __cplusplus 62.44 +extern "C" { 62.45 +#endif 62.46 +#ifdef __cplusplus 62.47 +} 62.48 +#endif 62.49 +#endif 62.50 +/* Header for class TestClass3_Inner1 */ 62.51 + 62.52 +#ifndef _Included_TestClass3_Inner1 62.53 +#define _Included_TestClass3_Inner1 62.54 +#ifdef __cplusplus 62.55 +extern "C" { 62.56 +#endif 62.57 +#ifdef __cplusplus 62.58 +} 62.59 +#endif 62.60 +#endif 62.61 +/* Header for class TestClass3_Inner1_Inner1B */ 62.62 + 62.63 +#ifndef _Included_TestClass3_Inner1_Inner1B 62.64 +#define _Included_TestClass3_Inner1_Inner1B 62.65 +#ifdef __cplusplus 62.66 +extern "C" { 62.67 +#endif 62.68 +#ifdef __cplusplus 62.69 +} 62.70 +#endif 62.71 +#endif 62.72 +/* Header for class TestClass3_Inner1_Inner1A */ 62.73 + 62.74 +#ifndef _Included_TestClass3_Inner1_Inner1A 62.75 +#define _Included_TestClass3_Inner1_Inner1A 62.76 +#ifdef __cplusplus 62.77 +extern "C" { 62.78 +#endif 62.79 +#ifdef __cplusplus 62.80 +} 62.81 +#endif 62.82 +#endif
63.1 --- a/test/tools/javah/MissingParamClassTest.sh Fri Sep 25 14:24:14 2009 -0700 63.2 +++ b/test/tools/javah/MissingParamClassTest.sh Fri Sep 25 22:04:43 2009 -0700 63.3 @@ -77,10 +77,7 @@ 63.4 rm -f ParamClassTest.class MissingParamClassException.class ParamClassTest.h 63.5 rm -f ${TMP1} 63.6 63.7 -cp ${TESTSRC}${FS}ParamClassTest.java . 63.8 -cp ${TESTSRC}${FS}MissingParamClassException.java . 63.9 - 63.10 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" 63.11 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java" 63.12 63.13 # Before running javah remove dependent class file 63.14 rm -f MissingParamClassException.class 63.15 @@ -88,15 +85,12 @@ 63.16 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1} 63.17 63.18 if [ -f $GENERATED_HEADER_FILE ]; then 63.19 - echo "Failed" 63.20 - exit 1 63.21 + echo "1-- Failed: $GENERATED_HEADER_FILE found" 63.22 + rc=1 63.23 fi 63.24 -if [ ! -f ${TMP1} ]; then 63.25 - echo "Failed" 63.26 - exit 1 63.27 -else 63.28 - echo "Passed" 63.29 - exit 0 63.30 +if [ ! -s ${TMP1} ]; then 63.31 + echo "1-- Failed: ${TMP1} is empty" 63.32 + rc=1 63.33 fi 63.34 63.35 # Clean out work dir 63.36 @@ -104,7 +98,9 @@ 63.37 rm -f $GENERATED_HEADER_FILE $TMP1 63.38 63.39 # Re-compile everything 63.40 -"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . ${TESTSRC}${FS}ParamClassTest.java 63.41 + 63.42 +"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d . "${TESTSRC}${FS}ParamClassTest.java" "${TESTSRC}${FS}MissingParamClassException.java" 63.43 + 63.44 63.45 # Before re-run of javah remove dependent class file Param.class 63.46 rm -f Param.class 63.47 @@ -112,13 +108,17 @@ 63.48 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} ParamClassTest 2>${TMP1} 63.49 63.50 if [ -f $GENERATED_HEADER_FILE ]; then 63.51 - echo "Failed" 63.52 - exit 1 63.53 + echo "2-- Failed: $GENERATED_HEADER_FILE found" 63.54 + rc=1 63.55 fi 63.56 -if [ ! -f ${TMP1} ]; then 63.57 - echo "Failed" 63.58 - exit 1 63.59 +if [ ! -s ${TMP1} ]; then 63.60 + echo "2-- Failed: ${TMP1} is empty" 63.61 + rc=1 63.62 +fi 63.63 + 63.64 +if [ "$rc" = "" ]; then 63.65 + echo Passed 63.66 else 63.67 - echo "Passed" 63.68 - exit 0 63.69 + echo Failed 63.70 + exit 1 63.71 fi
64.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 64.2 +++ b/test/tools/javah/compareTest/CompareTest.java Fri Sep 25 22:04:43 2009 -0700 64.3 @@ -0,0 +1,265 @@ 64.4 +/* 64.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 64.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 64.7 + * 64.8 + * This code is free software; you can redistribute it and/or modify it 64.9 + * under the terms of the GNU General Public License version 2 only, as 64.10 + * published by the Free Software Foundation. 64.11 + * 64.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 64.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 64.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 64.15 + * version 2 for more details (a copy is included in the LICENSE file that 64.16 + * accompanied this code). 64.17 + * 64.18 + * You should have received a copy of the GNU General Public License version 64.19 + * 2 along with this work; if not, write to the Free Software Foundation, 64.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 64.21 + * 64.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 64.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 64.24 + * have any questions. 64.25 + */ 64.26 + 64.27 +import java.io.DataInputStream; 64.28 +import java.io.File; 64.29 +import java.io.IOException; 64.30 +import java.io.InputStream; 64.31 +import java.io.PrintWriter; 64.32 +import java.io.StringWriter; 64.33 +import java.util.ArrayList; 64.34 +import java.util.Arrays; 64.35 +import java.util.Enumeration; 64.36 +import java.util.List; 64.37 +import java.util.Set; 64.38 +import java.util.TreeSet; 64.39 +import java.util.jar.JarEntry; 64.40 +import java.util.jar.JarFile; 64.41 + 64.42 +import com.sun.tools.classfile.AccessFlags; 64.43 +import com.sun.tools.classfile.ClassFile; 64.44 +import com.sun.tools.classfile.ConstantPoolException; 64.45 +import com.sun.tools.classfile.Method; 64.46 +import java.io.BufferedReader; 64.47 +import java.io.FileInputStream; 64.48 +import java.io.InputStreamReader; 64.49 +import java.util.LinkedHashSet; 64.50 + 64.51 +public class CompareTest { 64.52 + String[][] testCases = { 64.53 + { }, 64.54 + { "-jni" }, 64.55 +// { "-llni" }, 64.56 + }; 64.57 + 64.58 + public static void main(String... args) throws Exception { 64.59 + new CompareTest().run(args); 64.60 + } 64.61 + 64.62 + public void run(String... args) throws Exception { 64.63 + old_javah_cmd = new File(args[0]); 64.64 + rt_jar = new File(args[1]); 64.65 + 64.66 + Set<String> testClasses; 64.67 + if (args.length > 2) { 64.68 + testClasses = new LinkedHashSet<String>(Arrays.asList(Arrays.copyOfRange(args, 2, args.length))); 64.69 + } else 64.70 + testClasses = getNativeClasses(new JarFile(rt_jar)); 64.71 + 64.72 + for (String[] options: testCases) { 64.73 + for (String name: testClasses) { 64.74 + test(Arrays.asList(options), rt_jar, name); 64.75 + } 64.76 + } 64.77 + 64.78 + if (errors == 0) 64.79 + System.out.println(count + " tests passed"); 64.80 + else 64.81 + throw new Exception(errors + "/" + count + " tests failed"); 64.82 + } 64.83 + 64.84 + public void test(List<String> options, File bootclasspath, String className) 64.85 + throws IOException, InterruptedException { 64.86 + System.err.println("test: " + options + " " + className); 64.87 + count++; 64.88 + 64.89 + testOptions = options; 64.90 + testClassName = className; 64.91 + 64.92 + File oldOutDir = initDir(file(new File("old"), className)); 64.93 + int old_rc = old_javah(options, oldOutDir, bootclasspath, className); 64.94 + 64.95 + File newOutDir = initDir(file(new File("new"), className)); 64.96 + int new_rc = new_javah(options, newOutDir, bootclasspath, className); 64.97 + 64.98 + if (old_rc != new_rc) 64.99 + error("return codes differ; old: " + old_rc + ", new: " + new_rc); 64.100 + 64.101 + compare(oldOutDir, newOutDir); 64.102 + } 64.103 + 64.104 + int old_javah(List<String> options, File outDir, File bootclasspath, String className) 64.105 + throws IOException, InterruptedException { 64.106 + List<String> cmd = new ArrayList<String>(); 64.107 + cmd.add(old_javah_cmd.getPath()); 64.108 + cmd.addAll(options); 64.109 + cmd.add("-d"); 64.110 + cmd.add(outDir.getPath()); 64.111 + cmd.add("-bootclasspath"); 64.112 + cmd.add(bootclasspath.getPath()); 64.113 + cmd.add(className); 64.114 + System.err.println("old_javah: " + cmd); 64.115 + ProcessBuilder pb = new ProcessBuilder(cmd); 64.116 + pb.redirectErrorStream(true); 64.117 + Process p = pb.start(); 64.118 + BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream())); 64.119 + String line; 64.120 + StringBuilder sb = new StringBuilder(); 64.121 + while ((line = in.readLine()) != null) { 64.122 + sb.append(line); 64.123 + sb.append("\n"); 64.124 + } 64.125 + System.err.println("old javah out: " + sb.toString()); 64.126 + return p.waitFor(); 64.127 + } 64.128 + 64.129 + int new_javah(List<String> options, File outDir, File bootclasspath, String className) { 64.130 + List<String> args = new ArrayList<String>(); 64.131 + args.addAll(options); 64.132 + args.add("-d"); 64.133 + args.add(outDir.getPath()); 64.134 + args.add("-bootclasspath"); 64.135 + args.add(bootclasspath.getPath()); 64.136 + args.add(className); 64.137 + StringWriter sw = new StringWriter(); 64.138 + PrintWriter pw = new PrintWriter(sw); 64.139 + int rc = com.sun.tools.javah.Main.run(args.toArray(new String[args.size()]), pw); 64.140 + pw.close(); 64.141 + System.err.println("new javah out: " + sw.toString()); 64.142 + return rc; 64.143 + } 64.144 + 64.145 + Set<String> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException { 64.146 + System.err.println("getNativeClasses: " + jar.getName()); 64.147 + Set<String> results = new TreeSet<String>(); 64.148 + Enumeration<JarEntry> e = jar.entries(); 64.149 + while (e.hasMoreElements()) { 64.150 + JarEntry je = e.nextElement(); 64.151 + if (isNativeClass(jar, je)) { 64.152 + String name = je.getName(); 64.153 + results.add(name.substring(0, name.length() - 6).replace("/", ".")); 64.154 + } 64.155 + } 64.156 + return results; 64.157 + } 64.158 + 64.159 + boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException { 64.160 + String name = entry.getName(); 64.161 + if (name.startsWith("META-INF") || !name.endsWith(".class")) 64.162 + return false; 64.163 + //String className = name.substring(0, name.length() - 6).replace("/", "."); 64.164 + //System.err.println("check " + className); 64.165 + InputStream in = jar.getInputStream(entry); 64.166 + ClassFile cf = ClassFile.read(in); 64.167 + for (int i = 0; i < cf.methods.length; i++) { 64.168 + Method m = cf.methods[i]; 64.169 + if (m.access_flags.is(AccessFlags.ACC_NATIVE)) { 64.170 + // System.err.println(className); 64.171 + return true; 64.172 + } 64.173 + } 64.174 + return false; 64.175 + } 64.176 + 64.177 + void compare(File f1, File f2) throws IOException { 64.178 + if (f1.isFile() && f2.isFile()) 64.179 + compareFiles(f1, f2); 64.180 + else if (f1.isDirectory() && f2.isDirectory()) 64.181 + compareDirectories(f1, f2); 64.182 + else 64.183 + error("files differ: " 64.184 + + f1 + " (" + getFileType(f1) + "), " 64.185 + + f2 + " (" + getFileType(f2) + ")"); 64.186 + } 64.187 + 64.188 + void compareDirectories(File d1, File d2) throws IOException { 64.189 + Set<String> list = new TreeSet<String>(); 64.190 + list.addAll(Arrays.asList(d1.list())); 64.191 + list.addAll(Arrays.asList(d2.list())); 64.192 + for (String c: list) 64.193 + compare(new File(d1, c), new File(d2, c)); 64.194 + } 64.195 + 64.196 + void compareFiles(File f1, File f2) throws IOException { 64.197 + byte[] c1 = readFile(f1); 64.198 + byte[] c2 = readFile(f2); 64.199 + if (!Arrays.equals(c1, c2)) 64.200 + error("files differ: " + f1 + ", " + f2); 64.201 + } 64.202 + 64.203 + byte[] readFile(File file) throws IOException { 64.204 + int size = (int) file.length(); 64.205 + byte[] data = new byte[size]; 64.206 + DataInputStream in = new DataInputStream(new FileInputStream(file)); 64.207 + try { 64.208 + in.readFully(data); 64.209 + } finally { 64.210 + in.close(); 64.211 + } 64.212 + return data; 64.213 + } 64.214 + 64.215 + String getFileType(File f) { 64.216 + return f.isDirectory() ? "directory" 64.217 + : f.isFile() ? "file" 64.218 + : f.exists() ? "other" 64.219 + : "not found"; 64.220 + } 64.221 + 64.222 + /** 64.223 + * Set up an empty directory. 64.224 + */ 64.225 + public File initDir(File dir) { 64.226 + if (dir.exists()) 64.227 + deleteAll(dir); 64.228 + dir.mkdirs(); 64.229 + return dir; 64.230 + } 64.231 + 64.232 + /** 64.233 + * Delete a file or a directory (including all its contents). 64.234 + */ 64.235 + boolean deleteAll(File file) { 64.236 + if (file.isDirectory()) { 64.237 + for (File f: file.listFiles()) 64.238 + deleteAll(f); 64.239 + } 64.240 + return file.delete(); 64.241 + } 64.242 + 64.243 + File file(File dir, String... path) { 64.244 + File f = dir; 64.245 + for (String p: path) 64.246 + f = new File(f, p); 64.247 + return f; 64.248 + } 64.249 + 64.250 + /** 64.251 + * Report an error. 64.252 + */ 64.253 + void error(String msg, String... more) { 64.254 + System.err.println("test: " + testOptions + " " + testClassName); 64.255 + System.err.println("error: " + msg); 64.256 + for (String s: more) 64.257 + System.err.println(s); 64.258 + errors++; 64.259 + System.exit(1); 64.260 + } 64.261 + 64.262 + File old_javah_cmd; 64.263 + File rt_jar; 64.264 + List<String> testOptions; 64.265 + String testClassName; 64.266 + int count; 64.267 + int errors; 64.268 +}
65.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 65.2 +++ b/test/tools/javah/compareTest/CompareTest.sh Fri Sep 25 22:04:43 2009 -0700 65.3 @@ -0,0 +1,43 @@ 65.4 +#!/bin/sh 65.5 +# 65.6 +# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 65.7 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 65.8 +# 65.9 +# This code is free software; you can redistribute it and/or modify it 65.10 +# under the terms of the GNU General Public License version 2 only, as 65.11 +# published by the Free Software Foundation. 65.12 +# 65.13 +# This code is distributed in the hope that it will be useful, but WITHOUT 65.14 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 65.15 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 65.16 +# version 2 for more details (a copy is included in the LICENSE file that 65.17 +# accompanied this code). 65.18 +# 65.19 +# You should have received a copy of the GNU General Public License version 65.20 +# 2 along with this work; if not, write to the Free Software Foundation, 65.21 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 65.22 +# 65.23 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 65.24 +# CA 95054 USA or visit www.sun.com if you need additional information or 65.25 +# have any questions. 65.26 +# 65.27 + 65.28 +jdk=${1:-/opt/jdk/1.6.0} 65.29 +javah=${jdk}/bin/javah 65.30 +rtjar=${jdk}/jre/lib/rt.jar 65.31 + 65.32 +# compile test 65.33 +mkdir -p build/compareTest 65.34 +/opt/jdk/1.7.0/bin/javac -classpath build/classes -d build/compareTest test/tools/javah/compareTest/*.java 65.35 + 65.36 +# run test 65.37 +/opt/jdk/1.7.0/bin/java -classpath build/compareTest:build/classes CompareTest $javah $rtjar 2>&1 | tee CompareTest.out 65.38 + 65.39 +# show diffs for tests that failed 65.40 +grep 'error:' CompareTest.out | sed -e 's|.*new/||' -e 's/\.h$//' -e 's|_|.|g' > CompareTest.classes.fail 65.41 + 65.42 +for i in $(cat CompareTest.classes.fail) ; do 65.43 + /opt/jdk/1.7.0/bin/java -classpath compareTest:build/classes CompareTest $javah $rtjar $i 65.44 + diff -r old new 65.45 +done 65.46 +
66.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 66.2 +++ b/test/tools/javah/compareTest/FindNativeFiles.java Fri Sep 25 22:04:43 2009 -0700 66.3 @@ -0,0 +1,86 @@ 66.4 +/* 66.5 + * Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. 66.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 66.7 + * 66.8 + * This code is free software; you can redistribute it and/or modify it 66.9 + * under the terms of the GNU General Public License version 2 only, as 66.10 + * published by the Free Software Foundation. 66.11 + * 66.12 + * This code is distributed in the hope that it will be useful, but WITHOUT 66.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 66.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 66.15 + * version 2 for more details (a copy is included in the LICENSE file that 66.16 + * accompanied this code). 66.17 + * 66.18 + * You should have received a copy of the GNU General Public License version 66.19 + * 2 along with this work; if not, write to the Free Software Foundation, 66.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 66.21 + * 66.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 66.23 + * CA 95054 USA or visit www.sun.com if you need additional information or 66.24 + * have any questions. 66.25 + */ 66.26 + 66.27 +import java.io.IOException; 66.28 +import java.io.InputStream; 66.29 +import java.util.Enumeration; 66.30 +import java.util.jar.JarEntry; 66.31 +import java.util.jar.JarFile; 66.32 + 66.33 +import com.sun.tools.classfile.AccessFlags; 66.34 +import com.sun.tools.classfile.ClassFile; 66.35 +import com.sun.tools.classfile.ConstantPoolException; 66.36 +import com.sun.tools.classfile.Method; 66.37 +import java.util.Comparator; 66.38 +import java.util.Set; 66.39 +import java.util.TreeSet; 66.40 + 66.41 +public class FindNativeFiles { 66.42 + public static void main(String[] args) throws IOException, ConstantPoolException { 66.43 + new FindNativeFiles().run(args); 66.44 + } 66.45 + 66.46 + public void run(String[] args) throws IOException, ConstantPoolException { 66.47 + JarFile jar = new JarFile(args[0]); 66.48 + Set<JarEntry> entries = getNativeClasses(jar); 66.49 + for (JarEntry e: entries) { 66.50 + String name = e.getName(); 66.51 + String className = name.substring(0, name.length() - 6).replace("/", "."); 66.52 + System.out.println(className); 66.53 + } 66.54 + } 66.55 + 66.56 + Set<JarEntry> getNativeClasses(JarFile jar) throws IOException, ConstantPoolException { 66.57 + Set<JarEntry> results = new TreeSet<JarEntry>(new Comparator<JarEntry>() { 66.58 + public int compare(JarEntry o1, JarEntry o2) { 66.59 + return o1.getName().compareTo(o2.getName()); 66.60 + } 66.61 + }); 66.62 + Enumeration<JarEntry> e = jar.entries(); 66.63 + while (e.hasMoreElements()) { 66.64 + JarEntry je = e.nextElement(); 66.65 + if (isNativeClass(jar, je)) 66.66 + results.add(je); 66.67 + } 66.68 + return results; 66.69 + } 66.70 + 66.71 + boolean isNativeClass(JarFile jar, JarEntry entry) throws IOException, ConstantPoolException { 66.72 + String name = entry.getName(); 66.73 + if (name.startsWith("META-INF") || !name.endsWith(".class")) 66.74 + return false; 66.75 + //String className = name.substring(0, name.length() - 6).replace("/", "."); 66.76 + //System.err.println("check " + className); 66.77 + InputStream in = jar.getInputStream(entry); 66.78 + ClassFile cf = ClassFile.read(in); 66.79 + in.close(); 66.80 + for (int i = 0; i < cf.methods.length; i++) { 66.81 + Method m = cf.methods[i]; 66.82 + if (m.access_flags.is(AccessFlags.ACC_NATIVE)) { 66.83 + // System.err.println(className); 66.84 + return true; 66.85 + } 66.86 + } 66.87 + return false; 66.88 + } 66.89 +}
67.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 67.2 +++ b/test/tools/javah/compareTest/README Fri Sep 25 22:04:43 2009 -0700 67.3 @@ -0,0 +1,16 @@ 67.4 +test/tools/javah/compareTest/README 67.5 + 67.6 +This directory contains a program for comparing the output of new javah against the 67.7 +output of JDK 6 or other older versions of javah. 67.8 + 67.9 +It cannot be run automatically because of the need for the older version of javah 67.10 +to compare against. 67.11 + 67.12 +The test works by scanning a jar file, such as rt.jar, looking for all files with 67.13 +native methods. It then runs both the old and new versions of javah on those 67.14 +classes with native methods, and verifies that the results are character-for-character 67.15 +identical. 67.16 + 67.17 +To run the test, build langtools, then execute the script in the root langtools 67.18 +directory, providing the location of the JDK to be tested. The default is 67.19 +/opt/jdk/1.6.0.