From 5c7411981584e487ac41794feb98a66df9fd6fcb Mon Sep 17 00:00:00 2001 From: gandalf Date: Fri, 23 Mar 2012 15:19:26 +0000 Subject: Merge GNU Classpath 0.99 into libjava. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185741 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/classpath/tools/Makefile.am | 10 ++- libjava/classpath/tools/Makefile.in | 10 ++- .../tools/common/ClasspathToolParser.class | Bin 4028 -> 4028 bytes .../gnu/classpath/tools/common/Messages.class | Bin 1151 -> 1151 bytes .../tools/doclets/htmldoclet/HtmlDoclet.class | Bin 79930 -> 79930 bytes .../gnu/classpath/tools/getopt/Messages.class | Bin 1151 -> 1151 bytes .../classes/gnu/classpath/tools/gjdoc/Main.class | Bin 29338 -> 29338 bytes .../gnu/classpath/tools/javah/JniHelper.class | Bin 2909 -> 2933 bytes .../classpath/tools/javah/JniIncludePrinter.class | Bin 4600 -> 4632 bytes .../classes/gnu/classpath/tools/javah/Main$1.class | Bin 1002 -> 1002 bytes .../gnu/classpath/tools/javah/Main$10.class | Bin 941 -> 941 bytes .../classes/gnu/classpath/tools/javah/Main$2.class | Bin 1119 -> 1119 bytes .../classes/gnu/classpath/tools/javah/Main$3.class | Bin 1124 -> 1124 bytes .../classes/gnu/classpath/tools/javah/Main$4.class | Bin 1007 -> 1007 bytes .../classes/gnu/classpath/tools/javah/Main$5.class | Bin 1069 -> 1069 bytes .../classes/gnu/classpath/tools/javah/Main$6.class | Bin 939 -> 939 bytes .../classes/gnu/classpath/tools/javah/Main$7.class | Bin 1064 -> 1064 bytes .../classes/gnu/classpath/tools/javah/Main$8.class | Bin 1064 -> 1064 bytes .../classes/gnu/classpath/tools/javah/Main$9.class | Bin 973 -> 973 bytes .../classes/gnu/classpath/tools/javah/Main.class | Bin 11933 -> 12769 bytes .../classes/gnu/classpath/tools/orbd/Main$1.class | Bin 1106 -> 1106 bytes .../classes/gnu/classpath/tools/orbd/Main$2.class | Bin 1052 -> 1052 bytes .../classes/gnu/classpath/tools/orbd/Main$3.class | Bin 1048 -> 1048 bytes .../classes/gnu/classpath/tools/orbd/Main$4.class | Bin 969 -> 969 bytes .../classes/gnu/classpath/tools/orbd/Main$5.class | Bin 721 -> 721 bytes .../classes/gnu/classpath/tools/orbd/Main.class | Bin 5476 -> 5476 bytes .../tools/gnu/classpath/tools/common/Messages.java | 4 +- .../tools/gnu/classpath/tools/getopt/Messages.java | 4 +- .../tools/gnu/classpath/tools/javah/JniHelper.java | 2 + .../classpath/tools/javah/JniIncludePrinter.java | 5 +- .../tools/gnu/classpath/tools/javah/Main.java | 87 +++++++++++++-------- .../gnu/classpath/tools/common/Messages.properties | 40 ---------- .../gnu/classpath/tools/common/messages.properties | 40 ++++++++++ .../gnu/classpath/tools/getopt/Messages.properties | 46 ----------- .../gnu/classpath/tools/getopt/messages.properties | 46 +++++++++++ 35 files changed, 162 insertions(+), 132 deletions(-) delete mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/common/messages.properties delete mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/getopt/Messages.properties create mode 100644 libjava/classpath/tools/resource/gnu/classpath/tools/getopt/messages.properties (limited to 'libjava/classpath/tools') diff --git a/libjava/classpath/tools/Makefile.am b/libjava/classpath/tools/Makefile.am index f7ad91c9069..a4d48aafebc 100755 --- a/libjava/classpath/tools/Makefile.am +++ b/libjava/classpath/tools/Makefile.am @@ -141,7 +141,7 @@ EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \ gtnameserv.in gorbd.in grmid.in grmic.in gjdoc.in # All our example java source files -TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \ +TOOLS_JAVA_FILES = \ $(srcdir)/gnu/classpath/tools/*.java \ $(srcdir)/gnu/classpath/tools/*/*.java \ $(srcdir)/gnu/classpath/tools/*/*/*.java \ @@ -174,8 +174,8 @@ PROPERTY_FILES = $(srcdir)/external/asm/org/objectweb/asm/optimizer/shrink.prope $(srcdir)/resource/gnu/classpath/tools/keytool/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/native2ascii/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/appletviewer/messages.properties \ - $(srcdir)/resource/gnu/classpath/tools/common/Messages.properties \ - $(srcdir)/resource/gnu/classpath/tools/getopt/Messages.properties \ + $(srcdir)/resource/gnu/classpath/tools/common/messages.properties \ + $(srcdir)/resource/gnu/classpath/tools/getopt/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/tnameserv/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/jarsigner/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/rmiregistry/messages.properties \ @@ -312,7 +312,9 @@ dist-hook: $(mkinstalldirs) $(distdir)/$$fdir; \ fi; \ echo "cp -p $$file $(distdir)/$$f"; \ - cp -p $$file $(distdir)/$$f; \ + if ! cp -p $$file $(distdir)/$$f; then \ + exit -1 ; \ + fi ; \ done # To generate the example zip just depend on the sources and ignore diff --git a/libjava/classpath/tools/Makefile.in b/libjava/classpath/tools/Makefile.in index d82fac6d9ae..2cf1a008500 100644 --- a/libjava/classpath/tools/Makefile.in +++ b/libjava/classpath/tools/Makefile.in @@ -551,7 +551,7 @@ EXTRA_DIST = toolwrapper.c gappletviewer.in gjarsigner.in gkeytool.in \ # All our example java source files -TOOLS_JAVA_FILES = $(srcdir)/gnu/classpath/tools/*/*.java \ +TOOLS_JAVA_FILES = \ $(srcdir)/gnu/classpath/tools/*.java \ $(srcdir)/gnu/classpath/tools/*/*.java \ $(srcdir)/gnu/classpath/tools/*/*/*.java \ @@ -585,8 +585,8 @@ PROPERTY_FILES = $(srcdir)/external/asm/org/objectweb/asm/optimizer/shrink.prope $(srcdir)/resource/gnu/classpath/tools/keytool/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/native2ascii/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/appletviewer/messages.properties \ - $(srcdir)/resource/gnu/classpath/tools/common/Messages.properties \ - $(srcdir)/resource/gnu/classpath/tools/getopt/Messages.properties \ + $(srcdir)/resource/gnu/classpath/tools/common/messages.properties \ + $(srcdir)/resource/gnu/classpath/tools/getopt/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/tnameserv/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/jarsigner/messages.properties \ $(srcdir)/resource/gnu/classpath/tools/rmiregistry/messages.properties \ @@ -1382,7 +1382,9 @@ dist-hook: $(mkinstalldirs) $(distdir)/$$fdir; \ fi; \ echo "cp -p $$file $(distdir)/$$f"; \ - cp -p $$file $(distdir)/$$f; \ + if ! cp -p $$file $(distdir)/$$f; then \ + exit -1 ; \ + fi ; \ done # To generate the example zip just depend on the sources and ignore diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class index 67c15788fc2..472e1386225 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/common/ClasspathToolParser.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class index 9b3d765a117..39697a899c8 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/common/Messages.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class index 1e86b0b069b..c7429e294aa 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/doclets/htmldoclet/HtmlDoclet.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class index f86b8f70c3b..ce6cc5c67d8 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/getopt/Messages.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class index 2f46dd2828c..97bda5f9b93 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/gjdoc/Main.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class index 8f09f16e2fa..cf4b5cf24be 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniHelper.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class index c31f88ae6b7..30d1674c646 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/JniIncludePrinter.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class index ca86d040462..05958fdaee7 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class index ea003e4f0ff..3e1615abdfa 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$10.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class index 560a505a0a9..c0998c8745a 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$2.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class index cd7143a5c50..62bf927c584 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$3.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class index 88ea4ee1a10..0305abe9e83 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$4.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class index fee2bd107ba..c8ed40054c3 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$5.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class index bb6d72a3e33..d5be6d22668 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$6.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class index 44390e12701..b2e37e11242 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$7.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class index 28bf6e998c9..9900e53b932 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$8.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class index 013a6553e09..bc9fb98c86a 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main$9.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class index 57adaabe3ec..709b6d01262 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/javah/Main.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class index 81975151a3c..a93676b308f 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$1.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class index f87a12e80d1..2e73084c919 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$2.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class index f5a91597b31..c785c7a3e43 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$3.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class index df3cba93009..31d7a46c00b 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$4.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class index 0c082d0d0de..04b7561333f 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main$5.class differ diff --git a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class index 53468e34872..ee1af075f39 100644 Binary files a/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class and b/libjava/classpath/tools/classes/gnu/classpath/tools/orbd/Main.class differ diff --git a/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java index 1c92d348d2b..4f6d687fd4b 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java +++ b/libjava/classpath/tools/gnu/classpath/tools/common/Messages.java @@ -1,5 +1,5 @@ /* Messages.java -- i18n support for tools common code - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,7 +44,7 @@ import java.util.ResourceBundle; class Messages { private static final String BUNDLE_NAME - = "gnu.classpath.tools.common.Messages"; //$NON-NLS-1$ + = "gnu.classpath.tools.common.messages"; //$NON-NLS-1$ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java index 19f10174332..9a9c4ec8aa2 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java +++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/Messages.java @@ -1,5 +1,5 @@ /* Messages.java -- i18n support for getopt - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2010 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -44,7 +44,7 @@ import java.util.ResourceBundle; class Messages { private static final String BUNDLE_NAME - = "gnu.classpath.tools.getopt.Messages"; //$NON-NLS-1$ + = "gnu.classpath.tools.getopt.messages"; //$NON-NLS-1$ private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java index 9225444be27..9a723cadf1c 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniHelper.java @@ -104,6 +104,8 @@ public class JniHelper result.append("_3"); else if (c == '/') result.append("_"); + else if (c == '$') + result.append("_"); else if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) result.append(c); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java index cb8bcd8d9c2..cf5fed39f13 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java @@ -1,5 +1,5 @@ /* JniIncludePrinter.java - Generate a JNI header file - Copyright (C) 2006, 2007 Free Software Foundation, Inc. + Copyright (C) 2006, 2007, 2011 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -63,6 +63,7 @@ public class JniIncludePrinter { klass.linkSupers(); boolean wroteAny = false; + ClassWrapper headerClass = klass; for (; klass != null; klass = klass.superClass) { Iterator i = klass.fields.iterator(); @@ -77,7 +78,7 @@ public class JniIncludePrinter continue; // Note that we don't want to mangle the field name. - String name = (JniHelper.mangle(klass.name) + "_" + field.name); + String name = (JniHelper.mangle(headerClass.name) + "_" + field.name); out.print("#undef "); out.println(name); out.print("#define "); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java index bec04f00dab..894a5c4d2c0 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java @@ -58,9 +58,11 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.Set; import java.util.Map; import org.objectweb.asm.ClassReader; +import org.objectweb.asm.tree.InnerClassNode; public class Main { @@ -101,6 +103,9 @@ public class Main // Map class names to lists of Text objects. HashMap> textMap = new HashMap>(); + // Set of classes which have been parsed + Set parsed = new HashSet(); + void readCommandFile(String textFileName) throws OptionException { FileInputStream fis; @@ -317,7 +322,7 @@ public class Main return result; } - private void writeHeaders(HashMap klasses, Printer printer) + private void writeHeaders(Map klasses, Printer printer) throws IOException { Iterator> i = klasses.entrySet().iterator(); @@ -332,6 +337,53 @@ public class Main } } + private Map parseClasses(Iterator inputs) + throws IOException + { + Map results = new HashMap(); + while (inputs.hasNext()) + { + // Let user specify either kind of class name or a + // file name. + Object item = inputs.next(); + ClassWrapper klass; + File filename; + if (item instanceof File) + { + // Load class from file. + if (verbose) + System.err.println("[reading file " + item + "]"); + klass = getClass((File) item); + filename = new File(klass.name); + } + else + { + // Load class given the class name. + String className = ((String) item).replace('.', '/'); + if (verbose) + System.err.println("[reading class " + className + "]"); + // Use the name the user specified, even if it is + // different from the ultimate class name. + filename = new File(className); + klass = getClass(className); + } + results.put(filename, klass); + parsed.add(item.toString()); + + // Check to see if there are inner classes to also parse + Iterator innerClasses = klass.innerClasses.iterator(); + HashSet innerNames = new HashSet(); + while (innerClasses.hasNext()) + { + String innerName = ((InnerClassNode) innerClasses.next()).name; + if (!parsed.contains(innerName)) + innerNames.add(innerName); + } + results.putAll(parseClasses(innerNames.iterator())); + } + return results; + } + protected void postParse(String[] names) { // Nothing here. @@ -385,36 +437,7 @@ public class Main } } - Iterator i = klasses.iterator(); - HashMap results = new HashMap(); - while (i.hasNext()) - { - // Let user specify either kind of class name or a - // file name. - Object item = i.next(); - ClassWrapper klass; - File filename; - if (item instanceof File) - { - // Load class from file. - if (verbose) - System.err.println("[reading file " + item + "]"); - klass = getClass((File) item); - filename = new File(klass.name); - } - else - { - // Load class given the class name. - String className = ((String) item).replace('.', '/'); - if (verbose) - System.err.println("[reading class " + className + "]"); - // Use the name the user specified, even if it is - // different from the ultimate class name. - filename = new File(className); - klass = getClass(className); - } - results.put(filename, klass); - } + Map results = parseClasses(klasses.iterator()); writeHeaders(results, printer); } @@ -457,7 +480,7 @@ public class Main ClassWrapper result = readClass(is); classMap.put(name, result); } - return (ClassWrapper) classMap.get(name); + return classMap.get(name); } public static void main(String[] args) throws IOException diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties deleted file mode 100644 index 17e79c453ac..00000000000 --- a/libjava/classpath/tools/resource/gnu/classpath/tools/common/Messages.properties +++ /dev/null @@ -1,40 +0,0 @@ -# MessagesBundle.properties -- English language messages -# Copyright (C) 2006, 2008 Free Software Foundation, Inc. -# -# This file is part of GNU Classpath. -# -# GNU Classpath is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Classpath is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Classpath; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA. -# -# Linking this library statically or dynamically with other modules is -# making a combined work based on this library. Thus, the terms and -# conditions of the GNU General Public License cover the whole -# combination. -# -# As a special exception, the copyright holders of this library give you -# permission to link this library with independent modules to produce an -# executable, regardless of the license terms of these independent -# modules, and to copy and distribute the resulting executable under -# terms of your choice, provided that you also meet, for each linked -# independent module, the terms and conditions of the license of that -# module. An independent module is a module which is not derived from -# or based on this library. If you modify this library, you may extend -# this exception to your version of the library, but you are not -# obligated to do so. If you do not wish to do so, delete this -# exception statement from your version. - -ClasspathToolParser.JArgument=pass argument to the Java runtime -ClasspathToolParser.JName=OPTION -ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2008 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/common/messages.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/common/messages.properties new file mode 100644 index 00000000000..afd751e6447 --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/common/messages.properties @@ -0,0 +1,40 @@ +# messages.properties -- English language messages +# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc. +# +# This file is part of GNU Classpath. +# +# GNU Classpath is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Classpath is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Classpath; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +ClasspathToolParser.JArgument=pass argument to the Java runtime +ClasspathToolParser.JName=OPTION +ClasspathToolParser.VersionFormat={0} (GNU Classpath) {1}\n\nCopyright 2008 Free Software Foundation, Inc.\nThis is free software; see the source for copying conditions. There is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/Messages.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/Messages.properties deleted file mode 100644 index a747ab4b473..00000000000 --- a/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/Messages.properties +++ /dev/null @@ -1,46 +0,0 @@ -# MessagesBundle.properties -- English language messages -# Copyright (C) 2006 Free Software Foundation, Inc. -# -# This file is part of GNU Classpath. -# -# GNU Classpath is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# GNU Classpath is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GNU Classpath; see the file COPYING. If not, write to the -# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA -# 02110-1301 USA. -# -# Linking this library statically or dynamically with other modules is -# making a combined work based on this library. Thus, the terms and -# conditions of the GNU General Public License cover the whole -# combination. -# -# As a special exception, the copyright holders of this library give you -# permission to link this library with independent modules to produce an -# executable, regardless of the license terms of these independent -# modules, and to copy and distribute the resulting executable under -# terms of your choice, provided that you also meet, for each linked -# independent module, the terms and conditions of the license of that -# module. An independent module is a module which is not derived from -# or based on this library. If you modify this library, you may extend -# this exception to your version of the library, but you are not -# obligated to do so. If you do not wish to do so, delete this -# exception statement from your version. - -Parser.StdOptions=Standard options -Parser.PrintHelp=print this help, then exit -Parser.PrintVersion=print version number, then exit -Parser.ArgReqd=option ''{0}'' requires an argument -Parser.Unrecognized=unrecognized option ''{0}'' -Parser.NoArg=option ''{0}'' doesn''t allow an argument -Parser.UnrecDash=unrecognized option ''-{0}'' -Parser.TryHelpShort=Try ''{0} -help'' for more information -Parser.TryHelpLong=Try ''{0} --help'' for more information diff --git a/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/messages.properties b/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/messages.properties new file mode 100644 index 00000000000..61bfd0e8fdc --- /dev/null +++ b/libjava/classpath/tools/resource/gnu/classpath/tools/getopt/messages.properties @@ -0,0 +1,46 @@ +# messages.properties -- English language messages +# Copyright (C) 2006, 2010 Free Software Foundation, Inc. +# +# This file is part of GNU Classpath. +# +# GNU Classpath is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# GNU Classpath is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GNU Classpath; see the file COPYING. If not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA. +# +# Linking this library statically or dynamically with other modules is +# making a combined work based on this library. Thus, the terms and +# conditions of the GNU General Public License cover the whole +# combination. +# +# As a special exception, the copyright holders of this library give you +# permission to link this library with independent modules to produce an +# executable, regardless of the license terms of these independent +# modules, and to copy and distribute the resulting executable under +# terms of your choice, provided that you also meet, for each linked +# independent module, the terms and conditions of the license of that +# module. An independent module is a module which is not derived from +# or based on this library. If you modify this library, you may extend +# this exception to your version of the library, but you are not +# obligated to do so. If you do not wish to do so, delete this +# exception statement from your version. + +Parser.StdOptions=Standard options +Parser.PrintHelp=print this help, then exit +Parser.PrintVersion=print version number, then exit +Parser.ArgReqd=option ''{0}'' requires an argument +Parser.Unrecognized=unrecognized option ''{0}'' +Parser.NoArg=option ''{0}'' doesn''t allow an argument +Parser.UnrecDash=unrecognized option ''-{0}'' +Parser.TryHelpShort=Try ''{0} -help'' for more information +Parser.TryHelpLong=Try ''{0} --help'' for more information -- cgit v1.2.1