summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/Makefile.am36
-rw-r--r--tools/gnu/classpath/tools/appletviewer/AppletWarning.java66
-rw-r--r--tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java3
-rw-r--r--tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java175
-rw-r--r--tools/gnu/classpath/tools/appletviewer/Main.java109
-rw-r--r--tools/gnu/classpath/tools/appletviewer/Messages.java67
-rw-r--r--tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java4
-rw-r--r--tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java12
-rw-r--r--tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java4
-rw-r--r--tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java3
-rw-r--r--tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java10
-rw-r--r--tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java33
-rw-r--r--tools/gnu/classpath/tools/javah/ClassWrapper.java5
-rw-r--r--tools/gnu/classpath/tools/javah/CniPrintStream.java6
-rw-r--r--tools/gnu/classpath/tools/javah/JniIncludePrinter.java2
-rw-r--r--tools/gnu/classpath/tools/javah/JniStubPrinter.java4
-rw-r--r--tools/gnu/classpath/tools/rmic/RMICException.java51
-rw-r--r--tools/toolwrapper.c2
18 files changed, 225 insertions, 367 deletions
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 04c2f2bbf..7c666dcd5 100755
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -33,63 +33,75 @@ AM_CPPFLAGS = -Wall \
gappletviewer_SOURCES = toolwrapper.c
gappletviewer_CFLAGS = \
-DTOOLPACKAGE="\"appletviewer\"" \
- -DTOOLNAME="\"gappletviewer\""
+ -DTOOLNAME="\"gappletviewer\"" \
+ -DASM_JAR=""
gjarsigner_SOURCES = toolwrapper.c
gjarsigner_CFLAGS = \
-DTOOLPACKAGE="\"jarsigner\"" \
- -DTOOLNAME="\"gjarsigner\""
+ -DTOOLNAME="\"gjarsigner\"" \
+ -DASM_JAR=""
gkeytool_SOURCES = toolwrapper.c
gkeytool_CFLAGS = \
-DTOOLPACKAGE="\"keytool\"" \
- -DTOOLNAME="\"gkeytool\""
+ -DTOOLNAME="\"gkeytool\"" \
+ -DASM_JAR=""
gjar_SOURCES = toolwrapper.c
gjar_CFLAGS = \
-DTOOLPACKAGE="\"jar\"" \
- -DTOOLNAME="\"gjar\""
+ -DTOOLNAME="\"gjar\"" \
+ -DASM_JAR=""
gnative2ascii_SOURCES = toolwrapper.c
gnative2ascii_CFLAGS = \
-DTOOLPACKAGE="\"native2ascii\"" \
- -DTOOLNAME="\"gnative2ascii\""
+ -DTOOLNAME="\"gnative2ascii\"" \
+ -DASM_JAR=""
gserialver_SOURCES = toolwrapper.c
gserialver_CFLAGS = \
-DTOOLPACKAGE="\"serialver\"" \
- -DTOOLNAME="\"gserialver\""
+ -DTOOLNAME="\"gserialver\"" \
+ -DASM_JAR=""
grmiregistry_SOURCES = toolwrapper.c
grmiregistry_CFLAGS = \
-DTOOLPACKAGE="\"rmiregistry\"" \
- -DTOOLNAME="\"grmiregistry\""
+ -DTOOLNAME="\"grmiregistry\"" \
+ -DASM_JAR=""
gtnameserv_SOURCES = toolwrapper.c
gtnameserv_CFLAGS = \
-DTOOLPACKAGE="\"tnameserv\"" \
- -DTOOLNAME="\"gtnameserv\""
+ -DTOOLNAME="\"gtnameserv\"" \
+ -DASM_JAR=""
gorbd_SOURCES = toolwrapper.c
gorbd_CFLAGS = \
-DTOOLPACKAGE="\"orbd\"" \
- -DTOOLNAME="\"gorbd\""
+ -DTOOLNAME="\"gorbd\"" \
+ -DASM_JAR=""
grmid_SOURCES = toolwrapper.c
grmid_CFLAGS = \
-DTOOLPACKAGE="\"rmid\"" \
- -DTOOLNAME="\"grmid\""
+ -DTOOLNAME="\"grmid\"" \
+ -DASM_JAR=""
if USE_ASM
gjavah_SOURCES = toolwrapper.c
gjavah_CFLAGS = \
-DTOOLPACKAGE="\"javah\"" \
- -DTOOLNAME="\"gjavah\""
+ -DTOOLNAME="\"gjavah\"" \
+ -DASM_JAR="\":$(PATH_TO_ASM)\""
grmic_SOURCES = toolwrapper.c
grmic_CFLAGS = \
-DTOOLPACKAGE="\"rmic\"" \
- -DTOOLNAME="\"grmic\""
+ -DTOOLNAME="\"grmic\"" \
+ -DASM_JAR="\":$(PATH_TO_ASM)\""
endif
else
diff --git a/tools/gnu/classpath/tools/appletviewer/AppletWarning.java b/tools/gnu/classpath/tools/appletviewer/AppletWarning.java
deleted file mode 100644
index b2376a4cb..000000000
--- a/tools/gnu/classpath/tools/appletviewer/AppletWarning.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/* AppletWarning -- a security warning message display dialog
- Copyright (C) 2003, 2004, 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. */
-
-package gnu.classpath.tools.appletviewer;
-
-import javax.swing.JOptionPane;
-
-/**
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class AppletWarning
-{
- private static String TITLE = "WARNING";
- private static boolean showWarning = false;
-
- private static String MESSAGE =
- "The current version of this applet plugin does not provide\n" +
- "a security manager capable of handling Java (tm) applets. Applets\n" +
- "have UNRESTRICTED access to your computer. This means they can do\n" +
- "anything you can do, like deleting all your important data.\n\n" +
- "Continue ?";
-
- public static int show()
- {
- if (showWarning)
- return JOptionPane.showConfirmDialog(null, MESSAGE, TITLE,
- JOptionPane.YES_NO_OPTION,
- JOptionPane.WARNING_MESSAGE);
- else
- return JOptionPane.YES_OPTION;
- }
-}
diff --git a/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java b/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
index bc0cc45e1..c41ac1d7c 100644
--- a/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
+++ b/tools/gnu/classpath/tools/appletviewer/CommonAppletStub.java
@@ -98,7 +98,8 @@ class CommonAppletStub
}
catch (MalformedURLException e)
{
- throw new RuntimeException("unknown codebase");
+ throw new RuntimeException("Attempted to create"
+ + " invalid codebase URL.", e);
}
}
diff --git a/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java b/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java
deleted file mode 100644
index 9c937cc77..000000000
--- a/tools/gnu/classpath/tools/appletviewer/ConsoleDialog.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/* ConsoleDialog -- a console dialog for applets
- Copyright (C) 2003, 2004, 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. */
-
-package gnu.classpath.tools.appletviewer;
-
-import java.awt.BorderLayout;
-import java.awt.Button;
-import java.awt.FlowLayout;
-import java.awt.Frame;
-import java.awt.Panel;
-import java.awt.TextArea;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintStream;
-
-
-/**
- * This class is a little dialog showing standard output and standard error output.
- *
- * @author Michael Koch (konqueror@gmx.de)
- */
-public class ConsoleDialog extends Frame
- implements ActionListener
-{
- static class InternalOutputStream extends OutputStream
- {
- private ConsoleDialog console;
-
- public InternalOutputStream(ConsoleDialog console)
- {
- super();
- this.console = console;
- }
-
- public void write(int data) throws IOException
- {
- console.print(String.valueOf((char) data));
- }
- }
-
- private TextArea textArea;
- private Button buttonClear;
- private Button buttonHide;
- private PrintStream printStream;
-
- /**
- * Creates a console dialog object.
- */
- public ConsoleDialog()
- {
- super(Main.messages.getString("gcjwebplugin.console_title"));
-
- setSize(400, 200);
- setLayout(new BorderLayout());
- addWindowListener(new WindowAdapter()
- {
- public void windowClosing(WindowEvent event)
- {
- hide();
- }
- });
-
- textArea = new TextArea();
- textArea.setEditable(false);
- add(textArea);
-
- Panel panel = new Panel();
- panel.setLayout(new FlowLayout());
- add(panel, BorderLayout.SOUTH);
-
- buttonClear = new Button(Main.messages.getString("gcjwebplugin.console_clear"));
- buttonClear.addActionListener(this);
- panel.add(buttonClear);
-
- buttonHide = new Button(Main.messages.getString("gcjwebplugin.console_hide"));
- buttonHide.addActionListener(this);
- panel.add(buttonHide);
-
- printStream = new PrintStream(new InternalOutputStream(this));
- clearTextArea();
- }
-
- /**
- * Clears the content of the textarea and inserts the initial text.
- */
- public void clearTextArea()
- {
- textArea.setText("");
-
- println("java.vm.version: " + System.getProperty("java.vm.version"));
- println("java.vm.vendor: " + System.getProperty("java.vm.vendor"));
- }
-
- /**
- * Print a message into the console dialog.
- *
- * @param message the message to print.
- */
- public void print(String message)
- {
- textArea.append(message);
- }
-
- /**
- * Print a line into the console dialog.
- *
- * @param message the line to print.
- */
- public void println(String message)
- {
- print(message + "\n");
- }
-
- /**
- * Perform actions on button clicks inside the console dialog.
- *
- * @param event the event.
- */
- public void actionPerformed(ActionEvent event)
- {
- if (event.getSource() == buttonHide)
- hide(); // Hide console window.
- else if (event.getSource() == buttonClear)
- clearTextArea(); // Clear text area and insert standard messages.
- }
-
- /**
- * Returns a <code>PrintStream</code> object that prints into the
- * console dialog.
- *
- * @return the <code>PrintStream</code> object.
- */
- public PrintStream getPrintStream()
- {
- return printStream;
- }
-}
diff --git a/tools/gnu/classpath/tools/appletviewer/Main.java b/tools/gnu/classpath/tools/appletviewer/Main.java
index b22368003..a10b889bc 100644
--- a/tools/gnu/classpath/tools/appletviewer/Main.java
+++ b/tools/gnu/classpath/tools/appletviewer/Main.java
@@ -60,12 +60,6 @@ import java.util.ResourceBundle;
class Main
{
- /**
- * The localized strings are kept in a separate file.
- */
- public static final ResourceBundle messages = ResourceBundle.getBundle
- ("gnu.classpath.tools.appletviewer.MessagesBundle");
-
private static HashMap classLoaderCache = new HashMap();
private static ClassLoader getClassLoader(URL codebase, ArrayList archives)
@@ -110,7 +104,7 @@ class Main
}
if (applet == null)
- applet = new ErrorApplet("Error loading applet");
+ applet = new ErrorApplet(Messages.getString ("Main.ErrorApplet"));
return applet;
}
@@ -127,68 +121,72 @@ class Main
public static void main(String[] args) throws IOException
{
parser = new ClasspathToolParser("appletviewer", true);
- parser.setHeader("usage: appletviewer [OPTION] -code CODE | URL...");
+ parser.setHeader(Messages.getString("Main.Usage"));
- OptionGroup attributeGroup = new OptionGroup("Applet tag options");
+ OptionGroup attributeGroup
+ = new OptionGroup(Messages.getString("Main.AppletTagOptions"));
- attributeGroup.add(new Option("code", Main.messages.getString
- ("gcjwebplugin.code_description"),
- "CODE")
+ attributeGroup.add(new Option("code",
+ Messages.getString("Main.CodeDescription"),
+ Messages.getString("Main.CodeArgument"))
{
public void parsed(String argument) throws OptionException
{
code = argument;
}
});
- attributeGroup.add(new Option("codebase", Main.messages.getString
- ("gcjwebplugin.codebase_description"),
- "CODEBASE")
+ attributeGroup.add
+ (new Option("codebase",
+ Messages.getString("Main.CodebaseDescription"),
+ Messages.getString("Main.CodebaseArgument"))
{
public void parsed(String argument) throws OptionException
{
codebase = argument;
}
});
- attributeGroup.add(new Option("archive", Main.messages.getString
- ("gcjwebplugin.archive_description"),
- "ARCHIVE")
+ attributeGroup.add
+ (new Option("archive",
+ Messages.getString("Main.ArchiveDescription"),
+ Messages.getString("Main.ArchiveArgument"))
{
public void parsed(String argument) throws OptionException
{
archive = argument;
}
});
- attributeGroup.add(new Option("width", Main.messages.getString
- ("gcjwebplugin.width_description"),
- "WIDTH")
+ attributeGroup.add(new Option("width",
+ Messages.getString("Main.WidthDescription"),
+ Messages.getString("Main.WidthArgument"))
{
public void parsed(String argument) throws OptionException
{
dimensions.width = Integer.parseInt(argument);
}
});
- attributeGroup.add(new Option("height", Main.messages.getString
- ("gcjwebplugin.height_description"),
- "HEIGHT")
+ attributeGroup.add(new Option("height",
+ Messages.getString("Main.HeightDescription"),
+ Messages.getString("Main.HeightArgument"))
{
public void parsed(String argument) throws OptionException
{
dimensions.height = Integer.parseInt(argument);
}
});
- attributeGroup.add(new Option("param", Main.messages.getString
- ("gcjwebplugin.param_description"),
- "NAME,VALUE")
+ attributeGroup.add(new Option("param",
+ Messages.getString("Main.ParamDescription"),
+ Messages.getString("Main.ParamArgument"))
{
public void parsed(String argument) throws OptionException
{
parameters.add(argument);
}
});
- OptionGroup pluginGroup = new OptionGroup("Plugin option");
- pluginGroup.add(new Option("plugin", Main.messages.getString
- ("gcjwebplugin.plugin_description"),
- "INPUT,OUTPUT")
+ OptionGroup pluginGroup
+ = new OptionGroup(Messages.getString("Main.PluginOption"));
+ pluginGroup.add(new Option("plugin",
+ Messages.getString("Main.PluginDescription"),
+ Messages.getString("Main.PluginArgument"))
{
public void parsed(String argument) throws OptionException
{
@@ -198,29 +196,34 @@ class Main
pipeOutName = argument.substring(comma + 1);
}
});
- OptionGroup debuggingGroup = new OptionGroup("Debugging option");
- debuggingGroup.add(new Option("verbose", Main.messages.getString
- ("gcjwebplugin.verbose_description"),
- (String) null)
+ OptionGroup debuggingGroup
+ = new OptionGroup(Messages.getString("Main.DebuggingOption"));
+ debuggingGroup.add
+ (new Option("verbose",
+ Messages.getString("Main.VerboseDescription"),
+ (String) null)
{
public void parsed(String argument) throws OptionException
{
verbose = true;
}
});
- OptionGroup compatibilityGroup = new OptionGroup("Compatibility options");
- compatibilityGroup.add(new Option("debug", Main.messages.getString
- ("gcjwebplugin.debug_description"),
- (String) null)
+ OptionGroup compatibilityGroup
+ = new OptionGroup(Messages.getString("Main.CompatibilityOptions"));
+ compatibilityGroup.add
+ (new Option("debug",
+ Messages.getString("Main.DebugDescription"),
+ (String) null)
{
public void parsed(String argument) throws OptionException
{
// Currently ignored.
}
});
- compatibilityGroup.add(new Option("encoding", Main.messages.getString
- ("gcjwebplugin.encoding_description"),
- "CHARSET")
+ compatibilityGroup.add
+ (new Option("encoding",
+ Messages.getString("Main.EncodingDescription"),
+ Messages.getString("Main.EncodingArgument"))
{
public void parsed(String argument) throws OptionException
{
@@ -263,15 +266,12 @@ class Main
else
{
// Warn user about missing security manager.
- System.err.println("WARNING: CURRENTLY GAPPLETVIEWER RUNS WITH NO SECURITY MANAGER.\n\n"
- + "THIS MEANS THAT APPLETS YOU LOAD CAN DO ANYTHING A JAVA APPLICATION\n"
- + "THAT YOU DOWNLOAD AND RUN CAN DO. BE *VERY* CAREFUL WHICH APPLETS YOU RUN.\n"
- + "DO NOT USE GAPPLETVIEWER ON YOUR SYSTEM IF YOUR SYSTEM STORES IMPORTANT DATA.\n"
- + "THIS DATA CAN BE DESTROYED OR STOLEN IF YOU LOAD A MALICIOUS APPLET.\n");
+ System.err.println(Messages.getString("Main.SecurityWarning") + "\n");
- System.err.println("[press 'c' or 'C' to continue or anything else to quit]");
+ System.err.println(Messages.getString("Main.ContinuationPrompt"));
- BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+ BufferedReader stdin
+ = new BufferedReader(new InputStreamReader(System.in));
String response = null;
try
@@ -280,8 +280,8 @@ class Main
}
catch (IOException e)
{
- System.err.println("failed to read response to warning message: " + e);
- System.exit(1);
+ throw new RuntimeException("Failed to read response"
+ + " to continuation prompt.", e);
}
if (!(response.equals("c") || response.equals("C")))
@@ -295,7 +295,7 @@ class Main
// arguments so we have nothing to work with.
if (args.length == 0)
{
- System.err.println(Main.messages.getString("gcjwebplugin.no_input_files"));
+ System.err.println(Messages.getString("Main.NoInputFiles"));
System.exit(1);
}
// Create a standalone appletviewer from a list of URLs.
@@ -305,7 +305,8 @@ class Main
{
// Create a standalone appletviewer from the --code
// option.
- new StandaloneAppletViewer(code, codebase, archive, parameters, dimensions);
+ new StandaloneAppletViewer(code, codebase, archive,
+ parameters, dimensions);
}
}
}
@@ -314,7 +315,7 @@ class Main
{
if (verbose)
{
- System.out.println("raw arguments:");
+ System.out.println(Messages.getString("Main.RawArguments"));
for (int i = 0; i < args.length; i++)
System.out.println(" " + args[i]);
diff --git a/tools/gnu/classpath/tools/appletviewer/Messages.java b/tools/gnu/classpath/tools/appletviewer/Messages.java
new file mode 100644
index 000000000..614a509fd
--- /dev/null
+++ b/tools/gnu/classpath/tools/appletviewer/Messages.java
@@ -0,0 +1,67 @@
+/* Messages.java -- localization support for appletviewer
+ 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. */
+
+
+package gnu.classpath.tools.appletviewer;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class Messages
+{
+ private static final String BUNDLE_NAME
+ = "gnu.classpath.tools.appletviewer.messages"; //$NON-NLS-1$
+
+ private static final ResourceBundle RESOURCE_BUNDLE
+ = ResourceBundle.getBundle(BUNDLE_NAME);
+
+ private Messages()
+ {
+ }
+
+ public static String getString(String key)
+ {
+ try
+ {
+ return RESOURCE_BUNDLE.getString(key);
+ }
+ catch (MissingResourceException e)
+ {
+ return '!' + key + '!';
+ }
+ }
+}
diff --git a/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java b/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
index a0e6acd12..bc445a6b3 100644
--- a/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
+++ b/tools/gnu/classpath/tools/appletviewer/PluginAppletContext.java
@@ -54,7 +54,7 @@ class PluginAppletContext extends CommonAppletContext
}
catch(IOException e)
{
- System.err.println("showDocument failed: " + e);
+ throw new RuntimeException("showDocument failed.", e);
}
}
@@ -66,7 +66,7 @@ class PluginAppletContext extends CommonAppletContext
}
catch(IOException e)
{
- System.err.println("showDocument failed: " + e);
+ throw new RuntimeException("showStatus failed.", e);
}
}
}
diff --git a/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java b/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
index fdb8097b4..d77aad392 100644
--- a/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
+++ b/tools/gnu/classpath/tools/appletviewer/PluginAppletViewer.java
@@ -141,7 +141,9 @@ class PluginAppletViewer
pluginOutputStream.newLine();
pluginOutputStream.flush();
- System.err.println(" PIPE: applet viewer wrote: " + message);
+ System.err.println
+ (" " + Messages.getString("PluginAppletViewer.AppletViewerWrote")
+ + message);
}
/**
@@ -155,7 +157,9 @@ class PluginAppletViewer
{
String message = pluginInputStream.readLine();
- System.err.println(" PIPE: applet viewer read: " + message);
+ System.err.println
+ (" " + Messages.getString("PluginAppletViewer.AppletViewerRead")
+ + message);
if (message == null || message.equals("shutdown"))
{
@@ -163,7 +167,9 @@ class PluginAppletViewer
pluginInputStream.close();
pluginOutputStream.close();
- System.err.println("appletviewer: exiting plugin applet viewer");
+ System.err.println
+ (Messages.getString("PluginAppletViewer.AppletViewerExiting"));
+
System.exit(0);
}
diff --git a/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java b/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
index 6d36e1cf0..283d547b8 100644
--- a/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
+++ b/tools/gnu/classpath/tools/appletviewer/PluginAppletWindow.java
@@ -428,10 +428,6 @@ class PluginAppletWindow
if (contexts.get(tag.getCodeBase()) == null)
contexts.put(tag.getCodeBase(), new PluginAppletContext());
- int result = AppletWarning.show();
- if (result == JOptionPane.NO_OPTION)
- return;
-
add(applet);
AppletContext context = (AppletContext) contexts.get(tag.getCodeBase());
diff --git a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
index a779f068a..48468f84d 100644
--- a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
+++ b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletContext.java
@@ -58,7 +58,8 @@ class StandaloneAppletContext extends CommonAppletContext
public void showDocument(URL url, String target)
{
- System.err.println("showDocument is not implemented in standalone mode");
+ System.err.println
+ (Messages.getString("StandaloneAppletContext.ShowDocumentError"));
}
// In standalone mode, there are potentially several windows, each
diff --git a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
index 2b58f4b87..cc3a65cd7 100644
--- a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
+++ b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletViewer.java
@@ -79,7 +79,8 @@ class StandaloneAppletViewer extends Main
{
if (!(code.equals("") || code.endsWith(".class")))
{
- System.err.println("appletviewer: option '--code' requires a class filename");
+ System.err.println
+ (Messages.getString("StandaloneAppletViewer.CodeOptionError"));
System.exit(1);
}
@@ -118,13 +119,16 @@ class StandaloneAppletViewer extends Main
{
if (verbose)
{
- System.out.println("parsed applet tags:");
+ System.out.println
+ (Messages.getString("StandaloneAppletViewer.ParsedAppletTags"));
for (int i = 0; i < appletTags.size(); i++)
{
AppletTag tag = (AppletTag) appletTags.get(i);
- System.out.println(" tag " + i + ":");
+ System.out.println
+ (" " + Messages.getString("StandaloneAppletViewer.Tag")
+ + " " + i + ":");
System.out.println(tag);
}
}
diff --git a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
index fd2a7c0d8..3a0a44282 100644
--- a/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
+++ b/tools/gnu/classpath/tools/appletviewer/StandaloneAppletWindow.java
@@ -128,57 +128,57 @@ class StandaloneAppletWindow
addHierarchyListener(this);
addHierarchyBoundsListener(this);
- restartItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_restart"));
+ restartItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuRestart"));
restartItem.setEnabled(false);
restartItem.addActionListener(this);
- reloadItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_reload"));
+ reloadItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuReload"));
reloadItem.setEnabled(false);
reloadItem.addActionListener(this);
- cancelItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_cancel"));
+ cancelItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuCancel"));
cancelItem.setEnabled(false);
cancelItem.addActionListener(this);
- saveItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_save"));
+ saveItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuSave"));
saveItem.setEnabled(false);
saveItem.addActionListener(this);
- startItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_start"));
+ startItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuStart"));
startItem.setEnabled(false);
startItem.addActionListener(this);
- cloneItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_clone"));
+ cloneItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuClone"));
cloneItem.setEnabled(false);
cloneItem.addActionListener(this);
- closeItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_close"));
+ closeItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuClose"));
closeItem.setEnabled(false);
closeItem.addActionListener(this);
tagItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_tag"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuTag"));
tagItem.setEnabled(false);
tagItem.addActionListener(this);
infoItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_info"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuInfo"));
infoItem.setEnabled(false);
infoItem.addActionListener(this);
editItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_edit"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuEdit"));
editItem.setEnabled(false);
editItem.addActionListener(this);
editItem.setEnabled(false);
encodingItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_encoding"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuEncoding"));
encodingItem.setEnabled(false);
encodingItem.addActionListener(this);
printItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_print"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuPrint"));
printItem.setEnabled(false);
printItem.addActionListener(this);
propertiesItem =
- new MenuItem(Main.messages.getString("gcjwebplugin.menu_properties"));
+ new MenuItem(Messages.getString("StandaloneAppletWindow.MenuProperties"));
propertiesItem.setEnabled(false);
propertiesItem.addActionListener(this);
- quitItem = new MenuItem(Main.messages.getString("gcjwebplugin.menu_quit"));
+ quitItem = new MenuItem(Messages.getString("StandaloneAppletWindow.MenuQuit"));
quitItem.addActionListener(this);
MenuBar menuBar = new MenuBar();
- Menu menuApplet = new Menu(Main.messages.getString("gcjwebplugin.menu_title"));
+ Menu menuApplet = new Menu(Messages.getString("StandaloneAppletWindow.MenuTitle"));
menuBar.add(menuApplet);
menuApplet.add(restartItem);
menuApplet.add(reloadItem);
@@ -199,7 +199,8 @@ class StandaloneAppletWindow
menuApplet.add(closeItem);
menuApplet.add(quitItem);
setMenuBar(menuBar);
- setTitle("GNU Classpath Applet Viewer: " + tag.code);
+ setTitle(Messages.getString("StandaloneAppletWindow.WindowTitle")
+ + " " + tag.code);
AppletContext context = (AppletContext) contexts.get(tag.codebase);
((StandaloneAppletContext) context).addApplet(applet);
diff --git a/tools/gnu/classpath/tools/javah/ClassWrapper.java b/tools/gnu/classpath/tools/javah/ClassWrapper.java
index 778896395..e238065c2 100644
--- a/tools/gnu/classpath/tools/javah/ClassWrapper.java
+++ b/tools/gnu/classpath/tools/javah/ClassWrapper.java
@@ -338,4 +338,9 @@ public class ClassWrapper
out.println();
out.println("#endif // " + xname);
}
+
+ public String toString()
+ {
+ return name;
+ }
}
diff --git a/tools/gnu/classpath/tools/javah/CniPrintStream.java b/tools/gnu/classpath/tools/javah/CniPrintStream.java
index 574d7fd5f..64ba537d4 100644
--- a/tools/gnu/classpath/tools/javah/CniPrintStream.java
+++ b/tools/gnu/classpath/tools/javah/CniPrintStream.java
@@ -196,9 +196,9 @@ public class CniPrintStream
private void writeClass(PrintStream out, String klass)
{
int index = klass.lastIndexOf('/');
- String pkg = klass.substring(0, index);
- String[] pkgParts = pkg.split("/");
- String className = klass.substring(index + 1);
+ String pkg = index == -1 ? "" : klass.substring(0, index);
+ String[] pkgParts = index == -1 ? new String[0] : pkg.split("/");
+ String className = index == -1 ? klass : klass.substring(index + 1);
moveToPackage(out, pkgParts);
indent(out, pkgParts.length + 2);
out.print("class ");
diff --git a/tools/gnu/classpath/tools/javah/JniIncludePrinter.java b/tools/gnu/classpath/tools/javah/JniIncludePrinter.java
index 3d88650c1..f29bfc300 100644
--- a/tools/gnu/classpath/tools/javah/JniIncludePrinter.java
+++ b/tools/gnu/classpath/tools/javah/JniIncludePrinter.java
@@ -112,7 +112,7 @@ public class JniIncludePrinter
if (! klass.hasNativeMethod())
return;
String xname = JniHelper.mangle(klass.name);
- JniPrintStream out = (JniPrintStream) getPrintStream(xname + ".h", klass);
+ JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".h", klass);
if (out == null)
return;
out.println();
diff --git a/tools/gnu/classpath/tools/javah/JniStubPrinter.java b/tools/gnu/classpath/tools/javah/JniStubPrinter.java
index 0bc11873f..4e7871008 100644
--- a/tools/gnu/classpath/tools/javah/JniStubPrinter.java
+++ b/tools/gnu/classpath/tools/javah/JniStubPrinter.java
@@ -76,12 +76,12 @@ public class JniStubPrinter
if (! klass.hasNativeMethod())
return;
String xname = JniHelper.mangle(klass.name);
- JniPrintStream out = (JniPrintStream) getPrintStream(xname + ".c", klass);
+ JniPrintStream out = (JniPrintStream) getPrintStream(klass.name + ".c", klass);
if (out == null)
return;
out.println();
out.print("#include <");
- out.print(xname);
+ out.print(klass.name);
out.println(".h>");
Iterator i = klass.methods.iterator();
diff --git a/tools/gnu/classpath/tools/rmic/RMICException.java b/tools/gnu/classpath/tools/rmic/RMICException.java
index 8d6e5f766..300d60947 100644
--- a/tools/gnu/classpath/tools/rmic/RMICException.java
+++ b/tools/gnu/classpath/tools/rmic/RMICException.java
@@ -1,5 +1,5 @@
/* RMICException.java --
- Copyright (c) 2003 Free Software Foundation, Inc.
+ Copyright (c) 2003, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -18,32 +18,37 @@ along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
+
package gnu.classpath.tools.rmic;
/**
- * Thrown by the underlying compiler used by RMIC when it fails to compile a file.
- *
+ * Thrown by the underlying compiler used by RMIC when it fails to compile a
+ * file.
+ *
* @author Dalibor Topic <robilad@kaffe.org>
*/
+public class RMICException
+ extends Exception
+{
+ /**
+ * Create an exception with a message. The cause remains uninitialized.
+ *
+ * @param message the message string
+ * @see #initCause(Throwable)
+ */
+ public RMICException(String message)
+ {
+ super(message);
+ }
-public class RMICException extends Exception {
- /**
- * Create an exception with a message. The cause remains uninitialized.
- *
- * @param s the message string
- * @see #initCause(Throwable)
- */
- public RMICException(String message) {
- super(message);
- }
-
- /**
- * Create an exception with a message and a cause.
- *
- * @param s the message string
- * @param cause the cause of this exception
- */
- public RMICException(String message, Throwable cause) {
- super(message, cause);
- }
+ /**
+ * Create an exception with a message and a cause.
+ *
+ * @param message the message string
+ * @param cause the cause of this exception
+ */
+ public RMICException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
}
diff --git a/tools/toolwrapper.c b/tools/toolwrapper.c
index 9f4720ab9..dd23286c3 100644
--- a/tools/toolwrapper.c
+++ b/tools/toolwrapper.c
@@ -136,7 +136,7 @@ main (int argc, const char** argv)
goto destroy;
}
- vm_args.options[vm_args.nOptions++].optionString = "-Djava.class.path=" TOOLS_ZIP;
+ vm_args.options[vm_args.nOptions++].optionString = "-Xbootclasspath/p:" TOOLS_ZIP ASM_JAR;
}
/* Terminate vm_args.options with a NULL element. */