From: <cr...@us...> - 2008-10-05 02:26:28
|
Revision: 4604 http://jnode.svn.sourceforge.net/jnode/?rev=4604&view=rev Author: crawley Date: 2008-10-05 02:25:18 +0000 (Sun, 05 Oct 2008) Log Message: ----------- Changing the keyboard layout manager to get the initial keyboard layout ID to keyboard interpreter class mappings from a plugin extension. Modified Paths: -------------- trunk/core/descriptors/org.jnode.driver.input.l10n.xml trunk/core/descriptors/org.jnode.driver.input.xml trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java Modified: trunk/core/descriptors/org.jnode.driver.input.l10n.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.input.l10n.xml 2008-10-05 02:02:08 UTC (rev 4603) +++ trunk/core/descriptors/org.jnode.driver.input.l10n.xml 2008-10-05 02:25:18 UTC (rev 4604) @@ -16,5 +16,36 @@ <export name="org.jnode.driver.input.l10n.*"/> </library> </runtime> + + <extension point="org.jnode.driver.input.keyboard-layouts"> + <layout name="BE_fr" class="org.jnode.driver.input.l10n.KeyboardInterpreter_BE_fr"/> + <layout name="CH_fr" class="org.jnode.driver.input.l10n.KeyboardInterpreter_CH_fr"/> + <layout name="DE" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DE"/> + <layout name="DE_de" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DE"/> + <layout name="DK" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DK"/> + <layout name="DK_dk" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DK"/> + <layout name="ES" class="org.jnode.driver.input.l10n.KeyboardInterpreter_ES"/> + <layout name="ES_es" class="org.jnode.driver.input.l10n.KeyboardInterpreter_ES"/> + <layout name="FR" class="org.jnode.driver.input.l10n.KeyboardInterpreter_FR"/> + <layout name="FR_fr" class="org.jnode.driver.input.l10n.KeyboardInterpreter_FR"/> + <layout name="GB" class="org.jnode.driver.input.l10n.KeyboardInterpreter_GB_en"/> + <layout name="GB_en" class="org.jnode.driver.input.l10n.KeyboardInterpreter_GB_en"/> + <layout name="HU" class="org.jnode.driver.input.l10n.KeyboardInterpreter_HU"/> + <layout name="HU_hu" class="org.jnode.driver.input.l10n.KeyboardInterpreter_HU"/> + <layout name="HU_hu_101" class="org.jnode.driver.input.l10n.KeyboardInterpreter_HU"/> + <layout name="HU_101" class="org.jnode.driver.input.l10n.KeyboardInterpreter_HU"/> + <layout name="IT" class="org.jnode.driver.input.l10n.KeyboardInterpreter_IT"/> + <layout name="IT_it" class="org.jnode.driver.input.l10n.KeyboardInterpreter_IT"/> + <layout name="NO" class="org.jnode.driver.input.l10n.KeyboardInterpreter_NO"/> + <layout name="NO_no" class="org.jnode.driver.input.l10n.KeyboardInterpreter_NO"/> + <layout name="RU" class="org.jnode.driver.input.l10n.KeyboardInterpreter_RU"/> + <layout name="RU_ru" class="org.jnode.driver.input.l10n.KeyboardInterpreter_RU"/> + <layout name="SE" class="org.jnode.driver.input.l10n.KeyboardInterpreter_SE"/> + <layout name="SE_se" class="org.jnode.driver.input.l10n.KeyboardInterpreter_SE"/> + <layout name="US" class="org.jnode.driver.input.l10n.KeyboardInterpreter_US_en"/> + <layout name="US_en" class="org.jnode.driver.input.l10n.KeyboardInterpreter_US_en"/> + <layout name="DV" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DV"/> <!-- deprecated --> + <layout name="US_en_dvorak" class="org.jnode.driver.input.l10n.KeyboardInterpreter_DV"/> + </extension> </plugin> Modified: trunk/core/descriptors/org.jnode.driver.input.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.input.xml 2008-10-05 02:02:08 UTC (rev 4603) +++ trunk/core/descriptors/org.jnode.driver.input.xml 2008-10-05 02:25:18 UTC (rev 4604) @@ -17,6 +17,8 @@ <export name="org.jnode.driver.input.*"/> </library> </runtime> + + <extension-point id="keyboard-layouts" name="Standard keyboard layout identifier mappings"/> <extension point="org.jnode.security.permissions"> <permission class="org.jnode.driver.DriverPermission" name="setPreferredListener"/> Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java 2008-10-05 02:02:08 UTC (rev 4603) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardInputPlugin.java 2008-10-05 02:25:18 UTC (rev 4604) @@ -1,3 +1,23 @@ +/* + * $Id: TextScreenConsolePlugin.java 4556 2008-09-13 08:02:20Z crawley $ + * + * JNode.org + * Copyright (C) 2003-2006 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ package org.jnode.driver.input; import javax.naming.NamingException; @@ -7,6 +27,12 @@ import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginException; +/** + * The keyboard input plugin defines an extension point that is used to + * register keyboard interpreters, and hosts the keyboard layout manager. + * + * @author cr...@jn... + */ public class KeyboardInputPlugin extends Plugin { private KeyboardLayoutManager mgr; @@ -18,9 +44,9 @@ @Override protected void startPlugin() throws PluginException { try { - mgr = new KeyboardLayoutManager(); + mgr = new KeyboardLayoutManager( + getDescriptor().getExtensionPoint("keyboard-layouts")); InitialNaming.bind(KeyboardLayoutManager.NAME, mgr); - // TODO Load the initial layout mappings from the plugin descriptor. } catch (NamingException ex) { throw new PluginException(ex); } Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2008-10-05 02:02:08 UTC (rev 4603) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardInterpreter.java 2008-10-05 02:25:18 UTC (rev 4604) @@ -31,9 +31,19 @@ */ public interface KeyboardInterpreter { + /** + * A factory API for keyboard interpreters + */ public interface Factory { - // Create a new interpreter instance. + /** + * Create a new interpreter instance. + */ public KeyboardInterpreter create() throws KeyboardInterpreterException; + + /** + * Provide a short description for the layout. + */ + public String describe(); } public static final int XT_RELEASE = 0x80; Modified: trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java 2008-10-05 02:02:08 UTC (rev 4603) +++ trunk/core/src/driver/org/jnode/driver/input/KeyboardLayoutManager.java 2008-10-05 02:25:18 UTC (rev 4604) @@ -1,10 +1,38 @@ +/* + * $Id: TextScreenConsolePlugin.java 4556 2008-09-13 08:02:20Z crawley $ + * + * JNode.org + * Copyright (C) 2003-2006 JNode.org + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation; either version 2.1 of the License, or + * (at your option) any later version. + * + * This library 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 Lesser General Public + * License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; If not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ package org.jnode.driver.input; +import java.util.Collection; import java.util.HashMap; +import java.util.Iterator; import java.util.Locale; import java.util.ResourceBundle; +import java.util.TreeSet; import org.apache.log4j.Logger; +import org.apache.log4j.Priority; +import org.jnode.plugin.ConfigurationElement; +import org.jnode.plugin.Extension; +import org.jnode.plugin.ExtensionPoint; +import org.jnode.plugin.ExtensionPointListener; /** * The KeyboardManager provides methods for creating KeyboardInterpreter objects, and managing @@ -13,7 +41,7 @@ * @author Marc DENTY * @author cr...@jn... */ -public class KeyboardLayoutManager { +public class KeyboardLayoutManager implements ExtensionPointListener { private final Logger log = Logger.getLogger(KeyboardLayoutManager.class); @@ -21,14 +49,27 @@ * The name used to bind this manager in the InitialNaming namespace. */ public static Class<KeyboardLayoutManager> NAME = KeyboardLayoutManager.class; + + public static final String EP_NAME = "org.jnode.driver.input.keyboard-layouts"; - private HashMap<String, KeyboardInterpreter.Factory> map = + private final HashMap<String, KeyboardInterpreter.Factory> map = new HashMap<String, KeyboardInterpreter.Factory>(); + + private final ExtensionPoint keyboardLayoutEP; + + public KeyboardLayoutManager(ExtensionPoint keyboardLayoutEP) { + this.keyboardLayoutEP = keyboardLayoutEP; + keyboardLayoutEP.addListener(this); + for (Extension extension : keyboardLayoutEP.getExtensions()) { + addLayoutsToMap(extension); + } + } + /** * Load the default keyboard layout as specified in the 'org.jnode.driver.input.KeyboardLayout' * resource bundle. If none is specified or the specified layout cannot be used, we use the - * 'US_en' layout as a fallback. + * 'US_en' layout as a fall-back. * * @return a valid KeyboardInterpreter * @throws KeyboardInterpreterException @@ -59,7 +100,7 @@ "' keyboard interpreter", ex); } } - // Use the US_en keyboard layout as a fallback if there was no resource bundle, no + // Use the US_en keyboard layout as a fall-back if there was no resource bundle, no // usable default keyboard layout or the specified default layout had no interpreter. log.error("Trying the 'US_en' keyboard interpreter as a fallback"); try { @@ -171,22 +212,96 @@ * @param name the keyboard layout identifier. * @param factory the factory to be registered. */ - public synchronized void registerKeyboardLayout( - String name, KeyboardInterpreter.Factory factory) { + public synchronized void add(String name, KeyboardInterpreter.Factory factory) { map.put(name, factory); } /** - * Register a keyboard interpreter class. The class is + * Register a keyboard interpreter class. The classname will be wrapped in + * a new KeyboardInterpreter.Factory. * * @param name the keyboard layout identifier. - * @param factory the name of the class to be registered. + * @param className the name of the class to be registered. */ - public void registerKeyboardLayout(String name, String className) { - registerKeyboardLayout(name, new KIClassWrapper(className)); + public void add(String name, String className) { + add(name, new KIClassWrapper(className)); } /** + * Remove the keyboard interpreter factory for a given layout identifier. + * @param name keyboard layout identifier. + * @return the factory removed or <code>null</node> + */ + public synchronized KeyboardInterpreter.Factory remove(String name) { + return map.remove(name); + } + + /** + * Gets a collection of all layout identifiers known to this manager. + */ + public synchronized Collection<String> layouts() { + return new TreeSet<String>(map.keySet()); + } + + /** + * Gets an iterator for the layout identifiers known to this manager. + * + * @return An iterator the returns instances of String. + */ + public Iterator<String> layoutIterator() { + return layouts().iterator(); + } + + /** + * Add all keyboard layouts in the extension data to the map. + */ + @Override + public void extensionAdded(ExtensionPoint point, Extension extension) { + if (point.equals(keyboardLayoutEP)) { + addLayoutsToMap(extension); + } + } + + /** + * Remove from the map any keyboard layouts that are identical to the extension data. + */ + @Override + public void extensionRemoved(ExtensionPoint point, Extension extension) { + if (point.equals(keyboardLayoutEP)) { + removeLayoutsFromMap(extension); + } + } + + private synchronized void addLayoutsToMap(Extension extension) { + for (ConfigurationElement element : extension.getConfigurationElements()) { + if (element.getName().equals("layout")) { + String name = element.getAttribute("name"); + String className = element.getAttribute("class"); + if (name != null && className != null) { + add(name, className); + } + } + } + } + + private synchronized void removeLayoutsFromMap(Extension extension) { + for (ConfigurationElement element : extension.getConfigurationElements()) { + if (element.getName().equals("layout")) { + String name = element.getAttribute("name"); + String className = element.getAttribute("class"); + if (name == null || className == null) { + continue; + } + KeyboardInterpreter.Factory factory = map.get(name); + if (factory != null && (factory instanceof KIClassWrapper) && + ((KIClassWrapper) factory).className.equals(className)) { + map.remove(name); + } + } + } + } + + /** * This wrapper class allows us to treat a class name as a keyboard interpreter * factory. */ @@ -228,5 +343,10 @@ className, ex); } } + + @Override + public String describe() { + return className; + } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2008-11-10 22:09:31
|
Revision: 4698 http://jnode.svn.sourceforge.net/jnode/?rev=4698&view=rev Author: fduminy Date: 2008-11-10 22:09:27 +0000 (Mon, 10 Nov 2008) Log Message: ----------- initial version of JTestServer Added Paths: ----------- trunk/core/descriptors/org.jtestserver.server.xml trunk/core/src/test/org/jtestserver/ trunk/core/src/test/org/jtestserver/client/ trunk/core/src/test/org/jtestserver/client/DefaultTestClient.java trunk/core/src/test/org/jtestserver/client/NewProcessLauncher.java trunk/core/src/test/org/jtestserver/client/PipeInputStream.java trunk/core/src/test/org/jtestserver/client/TestClient.java trunk/core/src/test/org/jtestserver/client/TestDriver.java trunk/core/src/test/org/jtestserver/client/TestServerLauncher.java trunk/core/src/test/org/jtestserver/client/TestServerProcess.java trunk/core/src/test/org/jtestserver/common/ trunk/core/src/test/org/jtestserver/common/Status.java trunk/core/src/test/org/jtestserver/common/message/ trunk/core/src/test/org/jtestserver/common/message/Descriptors.java trunk/core/src/test/org/jtestserver/common/message/InputMessage.java trunk/core/src/test/org/jtestserver/common/message/Message.java trunk/core/src/test/org/jtestserver/common/message/MessageDescriptor.java trunk/core/src/test/org/jtestserver/common/message/NullValueException.java trunk/core/src/test/org/jtestserver/common/message/OutputMessage.java trunk/core/src/test/org/jtestserver/common/protocol/ trunk/core/src/test/org/jtestserver/common/protocol/Protocol.java trunk/core/src/test/org/jtestserver/common/protocol/ProtocolException.java trunk/core/src/test/org/jtestserver/common/protocol/TimeoutException.java trunk/core/src/test/org/jtestserver/common/protocol/UDPProtocol.java trunk/core/src/test/org/jtestserver/server/ trunk/core/src/test/org/jtestserver/server/TestFailureException.java trunk/core/src/test/org/jtestserver/server/TestServer.java trunk/core/src/test/org/jtestserver/server/TestServerCommand.java trunk/core/src/test/org/jtestserver/server/commands/ trunk/core/src/test/org/jtestserver/server/commands/AbstractTestServerCommand.java trunk/core/src/test/org/jtestserver/server/commands/GetStatusCommand.java trunk/core/src/test/org/jtestserver/server/commands/MauveTestRunner.java trunk/core/src/test/org/jtestserver/server/commands/RunMauveTestCommand.java trunk/core/src/test/org/jtestserver/server/commands/ShutdownCommand.java trunk/core/src/test/org/jtestserver/server/commands/TestRunner.java trunk/core/src/test/org/jtestserver/tests/ trunk/core/src/test/org/jtestserver/tests/AllTests.java trunk/core/src/test/org/jtestserver/tests/TestInputMessage.java trunk/core/src/test/org/jtestserver/tests/TestOutputMessage.java trunk/core/src/test/org/jtestserver/tests/TestProtocol.java trunk/core/src/test/org/jtestserver/tests/TestUDPProtocol.java trunk/core/src/test/org/jtestserver/tests/TestUtils.java trunk/core/src/test/org/jtestserver/tests/mauve-tests.txt Added: trunk/core/descriptors/org.jtestserver.server.xml =================================================================== --- trunk/core/descriptors/org.jtestserver.server.xml (rev 0) +++ trunk/core/descriptors/org.jtestserver.server.xml 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE plugin SYSTEM "jnode.dtd"> + +<plugin id="org.jtestserver.server" + name="JTestServer" + version="0.1" + provider-name="JNode.org" + provider-url="http://www.jnode.org/" + license-name="gpl"> + + <requires> + <import plugin="gnu.mauve"/> + <import plugin="org.jnode.test"/> + </requires> + + <runtime> + <library name="jnode-core.jar"> + <export name="org.jtestserver.server.*"/> + <export name="org.jtestserver.server.commands.*"/> + <export name="org.jtestserver.common.*"/> + <export name="org.jtestserver.common.message.*"/> + <export name="org.jtestserver.common.protocol.*"/> + </library> + </runtime> + + <extension point="org.jnode.security.permissions"> + <permission class="java.security.AllPermission" /> + </extension> + + <extension point="org.jnode.shell.aliases"> + <alias name="TestServer" class="org.jtestserver.server.TestServer"/> + </extension> + +</plugin> \ No newline at end of file Added: trunk/core/src/test/org/jtestserver/client/DefaultTestClient.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/DefaultTestClient.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/DefaultTestClient.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,65 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.jtestserver.common.Status; +import org.jtestserver.common.message.Descriptors; +import org.jtestserver.common.message.Message; +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public class DefaultTestClient implements TestClient { + private static final Logger LOGGER = Logger.getLogger(DefaultTestClient.class.getName()); + + private final Protocol protocol; + + public DefaultTestClient(Protocol protocol) { + this.protocol = protocol; + } + + @Override + public Status runMauveTest(String test) throws ProtocolException, TimeoutException { + return (Status) Message.send(protocol, Descriptors.RUN_MAUVE_TEST, test); + } + + @Override + public Status getStatus() throws ProtocolException, TimeoutException { + return (Status) Message.send(protocol, Descriptors.GET_STATUS); + } + + @Override + public void shutdown() throws ProtocolException, TimeoutException { + Message.send(protocol, Descriptors.SHUTDOWN); + } + + @Override + public void close() throws ProtocolException { + try { + shutdown(); + } catch (TimeoutException e) { + LOGGER.log(Level.SEVERE, "error in close", e); + } + protocol.close(); + } +} Added: trunk/core/src/test/org/jtestserver/client/NewProcessLauncher.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/NewProcessLauncher.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/NewProcessLauncher.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.io.File; +import java.io.IOException; +import java.util.logging.Logger; + +import org.jtestserver.server.TestServer; + +public class NewProcessLauncher implements TestServerLauncher { + private static final Logger LOGGER = Logger.getLogger(NewProcessLauncher.class.getName()); + + @Override + public Process launch() throws IOException { + String javaHome = "/home/fabien/apps/java/"; + String java = javaHome + "bin/java"; + String jnodeCore = "/home/fabien/data/Projets/JNode/jnode/core/"; + String classesDir = jnodeCore + "build/classes"; + String mainClass = TestServer.class.getName(); + String classpath = "." + File.pathSeparatorChar + jnodeCore + "lib/mauve.jar"; + String command = java + " -cp " + classpath + " " + mainClass; + + LOGGER.finer("command: " + command); + return Runtime.getRuntime().exec(command, new String[0], new File(classesDir)); + } + +} Added: trunk/core/src/test/org/jtestserver/client/PipeInputStream.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/PipeInputStream.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/PipeInputStream.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,68 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.io.BufferedReader; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class PipeInputStream { + private final InputStream input; + private final Logger logger; + private final Level level; + + private PipeThread pipeThread; + + public PipeInputStream(final InputStream input, final Logger logger, Level level) { + this.level = level; + this.input = input; + this.logger = logger; + this.pipeThread = new PipeThread(); + } + + public void start() { + pipeThread.start(); + } + + private class PipeThread extends Thread { + public void run() { + final InputStreamReader isr = new InputStreamReader(input); + final BufferedReader br = new BufferedReader(isr, 100); + String line; + try { + try { + while ((line = br.readLine()) != null) { + logger.log(level, line); + } + } catch (EOFException e) { + // ignore + } + br.close(); + } catch (IOException e) { + // ignore + + } + } + } +} Added: trunk/core/src/test/org/jtestserver/client/TestClient.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/TestClient.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/TestClient.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,31 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import org.jtestserver.common.Status; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public interface TestClient { + Status runMauveTest(String test) throws ProtocolException, TimeoutException; + Status getStatus() throws ProtocolException, TimeoutException; + void shutdown() throws ProtocolException, TimeoutException; + void close() throws ProtocolException; +} Added: trunk/core/src/test/org/jtestserver/client/TestDriver.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/TestDriver.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/TestDriver.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,119 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.InetAddress; +import java.util.ArrayList; +import java.util.List; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.jtestserver.common.Status; +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; +import org.jtestserver.common.protocol.UDPProtocol; + +public class TestDriver { + private static final Logger LOGGER = Logger.getLogger(TestDriver.class.getName()); + + public static void main(String[] args) throws ProtocolException, IOException { + TestDriver testDriver = createUDPTestDriver(InetAddress.getByName("localhost")); + + if ((args.length > 0) && "kill".equals(args[0])) { + testDriver.killRunningServers(); + } else { + testDriver.start(); + } + } + + private static TestDriver createUDPTestDriver(InetAddress serverAddress) throws ProtocolException { + UDPProtocol protocol = UDPProtocol.createClient(serverAddress); + protocol.setTimeout(10000); + + return new TestDriver(protocol, new NewProcessLauncher()); + } + + private final TestClient client; + private final TestServerProcess serverProcess; + private final List<String> tests = new ArrayList<String>(); + + private TestDriver(Protocol protocol, TestServerLauncher launcher) { + this.client = new DefaultTestClient(protocol); + this.serverProcess = new TestServerProcess(launcher); + } + + public void killRunningServers() throws ProtocolException { + try { + // kill server that might still be running + client.shutdown(); + } catch (Throwable t) { + LOGGER.log(Level.SEVERE, "unexpected error", t); + } + + boolean killed = false; + while (!killed) { + try { + client.getStatus(); + } catch (TimeoutException e) { + LOGGER.log(Level.SEVERE, "a timeout happened", e); + killed = true; + } + } + } + + public void start() throws IOException, ProtocolException { + //killRunningServers(); + + //serverProcess.start(); + + readTests(); + + for (String test : tests) { + try { + Status status = client.runMauveTest(test); + LOGGER.info(((status == null) ? "null" : status.toString()) + ": " + test); + } catch (TimeoutException e) { + LOGGER.log(Level.SEVERE, "a timeout happened", e); + } + } + + //killRunningServers(); + } + + private void readTests() throws IOException { + if (tests.isEmpty()) { + InputStream in = TestDriver.class.getResourceAsStream("/org/jnode/test/jtestserver/tests/mauve-tests.txt"); + BufferedReader reader = new BufferedReader(new InputStreamReader(in)); + String test = null; + while ((test = reader.readLine()) != null) { + if (!test.startsWith("#")) { + tests.add(test); + } + } + LOGGER.info("" + tests.size() + " tests"); + } + } + +} Added: trunk/core/src/test/org/jtestserver/client/TestServerLauncher.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/TestServerLauncher.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/TestServerLauncher.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,26 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.io.IOException; + +public interface TestServerLauncher { + Process launch() throws IOException; +} Added: trunk/core/src/test/org/jtestserver/client/TestServerProcess.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/TestServerProcess.java (rev 0) +++ trunk/core/src/test/org/jtestserver/client/TestServerProcess.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,89 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.client; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.Logger; + + +public class TestServerProcess { + private static final Logger LOGGER = Logger.getLogger(TestServerProcess.class.getName()); + + private static final Logger SERVER_LOGGER = Logger.getLogger("Server"); + + private final TestServerLauncher launcher; + private PipeInputStream outputPipe; + private PipeInputStream errorPipe; + + private Process process; + private WatchDog watchDog; + + public TestServerProcess(TestServerLauncher launcher) { + this.launcher = launcher; + + } + + public void start() throws IOException { + process = launcher.launch(); + + outputPipe = new PipeInputStream(process.getInputStream(), SERVER_LOGGER, Level.INFO); + outputPipe.start(); + + errorPipe = new PipeInputStream(process.getErrorStream(), SERVER_LOGGER, Level.SEVERE); + errorPipe.start(); + + watchDog = new WatchDog(); + watchDog.start(); + + LOGGER.finer("process = " + process); + } + + public boolean isAlive() { + boolean alive = false; + + try { + process.exitValue(); + } catch (IllegalThreadStateException e) { + alive = true; + } + return alive; + } + + private class WatchDog extends Thread { + public WatchDog() { + setDaemon(true); + } + + @Override + public void run() { + while (true) { + while (TestServerProcess.this.isAlive()) { + try { + Thread.sleep(10000); + } catch (InterruptedException e) { + // ignore + } + + } + } + } + } +} Added: trunk/core/src/test/org/jtestserver/common/Status.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/Status.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/Status.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,26 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common; + +public enum Status { + READY, + ERROR, + RUNNING; +} Added: trunk/core/src/test/org/jtestserver/common/message/Descriptors.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/Descriptors.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/Descriptors.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,33 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + +import org.jtestserver.common.Status; + +public interface Descriptors { + public static final MessageDescriptor RUN_MAUVE_TEST = + new MessageDescriptor(Status.class, "RUN_MAUVE_TEST", String.class); + + public static final MessageDescriptor SHUTDOWN = + new MessageDescriptor(null, "SHUTDOWN"); + + public static final MessageDescriptor GET_STATUS = + new MessageDescriptor(Status.class, "GET_STATUS"); +} Added: trunk/core/src/test/org/jtestserver/common/message/InputMessage.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/InputMessage.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/InputMessage.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,90 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +import javax.net.ssl.SSLEngineResult.Status; + +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public class InputMessage extends Message { + private final StringTokenizer message; + + public static InputMessage create(Protocol protocol) throws ProtocolException, TimeoutException { + return new InputMessage(protocol.receive()); + } + + private InputMessage(String message) { + this.message = new StringTokenizer(message, SEPARATOR, false); + } + + public final Object[] parseParameters(MessageDescriptor desc) { + List<Object> parameters = new ArrayList<Object>(); + + for (Class<?> paramClass : desc.getParamClasses()) { + parameters.add(parse(paramClass)); + } + + return parameters.toArray(); + } + + final Object parse(Class<?> type) { + Object result = null; + + try { + if (int.class.equals(type) || Integer.class.equals(type)) { + result = getInt(); + } else if (String.class.equals(type)) { + result = getString(); + } else if (Status.class.equals(type)) { + result = getStatus(); + } else { + //TODO throw exception + } + } catch (NullValueException nve) { + // the parsed value is equals to the NULL constant + result = null; + } + + return result; + } + + public String getString() { + String str = message.nextToken(); + if (NULL.equals(str)) { + throw new NullValueException(); + } + + return str; + } + + public Status getStatus() { + return Status.valueOf(getString()); + } + + public int getInt() { + return Integer.parseInt(getString()); + } +} Added: trunk/core/src/test/org/jtestserver/common/message/Message.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/Message.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/Message.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,44 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + + +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public abstract class Message { + + public static Object send(Protocol protocol, MessageDescriptor desc, Object... params) + throws ProtocolException, TimeoutException { + OutputMessage output = OutputMessage.createOutputMessage(desc, params); + output.sendWith(protocol); + + Object result = null; + if (desc.getResultClass() != null) { + InputMessage input = InputMessage.create(protocol); + result = input.parse(desc.getResultClass()); + } + return result; + } + + static final String SEPARATOR = ";"; + static final String NULL = "NULL"; +} Added: trunk/core/src/test/org/jtestserver/common/message/MessageDescriptor.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/MessageDescriptor.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/MessageDescriptor.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + + +public class MessageDescriptor { + private final Class<?> resultClass; + private final String name; + private final Class<?>[] paramClasses; + + MessageDescriptor(Class<?> resultClass, String name, Class<?>... paramClasses) { + this.resultClass = resultClass; + this.name = name; + this.paramClasses = paramClasses; + } + + public final String getName() { + return name; + } + + final Class<?> getResultClass() { + return resultClass; + } + + final Class<?>[] getParamClasses() { + return paramClasses; + } +} Added: trunk/core/src/test/org/jtestserver/common/message/NullValueException.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/NullValueException.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/NullValueException.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + +public class NullValueException extends RuntimeException { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public NullValueException() { + super(); + } + + public NullValueException(String message, Throwable cause) { + super(message, cause); + } + + public NullValueException(String message) { + super(message); + } + + public NullValueException(Throwable cause) { + super(cause); + } + +} Added: trunk/core/src/test/org/jtestserver/common/message/OutputMessage.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/message/OutputMessage.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/message/OutputMessage.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,91 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.message; + +import org.jtestserver.common.Status; +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public class OutputMessage extends Message { + private final StringBuilder message; + + public static final OutputMessage createResultMessage(MessageDescriptor desc, Object result) { + OutputMessage output = null; + + if (desc.getResultClass() != null) { + output = new OutputMessage(); + output.append(desc.getResultClass(), result); + } + + return output; + } + + public static final OutputMessage createOutputMessage(MessageDescriptor desc, Object... params) { + OutputMessage output = new OutputMessage(); + output.append(desc.getName()); + + int iParam = 0; + for (Class<?> paramClass : desc.getParamClasses()) { + output.append(paramClass, params[iParam]); + iParam++; + } + + return output; + } + + private OutputMessage() { + message = new StringBuilder(); + } + + public void sendWith(Protocol protocol) throws ProtocolException, TimeoutException { + protocol.send(message.toString()); + } + + private OutputMessage append(CharSequence chars) { + if (message.length() > 0) { + message.append(SEPARATOR); + } + + message.append(chars); + + return this; + } + + private OutputMessage append(int i) { + return append(Integer.toString(i)); + } + + private final void append(Class<?> type, Object value) { + if (value == null) { + append(NULL); + } else if (int.class.equals(type)) { + append(int.class.cast(value)); + } else if (Integer.class.equals(type)) { + append(Integer.class.cast(value).intValue()); + } else if (String.class.equals(type)) { + append((String) value); + } else if (Status.class.equals(type)) { + append(((Status) value).toString()); + } else { + //TODO throw exception + } + } +} Added: trunk/core/src/test/org/jtestserver/common/protocol/Protocol.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/protocol/Protocol.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/protocol/Protocol.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,30 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.protocol; + + +public interface Protocol { + public void send(String command) throws ProtocolException, TimeoutException; + + public String receive() throws ProtocolException, TimeoutException; + + public void close() throws ProtocolException; + +} Added: trunk/core/src/test/org/jtestserver/common/protocol/ProtocolException.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/protocol/ProtocolException.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/protocol/ProtocolException.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.protocol; + +public class ProtocolException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public ProtocolException() { + super(); + } + + public ProtocolException(String message, Throwable cause) { + super(message, cause); + } + + public ProtocolException(String message) { + super(message); + } + + public ProtocolException(Throwable cause) { + super(cause); + } + +} Added: trunk/core/src/test/org/jtestserver/common/protocol/TimeoutException.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/protocol/TimeoutException.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/protocol/TimeoutException.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.protocol; + +public class TimeoutException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TimeoutException() { + super(); + } + + public TimeoutException(String message, Throwable cause) { + super(message, cause); + } + + public TimeoutException(String message) { + super(message); + } + + public TimeoutException(Throwable cause) { + super(cause); + } + +} Added: trunk/core/src/test/org/jtestserver/common/protocol/UDPProtocol.java =================================================================== --- trunk/core/src/test/org/jtestserver/common/protocol/UDPProtocol.java (rev 0) +++ trunk/core/src/test/org/jtestserver/common/protocol/UDPProtocol.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,171 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.common.protocol; + +import java.io.IOException; +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.net.SocketException; +import java.net.SocketTimeoutException; +import java.nio.ByteBuffer; + +public class UDPProtocol implements Protocol { + private static final int DEFAULT_PORT = 10000; + + private static final int INT_SIZE = 4; // size of an int in bytes + + private final DatagramSocket socket; + private InetAddress remoteIp; + private int remotePort; + + /** + * Create an UDPProtocol for a server listening on {@link UDPProtocol#DEFAULT_PORT} + * @return + * @throws ProtocolException + */ + public static UDPProtocol createServer() throws ProtocolException { + return createServer(DEFAULT_PORT); + } + + /** + * Create an UDPProtocol for a server listening on given port + * @param localPort + * @return + * @throws ProtocolException + */ + public static UDPProtocol createServer(int localPort) throws ProtocolException { + return new UDPProtocol(localPort); + } + + /** + * Create an UDPProtocol for a client of the server at specified address + * listening on {@link UDPProtocol#DEFAULT_PORT} + * + * @param serverIp + * @return + * @throws ProtocolException + */ + public static UDPProtocol createClient(InetAddress serverIp) throws ProtocolException { + return createClient(serverIp, DEFAULT_PORT); + } + + /** + * Create an UDPProtocol for a client of the server at specified address and port + * @param serverIp + * @param serverPort + * @return + * @throws ProtocolException + */ + public static UDPProtocol createClient(InetAddress serverIp, int serverPort) throws ProtocolException { + return new UDPProtocol(serverIp, serverPort); + } + + /** + * Create an UDPProtocol for a server listening on given port. + * Note : the constructor should be 'private' but we need it to simulate timeouts in the tests. + * @param localPort + * @throws ProtocolException + */ + protected UDPProtocol(int localPort) throws ProtocolException { + try { + socket = new DatagramSocket(localPort); + } catch (SocketException se) { + throw new ProtocolException(se); + } + } + + /** + * Create an UDPProtocol for a client of the server at specified address and port + * Note : the constructor should be 'private' but we need it to simulate timeouts in the tests. + * @param serverIp + * @param serverPort + * @throws ProtocolException + */ + protected UDPProtocol(InetAddress serverIp, int serverPort) throws ProtocolException { + try { + socket = new DatagramSocket(); + this.remoteIp = serverIp; + this.remotePort = serverPort; + } catch (SocketException se) { + throw new ProtocolException(se); + } + } + + public void setTimeout(int timeout) throws ProtocolException { + try { + socket.setSoTimeout(timeout); + } catch (SocketException se) { + throw new ProtocolException(se); + } + } + + @Override + public void send(String command) throws ProtocolException, TimeoutException { + try { + // send size of data + ByteBuffer byteBuffer = ByteBuffer.allocate(INT_SIZE).putInt(command.length()); + byte[] data = byteBuffer.array(); + DatagramPacket packet = new DatagramPacket(data, data.length, remoteIp, remotePort); + + socket.send(packet); + + // send data + data = command.getBytes(); + packet = new DatagramPacket(data, data.length, remoteIp, remotePort); + socket.send(packet); + } catch (SocketTimeoutException e) { + throw new TimeoutException("timeout in receive", e); + } catch (IOException e) { + throw new ProtocolException("error in receive", e); + } + } + + @Override + public String receive() throws ProtocolException, TimeoutException { + try { + // receive size of data + byte[] data = new byte[INT_SIZE]; + DatagramPacket packet = new DatagramPacket(data, data.length); + socket.receive(packet); + int size = ByteBuffer.wrap(data).getInt(); + + // receive actual data + data = new byte[size]; + packet = new DatagramPacket(data, data.length); + socket.receive(packet); + + remoteIp = packet.getAddress(); + remotePort = packet.getPort(); + + return new String(packet.getData()); + } catch (SocketTimeoutException e) { + throw new TimeoutException("timeout in receive", e); + } catch (IOException e) { + throw new ProtocolException("error in receive", e); + } + } + + @Override + public void close() { + socket.disconnect(); + socket.close(); + } +} Added: trunk/core/src/test/org/jtestserver/server/TestFailureException.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/TestFailureException.java (rev 0) +++ trunk/core/src/test/org/jtestserver/server/TestFailureException.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,45 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.server; + +public class TestFailureException extends Exception { + + /** + * + */ + private static final long serialVersionUID = 1L; + + public TestFailureException() { + super(); + } + + public TestFailureException(String message, Throwable cause) { + super(message, cause); + } + + public TestFailureException(String message) { + super(message); + } + + public TestFailureException(Throwable cause) { + super(cause); + } + +} Added: trunk/core/src/test/org/jtestserver/server/TestServer.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/TestServer.java (rev 0) +++ trunk/core/src/test/org/jtestserver/server/TestServer.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,115 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.server; + +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +import org.jtestserver.common.message.InputMessage; +import org.jtestserver.common.message.OutputMessage; +import org.jtestserver.common.protocol.Protocol; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; +import org.jtestserver.common.protocol.UDPProtocol; +import org.jtestserver.server.commands.GetStatusCommand; +import org.jtestserver.server.commands.MauveTestRunner; +import org.jtestserver.server.commands.RunMauveTestCommand; +import org.jtestserver.server.commands.ShutdownCommand; + +public class TestServer { + private static final Logger LOGGER = Logger.getLogger(TestServer.class.getName()); + + public static void main(String[] args) throws ProtocolException { + UDPProtocol protocol = UDPProtocol.createServer(); + //protocol.setTimeout(10000); + + TestServer server = new TestServer(protocol); + server.start(); + } + + private boolean shutdownRequested = false; + private final Protocol protocol; + private final Map<String, TestServerCommand> nameToCommand; + + public TestServer(Protocol protocol) { + this.protocol = protocol; + nameToCommand = new HashMap<String, TestServerCommand>(); + + addCommand(new RunMauveTestCommand()); + addCommand(new ShutdownCommand(this)); + addCommand(new GetStatusCommand()); + } + + private void addCommand(TestServerCommand command) { + nameToCommand.put(command.getName(), command); + } + + public void start() { + while (!shutdownRequested) { + try { + InputMessage input = InputMessage.create(protocol); + String commandName = input.getString(); + TestServerCommand command = nameToCommand.get(commandName); + + OutputMessage output = null; + if (command == null) { + //TODO + } else { + try { + output = command.execute(input); + } catch (Throwable t) { + LOGGER.log(Level.SEVERE, "error in command", t); + } + } + + // if the command returns a result + if (output != null) { + output.sendWith(protocol); + } + + } catch (ProtocolException pe) { + LOGGER.log(Level.SEVERE, "protocol error", pe); + } catch (TimeoutException te) { + // ignore + } catch (Throwable t) { + LOGGER.log(Level.SEVERE, "unexpected error", t); + } + } + + shutdown(); + } + + private void shutdown() { + try { + protocol.close(); + } catch (ProtocolException e) { + LOGGER.log(Level.SEVERE, "error in shutdown", e); + } + MauveTestRunner.getInstance().shutdown(); + LOGGER.info("Server has shutdown"); + } + + public void requestShutdown() { + shutdownRequested = true; + LOGGER.info("shutdown requested"); + } +} Added: trunk/core/src/test/org/jtestserver/server/TestServerCommand.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/TestServerCommand.java (rev 0) +++ trunk/core/src/test/org/jtestserver/server/TestServerCommand.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,30 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.server; + +import org.jtestserver.common.message.InputMessage; +import org.jtestserver.common.message.OutputMessage; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; + +public interface TestServerCommand { + String getName(); + OutputMessage execute(InputMessage input) throws ProtocolException, TimeoutException; +} Added: trunk/core/src/test/org/jtestserver/server/commands/AbstractTestServerCommand.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/commands/AbstractTestServerCommand.java (rev 0) +++ trunk/core/src/test/org/jtestserver/server/commands/AbstractTestServerCommand.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,50 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 +of the License, or (at your option) any later version. + +JTestServer 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 this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ +package org.jtestserver.server.commands; + +import org.jtestserver.common.message.InputMessage; +import org.jtestserver.common.message.MessageDescriptor; +import org.jtestserver.common.message.OutputMessage; +import org.jtestserver.common.protocol.ProtocolException; +import org.jtestserver.common.protocol.TimeoutException; +import org.jtestserver.server.TestServerCommand; + +public abstract class AbstractTestServerCommand<T> implements TestServerCommand { + private final MessageDescriptor descriptor; + + public AbstractTestServerCommand(MessageDescriptor descriptor) { + this.descriptor = descriptor; + } + + @Override + public final String getName() { + return descriptor.getName(); + } + + @Override + public final OutputMessage execute(InputMessage input) throws ProtocolException, TimeoutException { + Object[] params = input.parseParameters(descriptor); + T result = execute(params); + + return OutputMessage.createResultMessage(descriptor, result); + } + + protected abstract T execute(Object[] params) throws ProtocolException, TimeoutException; +} Added: trunk/core/src/test/org/jtestserver/server/commands/GetStatusCommand.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/commands/GetStatusCommand.java (rev 0) +++ trunk/core/src/test/org/jtestserver/server/commands/GetStatusCommand.java 2008-11-10 22:09:27 UTC (rev 4698) @@ -0,0 +1,36 @@ +/* +JTestServer is a client/server framework for testing any JVM implementation. + +Copyright (C) 2008 Fabien DUMINY (fd...@jn...) + +JTestServer 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 ... [truncated message content] |
From: <ls...@us...> - 2008-11-22 15:47:50
|
Revision: 4719 http://jnode.svn.sourceforge.net/jnode/?rev=4719&view=rev Author: lsantha Date: 2008-11-22 15:47:46 +0000 (Sat, 22 Nov 2008) Log Message: ----------- openjdk integration Modified Paths: -------------- trunk/core/descriptors/com.sun.tools.javac.xml trunk/core/src/classpath/java/java/net/HttpURLConnection.java Modified: trunk/core/descriptors/com.sun.tools.javac.xml =================================================================== --- trunk/core/descriptors/com.sun.tools.javac.xml 2008-11-22 15:39:33 UTC (rev 4718) +++ trunk/core/descriptors/com.sun.tools.javac.xml 2008-11-22 15:47:46 UTC (rev 4719) @@ -41,6 +41,7 @@ <export name="com.sun.tools.javac.sym.*"/> <export name="com.sun.tools.javac.tree.*"/> <export name="com.sun.tools.javac.util.*"/> + <export name="com.sun.tools.javac.zip.*"/> </library> </runtime> Modified: trunk/core/src/classpath/java/java/net/HttpURLConnection.java =================================================================== --- trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2008-11-22 15:39:33 UTC (rev 4718) +++ trunk/core/src/classpath/java/java/net/HttpURLConnection.java 2008-11-22 15:47:46 UTC (rev 4719) @@ -586,4 +586,9 @@ // http://www.w3.org/Protocols/HTTP-NG/ng-notes.txt return super.getHeaderFieldDate(key, value); } + //jnode openjdk + public void setChunkedStreamingMode(Integer chunkSize) { + //todo implement it + + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2008-11-25 10:44:14
|
Revision: 4747 http://jnode.svn.sourceforge.net/jnode/?rev=4747&view=rev Author: lsantha Date: 2008-11-25 10:44:10 +0000 (Tue, 25 Nov 2008) Log Message: ----------- Openjdk sourcecode reorganized to separate source trees. Modified Paths: -------------- trunk/core/build.xml trunk/core/core.iml Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2008-11-25 10:43:04 UTC (rev 4746) +++ trunk/core/build.xml 2008-11-25 10:44:10 UTC (rev 4747) @@ -33,6 +33,11 @@ <pathelement location="${my-src.dir}/openjdk/sun"/> <pathelement location="${my-src.dir}/openjdk/vm"/> </path> + <path id="classpath-sources2"> + <pathelement location="${my-src.dir}/openjdk/corba"/> + <pathelement location="${my-src.dir}/openjdk/jaxws"/> + <pathelement location="${my-src.dir}/openjdk/langtools"/> + </path> <path id="my-sources1"> <path refid="classpath-sources"/> <pathelement location="${my-src.dir}/core"/> @@ -134,6 +139,14 @@ <src refid="my-sources" /> <classpath refid="my-cp"/> </jnode.compile> + <jnode.compile> + <bootclasspath> + <pathelement location="${classpath-sources}" /> + <pathelement location="${mx4j.jar}"/> <!-- should be in GNU Classpath since java 5.0 --> + </bootclasspath> + <src refid="classpath-sources2" /> + <classpath refid="my-cp"/> + </jnode.compile> <!-- Copy all non java files to class dir --> <copy todir="${my-classes.dir}"> <fileset dir="${my-src.dir}/classpath/gnu" excludes="${my-non-resources}"/> @@ -148,6 +161,9 @@ <fileset dir="${my-src.dir}/openjdk/com" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/sun" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/vm" excludes="${my-non-resources}"/> + <fileset dir="${my-src.dir}/openjdk/corba" excludes="${my-non-resources}"/> + <fileset dir="${my-src.dir}/openjdk/jaxws" excludes="${my-non-resources}"/> + <fileset dir="${my-src.dir}/openjdk/langtools" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/icedtea" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/core" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/endorsed/nanoxml" excludes="${my-non-resources}"/> Modified: trunk/core/core.iml =================================================================== --- trunk/core/core.iml 2008-11-25 10:43:04 UTC (rev 4746) +++ trunk/core/core.iml 2008-11-25 10:44:10 UTC (rev 4747) @@ -17,8 +17,11 @@ <sourceFolder url="file://$MODULE_DIR$/src/icedtea" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/mmtk-vm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/com" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/openjdk/corba" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/java" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/javax" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/openjdk/jaxws" isTestSource="false" /> + <sourceFolder url="file://$MODULE_DIR$/src/openjdk/langtools" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/org" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/sun" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/vm" isTestSource="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2008-12-07 14:38:50
|
Revision: 4778 http://jnode.svn.sourceforge.net/jnode/?rev=4778&view=rev Author: lsantha Date: 2008-12-07 14:38:47 +0000 (Sun, 07 Dec 2008) Log Message: ----------- Removed oldjavap. Modified Paths: -------------- trunk/core/descriptors/sun.tools.xml Removed Paths: ------------- trunk/core/src/openjdk/langtools/sun/tools/javap/oldjavap/ Modified: trunk/core/descriptors/sun.tools.xml =================================================================== --- trunk/core/descriptors/sun.tools.xml 2008-12-07 14:18:22 UTC (rev 4777) +++ trunk/core/descriptors/sun.tools.xml 2008-12-07 14:38:47 UTC (rev 4778) @@ -18,7 +18,6 @@ <export name="sun.tools.javac.*"/> <export name="sun.tools.javac.resources.*"/> <export name="sun.tools.javap.*"/> - <export name="sun.tools.javap.oldjavap.*"/> <export name="sun.tools.tree.*"/> <export name="sun.tools.util.*"/> </library> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2008-12-18 19:25:12
|
Revision: 4795 http://jnode.svn.sourceforge.net/jnode/?rev=4795&view=rev Author: lsantha Date: 2008-12-18 19:25:07 +0000 (Thu, 18 Dec 2008) Log Message: ----------- Removed unused classes. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.xml Removed Paths: ------------- trunk/core/src/classpath/gnu/gnu/classpath/ListenerData.java trunk/core/src/classpath/gnu/gnu/classpath/NotImplementedException.java trunk/core/src/classpath/gnu/gnu/classpath/Pair.java trunk/core/src/classpath/gnu/gnu/classpath/Pointer32.java trunk/core/src/classpath/gnu/gnu/classpath/Pointer64.java trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeInputStream.java trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeOutputStream.java trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeReader.java trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeWriter.java trunk/core/src/classpath/gnu/gnu/java/io/ASN1ParsingException.java trunk/core/src/classpath/gnu/gnu/java/io/ClassLoaderObjectInputStream.java trunk/core/src/classpath/gnu/gnu/java/io/ObjectIdentityMap2Int.java trunk/core/src/classpath/vm/gnu/java/lang/management/ trunk/core/src/classpath/vm/gnu/java/security/action/GetBooleanAction.java trunk/core/src/classpath/vm/gnu/java/security/action/GetIntegerAction.java trunk/core/src/classpath/vm/java/lang/management/ trunk/core/src/classpath/vm/java/lang/reflect/VMProxy.java trunk/core/src/classpath/vm/java/util/ Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/descriptors/org.classpath.core.xml 2008-12-18 19:25:07 UTC (rev 4795) @@ -72,7 +72,6 @@ <export name="gnu.classpath.SystemProperties"/> <export name="gnu.classpath.VMSystemProperties"/> <export name="gnu.classpath.VMStackWalker"/> - <export name="gnu.classpath.NotImplementedException"/> <export name="gnu.classpath.ServiceFactory"/> <export name="gnu.classpath.ServiceFactory$ServiceIterator"/> <export name="gnu.classpath.ServiceProviderLoadingAction"/> Deleted: trunk/core/src/classpath/gnu/gnu/classpath/ListenerData.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/ListenerData.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/ListenerData.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,136 +0,0 @@ -/* ListenerData.java - Class to contain data about management bean listeners - Copyright (C) 2006 Free Software Foundation - -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; - -import javax.management.NotificationFilter; -import javax.management.NotificationListener; - -/** - * Container for data on management listeners. Wraps - * a {@link javax.management.NotificationListener}, - * {@link javax.management.NotificationFilter} and - * passback object in one class. - * - * @author Andrew John Hughes (gnu...@me...) - * @since 1.5 - */ -public class ListenerData -{ - /** - * The listener itself. - */ - private NotificationListener listener; - - /** - * A filter to apply to incoming events. - */ - private NotificationFilter filter; - - /** - * An object to pass back to the listener on an - * event occurring. - */ - private Object passback; - - /** - * Constructs a new {@link ListenerData} with the specified - * listener, filter and passback object. - * - * @param listener the listener itself. - * @param filter the filter for incoming events. - * @param passback the object to passback on an incoming event. - */ - public ListenerData(NotificationListener listener, - NotificationFilter filter, Object passback) - { - this.listener = listener; - this.filter = filter; - this.passback = passback; - } - - /** - * Returns the listener. - * - * @return the listener. - */ - public NotificationListener getListener() - { - return listener; - } - - /** - * Returns the filter. - * - * @return the filter. - */ - public NotificationFilter getFilter() - { - return filter; - } - - /** - * Returns the passback object. - * - * @return the passback object. - */ - public Object getPassback() - { - return passback; - } - - /** - * Returns true if the supplied object is an instance of - * {@link ListenerData} and has the same listener, filter - * and passback object. - * - * @param obj the object to check. - * @return true if <code>obj</code> is equal to this. - */ - public boolean equals(Object obj) - { - if (obj instanceof ListenerData) - { - ListenerData data = (ListenerData) obj; - return (data.getListener() == listener && - data.getFilter() == filter && - data.getPassback() == passback); - } - return false; - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/NotImplementedException.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/NotImplementedException.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/NotImplementedException.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,61 +0,0 @@ -/* NotImplementedException.java -- Marker for stub methods - 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; - -/** - * This class is used as a marker to indicate that a given method - * is merely a stub, requiring implementation. For historical - * reasons, GNU Classpath includes a number of stub methods. We - * don't wish to remove them, but we do want to make them easily - * discoverable. JAPI will notice methods declared as throwing - * this exception and mark them appropriately. - */ -public class NotImplementedException - extends RuntimeException -{ - private static final long serialVersionUID = 5112972057211125814L; - - /** - * This class is not instantiable. It should only be used - * in a method 'throws' clause -- not actually ever thrown. - */ - private NotImplementedException() - { - } -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/Pair.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/Pair.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/Pair.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,126 +0,0 @@ -/* Pair.java -- A heterogenous pair of objects. - 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; - -/** - * A container for a pair of heterogenous objects. - * - * @author Andrew John Hughes (gnu...@me...) - */ -public class Pair<A,B> -{ - - /** - * The left-hand side of the pair. - */ - private A left; - - /** - * The right-hand side of the pair. - */ - private B right; - - /** - * Constructs a new pair using the given left and - * right values. - * - * @param left the left-hand side of the pair. - * @param right the right-hand side of the pair. - */ - public Pair(A left, B right) - { - this.left = left; - this.right = right; - } - - /** - * Returns the left-hand side of the pair. - * - * @return the left-hand value. - */ - public A getLeft() - { - return left; - } - - /** - * Returns the right-hand side of the pair. - * - * @return the right-hand value. - */ - public B getRight() - { - return right; - } - - /** - * Returns true if the specified object is also a - * pair with equivalent left and right values. - * - * @param obj the object to compare. - * @return true if the two are equal. - */ - public boolean equals(Object obj) - { - if (obj instanceof Pair) - { - Pair<A,B> p = (Pair<A,B>) obj; - A lp = p.getLeft(); - B rp = p.getRight(); - return (lp == null ? left == null : lp.equals(left)) && - (rp == null ? right == null : rp.equals(right)); - } - return false; - } - - /** - * Returns a hashcode for the pair, created by the - * summation of the hashcodes of the left and right - * hand values. - * - * @return a hashcode for the pair. - */ - public int hashCode() - { - return (left == null ? 0 : left.hashCode()) - + (right == null ? 0 : right.hashCode()); - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/Pointer32.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/Pointer32.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/Pointer32.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,52 +0,0 @@ -/* Pointer32.java -- 32 bit Pointer - Copyright (C) 2004 Free Software Foundation - -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; - -/** - * A type used to indicate special data used by native code that should not - * be marked by the garbage collector. - */ -public final class Pointer32 extends Pointer -{ - final int data; - - public Pointer32(int data) - { - this.data = data; - } -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/Pointer64.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/Pointer64.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/Pointer64.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,52 +0,0 @@ -/* Pointer64.java -- 64 bit Pointer - Copyright (C) 2004 Free Software Foundation - -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; - -/** - * A type used to indicate special data used by native code that should not - * be marked by the garbage collector. - */ -public final class Pointer64 extends Pointer -{ - final long data; - - public Pointer64(long data) - { - this.data = data; - } -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeInputStream.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeInputStream.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeInputStream.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,98 +0,0 @@ -/* TeeInputStream.java - Copyright (C) 2006 Free Software Foundation, Inc. - -This file is a 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 of the License, 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; 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.debug; - -import java.io.*; - -/** - * An input stream that copies all its input to a byte sink. - * - * @author Chris Burdess - */ -public class TeeInputStream - extends InputStream -{ - - private final InputStream in; - private final OutputStream out; - - /** - * Constructs a tee input stream. - * @param in the underlying input stream - * @param out the output sink - */ - public TeeInputStream(InputStream in, OutputStream out) - { - this.in = in; - this.out = out; - } - - public int read() - throws IOException - { - int ret = in.read(); - out.write(ret); - out.flush(); - return ret; - } - - public int read(byte[] b, int off, int len) - throws IOException - { - int ret = in.read(b, off, len); - if (ret != -1) - { - out.write(b, off, ret); - out.flush(); - } - return ret; - } - - public void close() - throws IOException - { - in.close(); - out.close(); - } - - public final boolean markSupported() - { - return false; - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeOutputStream.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeOutputStream.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeOutputStream.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,93 +0,0 @@ -/* TeeOutputStream.java - Copyright (C) 2006 Free Software Foundation, Inc. - -This file is a 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 of the License, 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; 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.debug; - -import java.io.*; - -/** - * An output stream that copies all its output to an additional byte sink. - * - * @author Chris Burdess - */ -public class TeeOutputStream - extends OutputStream -{ - - private final OutputStream out; - private final OutputStream sink; - - /** - * Constructs a tee output stream. - * @param out the underlying output stream - * @param sink the output sink - */ - public TeeOutputStream(OutputStream out, OutputStream sink) - { - this.out = out; - this.sink = sink; - } - - public void write(int c) - throws IOException - { - out.write(c); - sink.write(c); - } - - public void write(byte[] b, int off, int len) - throws IOException - { - out.write(b, off, len); - sink.write(b, off, len); - } - - public void flush() - throws IOException - { - out.flush(); - sink.flush(); - } - - public void close() - throws IOException - { - out.close(); - sink.close(); - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeReader.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeReader.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeReader.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,98 +0,0 @@ -/* TeeReader.java - Copyright (C) 2006 Free Software Foundation, Inc. - -This file is a 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 of the License, 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; 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.debug; - -import java.io.*; - -/** - * A reader that copies all characters read to an output sink. - * - * @author Chris Burdess - */ -public class TeeReader - extends Reader -{ - - private final Reader in; - private final Writer out; - - /** - * Constructs a tee reader. - * @param in the input - * @param out the output sink - */ - public TeeReader(Reader in, Writer out) - { - this.in = in; - this.out = out; - } - - public int read() - throws IOException - { - int ret = in.read(); - out.write(ret); - out.flush(); - return ret; - } - - public int read(char[] b, int off, int len) - throws IOException - { - int ret = in.read(b, off, len); - if (ret != -1) - { - out.write(b, off, ret); - out.flush(); - } - return ret; - } - - public void close() - throws IOException - { - in.close(); - out.close(); - } - - public final boolean markSupported() - { - return false; - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeWriter.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeWriter.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/classpath/debug/TeeWriter.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,93 +0,0 @@ -/* TeeWriter.java - Copyright (C) 2006 Free Software Foundation, Inc. - -This file is a 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 of the License, 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; 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.debug; - -import java.io.*; - -/** - * A writer that copies all its output to an additional character sink. - * - * @author Chris Burdess - */ -public class TeeWriter - extends Writer -{ - - private final Writer out; - private final Writer sink; - - /** - * Constructs a tee writer. - * @param out the underlying writer - * @param sink the output sink - */ - public TeeWriter(Writer out, Writer sink) - { - this.out = out; - this.sink = sink; - } - - public void write(int c) - throws IOException - { - out.write(c); - sink.write(c); - } - - public void write(char[] b, int off, int len) - throws IOException - { - out.write(b, off, len); - sink.write(b, off, len); - } - - public void flush() - throws IOException - { - out.flush(); - sink.flush(); - } - - public void close() - throws IOException - { - out.close(); - sink.close(); - } - -} Deleted: trunk/core/src/classpath/gnu/gnu/java/io/ASN1ParsingException.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/java/io/ASN1ParsingException.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/java/io/ASN1ParsingException.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,56 +0,0 @@ -/* ASN1ParsingException.java -- ASN.1 parsing exception. - Copyright (C) 2003 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.java.io; - -/** - * Signals a malformed ASN.1 sequence. - */ -public class ASN1ParsingException extends java.io.IOException -{ - - public ASN1ParsingException() - { - super(); - } - - public ASN1ParsingException(String msg) - { - super(msg); - } -} Deleted: trunk/core/src/classpath/gnu/gnu/java/io/ClassLoaderObjectInputStream.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/java/io/ClassLoaderObjectInputStream.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/java/io/ClassLoaderObjectInputStream.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,73 +0,0 @@ -/* gnu.java.io.ClassLoaderObjectInputStream - Copyright (C) 1998 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.java.io; - -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.StreamCorruptedException; - -/** - * ClassLoaderObjectInputStream is ObjectInputStream, with - * the ability to use a specific ClassLoader. - * - * @author Geoff Berry - * @version 1.1.0, 29 Jul 1998 - */ - -public class ClassLoaderObjectInputStream extends ObjectInputStream { - ClassLoader myClassLoader; - - /** Create the new ClassLoaderObjectInputStream. - * @param in the InputStream to read the Objects from. - * @param myClassLoader the ClassLoader to load classes - * with. - */ - public ClassLoaderObjectInputStream(InputStream in, ClassLoader myClassLoader) throws IOException,StreamCorruptedException { - super(in); - this.myClassLoader = myClassLoader; - } - - /** Overriden method to use the loadClass() method from - * the ClassLoader. - */ - public Class resolveClass(String name) throws IOException, ClassNotFoundException { - return myClassLoader.loadClass(name); - } -} Deleted: trunk/core/src/classpath/gnu/gnu/java/io/ObjectIdentityMap2Int.java =================================================================== --- trunk/core/src/classpath/gnu/gnu/java/io/ObjectIdentityMap2Int.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/gnu/gnu/java/io/ObjectIdentityMap2Int.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,292 +0,0 @@ -/* ObjectIdentityMapToInt.java -- Helper class for faster serialization - 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.java.io; - -/** - * This class provides a map from Object to non-negative int values. - * Objects are considered equal only if their references are equal. - * - * This can be used to equip objects with an integer id. This class - * is implemented to use as little memory as possible, particularly - * not to create hashtable buckets and Integer instances for each - * mapping. - * - * @author Fridtjof Siebert (si...@ai...) - */ -public class ObjectIdentityMap2Int -{ - - - /** - * Prime numbers used as size of array. We need the size to be a - * prime number since the delta used for conflict resulution must - * not have any common divisors with the length. - */ - private static final int[] PRIMES = { - 0x1f, - 0x3d, - 0x7f, - 0xfb, - 0x1fd, - 0x3fd, - 0x7f7, - 0xffd, - 0x1fff, - 0x3ffd, - 0x7fed, - 0xfff1, - 0x1ffff, - 0x3fffb, - 0x7ffff, - 0xffffd, - 0x1ffff7, - 0x3ffffd, - 0x7ffff1, - 0xfffffd, - 0x1ffffd9, - 0x3fffffb, - 0x7ffffd9, - 0xfffffc7, - 0x1ffffffd, - 0x3fffffdd, - 0x7fffffff}; - - - /** - * Object to be used instead of "null" - */ - private static final Object NIL = new Object(); - - - /** - * The objects in this map: - * - * invariant - * objectTable.size == PRIMES[cap] - */ - private Object[] objectTable; - - - /** - * The corresponding integer ids. - * - * invariant - * intTable.size == PRIMES[cap] - */ - private int[] intTable; - - - /** - * The number of entries in this map. - * - * invariant - * size < limit - */ - private int size = 0; - - - /** - * The index in primes of the size of the tables. - */ - private int cap = 0; - - - /** - * The limit for size at which the table size is increased. - * - * invariant - * limit = PRIMES[cap] / 4 * 3; - */ - private int limit = 0; - - - /** - * Constructs an empty <code>ObjectIdentityMap2Int</code>. - */ - public ObjectIdentityMap2Int() - { - alloc(0); - } - - - /** - * Helper function to alloc the object and int array for the given - * capacity. Set limit, reset size to 0. - * - * No elements will be stored in the newly allocated arrays. - * - * @param c the capacity: this is an index in PRIMES, PRIMES[c] - * gives the size of the arrays. - * - * @throws InternalError if c >= PRIMES.length (in this case, a - * normal Hashtable would throw an OutOfMemoryError or a - * NegativeArraySizeException since the array size exceeds the range - * of positive integers). - */ - private void alloc(int c) - { - if (c >= PRIMES.length) - throw new InternalError("Hash table size overflow"); - - cap = c; - int len = PRIMES[c]; - objectTable = new Object[len]; - intTable = new int[len]; - limit = len / 4 * 3; - - size = 0; - } - - - /** - * Add a mapping to this Map. - * - * ensures - * (get(o) == i); - * - * @param o object reference or null that is to be mapped. - * - * @param i the integer id to be associated with o - * - * @throws IllegalArgumentException if i<0 - * - * @throws InternalError if hash tables has grown to more then - * 0x7fffffff entries (ie., size >= 0x7fffffff*3/4). - */ - public void put(Object o, int i) - { - if (i < 0) - throw new IllegalArgumentException("int argument must be postive: "+i); - - o = (o == null) ? NIL : o; - int s = slot(o); - Object[] ot = objectTable; - intTable[s] = i; - if (objectTable[s] == null) - { - objectTable[s] = o; - size++; - if (size >= limit) - { - rehash(); - } - } - } - - - /** - * Helper function to find the index of a free or existing slot for - * object o - * - * ensure - * ((objectTable[result] != null) IMPLIES (objectTable[result] == o)); - * - * @param o an object, must not be null. - * - * @return an index of o - */ - private int slot(Object o) - { - Object[] ot = objectTable; - int hc = System.identityHashCode(o); - int len = ot.length; - int result = hc % len; - result = result < 0 ? -result : result; - int delta = 16 - (hc & 15); - Object existing = ot[result]; - while ((existing != null) && (existing != o)) - { - result += delta; - if (result >= len) - result -= len; - existing = ot[result]; - } - return result; - } - - - /** - * Helper function for put() to increaes the capacity of this table - * to the next size (approx. double the size). Keep the mapping and - * the size unchanged. - * - * ensure - * (cap == \old cap+1); - */ - private void rehash() - { - Object[] ot = objectTable; - int [] it = intTable; - alloc(cap + 1); - - for (int i = 0; i < ot.length; i++) - put(ot[i], it[i]); - } - - - /** - * Obtain an element from this map - * - * @param o an object or null - * - * @return the corresponding integer id for o or -1 if o has not - * been put into this map. - */ - public int get(Object o) - { - o = (o == null) ? NIL : o; - int s = slot(o); - return objectTable[s] == null ? -1 : intTable[s]; - } - - /** - * Clear this map - * - * ensures - * ((size == 0) && \forall Object o: get(o) == -1) - */ - public void clear() - { - Object[] ot = objectTable; - size = 0; - for (int i = 0; i < ot.length; i++) - ot[i] = null; - } - -} Deleted: trunk/core/src/classpath/vm/gnu/java/security/action/GetBooleanAction.java =================================================================== --- trunk/core/src/classpath/vm/gnu/java/security/action/GetBooleanAction.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/vm/gnu/java/security/action/GetBooleanAction.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,46 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package gnu.java.security.action; - -import java.security.PrivilegedAction; - -/** - * Utility class for getting Boolean properties in a privileged action. - * - * @see Boolean#getBoolean(String) - * @author Ewout Prangsma (ep...@us...) - */ -public class GetBooleanAction implements PrivilegedAction<Boolean> { - - private final String key; - - public GetBooleanAction(String key) { - this.key = key; - } - - /** - * @see java.security.PrivilegedAction#run() - */ - public Boolean run() { - return Boolean.valueOf(Boolean.getBoolean(key)); - } -} Deleted: trunk/core/src/classpath/vm/gnu/java/security/action/GetIntegerAction.java =================================================================== --- trunk/core/src/classpath/vm/gnu/java/security/action/GetIntegerAction.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/vm/gnu/java/security/action/GetIntegerAction.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,57 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package gnu.java.security.action; - -import java.security.PrivilegedAction; - - -/** - * Utility class for getting Integer properties in a privileged action. - * - * @see Integer#getInteger(String, Integer) - * @author Ewout Prangsma (ep...@us...) - */ -public class GetIntegerAction implements PrivilegedAction<Integer> { - - private final String key; - private final Integer defaultValue; - - public GetIntegerAction(String key) { - this(key, null); - } - - public GetIntegerAction(String key, int defaultValue) { - this(key, new Integer(defaultValue)); - } - - public GetIntegerAction(String key, Integer defaultValue) { - this.key = key; - this.defaultValue = defaultValue; - } - - /** - * @see java.security.PrivilegedAction#run() - */ - public Integer run() { - return Integer.getInteger(key, defaultValue); - } -} Deleted: trunk/core/src/classpath/vm/java/lang/reflect/VMProxy.java =================================================================== --- trunk/core/src/classpath/vm/java/lang/reflect/VMProxy.java 2008-12-18 18:34:56 UTC (rev 4794) +++ trunk/core/src/classpath/vm/java/lang/reflect/VMProxy.java 2008-12-18 19:25:07 UTC (rev 4795) @@ -1,143 +0,0 @@ -/* - * $Id$ - * - * JNode.org - * Copyright (C) 2003-2006 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library 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 Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package java.lang.reflect; - -import gnu.classpath.Configuration; - -//import java.lang.reflect.Proxy.ProxyData; -import java.lang.reflect.Proxy; - -final class VMProxy { - /** - * Set to true if the VM provides a native method to implement - * Proxy.getProxyClass completely, including argument verification. If this - * is true, HAVE_NATIVE_GET_PROXY_DATA and HAVE_NATIVE_GENERATE_PROXY_CLASS - * should be false. - * - * @see java.lang.reflect.Proxy - */ - static boolean HAVE_NATIVE_GET_PROXY_CLASS = false; - - /** - * Set to true if the VM provides a native method to implement the first - * part of Proxy.getProxyClass: generation of the array of methods to - * convert, and verification of the arguments. If this is true, - * HAVE_NATIVE_GET_PROXY_CLASS should be false. - * - * @see java.lang.reflect.Proxy - */ - static boolean HAVE_NATIVE_GET_PROXY_DATA = false; - - /** - * Set to true if the VM provides a native method to implement the second - * part of Proxy.getProxyClass: conversion of an array of methods into an - * actual proxy class. If this is true, HAVE_NATIVE_GET_PROXY_CLASS should - * be false. - * - * @see java.lang.reflect.Proxy - */ - static boolean HAVE_NATIVE_GENERATE_PROXY_CLASS = false; - - /** - * Optional native method to replace (and speed up) the pure Java - * implementation of getProxyClass. Only needed if - * VMProxy.HAVE_NATIVE_GET_PROXY_CLASS is true, this does the work of both - * getProxyData and generateProxyClass with no intermediate form in Java. - * The native code may safely assume that this class must be created, and - * does not already exist. - * - * @param loader - * the class loader to define the proxy class in; null implies - * the bootstrap class loader - * @param interfaces - * the interfaces the class will extend - * @return the generated proxy class - * @throws IllegalArgumentException - * if the constraints for getProxyClass were violated, except - * for problems with null - * @throws NullPointerException - * if `interfaces' is null or contains a null entry, or if - * handler is null - * @see Configuration#HAVE_NATIVE_GET_PROXY_CLASS - * @see #getProxyClass(ClassLoader, Class[]) - * @see #getProxyData(ClassLoader, Class[]) - * @see #generateProxyClass(ProxyData) - */ - static Class getProxyClass(ClassLoader loader, Class[] interfaces) { - return null; - } - - /** - * Optional native method to replace (and speed up) the pure Java - * implementation of getProxyData. Only needed if - * Configuration.HAVE_NATIVE_GET_PROXY_DATA is true. The native code may - * safely assume that a new ProxyData object must be created which does not - * duplicate any existing ones. - * - * @param loader - * the class loader to define the proxy class in; null implies - * the bootstrap class loader - * @param interfaces - * the interfaces the class will extend - * @return all data that is required to make this proxy class - * @throws IllegalArgumentException - * if the constraints for getProxyClass were violated, except - * for problems with null - * @throws NullPointerException - * if `interfaces' is null or contains a null entry, or if - * handler is null - * @see Configuration.HAVE_NATIVE_GET_PROXY_DATA - * @see #getProxyClass(ClassLoader, Class[]) - * @see #getProxyClass(ClassLoader, Class[]) - * @see ProxyType#getProxyData() - */ - //static Proxy.ProxyData getProxyData(ClassLoader loader, Class[] interfaces) { - static Proxy getProxyData(ClassLoader loader, Class[] interfaces) { - return null; - } - - /** - * Optional native method to replace (and speed up) the pure Java - * implementation of generateProxyClass. Only needed if - * Configuration.HAVE_NATIVE_GENERATE_PROXY_CLASS is true. The native code - * may safely assume that a new Class must be created, and that the - * ProxyData object does not describe any existing class. - * - * @param loader - * the class loader to define the proxy class in; null implies - * the bootstrap class loader - * @param data - * the struct of information to convert to a Class. This has - * already been verified for all problems except exceeding VM - * limitations - * @return the newly generated class - * @throws IllegalArgumentException - * if VM limitations are exceeded - * @see #getProxyClass(ClassLoader, Class[]) - * @see #getProxyClass(ClassLoader, Class[]) - * @see ProxyData#generateProxyClass(ClassLoader) - */ - //static Class generateProxyClass(ClassLoader loader, Proxy.ProxyData data) { - static Class generateProxyClass(ClassLoader loader, Proxy data) { - return null; - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-01-02 16:33:42
|
Revision: 4814 http://jnode.svn.sourceforge.net/jnode/?rev=4814&view=rev Author: lsantha Date: 2009-01-02 16:33:37 +0000 (Fri, 02 Jan 2009) Log Message: ----------- Fixed security exceptions during startup. Modified Paths: -------------- trunk/core/descriptors/org.jnode.driver.xml trunk/core/src/driver/org/jnode/driver/Driver.java Modified: trunk/core/descriptors/org.jnode.driver.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.xml 2008-12-30 21:01:21 UTC (rev 4813) +++ trunk/core/descriptors/org.jnode.driver.xml 2009-01-02 16:33:37 UTC (rev 4814) @@ -24,6 +24,7 @@ <extension-point id="mappers" name="Device to Driver mappers"/> <extension point="org.jnode.security.permissions"> + <permission class="java.lang.RuntimePermission" name="getClassLoader"/> <permission class="java.util.PropertyPermission" name="jnode.cmdline" actions="read"/> <permission class="org.jnode.security.JNodePermission" name="getVmClass"/> </extension> Modified: trunk/core/src/driver/org/jnode/driver/Driver.java =================================================================== --- trunk/core/src/driver/org/jnode/driver/Driver.java 2008-12-30 21:01:21 UTC (rev 4813) +++ trunk/core/src/driver/org/jnode/driver/Driver.java 2009-01-02 16:33:37 UTC (rev 4814) @@ -25,6 +25,8 @@ import org.jnode.plugin.PluginDescriptor; import org.jnode.plugin.PluginDescriptorListener; import org.jnode.system.BootLog; +import java.security.AccessController; +import java.security.PrivilegedAction; /** @@ -49,7 +51,12 @@ * Default constructor */ public Driver() { - final ClassLoader loader = getClass().getClassLoader(); + final ClassLoader loader = AccessController.doPrivileged( + new PrivilegedAction<ClassLoader>() { + public ClassLoader run() { + return getClass().getClassLoader(); + } + }); if (loader instanceof PluginClassLoader) { final PluginDescriptor descr = ((PluginClassLoader) loader).getDeclaringPluginDescriptor(); descr.addListener(new PluginListener()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-01-07 10:30:30
|
Revision: 4832 http://jnode.svn.sourceforge.net/jnode/?rev=4832&view=rev Author: lsantha Date: 2009-01-07 10:30:24 +0000 (Wed, 07 Jan 2009) Log Message: ----------- OpenJDK integration. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.xml trunk/core/src/core/org/jnode/vm/VmSystem.java Added Paths: ----------- trunk/core/src/openjdk/java/java/net/URI.java trunk/core/src/openjdk/java/java/net/URL.java trunk/core/src/openjdk/java/java/net/URLDecoder.java trunk/core/src/openjdk/java/java/net/URLEncoder.java trunk/core/src/openjdk/java/java/net/URLStreamHandler.java trunk/core/src/openjdk/sun/sun/net/www/URLConnection.java trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/ trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/Handler.java trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/JarFileFactory.java trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/JarURLConnection.java trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/URLJarFile.java trunk/core/src/openjdk/sun/sun/net/www/protocol/jar/URLJarFileCallBack.java Removed Paths: ------------- trunk/core/src/classpath/gnu/gnu/java/net/protocol/jar/ trunk/core/src/classpath/java/java/net/URI.java trunk/core/src/classpath/java/java/net/URL.java trunk/core/src/classpath/java/java/net/URLConnection.java trunk/core/src/classpath/java/java/net/URLDecoder.java trunk/core/src/classpath/java/java/net/URLEncoder.java trunk/core/src/classpath/java/java/net/URLStreamHandler.java Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2009-01-06 10:25:31 UTC (rev 4831) +++ trunk/core/descriptors/org.classpath.core.xml 2009-01-07 10:30:24 UTC (rev 4832) @@ -33,7 +33,8 @@ <export name="sun.reflect.misc.*"/> <export name="sun.net.InetAddressCachePolicy"/> <export name="sun.net.util.IPAddressUtil"/> - <export name="sun.net.www.ParseUtil"/> + <export name="sun.net.www.*"/> + <export name="sun.net.www.protocol.jar.*"/> <export name="sun.net.www.protocol.http.InMemoryCookieStore"/> <export name="sun.net.spi.nameservice.NameService"/> <export name="sun.net.spi.nameservice.NameServiceDescriptor"/> Deleted: trunk/core/src/classpath/java/java/net/URI.java =================================================================== --- trunk/core/src/classpath/java/java/net/URI.java 2009-01-06 10:25:31 UTC (rev 4831) +++ trunk/core/src/classpath/java/java/net/URI.java 2009-01-07 10:30:24 UTC (rev 4832) @@ -1,1441 +0,0 @@ -/* URI.java -- An URI class - Copyright (C) 2002, 2004, 2005, 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 java.net; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * <p> - * A URI instance represents that defined by - * <a href="http://www.ietf.org/rfc/rfc3986.txt">RFC3986</a>, - * with some deviations. - * </p> - * <p> - * At its highest level, a URI consists of: - * </p> - * <code>[<em>scheme</em><strong>:</strong>]<em>scheme-specific-part</em> - * [<strong>#</strong><em>fragment</em>]</code> - * </p> - * <p> - * where <strong>#</strong> and <strong>:</strong> are literal characters, - * and those parts enclosed in square brackets are optional. - * </p> - * <p> - * There are two main types of URI. An <em>opaque</em> URI is one - * which just consists of the above three parts, and is not further - * defined. An example of such a URI would be <em>mailto:</em> URI. - * In contrast, <em>hierarchical</em> URIs give further definition - * to the scheme-specific part, so as represent some part of a hierarchical - * structure. - * </p> - * <p> - * <code>[<strong>//</strong><em>authority</em>][<em>path</em>] - * [<strong>?</strong><em>query</em>]</code> - * </p> - * <p> - * with <strong>/</strong> and <strong>?</strong> being literal characters. - * When server-based, the authority section is further subdivided into: - * </p> - * <p> - * <code>[<em>user-info</em><strong>@</strong>]<em>host</em> - * [<strong>:</strong><em>port</em>]</code> - * </p> - * <p> - * with <strong>@</strong> and <strong>:</strong> as literal characters. - * Authority sections that are not server-based are said to be registry-based. - * </p> - * <p> - * Hierarchical URIs can be either relative or absolute. Absolute URIs - * always start with a `<strong>/</strong>', while relative URIs don't - * specify a scheme. Opaque URIs are always absolute. - * </p> - * <p> - * Each part of the URI may have one of three states: undefined, empty - * or containing some content. The former two of these are represented - * by <code>null</code> and the empty string in Java, respectively. - * The scheme-specific part may never be undefined. It also follows from - * this that the path sub-part may also not be undefined, so as to ensure - * the former. - * </p> - * <h2>Character Escaping and Quoting</h2> - * <p> - * The characters that can be used within a valid URI are restricted. - * There are two main classes of characters which can't be used as is - * within the URI: - * </p> - * <ol> - * <li><strong>Characters outside the US-ASCII character set</strong>. - * These have to be <strong>escaped</strong> in order to create - * an RFC-compliant URI; this means replacing the character with the - * appropriate hexadecimal value, preceded by a `%'.</li> - * <li><strong>Illegal characters</strong> (e.g. space characters, - * control characters) are quoted, which results in them being encoded - * in the same way as non-US-ASCII characters.</li> - * </ol> - * <p> - * The set of valid characters differs depending on the section of the URI: - * </p> - * <ul> - * <li><strong>Scheme</strong>: Must be an alphanumeric, `-', `.' or '+'.</li> - * <li><strong>Authority</strong>:Composed of the username, host, port, `@' - * and `:'.</li> - * <li><strong>Username</strong>: Allows unreserved or percent-encoded - * characters, sub-delimiters and `:'.</li> - * <li><strong>Host</strong>: Allows unreserved or percent-encoded - * characters, sub-delimiters and square brackets (`[' and `]') for IPv6 - * addresses.</li> - * <li><strong>Port</strong>: Digits only.</li> - * <li><strong>Path</strong>: Allows the path characters and `/'. - * <li><strong>Query</strong>: Allows the path characters, `?' and '/'. - * <li><strong>Fragment</strong>: Allows the path characters, `?' and '/'. - * </ul> - * <p> - * These definitions reference the following sets of characters: - * </p> - * <ul> - * <li><strong>Unreserved characters</strong>: The alphanumerics plus - * `-', `.', `_', and `~'.</li> - * <li><strong>Sub-delimiters</strong>: `!', `$', `&', `(', `)', `*', - * `+', `,', `;', `=' and the single-quote itself.</li> - * <li><strong>Path characters</strong>: Unreserved and percent-encoded - * characters and the sub-delimiters along with `@' and `:'.</li> - * </ul> - * <p> - * The constructors and accessor methods allow the use and retrieval of - * URI components which contain non-US-ASCII characters directly. - * They are only escaped when the <code>toASCIIString()</code> method - * is used. In contrast, illegal characters are always quoted, with the - * exception of the return values of the non-raw accessors. - * </p> - * - * @author Ito Kazumitsu (ito...@hi...) - * @author Dalibor Topic (ro...@ka...) - * @author Michael Koch (kon...@gm...) - * @author Andrew John Hughes (gnu...@me...) - * @since 1.4 - */ -public final class URI - implements Comparable<URI>, Serializable -{ - /** - * For serialization compatability. - */ - static final long serialVersionUID = -6052424284110960213L; - - /** - * Regular expression for parsing URIs. - * - * Taken from RFC 2396, Appendix B. - * This expression doesn't parse IPv6 addresses. - */ - private static final String URI_REGEXP = - "^(([^:/?#]+):)?((//([^/?#]*))?([^?#]*)(\\?([^#]*))?)?(#(.*))?"; - - /** - * Regular expression for parsing the authority segment. - */ - private static final String AUTHORITY_REGEXP = - "(([^?#]*)@)?([^?#:]*)(:([0-9]*))?"; - - /** - * Valid characters (taken from rfc2396/3986) - */ - private static final String RFC2396_DIGIT = "0123456789"; - private static final String RFC2396_LOWALPHA = "abcdefghijklmnopqrstuvwxyz"; - private static final String RFC2396_UPALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - private static final String RFC2396_ALPHA = - RFC2396_LOWALPHA + RFC2396_UPALPHA; - private static final String RFC2396_ALPHANUM = RFC2396_DIGIT + RFC2396_ALPHA; - private static final String RFC3986_UNRESERVED = RFC2396_ALPHANUM + "-._~"; - private static final String RFC3986_SUBDELIMS = "!$&'()*+,;="; - private static final String RFC3986_REG_NAME = - RFC3986_UNRESERVED + RFC3986_SUBDELIMS + "%"; - private static final String RFC3986_PCHAR = RFC3986_UNRESERVED + - RFC3986_SUBDELIMS + ":@%"; - private static final String RFC3986_SEGMENT = RFC3986_PCHAR; - private static final String RFC3986_PATH_SEGMENTS = RFC3986_SEGMENT + "/"; - private static final String RFC3986_SSP = RFC3986_PCHAR + "?/"; - private static final String RFC3986_HOST = RFC3986_REG_NAME + "[]"; - private static final String RFC3986_USERINFO = RFC3986_REG_NAME + ":"; - - /** - * Index of scheme component in parsed URI. - */ - private static final int SCHEME_GROUP = 2; - - /** - * Index of scheme-specific-part in parsed URI. - */ - private static final int SCHEME_SPEC_PART_GROUP = 3; - - /** - * Index of authority component in parsed URI. - */ - private static final int AUTHORITY_GROUP = 5; - - /** - * Index of path component in parsed URI. - */ - private static final int PATH_GROUP = 6; - - /** - * Index of query component in parsed URI. - */ - private static final int QUERY_GROUP = 8; - - /** - * Index of fragment component in parsed URI. - */ - private static final int FRAGMENT_GROUP = 10; - - /** - * Index of userinfo component in parsed authority section. - */ - private static final int AUTHORITY_USERINFO_GROUP = 2; - - /** - * Index of host component in parsed authority section. - */ - private static final int AUTHORITY_HOST_GROUP = 3; - - /** - * Index of port component in parsed authority section. - */ - private static final int AUTHORITY_PORT_GROUP = 5; - - /** - * The compiled version of the URI regular expression. - */ - private static final Pattern URI_PATTERN; - - /** - * The compiled version of the authority regular expression. - */ - private static final Pattern AUTHORITY_PATTERN; - - /** - * The set of valid hexadecimal characters. - */ - private static final String HEX = "0123456789ABCDEF"; - - private transient String scheme; - private transient String rawSchemeSpecificPart; - private transient String schemeSpecificPart; - private transient String rawAuthority; - private transient String authority; - private transient String rawUserInfo; - private transient String userInfo; - private transient String rawHost; - private transient String host; - private transient int port = -1; - private transient String rawPath; - private transient String path; - private transient String rawQuery; - private transient String query; - private transient String rawFragment; - private transient String fragment; - private String string; - - /** - * Static initializer to pre-compile the regular expressions. - */ - static - { - URI_PATTERN = Pattern.compile(URI_REGEXP); - AUTHORITY_PATTERN = Pattern.compile(AUTHORITY_REGEXP); - } - - private void readObject(ObjectInputStream is) - throws ClassNotFoundException, IOException - { - this.string = (String) is.readObject(); - try - { - parseURI(this.string); - } - catch (URISyntaxException x) - { - // Should not happen. - throw new RuntimeException(x); - } - } - - private void writeObject(ObjectOutputStream os) throws IOException - { - if (string == null) - string = toString(); - os.writeObject(string); - } - - /** - * <p> - * Returns the string content of the specified group of the supplied - * matcher. The returned value is modified according to the following: - * </p> - * <ul> - * <li>If the resulting string has a length greater than 0, then - * that string is returned.</li> - * <li>If a string of zero length, is matched, then the content - * of the preceding group is considered. If this is also an empty - * string, then <code>null</code> is returned to indicate an undefined - * value. Otherwise, the value is truly the empty string and this is - * the returned value.</li> - * </ul> - * <p> - * This method is used for matching against all parts of the URI - * that may be either undefined or empty (i.e. all those but the - * scheme-specific part and the path). In each case, the preceding - * group is the content of the original group, along with some - * additional distinguishing feature. For example, the preceding - * group for the query includes the preceding question mark, - * while that of the fragment includes the hash symbol. The presence - * of these features enables disambiguation between the two cases - * of a completely unspecified value and a simple non-existant value. - * The scheme differs in that it will never return an empty string; - * the delimiter follows the scheme rather than preceding it, so - * it becomes part of the following section. The same is true - * of the user information. - * </p> - * - * @param match the matcher, which contains the results of the URI - * matched against the URI regular expression. - * @return either the matched content, <code>null</code> for undefined - * values, or an empty string for a URI part with empty content. - */ - private static String getURIGroup(Matcher match, int group) - { - String matched = match.group(group); - if (matched == null || matched.length() == 0) - { - String prevMatched = match.group(group -1); - if (prevMatched == null || prevMatched.length() == 0) - return null; - else - return ""; - } - return matched; - } - - /** - * Sets fields of this URI by parsing the given string. - * - * @param str The string to parse - * - * @exception URISyntaxException If the given string violates RFC 2396 - */ - private void parseURI(String str) throws URISyntaxException - { - Matcher matcher = URI_PATTERN.matcher(str); - - if (matcher.matches()) - { - scheme = getURIGroup(matcher, SCHEME_GROUP); - rawSchemeSpecificPart = matcher.group(SCHEME_SPEC_PART_GROUP); - schemeSpecificPart = unquote(rawSchemeSpecificPart); - if (!isOpaque()) - { - rawAuthority = getURIGroup(matcher, AUTHORITY_GROUP); - rawPath = matcher.group(PATH_GROUP); - rawQuery = getURIGroup(matcher, QUERY_GROUP); - } - rawFragment = getURIGroup(matcher, FRAGMENT_GROUP); - } - else - throw new URISyntaxException(str, - "doesn't match URI regular expression"); - parseServerAuthority(); - - // We must eagerly unquote the parts, because this is the only time - // we may throw an exception. - authority = unquote(rawAuthority); - userInfo = unquote(rawUserInfo); - host = unquote(rawHost); - path = unquote(rawPath); - query = unquote(rawQuery); - fragment = unquote(rawFragment); - } - - /** - * Unquote "%" + hex quotes characters - * - * @param str The string to unquote or null. - * - * @return The unquoted string or null if str was null. - * - * @exception URISyntaxException If the given string contains invalid - * escape sequences. - */ - private static String unquote(String str) throws URISyntaxException - { - if (str == null) - return null; - byte[] buf = new byte[str.length()]; - int pos = 0; - for (int i = 0; i < str.length(); i++) - { - char c = str.charAt(i); - if (c == '%') - { - if (i + 2 >= str.length()) - throw new URISyntaxException(str, "Invalid quoted character"); - int hi = Character.digit(str.charAt(++i), 16); - int lo = Character.digit(str.charAt(++i), 16); - if (lo < 0 || hi < 0) - throw new URISyntaxException(str, "Invalid quoted character"); - buf[pos++] = (byte) (hi * 16 + lo); - } - else - buf[pos++] = (byte) c; - } - try - { - return new String(buf, 0, pos, "utf-8"); - } - catch (java.io.UnsupportedEncodingException x2) - { - throw (Error) new InternalError().initCause(x2); - } - } - - /** - * Quote characters illegal in URIs in given string. - * - * Replace illegal characters by encoding their UTF-8 - * representation as "%" + hex code for each resulting - * UTF-8 character. - * - * @param str The string to quote - * - * @return The quoted string. - */ - private static String quote(String str) - { - return quote(str, RFC3986_SSP); - } - - /** - * Quote characters illegal in URI authorities in given string. - * - * Replace illegal characters by encoding their UTF-8 - * representation as "%" + hex code for each resulting - * UTF-8 character. - * - * @param str The string to quote - * - * @return The quoted string. - */ - private static String quoteAuthority(String str) - { - // Technically, we should be using RFC2396_AUTHORITY, but - // it contains no additional characters. - return quote(str, RFC3986_REG_NAME); - } - - /** - * Quotes the characters in the supplied string that are not part of - * the specified set of legal characters. - * - * @param str the string to quote - * @param legalCharacters the set of legal characters - * - * @return the quoted string. - */ - private static String quote(String str, String legalCharacters) - { - StringBuffer sb = new StringBuffer(str.length()); - for (int i = 0; i < str.length(); i++) - { - char c = str.charAt(i); - if ((legalCharacters.indexOf(c) == -1) - && (c <= 127)) - { - sb.append('%'); - sb.append(HEX.charAt(c / 16)); - sb.append(HEX.charAt(c % 16)); - } - else - sb.append(c); - } - return sb.toString(); - } - - /** - * Quote characters illegal in URI hosts in given string. - * - * Replace illegal characters by encoding their UTF-8 - * representation as "%" + hex code for each resulting - * UTF-8 character. - * - * @param str The string to quote - * - * @return The quoted string. - */ - private static String quoteHost(String str) - { - return quote(str, RFC3986_HOST); - } - - /** - * Quote characters illegal in URI paths in given string. - * - * Replace illegal characters by encoding their UTF-8 - * representation as "%" + hex code for each resulting - * UTF-8 character. - * - * @param str The string to quote - * - * @return The quoted string. - */ - private static String quotePath(String str) - { - // Technically, we should be using RFC2396_PATH, but - // it contains no additional characters. - return quote(str, RFC3986_PATH_SEGMENTS); - } - - /** - * Quote characters illegal in URI user infos in given string. - * - * Replace illegal characters by encoding their UTF-8 - * representation as "%" + hex code for each resulting - * UTF-8 character. - * - * @param str The string to quote - * - * @return The quoted string. - */ - private static String quoteUserInfo(String str) - { - return quote(str, RFC3986_USERINFO); - } - - /** - * Creates an URI from the given string - * - * @param str The string to create the URI from - * - * @exception URISyntaxException If the given string violates RFC 2396 - * @exception NullPointerException If str is null - */ - public URI(String str) throws URISyntaxException - { - this.string = str; - parseURI(str); - } - - /** - * Create an URI from the given components - * - * @param scheme The scheme name - * @param userInfo The username and authorization info - * @param host The hostname - * @param port The port number - * @param path The path - * @param query The query - * @param fragment The fragment - * - * @exception URISyntaxException If the given string violates RFC 2396 - */ - public URI(String scheme, String userInfo, String host, int port, - String path, String query, String fragment) - throws URISyntaxException - { - this((scheme == null ? "" : scheme + ":") - + (userInfo == null && host == null && port == -1 ? "" : "//") - + (userInfo == null ? "" : quoteUserInfo(userInfo) + "@") - + (host == null ? "" : quoteHost(host)) - + (port == -1 ? "" : ":" + String.valueOf(port)) - + (path == null ? "" : quotePath(path)) - + (query == null ? "" : "?" + quote(query)) - + (fragment == null ? "" : "#" + quote(fragment))); - } - - /** - * Create an URI from the given components - * - * @param scheme The scheme name - * @param authority The authority - * @param path The apth - * @param query The query - * @param fragment The fragment - * - * @exception URISyntaxException If the given string violates RFC 2396 - */ - public URI(String scheme, String authority, String path, String query, - String fragment) throws URISyntaxException - { - this((scheme == null ? "" : scheme + ":") - + (authority == null ? "" : "//" + quoteAuthority(authority)) - + (path == null ? "" : quotePath(path)) - + (query == null ? "" : "?" + quote(query)) - + (fragment == null ? "" : "#" + quote(fragment))); - } - - /** - * Create an URI from the given components - * - * @param scheme The scheme name - * @param host The hostname - * @param path The path - * @param fragment The fragment - * - * @exception URISyntaxException If the given string violates RFC 2396 - */ - public URI(String scheme, String host, String path, String fragment) - throws URISyntaxException - { - this(scheme, null, host, -1, path, null, fragment); - } - - /** - * Create an URI from the given components - * - * @param scheme The scheme name - * @param ssp The scheme specific part - * @param fragment The fragment - * - * @exception URISyntaxException If the given string violates RFC 2396 - */ - public URI(String scheme, String ssp, String fragment) - throws URISyntaxException - { - this((scheme == null ? "" : scheme + ":") - + (ssp == null ? "" : quote(ssp)) - + (fragment == null ? "" : "#" + quote(fragment))); - } - - /** - * Create an URI from the given string - * - * @param str The string to create the URI from - * - * @exception IllegalArgumentException If the given string violates RFC 2396 - * @exception NullPointerException If str is null - */ - public static URI create(String str) - { - try - { - return new URI(str); - } - catch (URISyntaxException e) - { - throw (IllegalArgumentException) new IllegalArgumentException() - .initCause(e); - } - } - - /** - * Attempts to parse this URI's authority component, if defined, - * into user-information, host, and port components. The purpose - * of this method was to disambiguate between some authority sections, - * which form invalid server-based authories, but valid registry - * based authorities. In the updated RFC 3986, the authority section - * is defined differently, with registry-based authorities part of - * the host section. Thus, this method is now simply an explicit - * way of parsing any authority section. - * - * @return the URI, with the authority section parsed into user - * information, host and port components. - * @throws URISyntaxException if the given string violates RFC 2396 - */ - public URI parseServerAuthority() throws URISyntaxException - { - if (rawAuthority != null) - { - Matcher matcher = AUTHORITY_PATTERN.matcher(rawAuthority); - - if (matcher.matches()) - { - rawUserInfo = getURIGroup(matcher, AUTHORITY_USERINFO_GROUP); - rawHost = getURIGroup(matcher, AUTHORITY_HOST_GROUP); - - String portStr = getURIGroup(matcher, AUTHORITY_PORT_GROUP); - - if (portStr != null) - try - { - port = Integer.parseInt(portStr); - } - catch (NumberFormatException e) - { - URISyntaxException use = - new URISyntaxException - (string, "doesn't match URI regular expression"); - use.initCause(e); - throw use; - } - } - else - throw new URISyntaxException(string, - "doesn't match URI regular expression"); - } - return this; - } - - /** - * <p> - * Returns a normalized version of the URI. If the URI is opaque, - * or its path is already in normal form, then this URI is simply - * returned. Otherwise, the following transformation of the path - * element takes place: - * </p> - * <ol> - * <li>All `.' segments are removed.</li> - * <li>Each `..' segment which can be paired with a prior non-`..' segment - * is removed along with the preceding segment.</li> - * <li>A `.' segment is added to the front if the first segment contains - * a colon (`:'). This is a deviation from the RFC, which prevents - * confusion between the path and the scheme.</li> - * </ol> - * <p> - * The resulting URI will be free of `.' and `..' segments, barring those - * that were prepended or which couldn't be paired, respectively. - * </p> - * - * @return the normalized URI. - */ - public URI normalize() - { - if (isOpaque() || path.indexOf("/./") == -1 && path.indexOf("/../") == -1) - return this; - try - { - return new URI(scheme, authority, normalizePath(path), query, - fragment); - } - catch (URISyntaxException e) - { - throw (Error) new InternalError("Normalized URI variant could not "+ - "be constructed").initCause(e); - } - } - - /** - * <p> - * Normalize the given path. The following transformation takes place: - * </p> - * <ol> - * <li>All `.' segments are removed.</li> - * <li>Each `..' segment which can be paired with a prior non-`..' segment - * is removed along with the preceding segment.</li> - * <li>A `.' segment is added to the front if the first segment contains - * a colon (`:'). This is a deviation from the RFC, which prevents - * confusion between the path and the scheme.</li> - * </ol> - * <p> - * The resulting URI will be free of `.' and `..' segments, barring those - * that were prepended or which couldn't be paired, respectively. - * </p> - * - * @param relativePath the relative path to be normalized. - * @return the normalized path. - */ - private String normalizePath(String relativePath) - { - /* - This follows the algorithm in section 5.2.4. of RFC3986, - but doesn't modify the input buffer. - */ - StringBuffer input = new StringBuffer(relativePath); - StringBuffer output = new StringBuffer(); - int start = 0; - while (start < input.length()) - { - /* A */ - if (input.indexOf("../",start) == start) - { - start += 3; - continue; - } - if (input.indexOf("./",start) == start) - { - start += 2; - continue; - } - /* B */ - if (input.indexOf("/./",start) == start) - { - start += 2; - continue; - } - if (input.indexOf("/.",start) == start - && input.charAt(start + 2) != '.') - { - start += 1; - input.setCharAt(start,'/'); - continue; - } - /* C */ - if (input.indexOf("/../",start) == start) - { - start += 3; - removeLastSegment(output); - continue; - } - if (input.indexOf("/..",start) == start) - { - start += 2; - input.setCharAt(start,'/'); - removeLastSegment(output); - continue; - } - /* D */ - if (start == input.length() - 1 && input.indexOf(".",start) == start) - { - input.delete(0,1); - continue; - } - if (start == input.length() - 2 && input.indexOf("..",start) == start) - { - input.delete(0,2); - continue; - } - /* E */ - int indexOfSlash = input.indexOf("/",start); - while (indexOfSlash == start) - { - output.append("/"); - ++start; - indexOfSlash = input.indexOf("/",start); - } - if (indexOfSlash == -1) - indexOfSlash = input.length(); - output.append(input.substring(start, indexOfSlash)); - start = indexOfSlash; - } - return output.toString(); - } - - /** - * Removes the last segment of the path from the specified buffer. - * - * @param buffer the buffer containing the path. - */ - private void removeLastSegment(StringBuffer buffer) - { - int lastSlash = buffer.lastIndexOf("/"); - if (lastSlash == -1) - buffer.setLength(0); - else - buffer.setLength(lastSlash); - } - - /** - * Resolves the given URI against this URI - * - * @param uri The URI to resolve against this URI - * - * @return The resulting URI, or null when it couldn't be resolved - * for some reason. - * - * @throws NullPointerException if uri is null - */ - public URI resolve(URI uri) - { - if (uri.isAbsolute()) - return uri; - if (uri.isOpaque()) - return uri; - - String scheme = uri.getScheme(); - String schemeSpecificPart = uri.getSchemeSpecificPart(); - String authority = uri.getAuthority(); - String path = uri.getPath(); - String query = uri.getQuery(); - String fragment = uri.getFragment(); - - try - { - if (fragment != null && path != null && path.equals("") - && scheme == null && authority == null && query == null) - return new URI(this.scheme, this.schemeSpecificPart, fragment); - - if (authority == null) - { - authority = this.authority; - if (path == null) - path = ""; - if (! (path.startsWith("/"))) - { - StringBuffer basepath = new StringBuffer(this.path); - int i = this.path.lastIndexOf('/'); - - if (i >= 0) - basepath.delete(i + 1, basepath.length()); - - basepath.append(path); - path = normalizePath(basepath.toString()); - } - } - return new URI(this.scheme, authority, path, query, fragment); - } - catch (URISyntaxException e) - { - throw (Error) new InternalError("Resolved URI variant could not "+ - "be constructed").initCause(e); - } - } - - /** - * Resolves the given URI string against this URI - * - * @param str The URI as string to resolve against this URI - * - * @return The resulting URI - * - * @throws IllegalArgumentException If the given URI string - * violates RFC 2396 - * @throws NullPointerException If uri is null - */ - public URI resolve(String str) throws IllegalArgumentException - { - return resolve(create(str)); - } - - /** - * <p> - * Relativizes the given URI against this URI. The following - * algorithm is used: - * </p> - * <ul> - * <li>If either URI is opaque, the given URI is returned.</li> - * <li>If the schemes of the URIs differ, the given URI is returned.</li> - * <li>If the authority components of the URIs differ, then the given - * URI is returned.</li> - * <li>If the path of this URI is not a prefix of the supplied URI, - * then the given URI is returned.</li> - * <li>If all the above conditions hold, a new URI is created using the - * query and fragment components of the given URI, along with a path - * computed by removing the path of this URI from the start of the path - * of the supplied URI.</li> - * </ul> - * - * @param uri the URI to relativize agsint this URI - * @return the resulting URI - * @throws NullPointerException if the uri is null - */ - public URI relativize(URI uri) - { - if (isOpaque() || uri.isOpaque()) - return uri; - if (scheme == null && uri.getScheme() != null) - return uri; - if (scheme != null && !(scheme.equals(uri.getScheme()))) - return uri; - if (rawAuthority == null && uri.getRawAuthority() != null) - return uri; - if (rawAuthority != null && !(rawAuthority.equals(uri.getRawAuthority()))) - return uri; - if (!(uri.getRawPath().startsWith(rawPath))) - return uri; - try - { - return new URI(null, null, - uri.getRawPath().substring(rawPath.length()), - uri.getRawQuery(), uri.getRawFragment()); - } - catch (URISyntaxException e) - { - throw (Error) new InternalError("Relativized URI variant could not "+ - "be constructed").initCause(e); - } - } - - /** - * Creates an URL from an URI - * - * @throws MalformedURLException If a protocol handler for the URL could - * not be found, or if some other error occurred while constructing the URL - * @throws IllegalArgumentException If the URI is not absolute - */ - public URL toURL() throws IllegalArgumentException, MalformedURLException - { - if (isAbsolute()) - return new URL(this.toString()); - - throw new IllegalArgumentException("not absolute"); - } - - /** - * Returns the scheme of the URI - */ - public String getScheme() - { - return scheme; - } - - /** - * Tells whether this URI is absolute or not - */ - public boolean isAbsolute() - { - return scheme != null; - } - - /** - * Tell whether this URI is opaque or not - */ - public boolean isOpaque() - { - return ((scheme != null) && ! (schemeSpecificPart.startsWith("/"))); - } - - /** - * Returns the raw scheme specific part of this URI. - * The scheme-specific part is never undefined, though it may be empty - */ - public String getRawSchemeSpecificPart() - { - return rawSchemeSpecificPart; - } - - /** - * Returns the decoded scheme specific part of this URI. - */ - public String getSchemeSpecificPart() - { - return schemeSpecificPart; - } - - /** - * Returns the raw authority part of this URI - */ - public String getRawAuthority() - { - return rawAuthority; - } - - /** - * Returns the decoded authority part of this URI - */ - public String getAuthority() - { - return authority; - } - - /** - * Returns the raw user info part of this URI - */ - public String getRawUserInfo() - { - return rawUserInfo; - } - - /** - * Returns the decoded user info part of this URI - */ - public String getUserInfo() - { - return userInfo; - } - - /** - * Returns the hostname of the URI - */ - public String getHost() - { - return host; - } - - /** - * Returns the port number of the URI - */ - public int getPort() - { - return port; - } - - /** - * Returns the raw path part of this URI - */ - public String getRawPath() - { - return rawPath; - } - - /** - * Returns the path of the URI - */ - public String getPath() - { - return path; - } - - /** - * Returns the raw query part of this URI - */ - public String getRawQuery() - { - return rawQuery; - } - - /** - * Returns the query of the URI - */ - public String getQuery() - { - return query; - } - - /** - * Return the raw fragment part of this URI - */ - public String getRawFragment() - { - return rawFragment; - } - - /** - * Returns the fragment of the URI - */ - public String getFragment() - { - return fragment; - } - - /** - * <p> - * Compares the URI with the given object for equality. If the - * object is not a <code>URI</code>, then the method returns false. - * Otherwise, the following criteria are observed: - * </p> - * <ul> - * <li>The scheme of the URIs must either be null (undefined) in both cases, - * or equal, ignorant of case.</li> - * <li>The raw fragment of the URIs must either be null (undefined) in both - * cases, or equal, ignorant of case.</li> - * <li>Both URIs must be of the same type (opaque or hierarchial)</li> - * <li><strong>For opaque URIs:</strong></li> - * <ul> - * <li>The raw scheme-specific parts must be equal.</li> - * </ul> - * <li>For hierarchical URIs:</li> - * <ul> - * <li>The raw paths must be equal, ignorant of case.</li> - * <li>The raw queries are either both undefined or both equal, ignorant - * of case.</li> - * <li>The raw authority sections are either both undefined or:</li> - * <li><strong>For registry-based authorities:</strong></li> - * <ul><li>they are equal.</li></ul> - * <li><strong>For server-based authorities:</strong></li> - * <ul> - * <li>the hosts are equal, ignoring case</li> - * <li>the ports are equal</li> - * <li>the user information components are equal</li> - * </ul> - * </ul> - * </ul> - * - * @param obj the obj to compare the URI with. - * @return <code>true</code> if the objects are equal, according to - * the specification above. - */ - public boolean equals(Object obj) - { - if (!(obj instanceof URI)) - return false; - URI uriObj = (URI) obj; - if (scheme == null) - { - if (uriObj.getScheme() != null) - return false; - } - else - if (!(scheme.equalsIgnoreCase(uriObj.getScheme()))) - return false; - if (rawFragment == null) - { - if (uriObj.getRawFragment() != null) - return false; - } - else - if (!(rawFragment.equalsIgnoreCase(uriObj.getRawFragment()))) - return false; - boolean opaqueThis = isOpaque(); - boolean opaqueObj = uriObj.isOpaque(); - if (opaqueThis && opaqueObj) - return rawSchemeSpecificPart.equals(uriObj.getRawSchemeSpecificPart()); - else if (!opaqueThis && !opaqueObj) - { - boolean common = rawPath.equalsIgnoreCase(uriObj.getRawPath()) - && ((rawQuery == null && uriObj.getRawQuery() == null) - || rawQuery.equalsIgnoreCase(uriObj.getRawQuery())); - if (rawAuthority == null && uriObj.getRawAuthority() == null) - return common; - if (host == null) - return common - && rawAuthority.equalsIgnoreCase(uriObj.getRawAuthority()); - return common - && host.equalsIgnoreCase(uriObj.getHost()) - && port == uriObj.getPort() - && (rawUserInfo == null ? - uriObj.getRawUserInfo() == null : - rawUserInfo.equalsIgnoreCase(uriObj.getRawUserInfo())); - } - else - return false; - } - - /** - * Computes the hashcode of the URI - */ - public int hashCode() - { - return (getScheme() == null ? 0 : 13 * getScheme().hashCode()) - + 17 * getRawSchemeSpecificPart().hashCode() - + (getRawFragment() == null ? 0 : 21 + getRawFragment().hashCode()); - } - - /** - * Compare the URI with another URI. - * Undefined components are taken to be less than any other component. - * The following criteria are observed: - * </p> - * <ul> - * <li>Two URIs with different schemes are compared according to their - * scheme, regardless of case.</li> - * <li>A hierarchical URI is less than an opaque URI with the same - * scheme.</li> - * <li><strong>For opaque URIs:</strong></li> - * <ul> - * <li>URIs with differing scheme-specific parts are ordered according - * to the ordering of the scheme-specific part.</li> - * <li>URIs with the same scheme-specific part are ordered by the - * raw fragment.</li> - * </ul> - * <li>For hierarchical URIs:</li> - * <ul> - * <li>URIs are ordered according to their raw authority sections, - * if they are unequal.</li> - * <li><strong>For registry-based authorities:</strong></li> - * <ul><li>they are ordered according to the ordering of the authority - * component.</li></ul> - * <li><strong>For server-based authorities:</strong></li> - * <ul> - * <li>URIs are ordered according to the raw user information.</li> - * <li>URIs with the same user information are ordered by the host, - * ignoring case.</li> - * <lI>URIs with the same host are ordered by the port.</li> - * </ul> - * <li>URIs with the same authority section are ordered by the raw path.</li> - * <li>URIs with the same path are ordered by their raw query.</li> - * <li>URIs with the same query are ordered by their raw fragments.</li> - * </ul> - * </ul> - * - * @param uri The other URI to compare this URI with - * @return a negative integer, zero or a positive integer depending - * on whether this URI is less than, equal to or greater - * than that supplied, respectively. - */ - public int compareTo(URI uri) - throws ClassCastException - { - if (scheme == null && uri.getScheme() != null) - return -1; - if (scheme != null) - { - int sCompare = scheme.compareToIgnoreCase(uri.getScheme()); - if (sCompare != 0) - return sCompare; - } - boolean opaqueThis = isOpaque(); - boolean opaqueObj = uri.isOpaque(); - if (opaqueThis && !opaqueObj) - return 1; - if (!opaqueThis && opaqueObj) - return -1; - if (opaqueThis) - { - int ssCompare = - rawSchemeSpecificPart.compareTo(uri.getRawSchemeSpecificPart()); - if (ssCompare == 0) - return compareFragments(uri); - else - return ssCompare; - } - if (rawAuthority == null && uri.getRawAuthority() != null) - return -1; - if (rawAuthority != null) - { - int aCompare = rawAuthority.compareTo(uri.getRawAuthority()); - if (aCompare != 0) - { - if (host == null) - return aCompare; - if (rawUserInfo == null && uri.getRawUserInfo() != null) - return -1; - int uCompare = rawUserInfo.compareTo(uri.getRawUserInfo()); - if (uCompare != 0) - return uCompare; - if (host == null && uri.getHost() != null) - return -1; - int hCompare = host.compareTo(uri.getHost()); - if (hCompare != 0) - return hCompare; - return new Integer(port).compareTo(new Integer(uri.getPort())); - } - } - if (rawPath == null && uri.getRawPath() != null) - return -1; - if (rawPath != null) - { - int pCompare = rawPath.compareTo(uri.getRawPath()); - if (pCompare != 0) - return pCompare; - } - if (rawQuery == null && uri.getRawQuery() != null) - return -1; - if (rawQuery != null) - { - int qCompare = rawQuery.compareTo(uri.getRawQuery()); - if (qCompare != 0) - return qCompare; - } - return compareFragments(uri); - } - - /** - * Compares the fragment of this URI with that of the supplied URI. - * - * @param uri the URI to compare with this one. - * @return a negative integer, zero or a positive integer depending - * on whether this uri's fragment is less than, equal to - * or greater than the fragment of the uri supplied, respectively. - */ - private int compareFragments(URI uri) - { - if (rawFragment == null && uri.getRawFragment() != null) - return -1; - else if (rawFragment == null) - return 0; - else - return rawFragment.compareTo(uri.getRawFragment()); - } - - /** - * Returns the URI as a String. If the URI was created using a constructor, - * then this will be the same as the original input string. - * - * @return a string representation of the URI. - */ - public String toString() - { - return (scheme == null ? "" : scheme + ":") - + rawSchemeSpecificPart - + (rawFragment == null ? "" : "#" + rawFragment); - } - - /** - * Returns the URI as US-ASCII string. This is the same as the result - * from <code>toString()</code> for URIs that don't contain any non-US-ASCII - * characters. Otherwise, the non-US-ASCII characters are replaced - * by their percent-encoded representations. - * - * @return a string representation of the URI, containing only US-ASCII - * characters. - */ - public String toASCIIString() - { - String strRep = toString(); - boolean inNonAsciiBlock = false; - StringBuffer buffer = new StringBuffer(); - StringBuffer encBuffer = null; - for (int i = 0; i < strRep.length(); i++) - { - char c = strRep.charAt(i); - if (c <= 127) - { - if (inNonAsciiBlock) - { - buffer.append(escapeCharacters(encBuffer.toString())); - inNonAsciiBlock = false; - } - buffer.append(c); - } - else - { - if (!inNonAsciiBlock) - { - encBuffer = new StringBuffer(); - inNonAsciiBlock = true; - } - encBuffer.append(c); - } - } - return buffer.toString(); - } - - /** - * Converts the non-ASCII characters in the supplied string - * to their equivalent percent-encoded representations. - * That is, they are replaced by "%" followed by their hexadecimal value. - * - * @param str a string including non-ASCII characters. - * @return the string with the non-ASCII characters converted to their - * percent-encoded representations. - */ - private static String escapeCharacters(String str) - { - try - { - StringBuffer sb = new StringBuffer(); - // this is far from optimal, but it works - byte[] utf8 = str.getBytes("utf-8"); - for (int j = 0; j < utf8.length; j++) - { - sb.append('%'); - sb.append(HEX.charAt((utf8[j] & 0xff) / 16)); - sb.append(HEX.charAt((utf8[j] & 0xff) % 16)); - } - return sb.toString(); - } - catch (java.io.UnsupportedEncodingException x) - { - throw (Error) new InternalError("Escaping error").initCause(x); - } - } - -} Deleted: trunk/core/src/classpath/java/java/net/URL.java =================================================================== --- trunk/core/src/classpath/java/java/net/URL.java 2009-01-06 10:25:31 UTC (rev 4831) +++ trunk/core/src/classpath/java/java/net/URL.java 2009-01-07 10:30:24 UTC (rev 4832) @@ -1,979 +0,0 @@ -/* URL.java -- Uniform Resource Locator Class - Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004, 2005 - 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 java.net; - -import gnu.java.net.URLParseError; - -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.HashMap; -import java.util.StringTokenizer; - - -/* - * Written using on-line Java Platform 1.2 API Specification, as well - * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998). - * Status: Believed complete and correct. - */ - -/** - * This final class represents an Internet Uniform Resource Locator (URL). - * For details on the syntax of URL's and what they can be used for, - * refer to RFC 1738, available from <a - * href="http://ds.internic.net/rfcs/rfc1738.txt"> - * http://ds.internic.net/rfcs/rfc1738.txt</a> - * <p> - * There are a great many protocols supported by URL's such as "http", - * "ftp", and "file". This object can handle any arbitrary URL for which - * a URLStreamHandler object can be written. Default protocol handlers - * are provided for the "http" and "ftp" protocols. Additional protocols - * handler implementations may be provided in the future. In any case, - * an application or applet can install its own protocol handlers that - * can be "chained" with other protocol hanlders in the system to extend - * the base functionality provided with this class. (Note, however, that - * unsigned applets cannot access properties by default or install their - * own protocol handlers). - * <p> - * This chaining is done via the system property java.protocol.handler.pkgs - * If this property is set, it is assumed to be a "|" separated list of - * package names in which to attempt locating protocol handlers. The - * protocol handler is searched for by appending the string - * ".<protocol>.Handler" to each packed in the list until a hander is - * found. If a protocol handler is not found in this list of packages, or if - * the property does not exist, then the default protocol handler of - * "gnu.java.net.<protocol>.Handler" is tried. If this is - * unsuccessful, a MalformedURLException is thrown. - * <p> - * All of the constructor methods of URL attempt to load a protocol - * handler and so any needed protocol handlers must be installed when - * the URL is constructed. - * <p> - * Here is an example of how URL searches for protocol handlers. Assume - * the value of java.protocol.handler.pkgs is "com.foo|com.bar" and the - * URL is "news://comp.lang.java.programmer". URL would looking the - * following places for protocol handlers: - * <p><pre> - * com.foo.news.Handler - * com.bar.news.Handler - * gnu.java.net.news.Handler - * </pre><p> - * If the protocol handler is not found in any of those locations, a - * MalformedURLException would be thrown. - * <p> - * Please note that a protocol handler must be a subclass of - * URLStreamHandler. - * <p> - * Normally, this class caches protocol handlers. Once it finds a handler - * for a particular protocol, it never tries to look up a new handler - * again. However, if the system property - * gnu.java.net.nocache_protocol_handlers is set, then this - * caching behavior is disabled. This property is specific to this - * implementation. Sun's JDK may or may not do protocol caching, but it - * almost certainly does not examine this property. - * <p> - * Please also note that an application can install its own factory for - * loading protocol handlers (see setURLStreamHandlerFactory). If this is - * done, then the above information is superseded and the behavior of this - * class in loading protocol handlers is dependent on that factory. - * - * @author Aaron M. Renn (ar...@ur...) - * @author Warren Levy (wa...@cy...) - * - * @see URLStreamHandler - */ -public final class URL implements Serializable -{ - // @classpath-bugfix-22903 - // @vm-specific Added org.jnode.protocol - private static final String DEFAULT_SEARCH_PATH = - "org.jnode.protocol|gnu.java.net.protocol|gnu.inet"; - // @classpath-bugfix-end - - // Cached System ClassLoader - private static ClassLoader systemClassLoader; - - /** - * The name of the protocol for this URL. - * The protocol is always stored in lower case. - */ - private String protocol; - - /** - * The "authority" portion of the URL. - */ - private String authority; - - /** - * The hostname or IP address of this protocol. - * This includes a possible user. For example <code>jo...@so...</code>. - */ - private String host; - - /** - * The user information necessary to establish the connection. - */ - private String userInfo; - - /** - * The port number of this protocol or -1 if the port number used is - * the default for this protocol. - */ - private int port = -1; // Initialize for constructor using context. - - /** - * The "file" portion of the URL. It is defined as <code>path[?query]</code>. - */ - private String file; - - /** - * The anchor portion of the URL. - */ - private String ref; - - /** - * This is the hashCode for this URL - */ - private int hashCode; - - /** - * The protocol handler in use for this URL - */ - transient URLStreamHandler ph; - - /** - * If an application installs its own protocol handler factory, this is - * where we keep track of it. - */ - private static URLStreamHandlerFactory factory; - private static final long serialVersionUID = -7627629688361524110L; - - /** - * This a table where we cache protocol handlers to avoid the overhead - * of looking them up each time. - */ - private static HashMap ph_cache = new HashMap(); - - /** - * Whether or not to cache protocol handlers. - */ - private static boolean cache_handlers; - - static - { - String s = System.getProperty("gnu.java.net.nocache_protocol_handlers"); - - if (s == null) - cache_handlers = true; - else - cache_handlers = false; - } - - /** - * Constructs a URL and loads a protocol handler for the values passed as - * arguments. - * - * @param protocol The protocol for this URL ("http", "ftp", etc) - * @param host The hostname or IP address to connect to - * @param port The port number to use, or -1 to use the protocol's - * default port - * @param file The "file" portion of the URL. - * - * @exception MalformedURLException If a protocol handler cannot be loaded or - * a parse error occurs. - */ - public URL(String protocol, String host, int port, String file) - throws MalformedURLException - { - this(protocol, host, port, file, null); - } - - /** - * Constructs a URL and loads a protocol handler for the values passed in - * as arugments. Uses the default port for the protocol. - * - * @param protocol The protocol for this URL ("http", "ftp", etc) - * @param host The hostname or IP address for this URL - * @param file The "file" portion of this URL. - * - * @exception MalformedURLException If a protocol handler cannot be loaded or - * a parse error occurs. - */ - public URL(String protocol, String host, String file) - throws MalformedURLException - { - this(protocol, host, -1, file, null); - } - - /** - * This method initializes a new instance of <code>URL</code> with the - * specified protocol, host, port, and file. Additionally, this method - * allows the caller to specify a protocol handler to use instead of - * the default. If this handler is specified, the caller must have - * the "specifyStreamHandler" permission (see <code>NetPermission</code>) - * or a <code>SecurityException</code> will be thrown. - * - * @param protocol The protocol for this URL ("http", "ftp", etc) - * @param host The hostname or IP address to connect to - * @param port The port number to use, or -1 to use the protocol's default - * port - * @param file The "file" portion of the URL. - * @param ph The protocol handler to use with this URL. - * - * @exception MalformedURLException If no protocol handler can be loaded - * for the specified protocol. - * @exception SecurityException If the <code>SecurityManager</code> exists - * and does not allow the caller to specify its own protocol handler. - * - * @since 1.2 - */ - public URL(String protocol, String host, int port, String file, - URLStreamHandler ph) throws MalformedURLException - { - if (protocol == null) - throw new MalformedURLException("null protocol"); - protocol = protocol.toLowerCase(); - this.protocol = protocol; - - if (ph != null) - { - SecurityManager s = System.getSecurityManager(); - if (s != null) - s.checkPermission(new NetPermission("specifyStreamHandler")); - - this.ph = ph; - } - else - this.ph = getURLStreamHandler(protocol); - - if (this.ph == null) - throw new MalformedURLException("Protocol handler not found: " - + protocol); - - this.host = host; - this.port = port; - this.authority = (host != null) ? host : ""; - if (port >= 0 && host != null) - this.authority += ":" + port; - - int hashAt = file.indexOf('#'); - if (hashAt < 0) - { - this.file = file; - this.ref = null; - } - else - { - this.file = file.substring(0, hashAt); - this.ref = file.substring(hashAt + 1); - } - hashCode = hashCode(); // Used for serialization. - } - - /** - * Initializes a URL from a complete string specification such as - * "http://www.urbanophile.com/arenn/". First the protocol name is parsed - * out of the string. Then a handler is located for that protocol and - * the parseURL() method of that protocol handler is used to parse the - * remaining fields. - * - * @param spec The complete String representation of a URL - * - * @exception MalformedURLException If a protocol handler cannot be found - * or the URL cannot be parsed - */ - public URL(String spec) throws MalformedURLException - { - this((URL) null, spec != null ? spec : "", (URLStreamHandler) null); - } - - /** - * This method parses a String representation of a URL within the - * context of an existing URL. Principally this means that any - * fields not present the URL are inheritied from the context URL. - * This allows relative URL's to be easily constructed. If the - * context argument is null, then a complete URL must be specified - * in the URL string. If the protocol parsed out of the URL is - * different from the context URL's protocol, then then URL String - * is also expected to be a complete URL. - * - * @param context The context on which to parse the specification - * @param spec The string to parse an URL - * - * @exception MalformedURLException If a protocol handler cannot be found - * for the URL cannot be parsed - */ - public URL(URL context, String spec) throws MalformedURLException - { - this(context, spec, (URLStreamHandler) null); - } - - /** - * Creates an URL from given arguments - * This method parses a String representation of a URL within the - * context of an existing URL. Principally this means that any fields - * not present the URL are inheritied from the context URL. This allows - * relative URL's to be easily constructed. If the context argument i... [truncated message content] |
From: <ls...@us...> - 2009-02-02 06:21:03
|
Revision: 4969 http://jnode.svn.sourceforge.net/jnode/?rev=4969&view=rev Author: lsantha Date: 2009-02-02 06:20:51 +0000 (Mon, 02 Feb 2009) Log Message: ----------- Create new sourcetree for platform speciffic openjdk classes. Modified Paths: -------------- trunk/core/build.xml Added Paths: ----------- trunk/core/src/openjdk/svm/ trunk/core/src/openjdk/svm/java/ trunk/core/src/openjdk/svm/java/lang/ trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java trunk/core/src/openjdk/svm/java/lang/ProcessImpl.java trunk/core/src/openjdk/svm/java/lang/Terminator.java trunk/core/src/openjdk/svm/java/lang/UNIXProcess.java trunk/core/src/openjdk/svm/sun/ trunk/core/src/openjdk/svm/sun/util/ trunk/core/src/openjdk/svm/sun/util/resources/ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_be.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_bg.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ca.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_cs.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_da.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_de.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el_CY.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_GB.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_IE.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_MT.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_ES.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_US.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_et.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fi.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr_CA.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_hr.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_hu.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_in_ID.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_is.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_it.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_lt.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_lv.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_mk.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ms_MY.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_mt.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_mt_MT.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_nl.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_no.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_pl.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_pt.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_pt_PT.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ro.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ru.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_sk.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_sl.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_sq.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_sr.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_sv.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_tr.java trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_uk.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_be_BY.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_bg_BG.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_ca_ES.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_cs_CZ.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_da_DK.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_de_AT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_de_CH.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_de_DE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_de_GR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_de_LU.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_el_CY.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_el_GR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_AU.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_CA.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_GB.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_IE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_IN.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_MT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_NZ.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_PH.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_SG.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_US.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_en_ZA.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_AR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_BO.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_CL.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_CO.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_CR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_DO.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_EC.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_ES.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_GT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_HN.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_MX.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_NI.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_PA.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_PE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_PR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_PY.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_SV.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_US.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_UY.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_es_VE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_et_EE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fi_FI.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fr_BE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fr_CA.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fr_CH.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fr_FR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_fr_LU.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_ga_IE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_hr_HR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_hu_HU.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_in_ID.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_is_IS.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_it_CH.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_it_IT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_lt_LT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_lv_LV.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_mk_MK.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_ms_MY.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_mt_MT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_nl_BE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_nl_NL.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_no_NO.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_pl_PL.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_pt_BR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_pt_PT.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_ro_RO.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_ru_RU.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sk_SK.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sl_SI.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sq_AL.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sr_BA.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sr_CS.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sr_ME.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_sv_SE.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_tr_TR.java trunk/core/src/openjdk/svm/sun/util/resources/CurrencyNames_uk_UA.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_be.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_bg.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_ca.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_cs.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_da.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_de.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_el.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_el_CY.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_en.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_en_MT.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_en_PH.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_en_SG.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_es.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_es_US.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_et.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_fi.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_fr.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_ga.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_hr.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_hu.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_in.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_is.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_it.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_lt.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_lv.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_mk.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_ms.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_mt.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_nl.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_no.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_pl.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_pt.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_pt_BR.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_pt_PT.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_ro.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_ru.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_sk.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_sl.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_sq.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_sr.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_sv.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_tr.java trunk/core/src/openjdk/svm/sun/util/resources/LocaleNames_uk.java Removed Paths: ------------- trunk/core/src/openjdk/vm/java/lang/ProcessEnvironment.java trunk/core/src/openjdk/vm/java/lang/ProcessImpl.java trunk/core/src/openjdk/vm/java/lang/Terminator.java trunk/core/src/openjdk/vm/java/lang/UNIXProcess.java trunk/core/src/openjdk/vm/sun/util/ Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2009-02-02 00:10:20 UTC (rev 4968) +++ trunk/core/build.xml 2009-02-02 06:20:51 UTC (rev 4969) @@ -31,6 +31,7 @@ <pathelement location="${my-src.dir}/openjdk/org"/> <pathelement location="${my-src.dir}/openjdk/com"/> <pathelement location="${my-src.dir}/openjdk/sun"/> + <pathelement location="${my-src.dir}/openjdk/svm"/> <pathelement location="${my-src.dir}/openjdk/vm"/> </path> <path id="classpath-sources-corba"> @@ -114,6 +115,7 @@ <fileset dir="${my-src.dir}/openjdk/org" includes="**/*.jav"/> <fileset dir="${my-src.dir}/openjdk/com" includes="**/*.jav"/> <fileset dir="${my-src.dir}/openjdk/sun" includes="**/*.jav"/> + <fileset dir="${my-src.dir}/openjdk/svm" includes="**/*.jav"/> <fileset dir="${my-src.dir}/openjdk/vm" includes="**/*.jav"/> </copy> <ExpandTest classname="PrimitiveIntTest" type="int"/> @@ -184,6 +186,7 @@ <fileset dir="${my-src.dir}/openjdk/org" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/com" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/sun" excludes="${my-non-resources}"/> + <fileset dir="${my-src.dir}/openjdk/svm" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/vm" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/corba" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/jaxws" excludes="${my-non-resources}"/> Copied: trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java (from rev 4968, trunk/core/src/openjdk/vm/java/lang/ProcessEnvironment.java) =================================================================== --- trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java (rev 0) +++ trunk/core/src/openjdk/svm/java/lang/ProcessEnvironment.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,439 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/* We use APIs that access the standard Unix environ array, which + * is defined by UNIX98 to look like: + * + * char **environ; + * + * These are unsorted, case-sensitive, null-terminated arrays of bytes + * of the form FOO=BAR\000 which are usually encoded in the user's + * default encoding (file.encoding is an excellent choice for + * encoding/decoding these). However, even though the user cannot + * directly access the underlying byte representation, we take pains + * to pass on the child the exact byte representation we inherit from + * the parent process for any environment name or value not created by + * Javaland. So we keep track of all the byte representations. + * + * Internally, we define the types Variable and Value that exhibit + * String/byteArray duality. The internal representation of the + * environment then looks like a Map<Variable,Value>. But we don't + * expose this to the user -- we only provide a Map<String,String> + * view, although we could also provide a Map<byte[],byte[]> view. + * + * The non-private methods in this class are not for general use even + * within this package. Instead, they are the system-dependent parts + * of the system-independent method of the same name. Don't even + * think of using this class unless your method's name appears below. + * + * @author Martin Buchholz + * @since 1.5 + */ + +package java.lang; + +import java.io.*; +import java.util.*; + + +final class ProcessEnvironment +{ + private static final HashMap<Variable,Value> theEnvironment; + private static final Map<String,String> theUnmodifiableEnvironment; + static final int MIN_NAME_LENGTH = 0; + + static { + // We cache the C environment. This means that subsequent calls + // to putenv/setenv from C will not be visible from Java code. + byte[][] environ = environ(); + theEnvironment = new HashMap<Variable,Value>(environ.length/2 + 3); + // Read environment variables back to front, + // so that earlier variables override later ones. + for (int i = environ.length-1; i > 0; i-=2) + theEnvironment.put(Variable.valueOf(environ[i-1]), + Value.valueOf(environ[i])); + + theUnmodifiableEnvironment + = Collections.unmodifiableMap + (new StringEnvironment(theEnvironment)); + } + + /* Only for use by System.getenv(String) */ + static String getenv(String name) { + return theUnmodifiableEnvironment.get(name); + } + + /* Only for use by System.getenv() */ + static Map<String,String> getenv() { + return theUnmodifiableEnvironment; + } + + /* Only for use by ProcessBuilder.environment() */ + static Map<String,String> environment() { + return new StringEnvironment + ((Map<Variable,Value>)(theEnvironment.clone())); + } + + /* Only for use by Runtime.exec(...String[]envp...) */ + static Map<String,String> emptyEnvironment(int capacity) { + return new StringEnvironment(new HashMap<Variable,Value>(capacity)); + } + + private static native byte[][] environ(); + + // This class is not instantiable. + private ProcessEnvironment() {} + + // Check that name is suitable for insertion into Environment map + private static void validateVariable(String name) { + if (name.indexOf('=') != -1 || + name.indexOf('\u0000') != -1) + throw new IllegalArgumentException + ("Invalid environment variable name: \"" + name + "\""); + } + + // Check that value is suitable for insertion into Environment map + private static void validateValue(String value) { + if (value.indexOf('\u0000') != -1) + throw new IllegalArgumentException + ("Invalid environment variable value: \"" + value + "\""); + } + + // A class hiding the byteArray-String duality of + // text data on Unixoid operating systems. + private static abstract class ExternalData { + protected final String str; + protected final byte[] bytes; + + protected ExternalData(String str, byte[] bytes) { + this.str = str; + this.bytes = bytes; + } + + public byte[] getBytes() { + return bytes; + } + + public String toString() { + return str; + } + + public boolean equals(Object o) { + return o instanceof ExternalData + && arrayEquals(getBytes(), ((ExternalData) o).getBytes()); + } + + public int hashCode() { + return arrayHash(getBytes()); + } + } + + private static class Variable + extends ExternalData implements Comparable<Variable> + { + protected Variable(String str, byte[] bytes) { + super(str, bytes); + } + + public static Variable valueOfQueryOnly(Object str) { + return valueOfQueryOnly((String) str); + } + + public static Variable valueOfQueryOnly(String str) { + return new Variable(str, str.getBytes()); + } + + public static Variable valueOf(String str) { + validateVariable(str); + return valueOfQueryOnly(str); + } + + public static Variable valueOf(byte[] bytes) { + return new Variable(new String(bytes), bytes); + } + + public int compareTo(Variable variable) { + return arrayCompare(getBytes(), variable.getBytes()); + } + + public boolean equals(Object o) { + return o instanceof Variable && super.equals(o); + } + } + + private static class Value + extends ExternalData implements Comparable<Value> + { + protected Value(String str, byte[] bytes) { + super(str, bytes); + } + + public static Value valueOfQueryOnly(Object str) { + return valueOfQueryOnly((String) str); + } + + public static Value valueOfQueryOnly(String str) { + return new Value(str, str.getBytes()); + } + + public static Value valueOf(String str) { + validateValue(str); + return valueOfQueryOnly(str); + } + + public static Value valueOf(byte[] bytes) { + return new Value(new String(bytes), bytes); + } + + public int compareTo(Value value) { + return arrayCompare(getBytes(), value.getBytes()); + } + + public boolean equals(Object o) { + return o instanceof Value && super.equals(o); + } + } + + // This implements the String map view the user sees. + private static class StringEnvironment + extends AbstractMap<String,String> + { + private Map<Variable,Value> m; + private static String toString(Value v) { + return v == null ? null : v.toString(); + } + public StringEnvironment(Map<Variable,Value> m) {this.m = m;} + public int size() {return m.size();} + public boolean isEmpty() {return m.isEmpty();} + public void clear() { m.clear();} + public boolean containsKey(Object key) { + return m.containsKey(Variable.valueOfQueryOnly(key)); + } + public boolean containsValue(Object value) { + return m.containsValue(Value.valueOfQueryOnly(value)); + } + public String get(Object key) { + return toString(m.get(Variable.valueOfQueryOnly(key))); + } + public String put(String key, String value) { + return toString(m.put(Variable.valueOf(key), + Value.valueOf(value))); + } + public String remove(Object key) { + return toString(m.remove(Variable.valueOfQueryOnly(key))); + } + public Set<String> keySet() { + return new StringKeySet(m.keySet()); + } + public Set<Map.Entry<String,String>> entrySet() { + return new StringEntrySet(m.entrySet()); + } + public Collection<String> values() { + return new StringValues(m.values()); + } + + // It is technically feasible to provide a byte-oriented view + // as follows: + // public Map<byte[],byte[]> asByteArrayMap() { + // return new ByteArrayEnvironment(m); + // } + + + // Convert to Unix style environ as a monolithic byte array + // inspired by the Windows Environment Block, except we work + // exclusively with bytes instead of chars, and we need only + // one trailing NUL on Unix. + // This keeps the JNI as simple and efficient as possible. + public byte[] toEnvironmentBlock(int[]envc) { + int count = m.size() * 2; // For added '=' and NUL + for (Map.Entry<Variable,Value> entry : m.entrySet()) { + count += entry.getKey().getBytes().length; + count += entry.getValue().getBytes().length; + } + + byte[] block = new byte[count]; + + int i = 0; + for (Map.Entry<Variable,Value> entry : m.entrySet()) { + byte[] key = entry.getKey ().getBytes(); + byte[] value = entry.getValue().getBytes(); + System.arraycopy(key, 0, block, i, key.length); + i+=key.length; + block[i++] = (byte) '='; + System.arraycopy(value, 0, block, i, value.length); + i+=value.length + 1; + // No need to write NUL byte explicitly + //block[i++] = (byte) '\u0000'; + } + envc[0] = m.size(); + return block; + } + } + + static byte[] toEnvironmentBlock(Map<String,String> map, int[]envc) { + return map == null ? null : + ((StringEnvironment)map).toEnvironmentBlock(envc); + } + + + private static class StringEntry + implements Map.Entry<String,String> + { + private final Map.Entry<Variable,Value> e; + public StringEntry(Map.Entry<Variable,Value> e) {this.e = e;} + public String getKey() {return e.getKey().toString();} + public String getValue() {return e.getValue().toString();} + public String setValue(String newValue) { + return e.setValue(Value.valueOf(newValue)).toString(); + } + public String toString() {return getKey() + "=" + getValue();} + public boolean equals(Object o) { + return o instanceof StringEntry + && e.equals(((StringEntry)o).e); + } + public int hashCode() {return e.hashCode();} + } + + private static class StringEntrySet + extends AbstractSet<Map.Entry<String,String>> + { + private final Set<Map.Entry<Variable,Value>> s; + public StringEntrySet(Set<Map.Entry<Variable,Value>> s) {this.s = s;} + public int size() {return s.size();} + public boolean isEmpty() {return s.isEmpty();} + public void clear() { s.clear();} + public Iterator<Map.Entry<String,String>> iterator() { + return new Iterator<Map.Entry<String,String>>() { + Iterator<Map.Entry<Variable,Value>> i = s.iterator(); + public boolean hasNext() {return i.hasNext();} + public Map.Entry<String,String> next() { + return new StringEntry(i.next()); + } + public void remove() {i.remove();} + }; + } + private static Map.Entry<Variable,Value> vvEntry(final Object o) { + if (o instanceof StringEntry) + return ((StringEntry)o).e; + return new Map.Entry<Variable,Value>() { + public Variable getKey() { + return Variable.valueOfQueryOnly(((Map.Entry)o).getKey()); + } + public Value getValue() { + return Value.valueOfQueryOnly(((Map.Entry)o).getValue()); + } + public Value setValue(Value value) { + throw new UnsupportedOperationException(); + } + }; + } + public boolean contains(Object o) { return s.contains(vvEntry(o)); } + public boolean remove(Object o) { return s.remove(vvEntry(o)); } + public boolean equals(Object o) { + return o instanceof StringEntrySet + && s.equals(((StringEntrySet) o).s); + } + public int hashCode() {return s.hashCode();} + } + + private static class StringValues + extends AbstractCollection<String> + { + private final Collection<Value> c; + public StringValues(Collection<Value> c) {this.c = c;} + public int size() {return c.size();} + public boolean isEmpty() {return c.isEmpty();} + public void clear() { c.clear();} + public Iterator<String> iterator() { + return new Iterator<String>() { + Iterator<Value> i = c.iterator(); + public boolean hasNext() {return i.hasNext();} + public String next() {return i.next().toString();} + public void remove() {i.remove();} + }; + } + public boolean contains(Object o) { + return c.contains(Value.valueOfQueryOnly(o)); + } + public boolean remove(Object o) { + return c.remove(Value.valueOfQueryOnly(o)); + } + public boolean equals(Object o) { + return o instanceof StringValues + && c.equals(((StringValues)o).c); + } + public int hashCode() {return c.hashCode();} + } + + private static class StringKeySet extends AbstractSet<String> { + private final Set<Variable> s; + public StringKeySet(Set<Variable> s) {this.s = s;} + public int size() {return s.size();} + public boolean isEmpty() {return s.isEmpty();} + public void clear() { s.clear();} + public Iterator<String> iterator() { + return new Iterator<String>() { + Iterator<Variable> i = s.iterator(); + public boolean hasNext() {return i.hasNext();} + public String next() {return i.next().toString();} + public void remove() { i.remove();} + }; + } + public boolean contains(Object o) { + return s.contains(Variable.valueOfQueryOnly(o)); + } + public boolean remove(Object o) { + return s.remove(Variable.valueOfQueryOnly(o)); + } + } + + // Replace with general purpose method someday + private static int arrayCompare(byte[]x, byte[] y) { + int min = x.length < y.length ? x.length : y.length; + for (int i = 0; i < min; i++) + if (x[i] != y[i]) + return x[i] - y[i]; + return x.length - y.length; + } + + // Replace with general purpose method someday + private static boolean arrayEquals(byte[] x, byte[] y) { + if (x.length != y.length) + return false; + for (int i = 0; i < x.length; i++) + if (x[i] != y[i]) + return false; + return true; + } + + // Replace with general purpose method someday + private static int arrayHash(byte[] x) { + int hash = 0; + for (int i = 0; i < x.length; i++) + hash = 31 * hash + x[i]; + return hash; + } + +} Copied: trunk/core/src/openjdk/svm/java/lang/ProcessImpl.java (from rev 4968, trunk/core/src/openjdk/vm/java/lang/ProcessImpl.java) =================================================================== --- trunk/core/src/openjdk/svm/java/lang/ProcessImpl.java (rev 0) +++ trunk/core/src/openjdk/svm/java/lang/ProcessImpl.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,88 @@ +/* + * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.lang; + +import java.io.IOException; +import java.lang.Process; + +/** + * This class is for the exclusive use of ProcessBuilder.start() to + * create new processes. + * + * @author Martin Buchholz + * @since 1.5 + */ +final class ProcessImpl { + private ProcessImpl() {} // Not instantiable + + private static byte[] toCString(String s) { + if (s == null) + return null; + byte[] bytes = s.getBytes(); + byte[] result = new byte[bytes.length + 1]; + System.arraycopy(bytes, 0, + result, 0, + bytes.length); + result[result.length-1] = (byte)0; + return result; + } + + // Only for use by ProcessBuilder.start() + static Process start(String[] cmdarray, + java.util.Map<String,String> environment, + String dir, + boolean redirectErrorStream) + throws IOException + { + assert cmdarray != null && cmdarray.length > 0; + + // Convert arguments to a contiguous block; it's easier to do + // memory management in Java than in C. + byte[][] args = new byte[cmdarray.length-1][]; + int size = args.length; // For added NUL bytes + for (int i = 0; i < args.length; i++) { + args[i] = cmdarray[i+1].getBytes(); + size += args[i].length; + } + byte[] argBlock = new byte[size]; + int i = 0; + for (byte[] arg : args) { + System.arraycopy(arg, 0, argBlock, i, arg.length); + i += arg.length + 1; + // No need to write NUL bytes explicitly + } + + int[] envc = new int[1]; + byte[] envBlock = ProcessEnvironment.toEnvironmentBlock(environment, envc); + + return new UNIXProcess + (toCString(cmdarray[0]), + argBlock, args.length, + envBlock, envc[0], + toCString(dir), + redirectErrorStream); + } +} Copied: trunk/core/src/openjdk/svm/java/lang/Terminator.java (from rev 4968, trunk/core/src/openjdk/vm/java/lang/Terminator.java) =================================================================== --- trunk/core/src/openjdk/svm/java/lang/Terminator.java (rev 0) +++ trunk/core/src/openjdk/svm/java/lang/Terminator.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,73 @@ +/* + * Copyright 1999-2001 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.lang; + +import sun.misc.Signal; +import sun.misc.SignalHandler; + + +/** + * Package-private utility class for setting up and tearing down + * platform-specific support for termination-triggered shutdowns. + * + * @author Mark Reinhold + * @since 1.3 + */ + +class Terminator { + + private static SignalHandler handler = null; + + /* Invocations of setup and teardown are already synchronized + * on the shutdown lock, so no further synchronization is needed here + */ + + static void setup() { + if (handler != null) return; + SignalHandler sh = new SignalHandler() { + public void handle(Signal sig) { + Shutdown.exit(sig.getNumber() + 0200); + } + }; + handler = sh; + try { + Signal.handle(new Signal("HUP"), sh); + Signal.handle(new Signal("INT"), sh); + Signal.handle(new Signal("TERM"), sh); + } catch (IllegalArgumentException e) { + // When -Xrs is specified the user is responsible for + // ensuring that shutdown hooks are run by calling + // System.exit() + } + } + + static void teardown() { + /* The current sun.misc.Signal class does not support + * the cancellation of handlers + */ + } + +} Copied: trunk/core/src/openjdk/svm/java/lang/UNIXProcess.java (from rev 4968, trunk/core/src/openjdk/vm/java/lang/UNIXProcess.java) =================================================================== --- trunk/core/src/openjdk/svm/java/lang/UNIXProcess.java (rev 0) +++ trunk/core/src/openjdk/svm/java/lang/UNIXProcess.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,220 @@ +/* + * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code 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 + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package java.lang; + +import java.io.*; + +/* java.lang.Process subclass in the UNIX environment. + * + * @author Mario Wolczko and Ross Knippel. + * @author Konstantin Kladko (ported to Linux) + */ + +final class UNIXProcess extends Process { + private FileDescriptor stdin_fd; + private FileDescriptor stdout_fd; + private FileDescriptor stderr_fd; + private int pid; + private int exitcode; + private boolean hasExited; + + private OutputStream stdin_stream; + private InputStream stdout_stream; + private InputStream stderr_stream; + + /* this is for the reaping thread */ + private native int waitForProcessExit(int pid); + + private native int forkAndExec(byte[] prog, + byte[] argBlock, int argc, + byte[] envBlock, int envc, + byte[] dir, + boolean redirectErrorStream, + FileDescriptor stdin_fd, + FileDescriptor stdout_fd, + FileDescriptor stderr_fd) + throws IOException; + + /* In the process constructor we wait on this gate until the process */ + /* has been created. Then we return from the constructor. */ + /* fork() is called by the same thread which later waits for the process */ + /* to terminate */ + + private static class Gate { + + private boolean exited = false; + private IOException savedException; + + synchronized void exit() { /* Opens the gate */ + exited = true; + this.notify(); + } + + synchronized void waitForExit() { /* wait until the gate is open */ + boolean interrupted = false; + while (!exited) { + try { + this.wait(); + } catch (InterruptedException e) { + interrupted = true; + } + } + if (interrupted) { + Thread.currentThread().interrupt(); + } + } + + void setException (IOException e) { + savedException = e; + } + + IOException getException() { + return savedException; + } + } + + UNIXProcess(final byte[] prog, + final byte[] argBlock, final int argc, + final byte[] envBlock, final int envc, + final byte[] dir, + final boolean redirectErrorStream) + throws IOException { + stdin_fd = new FileDescriptor(); + stdout_fd = new FileDescriptor(); + stderr_fd = new FileDescriptor(); + + final Gate gate = new Gate(); + /* + * For each subprocess forked a corresponding reaper thread + * is started. That thread is the only thread which waits + * for the subprocess to terminate and it doesn't hold any + * locks while doing so. This design allows waitFor() and + * exitStatus() to be safely executed in parallel (and they + * need no native code). + */ + + java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + Thread t = new Thread("process reaper") { + public void run() { + try { + pid = forkAndExec(prog, + argBlock, argc, + envBlock, envc, + dir, + redirectErrorStream, + stdin_fd, stdout_fd, stderr_fd); + } catch (IOException e) { + gate.setException(e); /*remember to rethrow later*/ + gate.exit(); + return; + } + java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction() { + public Object run() { + stdin_stream = new BufferedOutputStream(new + FileOutputStream(stdin_fd)); + stdout_stream = new BufferedInputStream(new + FileInputStream(stdout_fd)); + stderr_stream = new FileInputStream(stderr_fd); + return null; + } + }); + gate.exit(); /* exit from constructor */ + int res = waitForProcessExit(pid); + synchronized (UNIXProcess.this) { + hasExited = true; + exitcode = res; + UNIXProcess.this.notifyAll(); + } + } + }; + t.setDaemon(true); + t.start(); + return null; + } + }); + gate.waitForExit(); + IOException e = gate.getException(); + if (e != null) + throw new IOException(e.toString()); + } + + public OutputStream getOutputStream() { + return stdin_stream; + } + + public InputStream getInputStream() { + return stdout_stream; + } + + public InputStream getErrorStream() { + return stderr_stream; + } + + public synchronized int waitFor() throws InterruptedException { + while (!hasExited) { + wait(); + } + return exitcode; + } + + public synchronized int exitValue() { + if (!hasExited) { + throw new IllegalThreadStateException("process hasn't exited"); + } + return exitcode; + } + + private static native void destroyProcess(int pid); + public void destroy() { + // There is a risk that pid will be recycled, causing us to + // kill the wrong process! So we only terminate processes + // that appear to still be running. Even with this check, + // there is an unavoidable race condition here, but the window + // is very small, and OSes try hard to not recycle pids too + // soon, so this is quite safe. + synchronized (this) { + if (!hasExited) + destroyProcess(pid); + } + try { + stdin_stream.close(); + stdout_stream.close(); + stderr_stream.close(); + } catch (IOException e) { + // ignore + } + } + + /* This routine initializes JNI field offsets for the class */ + private static native void initIDs(); + + static { + initIDs(); + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "1" }, + { "minimalDaysInFirstWeek", "1" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_be.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_be.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_be.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,10 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_be extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_bg.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_bg.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_bg.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,10 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_bg extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ca.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ca.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_ca.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_ca extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_cs.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_cs.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_cs.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_cs extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_da.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_da.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_da.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_da extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_de.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_de.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_de.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_de extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_el extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el_CY.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el_CY.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_el_CY.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,11 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_el_CY extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "minimalDaysInFirstWeek", "1" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,10 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_en extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_GB.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_GB.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_GB.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_en_GB extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_IE.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_IE.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_IE.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_en_IE extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_MT.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_MT.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_en_MT.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,11 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_en_MT extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_es extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "1" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_ES.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_ES.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_ES.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_es_ES extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_US.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_US.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_es_US.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,11 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_es_US extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "1" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_et.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_et.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_et.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_et extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fi.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fi.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fi.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_fi extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_fr extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "2" }, + { "minimalDaysInFirstWeek", "4" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr_CA.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr_CA.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_fr_CA.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,12 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_fr_CA extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[][] { + { "firstDayOfWeek", "1" }, + { "minimalDaysInFirstWeek", "1" }, + }; + } +} Added: trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_hr.java =================================================================== --- trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_hr.java (rev 0) +++ trunk/core/src/openjdk/svm/sun/util/resources/CalendarData_hr.java 2009-02-02 06:20:51 UTC (rev 4969) @@ -0,0 +1,11 @@ +package sun.util.resources; + +import java.util.ListResourceBundle; + +public final class CalendarData_hr extends LocaleNamesBundle { + protected final Object[][] getContents() { + return new Object[... [truncated message content] |
From: <ls...@us...> - 2009-04-15 08:15:47
|
Revision: 5274 http://jnode.svn.sourceforge.net/jnode/?rev=5274&view=rev Author: lsantha Date: 2009-04-15 08:15:46 +0000 (Wed, 15 Apr 2009) Log Message: ----------- Removing classlib fom jnode. Modified Paths: -------------- trunk/core/build.xml trunk/core/core.iml Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2009-04-15 08:11:24 UTC (rev 5273) +++ trunk/core/build.xml 2009-04-15 08:15:46 UTC (rev 5274) @@ -113,12 +113,6 @@ <fileset dir="${my-src.dir}/classpath/java" includes="**/*.properties"/> <fileset dir="${my-src.dir}/classpath/vm" includes="**/*.security"/> <fileset dir="${my-src.dir}/classpath/tools" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/java" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/javax" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/org" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/com" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/sun" includes="**/*.jav"/> - <fileset dir="${my-src.dir}/openjdk/svm" includes="**/*.jav"/> <fileset dir="${my-src.dir}/openjdk/vm" includes="**/*.jav"/> </copy> <ExpandTest classname="PrimitiveIntTest" type="int"/> @@ -176,16 +170,7 @@ <fileset dir="${my-src.dir}/classpath/ext" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/vm" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/tools" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/java" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/javax" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/org" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/com" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/sun" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/svm" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/vm" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/corba" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/jaxws" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/openjdk/langtools" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/icedtea" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/core" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/endorsed/nanoxml" excludes="${my-non-resources}"/> Modified: trunk/core/core.iml =================================================================== --- trunk/core/core.iml 2009-04-15 08:11:24 UTC (rev 5273) +++ trunk/core/core.iml 2009-04-15 08:15:46 UTC (rev 5274) @@ -18,15 +18,6 @@ <sourceFolder url="file://$MODULE_DIR$/src/endorsed/nanoxml" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/icedtea" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/mmtk-vm" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/com" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/corba" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/javax" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/jaxws" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/langtools" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/org" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/sun" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/openjdk/svm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/vm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/template" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="false" /> @@ -67,7 +58,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jmock-1.0.1.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -76,7 +67,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jmock-1.0.1.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/jmock-cglib-1.0.1.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -85,7 +76,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/jmock-cglib-1.0.1.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/cglib-2.1.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -94,16 +85,16 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/cglib-2.1.jar!/" /> + <root url="jar://$MODULE_DIR$/lib/junit-4.5.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> </library> </orderEntry> - <orderEntry type="module-library"> + <orderEntry type="module-library" exported=""> <library> <CLASSES> - <root url="jar://$MODULE_DIR$/lib/junit-4.5.jar!/" /> + <root url="jar://$MODULE_DIR$/../all/lib/classlib.jar!/" /> </CLASSES> <JAVADOC /> <SOURCES /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-04-15 08:43:43
|
Revision: 5279 http://jnode.svn.sourceforge.net/jnode/?rev=5279&view=rev Author: lsantha Date: 2009-04-15 08:43:41 +0000 (Wed, 15 Apr 2009) Log Message: ----------- Removing classlib fom jnode. Modified Paths: -------------- trunk/core/build.xml trunk/core/core.iml Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2009-04-15 08:40:35 UTC (rev 5278) +++ trunk/core/build.xml 2009-04-15 08:43:41 UTC (rev 5279) @@ -109,10 +109,7 @@ <jnode.copy-descriptors/> <copy todir="${my-classes.dir}"> - <fileset dir="${my-src.dir}/classpath/gnu" includes="**/*.properties"/> - <fileset dir="${my-src.dir}/classpath/java" includes="**/*.properties"/> <fileset dir="${my-src.dir}/classpath/vm" includes="**/*.security"/> - <fileset dir="${my-src.dir}/classpath/tools" includes="**/*.jav"/> <fileset dir="${my-src.dir}/openjdk/vm" includes="**/*.jav"/> </copy> <ExpandTest classname="PrimitiveIntTest" type="int"/> @@ -164,14 +161,9 @@ <!-- Copy all non java files to class dir --> <copy todir="${my-classes.dir}"> - <fileset dir="${my-src.dir}/classpath/gnu" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/classpath/java" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/classpath/javax" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/ext" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/classpath/vm" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/classpath/tools" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/openjdk/vm" excludes="${my-non-resources}"/> - <fileset dir="${my-src.dir}/icedtea" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/core" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/endorsed/nanoxml" excludes="${my-non-resources}"/> <fileset dir="${my-src.dir}/vmmagic" excludes="${my-non-resources}"/> Modified: trunk/core/core.iml =================================================================== --- trunk/core/core.iml 2009-04-15 08:40:35 UTC (rev 5278) +++ trunk/core/core.iml 2009-04-15 08:43:41 UTC (rev 5279) @@ -7,16 +7,11 @@ <content url="file://$MODULE_DIR$"> <sourceFolder url="file://$MODULE_DIR$/src/classlib" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/classpath/ext" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/classpath/gnu" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/classpath/java" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/classpath/javax" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/classpath/tools" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/classpath/vm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/core" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/driver" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/emu" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/endorsed/nanoxml" isTestSource="false" /> - <sourceFolder url="file://$MODULE_DIR$/src/icedtea" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/mmtk-vm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/openjdk/vm" isTestSource="false" /> <sourceFolder url="file://$MODULE_DIR$/src/template" isTestSource="false" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <fd...@us...> - 2009-05-17 11:13:47
|
Revision: 5495 http://jnode.svn.sourceforge.net/jnode/?rev=5495&view=rev Author: fduminy Date: 2009-05-17 11:13:42 +0000 (Sun, 17 May 2009) Log Message: ----------- - update of mauve with new feature to embed system properties inside the xml report, the html report and the RunResult class - added custom system properties to reports (xml, html) to say if server was running in a vmware, kvm or a new jvm Modified Paths: -------------- trunk/core/lib/mauve-src.jar trunk/core/lib/mauve.jar trunk/core/src/test/org/jtestserver/client/TestDriver.java trunk/core/src/test/org/jtestserver/server/commands/MauveTestRunner.java Modified: trunk/core/lib/mauve-src.jar =================================================================== (Binary files differ) Modified: trunk/core/lib/mauve.jar =================================================================== (Binary files differ) Modified: trunk/core/src/test/org/jtestserver/client/TestDriver.java =================================================================== --- trunk/core/src/test/org/jtestserver/client/TestDriver.java 2009-05-17 11:09:40 UTC (rev 5494) +++ trunk/core/src/test/org/jtestserver/client/TestDriver.java 2009-05-17 11:13:42 UTC (rev 5495) @@ -172,6 +172,7 @@ LOGGER.info("running list of working tests"); File workingTests = (latestRun == null) ? null : latestRun.getWorkingTests(); RunResult runResult = runTests(workingTests, true, workingList, crashingList, newRun.getTimestampString()); + runResult.setSystemProperty("jtestserver.process", process.getClass().getName()); LOGGER.info("running list of crashing tests"); File crashingTests = (latestRun == null) ? null : latestRun.getCrashingTests(); @@ -234,17 +235,19 @@ } RunResult result = new RunResult(timestamp); - int i = 0; + boolean firstTest = true; + int i = 0; // TODO for debug only, remove that for (String test : list) { if (i++ > 100) { // TODO for debug only, remove that break; } boolean working = false; + RunResult delta = null; LOGGER.info("launching test " + test); - + try { - RunResult delta = client.runMauveTest(test); + delta = client.runMauveTest(test); mergeResults(result, delta); working = true; @@ -256,6 +259,14 @@ } else { crashingList.add(test); } + + if (firstTest && (delta != null)) { + for (String name : delta.getSystemPropertyNames()) { + result.setSystemProperty(name, delta.getSystemProperty(name)); + } + + firstTest = false; + } } } Modified: trunk/core/src/test/org/jtestserver/server/commands/MauveTestRunner.java =================================================================== --- trunk/core/src/test/org/jtestserver/server/commands/MauveTestRunner.java 2009-05-17 11:09:40 UTC (rev 5494) +++ trunk/core/src/test/org/jtestserver/server/commands/MauveTestRunner.java 2009-05-17 11:13:42 UTC (rev 5495) @@ -64,16 +64,16 @@ private class JTSMauve extends Mauve { public RunResult runTest(String testName) { - // save the default locale, some tests change the default and we want - // to restore it before generating the HTML report... + // save the default locale, some tests change the default Locale savedLocale = Locale.getDefault(); result = new RunResult("Mauve Test Run"); + addSystemProperties(result); currentCheck = new CheckResult(0, false); executeLine("", testName); - // tests are complete so restore the default locale + // restore the default locale Locale.setDefault(savedLocale); return getResult(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2009-08-14 16:59:52
|
Revision: 5641 http://jnode.svn.sourceforge.net/jnode/?rev=5641&view=rev Author: lsantha Date: 2009-08-14 16:59:45 +0000 (Fri, 14 Aug 2009) Log Message: ----------- Added native stubs for sun.management. Modified Paths: -------------- trunk/core/descriptors/org.classpath.core.vm.xml trunk/core/descriptors/org.classpath.ext.management.xml Added Paths: ----------- trunk/core/src/openjdk/vm/sun/management/ trunk/core/src/openjdk/vm/sun/management/NativeClassLoadingImpl.java trunk/core/src/openjdk/vm/sun/management/NativeFlag.java trunk/core/src/openjdk/vm/sun/management/NativeGarbageCollectorImpl.java trunk/core/src/openjdk/vm/sun/management/NativeGcInfoBuilder.java trunk/core/src/openjdk/vm/sun/management/NativeHotSpotDiagnostic.java trunk/core/src/openjdk/vm/sun/management/NativeHotspotThread.java trunk/core/src/openjdk/vm/sun/management/NativeMemoryImpl.java trunk/core/src/openjdk/vm/sun/management/NativeMemoryManagerImpl.java trunk/core/src/openjdk/vm/sun/management/NativeMemoryPoolImpl.java trunk/core/src/openjdk/vm/sun/management/NativeThreadImpl.java trunk/core/src/openjdk/vm/sun/management/NativeVMManagementImpl.java Modified: trunk/core/descriptors/org.classpath.core.vm.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.vm.xml 2009-08-12 19:27:09 UTC (rev 5640) +++ trunk/core/descriptors/org.classpath.core.vm.xml 2009-08-14 16:59:45 UTC (rev 5641) @@ -2,12 +2,12 @@ <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="rt.vm" - name="Classpath AWT classes" + name="Native classes for the classlib" version="@VERSION@" system="true" plugin-version="@VERSION@" - provider-name="Classpath" - provider-url="http://classpath.org" + provider-name="JNode.org" + provider-url="http://jnode.org" license-name="classpath"> <runtime> @@ -34,6 +34,7 @@ <export name="javax.imageio.spi.*"/> <export name="sun.reflect.*"/> <export name="sun.misc.*"/> + <export name="sun.management.*"/> <export name="sun.security.provider.*"/> <export name="javax.isolate.*"/> Modified: trunk/core/descriptors/org.classpath.ext.management.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.management.xml 2009-08-12 19:27:09 UTC (rev 5640) +++ trunk/core/descriptors/org.classpath.ext.management.xml 2009-08-14 16:59:45 UTC (rev 5641) @@ -35,6 +35,7 @@ <export name="sun.management.counter.*"/> <export name="sun.management.counter.perf.*"/> <export name="sun.management.jmxremote.*"/> + <export name="sun.management.resources.*"/> </library> </runtime> Added: trunk/core/src/openjdk/vm/sun/management/NativeClassLoadingImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeClassLoadingImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeClassLoadingImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,13 @@ +package sun.management; + +/** + * @see sun.management.ClassLoadingImpl + */ +class NativeClassLoadingImpl { + /** + * @see sun.management.ClassLoadingImpl#setVerboseClass(boolean) + */ + private static void setVerboseClass(boolean arg1) { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeFlag.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeFlag.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeFlag.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,52 @@ +package sun.management; + +/** + * @see sun.management.Flag + */ +class NativeFlag { + /** + * @see sun.management.Flag#getAllFlagNames() + */ + private static String[] getAllFlagNames() { + //todo implement it + return new String[0]; + } + /** + * @see sun.management.Flag#getFlags(java.lang.String[], sun.management.Flag[], int) + */ + private static int getFlags(String[] arg1, Flag[] arg2, int arg3) { + //todo implement it + return 0; + } + /** + * @see sun.management.Flag#getInternalFlagCount() + */ + private static int getInternalFlagCount() { + //todo implement it + return 0; + } + /** + * @see sun.management.Flag#setLongValue(java.lang.String, long) + */ + private static void setLongValue(String arg1, long arg2) { + //todo implement it + } + /** + * @see sun.management.Flag#setBooleanValue(java.lang.String, boolean) + */ + private static void setBooleanValue(String arg1, boolean arg2) { + //todo implement it + } + /** + * @see sun.management.Flag#setStringValue(java.lang.String, java.lang.String) + */ + private static void setStringValue(String arg1, String arg2) { + //todo implement it + } + /** + * @see sun.management.Flag#initialize() + */ + private static void initialize() { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeGarbageCollectorImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeGarbageCollectorImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeGarbageCollectorImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,21 @@ +package sun.management; + +/** + * @see sun.management.GarbageCollectorImpl + */ +class NativeGarbageCollectorImpl { + /** + * @see sun.management.GarbageCollectorImpl#getCollectionCount() + */ + private static long getCollectionCount(GarbageCollectorImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.GarbageCollectorImpl#getCollectionTime() + */ + private static long getCollectionTime(GarbageCollectorImpl instance) { + //todo implement it + return 0; + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeGcInfoBuilder.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeGcInfoBuilder.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeGcInfoBuilder.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,31 @@ +package sun.management; + +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.MemoryUsage; +import com.sun.management.GcInfo; + +/** + * @see sun.management.GcInfoBuilder + */ +class NativeGcInfoBuilder { + /** + * @see sun.management.GcInfoBuilder#getNumGcExtAttributes(java.lang.management.GarbageCollectorMXBean) + */ + private static int getNumGcExtAttributes(GcInfoBuilder instance, GarbageCollectorMXBean arg1) { + //todo implement it + return 0; + } + /** + * @see sun.management.GcInfoBuilder#fillGcAttributeInfo(java.lang.management.GarbageCollectorMXBean, int, java.lang.String[], char[], java.lang.String[]) + */ + private static void fillGcAttributeInfo(GcInfoBuilder instance, GarbageCollectorMXBean arg1, int arg2, String[] arg3, char[] arg4, String[] arg5) { + //todo implement it + } + /** + * @see sun.management.GcInfoBuilder#getLastGcInfo0(java.lang.management.GarbageCollectorMXBean, int, java.lang.Object[], char[], java.lang.management.MemoryUsage[], java.lang.management.MemoryUsage[]) + */ + private static GcInfo getLastGcInfo0(GcInfoBuilder instance, GarbageCollectorMXBean arg1, int arg2, Object[] arg3, char[] arg4, MemoryUsage[] arg5, MemoryUsage[] arg6) { + //todo implement it + return null; + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeHotSpotDiagnostic.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeHotSpotDiagnostic.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeHotSpotDiagnostic.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,13 @@ +package sun.management; + +/** + * @see sun.management.HotSpotDiagnostic + */ +class NativeHotSpotDiagnostic { + /** + * @see sun.management.HotSpotDiagnostic#dumpHeap(java.lang.String, boolean) + */ + private static void dumpHeap(HotSpotDiagnostic instance, String arg1, boolean arg2) { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeHotspotThread.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeHotspotThread.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeHotspotThread.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,21 @@ +package sun.management; + +/** + * @see sun.management.HotspotThread + */ +class NativeHotspotThread { + /** + * @see sun.management.HotspotThread#getInternalThreadCount() + */ + private static int getInternalThreadCount(HotspotThread instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.HotspotThread#getInternalThreadTimes0(java.lang.String[], long[]) + */ + private static int getInternalThreadTimes0(HotspotThread instance, String[] arg1, long[] arg2) { + //todo implement it + return 0; + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeMemoryImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeMemoryImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeMemoryImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,38 @@ +package sun.management; + +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryManagerMXBean; +import java.lang.management.MemoryUsage; + +/** + * @see sun.management.MemoryImpl + */ +class NativeMemoryImpl { + /** + * @see sun.management.MemoryImpl#getMemoryPools0() + */ + private static MemoryPoolMXBean[] getMemoryPools0() { + //todo implement it + return new MemoryPoolMXBean[0]; + } + /** + * @see sun.management.MemoryImpl#getMemoryManagers0() + */ + private static MemoryManagerMXBean[] getMemoryManagers0() { + //todo implement it + return new MemoryManagerMXBean[0]; + } + /** + * @see sun.management.MemoryImpl#getMemoryUsage0(boolean) + */ + private static MemoryUsage getMemoryUsage0(MemoryImpl instance, boolean arg1) { + //todo implement it + return null; + } + /** + * @see sun.management.MemoryImpl#setVerboseGC(boolean) + */ + private static void setVerboseGC(MemoryImpl instance, boolean arg1) { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeMemoryManagerImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeMemoryManagerImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeMemoryManagerImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,16 @@ +package sun.management; + +import java.lang.management.MemoryPoolMXBean; + +/** + * @see sun.management.MemoryManagerImpl + */ +class NativeMemoryManagerImpl { + /** + * @see sun.management.MemoryManagerImpl#getMemoryPools0() + */ + private static MemoryPoolMXBean[] getMemoryPools0(MemoryManagerImpl instance) { + //todo implement it + return new MemoryPoolMXBean[0]; + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeMemoryPoolImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeMemoryPoolImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeMemoryPoolImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,68 @@ +package sun.management; + +import java.lang.management.MemoryUsage; +import java.lang.management.MemoryManagerMXBean; + +/** + * @see sun.management.MemoryPoolImpl + */ +class NativeMemoryPoolImpl { + /** + * @see sun.management.MemoryPoolImpl#getUsage0() + */ + private static MemoryUsage getUsage0(MemoryPoolImpl instance) { + //todo implement it + return null; + } + /** + * @see sun.management.MemoryPoolImpl#getPeakUsage0() + */ + private static MemoryUsage getPeakUsage0(MemoryPoolImpl instance) { + //todo implement it + return null; + } + /** + * @see sun.management.MemoryPoolImpl#getCollectionUsage0() + */ + private static MemoryUsage getCollectionUsage0(MemoryPoolImpl instance) { + //todo implement it + return null; + } + /** + * @see sun.management.MemoryPoolImpl#setUsageThreshold0(long, long) + */ + private static void setUsageThreshold0(MemoryPoolImpl instance, long arg1, long arg2) { + //todo implement it + } + /** + * @see sun.management.MemoryPoolImpl#setCollectionThreshold0(long, long) + */ + private static void setCollectionThreshold0(MemoryPoolImpl instance, long arg1, long arg2) { + //todo implement it + } + /** + * @see sun.management.MemoryPoolImpl#resetPeakUsage0() + */ + private static void resetPeakUsage0(MemoryPoolImpl instance) { + //todo implement it + } + /** + * @see sun.management.MemoryPoolImpl#getMemoryManagers0() + */ + private static MemoryManagerMXBean[] getMemoryManagers0(MemoryPoolImpl instance) { + //todo implement it + return new MemoryManagerMXBean[0]; + } + /** + * @see sun.management.MemoryPoolImpl#setPoolUsageSensor(sun.management.Sensor) + */ + private static void setPoolUsageSensor(MemoryPoolImpl instance, Sensor arg1) { + //todo implement it + } + /** + * @see sun.management.MemoryPoolImpl#setPoolCollectionSensor(sun.management.Sensor) + */ + private static void setPoolCollectionSensor(MemoryPoolImpl instance, Sensor arg1) { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeThreadImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeThreadImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeThreadImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,81 @@ +package sun.management; + +import java.lang.management.ThreadInfo; + +/** + * @see sun.management.ThreadImpl + */ +class NativeThreadImpl { + /** + * @see sun.management.ThreadImpl#getThreads() + */ + private static Thread[] getThreads() { + //todo implement it + return new Thread[0]; + } + /** + * @see sun.management.ThreadImpl#getThreadInfo0(long[], int, java.lang.management.ThreadInfo[]) + */ + private static void getThreadInfo0(long[] arg1, int arg2, ThreadInfo[] arg3) { + //todo implement it + } + /** + * @see sun.management.ThreadImpl#getThreadTotalCpuTime0(long) + */ + private static long getThreadTotalCpuTime0(long arg1) { + //todo implement it + return 0; + } + /** + * @see sun.management.ThreadImpl#getThreadUserCpuTime0(long) + */ + private static long getThreadUserCpuTime0(long arg1) { + //todo implement it + return 0; + } + /** + * @see sun.management.ThreadImpl#setThreadCpuTimeEnabled0(boolean) + */ + private static void setThreadCpuTimeEnabled0(boolean arg1) { + //todo implement it + } + /** + * @see sun.management.ThreadImpl#setThreadContentionMonitoringEnabled0(boolean) + */ + private static void setThreadContentionMonitoringEnabled0(boolean arg1) { + //todo implement it + } + /** + * @see sun.management.ThreadImpl#findMonitorDeadlockedThreads0() + */ + private static Thread[] findMonitorDeadlockedThreads0() { + //todo implement it + return new Thread[0]; + } + /** + * @see sun.management.ThreadImpl#findDeadlockedThreads0() + */ + private static Thread[] findDeadlockedThreads0() { + //todo implement it + return new Thread[0]; + } + /** + * @see sun.management.ThreadImpl#resetPeakThreadCount0() + */ + private static void resetPeakThreadCount0() { + //todo implement it + } + /** + * @see sun.management.ThreadImpl#dumpThreads0(long[], boolean, boolean) + */ + private static ThreadInfo[] dumpThreads0(long[] arg1, boolean arg2, boolean arg3) { + //todo implement it + return new ThreadInfo[0]; + } + /** + * @see sun.management.ThreadImpl#resetContentionTimes0(long) + */ + private static void resetContentionTimes0(long arg1) { + //todo implement it + } +} Added: trunk/core/src/openjdk/vm/sun/management/NativeVMManagementImpl.java =================================================================== --- trunk/core/src/openjdk/vm/sun/management/NativeVMManagementImpl.java (rev 0) +++ trunk/core/src/openjdk/vm/sun/management/NativeVMManagementImpl.java 2009-08-14 16:59:45 UTC (rev 5641) @@ -0,0 +1,203 @@ +package sun.management; + +import org.jnode.vm.isolate.VmIsolate; +import org.jnode.vm.Vm; + +/** + * @see sun.management.VMManagementImpl + */ +class NativeVMManagementImpl { + /** + * @see sun.management.VMManagementImpl#getVersion0() + */ + private static String getVersion0() { + //for java 6 + return "1.2"; + } + /** + * @see sun.management.VMManagementImpl#initOptionalSupportFields() + */ + private static void initOptionalSupportFields() { + //todo implement it + } + /** + * @see sun.management.VMManagementImpl#isThreadContentionMonitoringEnabled() + */ + private static boolean isThreadContentionMonitoringEnabled(VMManagementImpl instance) { + //todo implement it + return false; + } + /** + * @see sun.management.VMManagementImpl#isThreadCpuTimeEnabled() + */ + private static boolean isThreadCpuTimeEnabled(VMManagementImpl instance) { + //todo implement it + return false; + } + /** + * @see sun.management.VMManagementImpl#getTotalClassCount() + */ + private static long getTotalClassCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getUnloadedClassCount() + */ + private static long getUnloadedClassCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getVerboseClass() + */ + private static boolean getVerboseClass(VMManagementImpl instance) { + //todo implement it + return false; + } + /** + * @see sun.management.VMManagementImpl#getVerboseGC() + */ + private static boolean getVerboseGC(VMManagementImpl instance) { + //todo implement it + return false; + } + /** + * @see sun.management.VMManagementImpl#getProcessId() + */ + private static int getProcessId(VMManagementImpl instance) { + return VmIsolate.currentIsolate().getId(); + } + /** + * @see sun.management.VMManagementImpl#getVmArguments0() + */ + private static String getVmArguments0(VMManagementImpl instance) { + //todo implement it + return null; + } + /** + * @see sun.management.VMManagementImpl#getStartupTime() + */ + private static long getStartupTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getAvailableProcessors() + */ + private static int getAvailableProcessors(VMManagementImpl instance) { + return Vm.getVm().availableProcessors(); + } + /** + * @see sun.management.VMManagementImpl#getTotalCompileTime() + */ + private static long getTotalCompileTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getTotalThreadCount() + */ + private static long getTotalThreadCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getLiveThreadCount() + */ + private static int getLiveThreadCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getPeakThreadCount() + */ + private static int getPeakThreadCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getDaemonThreadCount() + */ + private static int getDaemonThreadCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getSafepointCount() + */ + private static long getSafepointCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getTotalSafepointTime() + */ + private static long getTotalSafepointTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getSafepointSyncTime() + */ + private static long getSafepointSyncTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getTotalApplicationNonStoppedTime() + */ + private static long getTotalApplicationNonStoppedTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getLoadedClassSize() + */ + private static long getLoadedClassSize(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getUnloadedClassSize() + */ + private static long getUnloadedClassSize(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getClassLoadingTime() + */ + private static long getClassLoadingTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getMethodDataSize() + */ + private static long getMethodDataSize(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getInitializedClassCount() + */ + private static long getInitializedClassCount(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getClassInitializationTime() + */ + private static long getClassInitializationTime(VMManagementImpl instance) { + //todo implement it + return 0; + } + /** + * @see sun.management.VMManagementImpl#getClassVerificationTime() + */ + private static long getClassVerificationTime(VMManagementImpl instance) { + //todo implement it + return 0; + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ga...@us...> - 2012-03-01 21:31:50
|
Revision: 5889 http://jnode.svn.sourceforge.net/jnode/?rev=5889&view=rev Author: galatnm Date: 2012-03-01 21:31:44 +0000 (Thu, 01 Mar 2012) Log Message: ----------- Fix broken build. Modified Paths: -------------- trunk/core/descriptors/org.jnode.test.xml Added Paths: ----------- trunk/core/src/test/org/jnode/test/util/ trunk/core/src/test/org/jnode/test/util/NumberUtilsTest.java Removed Paths: ------------- trunk/core/src/test/org/jnode/util/NumberUtilsTest.java Modified: trunk/core/descriptors/org.jnode.test.xml =================================================================== --- trunk/core/descriptors/org.jnode.test.xml 2012-02-29 12:16:57 UTC (rev 5888) +++ trunk/core/descriptors/org.jnode.test.xml 2012-03-01 21:31:44 UTC (rev 5889) @@ -17,6 +17,7 @@ <export name="org.jnode.test.bugs.*"/> <export name="org.jnode.test.security.*"/> <export name="org.jnode.test.threads.*"/> + <export name="org.jnode.test.util.*"/> </library> </runtime> Copied: trunk/core/src/test/org/jnode/test/util/NumberUtilsTest.java (from rev 5888, trunk/core/src/test/org/jnode/util/NumberUtilsTest.java) =================================================================== --- trunk/core/src/test/org/jnode/test/util/NumberUtilsTest.java (rev 0) +++ trunk/core/src/test/org/jnode/test/util/NumberUtilsTest.java 2012-03-01 21:31:44 UTC (rev 5889) @@ -0,0 +1,86 @@ +package org.jnode.test.util; + +import org.jnode.util.NumberUtils; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + + +public class NumberUtilsTest { + @Test + public void testToString() throws Exception { + String result = NumberUtils.toString(15.2365f,2); + assertEquals("15.23",result); + } + + @Test + public void testToStringNeg() throws Exception { + String result = NumberUtils.toString(-15.2365f,2); + assertEquals("-15.23",result); + } + + @Test + public void testHexInt(){ + String result = NumberUtils.hex(255); + assertEquals("000000ff",result.toLowerCase()); + } + + @Test + public void testHexIntNeg(){ + String result = NumberUtils.hex(-1); + assertEquals("ffffffff",result.toLowerCase()); + } + + @Test + public void testHexIntMax(){ + String result = NumberUtils.hex(Integer.MAX_VALUE); + assertEquals("7fffffff",result.toLowerCase()); + } + + @Test + public void testHexLong(){ + String result = NumberUtils.hex(255L); + assertEquals("00000000000000ff",result.toLowerCase()); + } + + @Test + public void testHexLongNeg(){ + String result = NumberUtils.hex(-1L); + assertEquals("ffffffffffffffff",result.toLowerCase()); + } + + @Test + public void testHexLongMax(){ + String result = NumberUtils.hex(Long.MAX_VALUE); + assertEquals("7fffffffffffffff",result.toLowerCase()); + } + + @Test + public void testHexWithLength(){ + String result = NumberUtils.hex(255,2); + assertEquals("ff",result.toLowerCase()); + } + + @Test + public void testToDecimalByte(){ + String result = NumberUtils.toDecimalByte(65536); + assertEquals("65.53 kb",result.toLowerCase()); + } + + @Test + public void testToBinaryByte(){ + String result = NumberUtils.toBinaryByte(65536); + assertEquals("64.0 kb",result.toLowerCase()); + } + + @Test + public void testGetSizeUnit(){ + assertEquals(1024,NumberUtils.getSizeUnit("1K").getMultiplier()); + assertEquals("K",NumberUtils.getSizeUnit("1K").getUnit()); + } + + @Test + public void testGetSize(){ + assertEquals(1024,NumberUtils.getSize("1K")); + } +} Deleted: trunk/core/src/test/org/jnode/util/NumberUtilsTest.java =================================================================== --- trunk/core/src/test/org/jnode/util/NumberUtilsTest.java 2012-02-29 12:16:57 UTC (rev 5888) +++ trunk/core/src/test/org/jnode/util/NumberUtilsTest.java 2012-03-01 21:31:44 UTC (rev 5889) @@ -1,85 +0,0 @@ -package org.jnode.util; - -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - - -public class NumberUtilsTest { - @Test - public void testToString() throws Exception { - String result = NumberUtils.toString(15.2365f,2); - assertEquals("15.23",result); - } - - @Test - public void testToStringNeg() throws Exception { - String result = NumberUtils.toString(-15.2365f,2); - assertEquals("-15.23",result); - } - - @Test - public void testHexInt(){ - String result = NumberUtils.hex(255); - assertEquals("000000ff",result.toLowerCase()); - } - - @Test - public void testHexIntNeg(){ - String result = NumberUtils.hex(-1); - assertEquals("ffffffff",result.toLowerCase()); - } - - @Test - public void testHexIntMax(){ - String result = NumberUtils.hex(Integer.MAX_VALUE); - assertEquals("7fffffff",result.toLowerCase()); - } - - @Test - public void testHexLong(){ - String result = NumberUtils.hex(255L); - assertEquals("00000000000000ff",result.toLowerCase()); - } - - @Test - public void testHexLongNeg(){ - String result = NumberUtils.hex(-1L); - assertEquals("ffffffffffffffff",result.toLowerCase()); - } - - @Test - public void testHexLongMax(){ - String result = NumberUtils.hex(Long.MAX_VALUE); - assertEquals("7fffffffffffffff",result.toLowerCase()); - } - - @Test - public void testHexWithLength(){ - String result = NumberUtils.hex(255,2); - assertEquals("ff",result.toLowerCase()); - } - - @Test - public void testToDecimalByte(){ - String result = NumberUtils.toDecimalByte(65536); - assertEquals("65.53 kb",result.toLowerCase()); - } - - @Test - public void testToBinaryByte(){ - String result = NumberUtils.toBinaryByte(65536); - assertEquals("64.0 kb",result.toLowerCase()); - } - - @Test - public void testGetSizeUnit(){ - assertEquals(1024,NumberUtils.getSizeUnit("1K").getMultiplier()); - assertEquals("K",NumberUtils.getSizeUnit("1K").getUnit()); - } - - @Test - public void testGetSize(){ - assertEquals(1024,NumberUtils.getSize("1K")); - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ls...@us...> - 2013-02-24 17:07:37
|
Revision: 5978 http://jnode.svn.sourceforge.net/jnode/?rev=5978&view=rev Author: lsantha Date: 2013-02-24 17:07:24 +0000 (Sun, 24 Feb 2013) Log Message: ----------- Updated headers. Modified Paths: -------------- trunk/core/build.xml trunk/core/descriptors/com.sun.tools.javac.xml trunk/core/descriptors/com.sun.tools.jdi.xml trunk/core/descriptors/ejc.xml trunk/core/descriptors/gnu.mauve.plugin.xml trunk/core/descriptors/gnu.mauve.xml trunk/core/descriptors/javax.ext.tools.xml trunk/core/descriptors/nanoxml.xml trunk/core/descriptors/net.sf.cglib.xml trunk/core/descriptors/org.apache.jakarta.commons.net.xml trunk/core/descriptors/org.apache.jakarta.log4j.xml trunk/core/descriptors/org.apache.tools.ant-launcher.xml trunk/core/descriptors/org.apache.tools.ant.xml trunk/core/descriptors/org.classpath.core.vm.xml trunk/core/descriptors/org.classpath.core.xml trunk/core/descriptors/org.classpath.ext.awt.xml trunk/core/descriptors/org.classpath.ext.corba.xml trunk/core/descriptors/org.classpath.ext.core.vm.xml trunk/core/descriptors/org.classpath.ext.core.xml trunk/core/descriptors/org.classpath.ext.imageio.xml trunk/core/descriptors/org.classpath.ext.jdwp.xml trunk/core/descriptors/org.classpath.ext.management.xml trunk/core/descriptors/org.classpath.ext.print.xml trunk/core/descriptors/org.classpath.ext.security.xml trunk/core/descriptors/org.classpath.ext.sql.xml trunk/core/descriptors/org.classpath.ext.xml trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml trunk/core/descriptors/org.classpath.ext.xml.ws.xml trunk/core/descriptors/org.classpath.ext.xml.xml trunk/core/descriptors/org.classpath.tools.xml trunk/core/descriptors/org.jmock.cglib.xml trunk/core/descriptors/org.jmock.xml trunk/core/descriptors/org.jnode.debug.xml trunk/core/descriptors/org.jnode.debugger.xml trunk/core/descriptors/org.jnode.driver.bus.firewire.xml trunk/core/descriptors/org.jnode.driver.bus.pci.xml trunk/core/descriptors/org.jnode.driver.bus.pcmcia.xml trunk/core/descriptors/org.jnode.driver.bus.smbus.xml trunk/core/descriptors/org.jnode.driver.bus.usb.hub.xml trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml trunk/core/descriptors/org.jnode.driver.bus.usb.xml trunk/core/descriptors/org.jnode.driver.character.xml trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml trunk/core/descriptors/org.jnode.driver.chipset.via.xml trunk/core/descriptors/org.jnode.driver.chipset.xml trunk/core/descriptors/org.jnode.driver.console.core.xml trunk/core/descriptors/org.jnode.driver.console.textscreen.xml trunk/core/descriptors/org.jnode.driver.console_x86.xml trunk/core/descriptors/org.jnode.driver.finder.xml trunk/core/descriptors/org.jnode.driver.input.l10n.xml trunk/core/descriptors/org.jnode.driver.input.xml trunk/core/descriptors/org.jnode.driver.serial.xml trunk/core/descriptors/org.jnode.driver.system.acpi.xml trunk/core/descriptors/org.jnode.driver.system.cmos.xml trunk/core/descriptors/org.jnode.driver.system.firmware.bios.xml trunk/core/descriptors/org.jnode.driver.system.firmware.xml trunk/core/descriptors/org.jnode.driver.system.pnp.xml trunk/core/descriptors/org.jnode.driver.system.ram.xml trunk/core/descriptors/org.jnode.driver.textscreen.core.xml trunk/core/descriptors/org.jnode.driver.textscreen_x86.xml trunk/core/descriptors/org.jnode.driver.xml trunk/core/descriptors/org.jnode.log4j.xml trunk/core/descriptors/org.jnode.permission.xml trunk/core/descriptors/org.jnode.plugin.impl.xml trunk/core/descriptors/org.jnode.plugin.xml trunk/core/descriptors/org.jnode.protocol.xml trunk/core/descriptors/org.jnode.runtime.core.bootlog.xml trunk/core/descriptors/org.jnode.runtime.core.resource.xml trunk/core/descriptors/org.jnode.runtime.core.xml trunk/core/descriptors/org.jnode.runtime_x86.xml trunk/core/descriptors/org.jnode.security.xml trunk/core/descriptors/org.jnode.system.repository.xml trunk/core/descriptors/org.jnode.test.core.xml trunk/core/descriptors/org.jnode.test.xml trunk/core/descriptors/org.jnode.testrunner.xml trunk/core/descriptors/org.jnode.util.xml trunk/core/descriptors/org.jnode.vm.core.xml trunk/core/descriptors/org.jnode.vm.memmgr.def.xml trunk/core/descriptors/org.jnode.vm.memmgr.mmtk.genrc.xml trunk/core/descriptors/org.jnode.vm.memmgr.mmtk.ms.xml trunk/core/descriptors/org.jnode.vm.memmgr.mmtk.nogc.xml trunk/core/descriptors/org.jnode.vm_x86.xml trunk/core/descriptors/org.jnode.work.xml trunk/core/descriptors/org.jtestserver.server.xml trunk/core/descriptors/org.junit.xml trunk/core/descriptors/org.objectweb.asm.xml trunk/core/descriptors/sun.tools.xml Modified: trunk/core/build.xml =================================================================== --- trunk/core/build.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/build.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,3 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <project name="JNode-Core" default="all" basedir="."> <typedef file="${basedir}/../all/lib/jnode.xml"/> Modified: trunk/core/descriptors/com.sun.tools.javac.xml =================================================================== --- trunk/core/descriptors/com.sun.tools.javac.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/com.sun.tools.javac.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="com.sun.tools.javac" Modified: trunk/core/descriptors/com.sun.tools.jdi.xml =================================================================== --- trunk/core/descriptors/com.sun.tools.jdi.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/com.sun.tools.jdi.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="com.sun.tools.jdi" Modified: trunk/core/descriptors/ejc.xml =================================================================== --- trunk/core/descriptors/ejc.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/ejc.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="ejc" @@ -21,4 +40,4 @@ <extension point="org.jnode.security.permissions"> <permission class="java.security.AllPermission"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/gnu.mauve.plugin.xml =================================================================== --- trunk/core/descriptors/gnu.mauve.plugin.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/gnu.mauve.plugin.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="gnu.mauve.plugin" Modified: trunk/core/descriptors/gnu.mauve.xml =================================================================== --- trunk/core/descriptors/gnu.mauve.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/gnu.mauve.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="gnu.mauve" Modified: trunk/core/descriptors/javax.ext.tools.xml =================================================================== --- trunk/core/descriptors/javax.ext.tools.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/javax.ext.tools.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="javax.ext.tools" @@ -25,4 +44,4 @@ </library> </runtime> -</fragment> \ No newline at end of file +</fragment> Modified: trunk/core/descriptors/nanoxml.xml =================================================================== --- trunk/core/descriptors/nanoxml.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/nanoxml.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="nanoxml" @@ -14,4 +33,4 @@ </library> </runtime> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/net.sf.cglib.xml =================================================================== --- trunk/core/descriptors/net.sf.cglib.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/net.sf.cglib.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="net.sf.cglib" @@ -12,4 +31,4 @@ <export name="net.sf.cglib.*"/> </library> </runtime> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.apache.jakarta.commons.net.xml =================================================================== --- trunk/core/descriptors/org.apache.jakarta.commons.net.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.apache.jakarta.commons.net.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.apache.jakarta.commons.net" @@ -21,4 +40,4 @@ <permission class="java.net.SocketPermission" name="*" actions="connect,listen"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.apache.jakarta.log4j.xml =================================================================== --- trunk/core/descriptors/org.apache.jakarta.log4j.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.apache.jakarta.log4j.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.apache.jakarta.log4j" @@ -23,4 +42,4 @@ </library> </runtime> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.apache.tools.ant-launcher.xml =================================================================== --- trunk/core/descriptors/org.apache.tools.ant-launcher.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.apache.tools.ant-launcher.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.apache.tools.ant-launcher" @@ -17,4 +36,4 @@ <extension point="org.jnode.security.permissions"> <permission class="java.util.PropertyPermission" name="ant.home" actions="read"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.apache.tools.ant.xml =================================================================== --- trunk/core/descriptors/org.apache.tools.ant.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.apache.tools.ant.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.apache.tools.ant" @@ -39,4 +58,4 @@ <permission class="org.jnode.permission.JNodePermission" name="getVmClass" actions="*" /> <permission class="java.util.PropertyPermission" name="*" actions="read,write"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.classpath.core.vm.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.vm.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.core.vm.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="rt.vm" Modified: trunk/core/descriptors/org.classpath.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.core.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.core.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="rt" Modified: trunk/core/descriptors/org.classpath.ext.awt.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.awt.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.awt.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.awt" Modified: trunk/core/descriptors/org.classpath.ext.corba.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.corba.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.corba.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.corba" Modified: trunk/core/descriptors/org.classpath.ext.core.vm.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.core.vm.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.core.vm.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.core.vm" Modified: trunk/core/descriptors/org.classpath.ext.core.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.core.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.core.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.core" Modified: trunk/core/descriptors/org.classpath.ext.imageio.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.imageio.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.imageio.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.imageio" Modified: trunk/core/descriptors/org.classpath.ext.jdwp.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.jdwp.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.jdwp.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.jdwp" Modified: trunk/core/descriptors/org.classpath.ext.management.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.management.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.management.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.management" Modified: trunk/core/descriptors/org.classpath.ext.print.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.print.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.print.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.print" Modified: trunk/core/descriptors/org.classpath.ext.security.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.security.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.security.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.security" Modified: trunk/core/descriptors/org.classpath.ext.sql.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.sql.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.sql.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.sql" Modified: trunk/core/descriptors/org.classpath.ext.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext" Modified: trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.xml.ws.tools.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.xml.ws.tools" Modified: trunk/core/descriptors/org.classpath.ext.xml.ws.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml.ws.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.xml.ws.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.xml.ws" Modified: trunk/core/descriptors/org.classpath.ext.xml.xml =================================================================== --- trunk/core/descriptors/org.classpath.ext.xml.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.ext.xml.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.ext.xml" Modified: trunk/core/descriptors/org.classpath.tools.xml =================================================================== --- trunk/core/descriptors/org.classpath.tools.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.classpath.tools.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <fragment id="org.classpath.tools" Modified: trunk/core/descriptors/org.jmock.cglib.xml =================================================================== --- trunk/core/descriptors/org.jmock.cglib.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jmock.cglib.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jmock.cglib" @@ -18,4 +37,4 @@ <export name="org.jmock.cglib.*"/> </library> </runtime> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jmock.xml =================================================================== --- trunk/core/descriptors/org.jmock.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jmock.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jmock" @@ -22,4 +41,4 @@ <extension point="org.jnode.security.permissions"> <permission class="java.io.FilePermission" name="<<ALL FILES>>" actions="delete"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jnode.debug.xml =================================================================== --- trunk/core/descriptors/org.jnode.debug.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.debug.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.debug" @@ -17,4 +36,4 @@ <permission class="java.net.SocketPermission" name="*" actions="connect,resolve"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jnode.debugger.xml =================================================================== --- trunk/core/descriptors/org.jnode.debugger.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.debugger.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.debugger" @@ -25,4 +44,4 @@ <permission class="org.jnode.permission.JNodePermission" name="getVmThread"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jnode.driver.bus.firewire.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.firewire.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.firewire.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.firewire" Modified: trunk/core/descriptors/org.jnode.driver.bus.pci.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.pci.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.pci" @@ -27,4 +46,4 @@ <permission class="org.jnode.permission.JNodePermission" name="getVmClass"/> </extension> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jnode.driver.bus.pcmcia.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.pcmcia.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.pcmcia.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.pcmcia" Modified: trunk/core/descriptors/org.jnode.driver.bus.smbus.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.smbus.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.smbus.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.smbus" @@ -18,4 +37,4 @@ </runtime> -</plugin> \ No newline at end of file +</plugin> Modified: trunk/core/descriptors/org.jnode.driver.bus.usb.hub.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.usb.hub.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.usb.hub.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.usb.hub" Modified: trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.usb.uhci.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.usb.uhci" Modified: trunk/core/descriptors/org.jnode.driver.bus.usb.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.bus.usb.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.bus.usb.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.bus.usb" Modified: trunk/core/descriptors/org.jnode.driver.character.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.character.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.character.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. + + This library 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 Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this library; If not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +--> <!DOCTYPE plugin SYSTEM "jnode.dtd"> <plugin id="org.jnode.driver.character" Modified: trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml =================================================================== --- trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml 2013-02-23 16:41:08 UTC (rev 5977) +++ trunk/core/descriptors/org.jnode.driver.chipset.i440BX.xml 2013-02-24 17:07:24 UTC (rev 5978) @@ -1,4 +1,23 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- + $Id$ + + Copyright (C) 2003-2013 JNode.org + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License... [truncated message content] |