diff options
| author | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-28 13:29:13 +0000 |
|---|---|---|
| committer | doko <doko@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-06-28 13:29:13 +0000 |
| commit | 1020ce5944edde4364baef4d371cd4f9b0dae721 (patch) | |
| tree | 602cd7aa7c947386134690d8e0f6b53abcdeacb9 /libjava/classpath/tools/gnu | |
| parent | 9f41ce98ce6f4f7c8ac5e2c4b6e5d27e10201015 (diff) | |
| download | ppe42-gcc-1020ce5944edde4364baef4d371cd4f9b0dae721.tar.gz ppe42-gcc-1020ce5944edde4364baef4d371cd4f9b0dae721.zip | |
libjava/
2008-06-28 Matthias Klose <doko@ubuntu.com>
Import GNU Classpath (classpath-0_97_2-release).
* Regenerate class and header files.
* Regenerate auto* files.
* gcj/javaprims.h: Define jobjectRefType.
* jni.cc (_Jv_JNI_GetObjectRefType): New (stub only).
(_Jv_JNIFunctions): Initialize GetObjectRefType.
* gnu/classpath/jdwp/VMVirtualMachine.java,
java/security/VMSecureRandom.java: Merge from classpath.
* HACKING: Fix typo.
* ChangeLog-2007: New file.
* configure.ac: Set JAVAC, pass --disable-regen-headers to classpath.
libjava/classpath/
2008-06-28 Matthias Klose <doko@ubuntu.com>
* m4/ac_prog_javac.m4: Disable check for JAVAC, when
not configured with --enable-java-maintainer-mode.
* aclocal.m4, configure: Regenerate.
* native/jni/gstreamer-peer/Makefile.am: Do not link with
libclasspathnative.
* native/jni/gstreamer-peer/Makefile.in: Regenerate.
* tools/Makefile.am, lib/Makefile.am: Use JAVAC for setting
JCOMPILER, drop flags not understood by gcj.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@137223 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/classpath/tools/gnu')
28 files changed, 191 insertions, 626 deletions
diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java index c41ac1d7c86..24b305a224f 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java @@ -113,7 +113,7 @@ class CommonAppletStub */ public String getParameter(String name) { - return (String) tag.getParameter(name.toLowerCase()); + return tag.getParameter(name.toLowerCase()); } /** diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java index a10b889bc97..4eff8f53ebb 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/Main.java @@ -55,7 +55,6 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; -import java.util.ResourceBundle; class Main diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java index 283d547b801..bcf57808c01 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java @@ -61,8 +61,6 @@ import java.net.URL; import java.util.ArrayList; import java.util.HashMap; -import javax.swing.JOptionPane; - class PluginAppletWindow extends EmbeddedWindow @@ -350,7 +348,7 @@ class PluginAppletWindow * Called when the hierarchy of this component changes. Use * <code>getChangeFlags()</code> on the event to see what exactly changed. * - * @param e the event describing the change + * @param event the event describing the change */ public void hierarchyChanged(HierarchyEvent event) { diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java index 3a0a442825d..b92dc50f5eb 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java @@ -512,7 +512,7 @@ class StandaloneAppletWindow * Called when the hierarchy of this component changes. Use * <code>getChangeFlags()</code> on the event to see what exactly changed. * - * @param e the event describing the change + * @param event the event describing the change */ public void hierarchyChanged(HierarchyEvent event) { diff --git a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java index 56bb1bb87c5..c1e5cac524b 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java +++ b/libjava/classpath/tools/gnu/classpath/tools/appletviewer/TagParser.java @@ -292,7 +292,7 @@ public class TagParser /** * Parses the archive string and returns a list. * - * @param the list of archives (comma-separated) in a String. + * @param arcs the list of archives (comma-separated) in a String. */ static ArrayList parseArchives(String arcs, AppletTag t) { diff --git a/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java b/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java index e44b9011cfd..b2e50872920 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java +++ b/libjava/classpath/tools/gnu/classpath/tools/common/ClasspathToolParser.java @@ -38,9 +38,16 @@ exception statement from your version. */ package gnu.classpath.tools.common; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.FileNotFoundException; +import java.io.FileReader; +import java.io.Reader; import java.text.MessageFormat; +import java.util.ArrayList; import gnu.classpath.Configuration; +import gnu.classpath.tools.getopt.FileArgumentCallback; import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.Parser; @@ -84,4 +91,149 @@ public class ClasspathToolParser } }); } + + public void parse(String[] inArgs, FileArgumentCallback files, + boolean handleFileLists) + { + FileArgumentCallback cb; + + if (handleFileLists) + cb = new AtFileArgumentCallback(files); + else + cb = files; + + parse(inArgs, cb); + } + + public String[] parse(String[] inArgs, boolean handleFileLists) + { + final ArrayList<String> fileResult = new ArrayList<String>(); + + final FileArgumentCallback cb = new FileArgumentCallback() + { + public void notifyFile(String fileArgument) + { + fileResult.add(fileArgument); + } + }; + + if (handleFileLists) + parse(inArgs, new AtFileArgumentCallback(cb)); + else + parse(inArgs, cb); + + return fileResult.toArray(new String[fileResult.size()]); + } + + + /** + * Simple function that takes the given {@link Reader}, treats it like + * a textfile and reads all the whitespace separated entries from it + * and adds them to the @{link FileArgumentCallback} instance. + * + * @param reader the reader to read from. + * @param cb the callback to post the filenames to. + * @throws OptionException if an error occurs reading the list. + */ + public void parseFileList(Reader reader, FileArgumentCallback cb) + throws OptionException + { + BufferedReader breader = new BufferedReader(reader); + String line = null; + + try + { + while ((line = breader.readLine()) != null) + parseLine(line, cb); + + reader.close(); + } + catch (IOException ioe) + { + throw new OptionException("I/O error while reading a file list", ioe); + } + + } + + /** + * Parses whitespace separated file entries. + * + * Note: This is not coping with whitespace in files or quoting. + * + * @param line the line of the file to parse. + * @param cb the callback to pass the parsed file to. + * @throws IOException if an I/O error occurs. + * @throws OptionException if an error occurs in the callback. + */ + private void parseLine(String line, FileArgumentCallback cb) + throws IOException, OptionException + { + final int length = line.length(); + int start = 0; + int end = 0; + + // While not reached end of line ... + while (start < length) + { + // Search for first non-whitespace character for the start of a word. + while (Character.isWhitespace(line.codePointAt(start))) + { + start++; + + if (start == length) + return; + } + + end = start + 1; + + // Search for first whitespace character for the end of a word. + while (end < length && !Character.isWhitespace(line.codePointAt(end))) + end++; + + cb.notifyFile(line.substring(start, end)); + + start = end + 1; + } + } + + /** + * Implementation of {@link FileArgumentCallback} that handles + * file arguments in {@link #notifyFile} starting with a <code>@</code> + * through {@link ClasspathToolParser#parseFileList}. + */ + class AtFileArgumentCallback extends FileArgumentCallback + { + FileArgumentCallback cb; + + AtFileArgumentCallback(FileArgumentCallback cb) + { + this.cb = cb; + } + + @Override + public void notifyFile(String fileArgument) + throws OptionException + { + if (fileArgument.codePointAt(0) == '@') + { + FileReader fr = null; + + try + { + fr = new FileReader(fileArgument.substring(1)); + } + catch (FileNotFoundException fnfe) + { + throw new OptionException("File not found: " + fileArgument.substring(1), + fnfe); + } + + ClasspathToolParser.this.parseFileList(fr, cb); + } + else + cb.notifyFile(fileArgument); + } + + } + } diff --git a/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionException.java b/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionException.java index a09d716f424..2d7f77a5501 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionException.java +++ b/libjava/classpath/tools/gnu/classpath/tools/getopt/OptionException.java @@ -49,4 +49,10 @@ public class OptionException { super(message); } + + public OptionException(String message, Throwable cause) + { + super(message, cause); + } + } diff --git a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java index d52028fefce..e5f1a3fb1e9 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/jar/Main.java @@ -172,9 +172,9 @@ public class Main } } - private Parser initializeParser() + private ClasspathToolParser initializeParser() { - Parser p = new JarParser("jar"); //$NON-NLS-1$ + ClasspathToolParser p = new JarParser("jar"); //$NON-NLS-1$ p.setHeader(Messages.getString("Main.Usage")); //$NON-NLS-1$ OptionGroup grp = new OptionGroup(Messages.getString("Main.OpMode")); //$NON-NLS-1$ @@ -265,11 +265,11 @@ public class Main private void run(String[] args) throws InstantiationException, IllegalAccessException, IOException { - Parser p = initializeParser(); + ClasspathToolParser p = initializeParser(); // Special hack to emulate old tar-style commands. if (args.length > 0 && args[0].charAt(0) != '-') args[0] = '-' + args[0]; - p.parse(args, new HandleFile()); + p.parse(args, new HandleFile(), true); if (readNamesFromStdin) readNames(); Action t = (Action) operationMode.newInstance(); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java index 445f902da48..8861541a58e 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/CniIncludePrinter.java @@ -63,14 +63,14 @@ public class CniIncludePrinter return new PrintStream(fos); } - public void printClass(File filename, ClassWrapper klass) throws IOException + public void printClass(File file, ClassWrapper klass) throws IOException { // Never write Object or Class. This is a hack, maybe // the user would like to see what they look like... if (klass.name.equals("java/lang/Object") || klass.name.equals("java/lang/Class")) return; - PrintStream ps = getPrintStream(filename + ".h", klass); + PrintStream ps = getPrintStream(file + ".h", klass); if (ps == null) return; ps.println(); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/GcjhMain.java b/libjava/classpath/tools/gnu/classpath/tools/javah/GcjhMain.java index 7faed1691d2..15bcec2630b 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/GcjhMain.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/GcjhMain.java @@ -38,10 +38,11 @@ package gnu.classpath.tools.javah; +import gnu.classpath.tools.common.ClasspathToolParser; + import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.OptionGroup; -import gnu.classpath.tools.getopt.Parser; import java.io.IOException; import java.util.ArrayList; @@ -60,9 +61,9 @@ public class GcjhMain extends Main return "gcjh"; } - protected Parser getParser() + protected ClasspathToolParser getParser() { - Parser result = super.getParser(); + ClasspathToolParser result = super.getParser(); result.setHeader("usage: gcjh [OPTION]... CLASS..."); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java index 6c1a8e166fb..ba44a571133 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/JniIncludePrinter.java @@ -107,15 +107,23 @@ public class JniIncludePrinter return new JniPrintStream(classpath, fos, klass); } - public void printClass(File filename, ClassWrapper klass) throws IOException + public void printClass(File file, ClassWrapper klass) throws IOException { // Note that we ignore the filename here. String xname = JniHelper.mangle(klass.name); - JniPrintStream out - = (JniPrintStream) getPrintStream(klass.name.replace('/', '_') + ".h", - klass); + + // mangle the filename a bit + String filename = klass.name; + + filename = filename.replace('/', '_'); + filename = filename.replace('$', '_'); + filename = filename + ".h"; + + JniPrintStream out = (JniPrintStream) getPrintStream(filename, klass); + if (out == null) return; + out.println(); out.print("#ifndef __"); out.print(xname); diff --git a/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java index 29c96cf5bba..bfca4444645 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/javah/Main.java @@ -188,7 +188,7 @@ public class Main return "javah"; } - protected Parser getParser() + protected ClasspathToolParser getParser() { ClasspathToolParser result = new ClasspathToolParser(getName(), true); result.setHeader("usage: javah [OPTIONS] CLASS..."); @@ -324,11 +324,11 @@ public class Main while (i.hasNext()) { Map.Entry e = (Map.Entry) i.next(); - File filename = (File) e.getKey(); + File file = (File) e.getKey(); ClassWrapper klass = (ClassWrapper) e.getValue(); if (verbose) - System.err.println("[writing " + klass + " as " + filename + "]"); - printer.printClass(filename, klass); + System.err.println("[writing " + klass + " as " + file + "]"); + printer.printClass(file, klass); } } @@ -339,8 +339,8 @@ public class Main protected void run(String[] args) throws IOException { - Parser p = getParser(); - String[] classNames = p.parse(args); + ClasspathToolParser p = getParser(); + String[] classNames = p.parse(args, true); postParse(classNames); loader = classpath.getLoader(); diff --git a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java index 0667befc6c5..6bf3193fc31 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java +++ b/libjava/classpath/tools/gnu/classpath/tools/native2ascii/Native2ASCII.java @@ -101,7 +101,7 @@ public class Native2ASCII encoding = argument; } }); - result.add(new Option("reverse", Messages.getString("Native2ASCII.ReversedHelp")) //$NON-NLS-1$ //$NON-NLS-2$ + result.add(new Option("reverse", Messages.getString("Native2ASCII.ReverseHelp")) //$NON-NLS-1$ //$NON-NLS-2$ { public void parsed(String argument) throws OptionException { diff --git a/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java b/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java index afb30ad7224..15f3612cc9a 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/orbd/Main.java @@ -41,10 +41,8 @@ import gnu.CORBA.OrbFunctional; import gnu.CORBA.IOR; import gnu.CORBA.NamingService.Ext; import gnu.classpath.tools.common.ClasspathToolParser; -import gnu.classpath.tools.getopt.FileArgumentCallback; import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; -import gnu.classpath.tools.getopt.OptionGroup; import gnu.classpath.tools.getopt.Parser; import org.omg.CosNaming.NamingContextExt; diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java index 9c50efa8ff9..e853a5a1b56 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/ClassRmicCompiler.java @@ -22,15 +22,11 @@ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA package gnu.classpath.tools.rmic; import gnu.java.rmi.server.RMIHashes; -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; import java.io.File; import java.io.FileOutputStream; -import java.io.FileWriter; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; -import java.io.PrintWriter; import java.lang.reflect.Method; import java.net.URL; import java.net.URLClassLoader; @@ -46,13 +42,10 @@ import java.rmi.server.RemoteRef; import java.rmi.server.RemoteStub; import java.rmi.server.Skeleton; import java.rmi.server.SkeletonMismatchException; -import java.security.MessageDigest; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Set; import java.util.StringTokenizer; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.ClassWriter; diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java b/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java index 12d1fa20eda..28f4d193144 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmic/Main.java @@ -22,16 +22,10 @@ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA package gnu.classpath.tools.rmic; import gnu.classpath.tools.common.ClasspathToolParser; -import gnu.classpath.tools.getopt.FileArgumentCallback; import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; -import gnu.classpath.tools.getopt.OptionGroup; import gnu.classpath.tools.getopt.Parser; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.OutputStream; import java.util.ArrayList; /** diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav deleted file mode 100644 index aff606b90cc..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/ImplTie.jav +++ /dev/null @@ -1,152 +0,0 @@ -package #package; - -#imports -import java.rmi.Remote; -import javax.rmi.PortableRemoteObject; -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.ORB; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.ResponseHandler; -import org.omg.CORBA.portable.UnknownException; -import org.omg.PortableServer.Servant; - -import org.omg.CORBA_2_3.portable.ObjectImpl; -import org.omg.CORBA_2_3.portable.InputStream; - -// This Tie type is obsolete. Use the POA - based tie (key -poa). - -/** - * This class accepts remote calls to the served GIOP object and delegates them - * to the enclosed implementing class. Being derived from the ObjectImpl, - * it directly implements the GIOP Object. - * - * It is normally generated with grmic -impl - */ -public class _#nameImpl_Tie extends ObjectImpl implements Tie -{ - /** - * All decoded remote calls are forwarded to this target. - */ - #implName target; - - /** - * The array of repository ids, supported by this GIOP Object - */ - private static final String[] type_ids = - { -#idList - }; - - /** - * Get an array of all interfaces (repository ids), - * supported by this Object. - * - * @return the array of Ids. - */ - public String[] _ids() - { - return type_ids; - } - - /** - * Set the invocation target, where all received calls are finally - * forwarded. - * - * @param a_target the forwarding target - * - * @throws ClassCastException if the target is not an instance of - * #implName - */ - public void setTarget(Remote a_target) - { - this.target = (#implName) a_target; - } - - /** - * Get the invocation target, where all received calls are finally - * forwarded. - * - * @return the target, an instance of - * #implName - */ - public Remote getTarget() - { - return target; - } - - /** - * Return the actual GIOP object that would handle this request. - * - * @return <code>this</code>, always. - */ - public org.omg.CORBA.Object thisObject() - { - return this; - } - - /** - * Deactivates this object, disconnecting it from the orb. - */ - public void deactivate() - { - _orb().disconnect(this); - _set_delegate(null); - target = null; - } - - /** - * Get the {@link ORB} where this {@link Servant} is connected. - * - * @return the ORB - */ - public ORB orb() - { - return _orb(); - } - - /** - * Connect this servant to the given ORB. - */ - public void orb(ORB orb) - { - orb.connect(this); - } - -/** - * This method is invoked by ORB in response to the remote call. It redirects - * the call to one of the methods in the target. - * - * @param method the name of the method to call. - * @param parameter_stream the input stream, from where the parameters must be - * read. - * @param reply the response hander, providing methods to return the result. - * - * @return the output stream, created by the response handler - * - * @throws SystemException if one occurs during method invocation. - */ - public OutputStream _invoke(String method, - org.omg.CORBA.portable.InputStream parameter_stream, - ResponseHandler reply) - { - try - { - InputStream in =(InputStream) parameter_stream; - -#tie_methods - - throw new BAD_OPERATION("No such method: '"+method+"'"); - } - catch (SystemException ex) - { - throw ex; - } - catch (Throwable ex) - { - throw new UnknownException(ex); - } - } -}
\ No newline at end of file diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav deleted file mode 100644 index 371e12d4486..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub.jav +++ /dev/null @@ -1,47 +0,0 @@ -package #package; - -#imports -import java.rmi.UnexpectedException; - -import javax.rmi.CORBA.Stub; -import javax.rmi.CORBA.Util; - -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.ApplicationException; -import org.omg.CORBA.portable.InputStream; -import org.omg.CORBA.portable.RemarshalException; - -import org.omg.CORBA_2_3.portable.OutputStream; - -/** - * This class delegates its method calls to the remote GIOP object. - * It is normally generated with grmic. - */ -public class _#name_Stub extends Stub - implements #interfaces -{ - /** - * Use serialVersionUID for interoperability. - */ - private static final long serialVersionUID = 1; - - /** - * The array of repository ids, supported by this GIOP Object - */ - private static final String[] type_ids = - { -#idList - }; - - /** - * Return the array of repository ids, supported by this GIOP Object. - * - * @return the array of Ids. - */ - public String[] _ids() - { - return type_ids; - } - -#stub_methods -}
\ No newline at end of file diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav deleted file mode 100644 index 17636deb670..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethod.jav +++ /dev/null @@ -1,33 +0,0 @@ - /** @inheritDoc */ - public #return_type #method_name(#argument_list) #throws - { - try - { - InputStream in = null; - try - { - OutputStream out = - (OutputStream) _request("#giop_method_name", true); -#argument_write - in = _invoke(out); - #read_return - } - catch (ApplicationException ex) - { - in = ex.getInputStream(); - throw new UnexpectedException(in.read_string()); - } - catch (RemarshalException ex) - { - return #method_name(#argument_names); - } - finally - { - _releaseReply(in); - } - } - catch (SystemException ex) - { - throw Util.mapSystemException(ex); - } - } diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav deleted file mode 100644 index 0125a02b0a3..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/StubMethodVoid.jav +++ /dev/null @@ -1,32 +0,0 @@ - /** @inheritDoc */ - public #return_type #method_name(#argument_list) #throws - { - try - { - InputStream in = null; - try - { - OutputStream out = - (OutputStream) _request("#giop_method_name", true); -#argument_write - in = _invoke(out); - } - catch (ApplicationException ex) - { - in = ex.getInputStream(); - throw new UnexpectedException(in.read_string()); - } - catch (RemarshalException ex) - { - #method_name(#argument_names); - } - finally - { - _releaseReply(in); - } - } - catch (SystemException ex) - { - throw Util.mapSystemException(ex); - } - } diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav deleted file mode 100644 index 1c55a059799..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12.jav +++ /dev/null @@ -1,62 +0,0 @@ -package #package; - -#imports -import java.lang.reflect.Method; -import java.rmi.server.RemoteRef; -import java.rmi.server.RemoteStub; -import java.rmi.UnexpectedException; - -/** - * This class delegates its method calls to the remote RMI object, referenced - * by {@link RemoteRef}. - * - * It is normally generated with rmic. - */ -public final class #name_Stub - extends RemoteStub - implements #interfaces -{ - /** - * Use serialVersionUID for interoperability - */ - private static final long serialVersionUID = 2; - - /** - * The explaining message for {@ling UnexpectedException}. - */ - private static final String exception_message = - "undeclared checked exception"; - - /* All remote methods, invoked by this stub: */ -#stub_method_declarations - #zeroSizeObjecArray - static - { - #zeroSizeClassArray - try - { -#stub_method_initializations - } - catch (NoSuchMethodException nex) - { - NoSuchMethodError err = new NoSuchMethodError( - "#name_Stub class initialization failed"); - err.initCause(nex); - throw err; - } - } - - /** - * Create the instance for _#name_Stub that forwards method calls to the - * remote object. - * - * @para the reference to the remote object. - */ - public #name_Stub(RemoteRef reference) - { - super(reference); - } - - /* Methods */ -#stub_methods -} diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav deleted file mode 100644 index 9aaf8f5adc0..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12Method.jav +++ /dev/null @@ -1,26 +0,0 @@ - /** @inheritDoc */ - public #return_type #method_name(#argument_list) #throws - { - try - { - Object result = ref.invoke(this, met_#method_name, - #object_arg_list, - #method_hash); - #return_statement - } - catch (RuntimeException e) - { - throw e; - } - catch (RemoteException e) - { - throw e; - } - catch (Exception e) - { - UnexpectedException uex = new UnexpectedException(exception_message); - uex.detail = e; - throw uex; - } - } -
\ No newline at end of file diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav deleted file mode 100644 index 860a93c8447..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Stub_12MethodVoid.jav +++ /dev/null @@ -1,25 +0,0 @@ - /** @inheritDoc */ - public void #method_name(#argument_list) #throws - { - try - { - ref.invoke(this, met_#method_name, - #object_arg_list, - #method_hash); - } - catch (RuntimeException e) - { - throw e; - } - catch (RemoteException e) - { - throw e; - } - catch (Exception e) - { - UnexpectedException uex = new UnexpectedException(exception_message); - uex.detail = e; - throw uex; - } - } -
\ No newline at end of file diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav deleted file mode 100644 index 797ae1401de..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/Tie.jav +++ /dev/null @@ -1,184 +0,0 @@ -package #package; - -#imports -import java.rmi.Remote; -import javax.rmi.PortableRemoteObject; -import javax.rmi.CORBA.Tie; - -import org.omg.CORBA.BAD_OPERATION; -import org.omg.CORBA.ORB; -import org.omg.CORBA.SystemException; -import org.omg.CORBA.portable.OutputStream; -import org.omg.CORBA.portable.ResponseHandler; -import org.omg.CORBA.portable.UnknownException; -import org.omg.PortableServer.Servant; -import org.omg.PortableServer.POA; -import org.omg.PortableServer.POAPackage.WrongPolicy; -import org.omg.PortableServer.POAPackage.ObjectNotActive; -import org.omg.PortableServer.POAPackage.ServantNotActive; - -import org.omg.CORBA_2_3.portable.InputStream; - -/** - * This class accepts remote calls to the served GIOP object and delegates them - * to the enclosed implementing class. Being servant, it must be connected to - * the ORB Poa. - * It is normally generated with grmic -poa - */ -public class _#nameImpl_Tie extends Servant implements Tie -{ - /** - * All decoded remote calls are forwarded to this target. - */ - #implName target; - - /** - * The array of repository ids, supported by this GIOP Object - */ - private static final String[] type_ids = - { -#idList - }; - - /** - * Get an array of all interfaces, supported by this - * {@link Servant}. - * - * @param poa unused - * @param objectId unused - * - * @return the array of Ids. - */ - public String[] _all_interfaces(POA poa, - byte[] objectId - ) - { - return type_ids; - } - - - /** - * Set the invocation target, where all received calls are finally - * forwarded. - * - * @param a_target the forwarding target - * - * @throws ClassCastException if the target is not an instance of - * #implName - */ - public void setTarget(Remote a_target) - { - this.target = (#implName) a_target; - } - - /** - * Get the invocation target, where all received calls are finally - * forwarded. - * - * @return the target, an instance of - * #implName - */ - public Remote getTarget() - { - return target; - } - - /** - * Return the actual GIOP object that would handle this request. - * - * @return the GIOP object. - */ - public org.omg.CORBA.Object thisObject() - { - return _this_object(); - } - - /** - * Deactivate this {@link Servant}. The WrongPolicy, ObjectNotActive - * and ServantNotActive exceptions, if thrown during deactivation, are - * catched and silently ignored. - */ - public void deactivate() - { - try - { - _poa().deactivate_object(_poa().servant_to_id(this)); - } - catch (WrongPolicy exception) - { - } - catch (ObjectNotActive exception) - { - } - catch (ServantNotActive exception) - { - } - } - - /** - * Get the {@link ORB} where this {@link Servant} is connected. - * - * @return the ORB - */ - public ORB orb() - { - return _orb(); - } - - /** - * Connect this servant to the given ORB. It is recommended to connect - * servant to the ORBs root or other POA rather than using this method. - */ - public void orb(ORB orb) - { - try - { - ((org.omg.CORBA_2_3.ORB) orb).set_delegate(this); - } - catch (ClassCastException e) - { - throw new org.omg.CORBA.BAD_PARAM( - "POA Servant requires an instance of org.omg.CORBA_2_3.ORB" - ); - } - } - -/** - * This method is invoked by ORB in response to the remote call. It redirects - * the call to one of the methods in the target. - * - * @param method the name of the method to call. - * @param parameter_stream the input stream, from where the parameters must be - * read. - * @param reply the response hander, providing methods to return the result. - * - * @return the output stream, created by the response handler - * - * @throws SystemException if one occurs during method invocation. - */ - public OutputStream _invoke(String method, - org.omg.CORBA.portable.InputStream parameter_stream, - ResponseHandler reply - ) throws SystemException - { - try - { - InputStream in =(InputStream) parameter_stream; - switch (method.charAt(#hashCharPos)) - { -#tie_methods - default: break; - } - - throw new BAD_OPERATION("No such method: '"+method+"'"); - } - catch (SystemException ex) - { - throw ex; - } - catch (Throwable ex) - { - throw new UnknownException(ex); - } - } -}
\ No newline at end of file diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav deleted file mode 100644 index 493f0009b48..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethod.jav +++ /dev/null @@ -1,11 +0,0 @@ - #hashCodeLabel - // #method_name - if (method.equals("#giop_method_name")) - { -#read_and_define_args - OutputStream out = reply.createReply(); - #return_type result = - target.#method_name(#argument_names); - #write_result - return out; - } diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav b/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav deleted file mode 100644 index 3db17da7c84..00000000000 --- a/libjava/classpath/tools/gnu/classpath/tools/rmic/templates/TieMethodVoid.jav +++ /dev/null @@ -1,9 +0,0 @@ - #hashCodeLabel - // #method_name - if (method.equals("#giop_method_name")) - { -#read_and_define_args - OutputStream out = reply.createReply(); - target.#method_name(#argument_names); - return out; - } diff --git a/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java b/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java index d601b13f178..4ee079c1e5c 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/rmid/Main.java @@ -39,7 +39,6 @@ package gnu.classpath.tools.rmid; import gnu.classpath.tools.rmid.ActivationSystemImpl; import gnu.classpath.tools.common.ClasspathToolParser; -import gnu.classpath.tools.getopt.FileArgumentCallback; import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; import gnu.classpath.tools.getopt.OptionGroup; diff --git a/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java index 460b7818532..78a8f98c4f0 100644 --- a/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java +++ b/libjava/classpath/tools/gnu/classpath/tools/tnameserv/Main.java @@ -39,10 +39,8 @@ package gnu.classpath.tools.tnameserv; import gnu.CORBA.NamingService.NamingServiceTransient; import gnu.classpath.tools.common.ClasspathToolParser; -import gnu.classpath.tools.getopt.FileArgumentCallback; import gnu.classpath.tools.getopt.Option; import gnu.classpath.tools.getopt.OptionException; -import gnu.classpath.tools.getopt.OptionGroup; import gnu.classpath.tools.getopt.Parser; /** |

