diff --git a/bundles/org.eclipse.equinox.io/.classpath b/bundles/org.eclipse.equinox.io/.classpath
deleted file mode 100644
index 5329b18fd6..0000000000
--- a/bundles/org.eclipse.equinox.io/.classpath
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
November 30, 2017
-- The Eclipse Foundation makes available all content in this plug-in - ("Content"). Unless otherwise indicated below, the Content - is provided to you under the terms and conditions of the Eclipse - Public License Version 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -
- -- If you did not receive this Content directly from the Eclipse - Foundation, the Content is being redistributed by another party - ("Redistributor") and different terms and conditions may - apply to your use of any object code in the Content. Check the - Redistributor's license that was provided with the Content. If no such - license exists, contact the Redistributor. Unless otherwise indicated - below, the terms and conditions of the EPL still apply to any source - code in the Content and such source code may be obtained at http://www.eclipse.org. -
- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.io/build.properties b/bundles/org.eclipse.equinox.io/build.properties deleted file mode 100644 index d0d957875c..0000000000 --- a/bundles/org.eclipse.equinox.io/build.properties +++ /dev/null @@ -1,23 +0,0 @@ -############################################################################### -# Copyright (c) 1997, 2015 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = osgi/,\ - src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.io/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java deleted file mode 100644 index 9f6aae71e9..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectionFactory.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.io; - -import java.io.IOException; -import javax.microedition.io.Connection; - -/** - * A Connection Factory service is called by the implementation of the Connector - * Service to create {@code javax.microedition.io.Connection} objects which - * implement the scheme named by {@code IO_SCHEME}. - * - * When a {@code ConnectorService.open} method is called, the implementation of - * the Connector Service will examine the specified name for a scheme. The - * Connector Service will then look for a Connection Factory service which is - * registered with the service property {@code IO_SCHEME} which matches the - * scheme. The {@link #createConnection(String, int, boolean)} method of the - * selected Connection Factory will then be called to create the actual - * {@code Connection} object. - * - * @author $Id$ - */ -public interface ConnectionFactory { - /** - * Service property containing the scheme(s) for which this Connection - * Factory can create {@code Connection} objects. This property is of type - * {@code String[]}. - */ - public static final String IO_SCHEME = "io.scheme"; - - /** - * Create a new {@code Connection} object for the specified URI. - * - * @param name The full URI passed to the {@code ConnectorService.open} - * method - * @param mode The mode parameter passed to the - * {@code ConnectorService.open} method - * @param timeouts The timeouts parameter passed to the - * {@code ConnectorService.open} method - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IOException If a {@code javax.microedition.io.Connection} object - * can not not be created. - */ - public Connection createConnection(String name, int mode, boolean timeouts) throws IOException; -} diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java deleted file mode 100644 index 3965bf616b..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/ConnectorService.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2002, 2013). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.osgi.service.io; - -import java.io.DataInputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import javax.microedition.io.Connection; -import javax.microedition.io.Connector; - -/** - * The Connector Service should be called to create and open - * {@code javax.microedition.io.Connection} objects. - * - * When an {@code open*} method is called, the implementation of the Connector - * Service will examine the specified name for a scheme. The Connector Service - * will then look for a Connection Factory service which is registered with the - * service property {@code IO_SCHEME} which matches the scheme. The - * {@code createConnection} method of the selected Connection Factory will then - * be called to create the actual {@code Connection} object. - * - *- * If more than one Connection Factory service is registered for a particular - * scheme, the service with the highest ranking (as specified in its - * {@code service.ranking} property) is called. If there is a tie in ranking, - * the service with the lowest service ID (as specified in its - * {@code service.id} property), that is the service that was registered first, - * is called. This is the same algorithm used by - * {@code BundleContext.getServiceReference}. - * - * @author $Id$ - */ -public interface ConnectorService { - /** - * Read access mode. - * - * @see "javax.microedition.io.Connector.READ" - */ - public static final int READ = Connector.READ; - /** - * Write access mode. - * - * @see "javax.microedition.io.Connector.WRITE" - */ - public static final int WRITE = Connector.WRITE; - /** - * Read/Write access mode. - * - * @see "javax.microedition.io.Connector.READ_WRITE" - */ - public static final int READ_WRITE = Connector.READ_WRITE; - - /** - * Create and open a {@code Connection} object for the specified name. - * - * @param name The URI for the connection. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name)" - */ - public Connection open(String name) throws IOException; - - /** - * Create and open a {@code Connection} object for the specified name and - * access mode. - * - * @param name The URI for the connection. - * @param mode The access mode. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name, int mode)" - */ - public Connection open(String name, int mode) throws IOException; - - /** - * Create and open a {@code Connection} object for the specified name, - * access mode and timeouts. - * - * @param name The URI for the connection. - * @param mode The access mode. - * @param timeouts A flag to indicate that the caller wants timeout - * exceptions. - * @return A new {@code javax.microedition.io.Connection} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.open(String name, int mode, boolean timeouts)" - */ - public Connection open(String name, int mode, boolean timeouts) throws IOException; - - /** - * Create and open an {@code InputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return An {@code InputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openInputStream(String name)" - */ - public InputStream openInputStream(String name) throws IOException; - - /** - * Create and open a {@code DataInputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return A {@code DataInputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openDataInputStream(String name)" - */ - public DataInputStream openDataInputStream(String name) throws IOException; - - /** - * Create and open an {@code OutputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return An {@code OutputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openOutputStream(String name)" - */ - public OutputStream openOutputStream(String name) throws IOException; - - /** - * Create and open a {@code DataOutputStream} object for the specified name. - * - * @param name The URI for the connection. - * @return A {@code DataOutputStream} object. - * @throws IllegalArgumentException If a parameter is invalid. - * @throws javax.microedition.io.ConnectionNotFoundException If the - * connection cannot be found. - * @throws IOException If some other kind of I/O error occurs. - * @see "javax.microedition.io.Connector.openDataOutputStream(String name)" - */ - public DataOutputStream openDataOutputStream(String name) throws IOException; -} diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java deleted file mode 100644 index 321a4bd03d..0000000000 --- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/package-info.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) OSGi Alliance (2010, 2012). All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * IO Connector Package Version 1.0. - * - *
- * Bundles wishing to use this package must list the package in the - * Import-Package header of the bundle's manifest. This package has two types of - * users: the consumers that use the API in this package and the providers that - * implement the API in this package. - * - *
- * Example import for consumers using the API in this package: - *
- * {@code Import-Package: org.osgi.service.io; version="[1.0,2.0)", javax.microedition.io} - *
- * Example import for providers implementing the API in this package: - *
- * {@code Import-Package: org.osgi.service.io; version="[1.0,1.1)", javax.microedition.io}
- *
- * @version 1.0
- * @author $Id$
- */
-
-package org.osgi.service.io;
-
diff --git a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo b/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo
deleted file mode 100644
index 7c8de0324f..0000000000
--- a/bundles/org.eclipse.equinox.io/osgi/org/osgi/service/io/packageinfo
+++ /dev/null
@@ -1 +0,0 @@
-version 1.0
diff --git a/bundles/org.eclipse.equinox.io/plugin.properties b/bundles/org.eclipse.equinox.io/plugin.properties
deleted file mode 100644
index 251be750a4..0000000000
--- a/bundles/org.eclipse.equinox.io/plugin.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-###############################################################################
-# Copyright (c) 1997-2009 by ProSyst Software GmbH
-# http://www.prosyst.com
-#
-# This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License 2.0
-# which accompanies this distribution, and is available at
-# https://www.eclipse.org/legal/epl-2.0/
-#
-# SPDX-License-Identifier: EPL-2.0
-#
-# Contributors:
-# ProSyst Software GmbH - initial API and implementation
-###############################################################################
-#Properties file for org.eclipse.equinox.io
-bundleVendor = Eclipse.org - Equinox
-bundleName = IO Connector Service
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.io/pom.xml b/bundles/org.eclipse.equinox.io/pom.xml
deleted file mode 100644
index d54d3d5f88..0000000000
--- a/bundles/org.eclipse.equinox.io/pom.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
- * Listener is notified for creation of the connection only when the connector - * service creates connection that implements only this and the Connection - * interface, when the needed IOProvider is not available at the moment of - * creation. When the provider becomes available then all registered listeners - * will receive event - *
- * CONNECTION_CREATED
and the created connection. Event
- * CONNECTION_CLOSED
must be send from every connection that
- * implements this interface when it is closing.
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public interface ConnectionListener extends EventListener {
- /**
- * Constant for event type created
- */
- public static final int CONNECTION_CREATED = 0;
- /**
- * Constant for event type closed
- */
- public static final int CONNECTION_CLOSED = 1;
-
- /**
- * Receives notification that a connection has been created or closed.
- */
- public void notify(String uri, int eventType, Connection conn);
-
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java
deleted file mode 100644
index 8f2f0ae02f..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/ConnectionNotifier.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io;
-
-/**
- * Provides methods for registering listeners for receiving events from a
- * connection (that implements this interface).
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public interface ConnectionNotifier {
- /**
- * Adds the given listener to the set of listeners that will be notified
- * when the connection is created or closed.
- */
- public void addConnectionListener(ConnectionListener l);
-
- /**
- * Removes the given listener from the set of listeners that will be
- * notified when the connection is created or closed.
- */
- public void removeConnectionListener(ConnectionListener l);
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java
deleted file mode 100644
index 2477c55d72..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/RandomAccessConnection.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io;
-
-import java.io.*;
-import javax.microedition.io.InputConnection;
-import javax.microedition.io.OutputConnection;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public interface RandomAccessConnection extends InputConnection, OutputConnection, DataInput, DataOutput {
-
- public long length() throws IOException;
-
- public long getFilePointer() throws IOException;
-
- public boolean isSelected();
-
- public int read() throws IOException;
-
- public int read(byte[] buff, int off, int len) throws IOException;
-
- public void seek(long len) throws IOException;
-
- public void write(int b) throws IOException;
-
- public void write(byte[] buff, int off, int len) throws IOException;
-
- public void flush() throws IOException;
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java
deleted file mode 100644
index 00bf119f8e..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/Activator.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import org.eclipse.equinox.internal.util.ref.Log;
-import org.osgi.framework.*;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class Activator implements BundleActivator {
-
- public static BundleContext bc = null;
- private ConnectorServiceImpl connector;
- private Log log;
-
- public void start(BundleContext bc) throws BundleException {
- Activator.bc = bc;
- log = new Log(bc, false);
- log.setDebug(getBoolean("equinox.connector.debug"));
- log.setPrintOnConsole(getBoolean("equinox.connector.console"));
- if (log.getDebug()) {
- log.setMaps(TracerConfigConnector.getMap(), null);
- }
- connector = new ConnectorServiceImpl(bc, log);
- }
-
- public void stop(BundleContext bc) {
- if (connector != null) {
- connector.close();
- connector = null;
- log.close();
- }
- Activator.bc = null;
- }
-
- public static boolean getBoolean(String property) {
- String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property);
- return ((prop != null) && prop.equalsIgnoreCase("true"));
- }
-
- public static int getInteger(String property, int defaultValue) {
- String prop = (bc != null) ? bc.getProperty(property) : System.getProperty(property);
- if (prop != null) {
- try {
- return Integer.decode(prop).intValue();
- } catch (NumberFormatException e) {
- //do nothing
- }
- }
- return defaultValue;
- }
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java
deleted file mode 100644
index 4d466e4f04..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionFactoryListener.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import java.io.IOException;
-import java.util.*;
-import javax.microedition.io.Connection;
-import org.eclipse.equinox.internal.io.impl.PrivilegedRunner.PrivilegedDispatcher;
-import org.osgi.framework.*;
-import org.osgi.service.io.ConnectionFactory;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class ConnectionFactoryListener implements ServiceListener, PrivilegedDispatcher {
- private static Hashtable urlToConN = new Hashtable(5);
- private BundleContext bc;
-
- public ConnectionFactoryListener(BundleContext bc) {
- this.bc = bc;
-
- try {
- bc.addServiceListener(this, '(' + Constants.OBJECTCLASS + '=' + ConnectionFactory.class.getName() + ')');
- } catch (InvalidSyntaxException ex) {
- // Ignored - syntax is right!
- }
- }
-
- public void close() {
- bc.removeServiceListener(this);
-
- if (!urlToConN.isEmpty()) {
- Vector copyV = new Vector(urlToConN.size());
-
- for (Enumeration en = urlToConN.elements(); en.hasMoreElements();) {
- copyV.addElement(en.nextElement());
- }
-
- for (Enumeration en = copyV.elements(); en.hasMoreElements();) {
- ConnectionNotifierImpl cn = (ConnectionNotifierImpl) en.nextElement();
- try {
- cn.close();
- } catch (IOException ex) {
- }
- }
- }
- }
-
- static void removeConnectionNotifier(String url) {
- urlToConN.remove(url);
- }
-
- static int count = 0;
-
- static Connection getConnectionNotifier(String scheme, String url, int mode, boolean timeouts, String filter, int count) throws IOException {
- ConnectionNotifierImpl ret = null;
- synchronized (urlToConN) {
- if (urlToConN.containsKey(url)) {
- return (Connection) urlToConN.get(url);
- }
-
- ret = new ConnectionNotifierImpl(scheme, url, mode, timeouts, filter);
- urlToConN.put(url, ret);
- if (count == ConnectionFactoryListener.count)
- return ret;
- }
-
- Connection c = ConnectorServiceImpl.getConnection(filter, url, mode, timeouts, false);
- if (c != null) {
- if (ret.hasListeners())
- ret.notifyCreated(c);
- else
- ret.close();
- }
- return c;
- }
-
- public void serviceChanged(ServiceEvent event) {
- if (event.getType() == ServiceEvent.REGISTERED && !urlToConN.isEmpty()) {
- ServiceReference ref = event.getServiceReference();
- ConnectionFactory factory = (ConnectionFactory) bc.getService(ref);
- String[] schemes = (String[]) ref.getProperty(ConnectionFactory.IO_SCHEME);
-
- Vector toNotify = new Vector(urlToConN.size());
- synchronized (urlToConN) {
- for (Enumeration en = urlToConN.elements(); en.hasMoreElements();) {
- ConnectionNotifierImpl cn = (ConnectionNotifierImpl) en.nextElement();
- if (match(schemes, cn.scheme))
- toNotify.addElement(cn);
- }
- }
- for (int i = 0; i < toNotify.size(); i++) {
- ConnectionNotifierImpl cn = (ConnectionNotifierImpl) toNotify.elementAt(i);
- try {
- if (cn.context != null) {
- PrivilegedRunner.doPrivileged(cn.context, this, 0, cn, factory, null, null);
- return;
- }
- Connection connection = factory.createConnection(cn.url, cn.mode, cn.timeouts);
- if (cn.hasListeners())
- cn.notifyCreated(connection);
- else
- cn.close();
- } catch (Throwable ex) {
- ex.printStackTrace();
- }
- }
-
- bc.ungetService(ref);
- }
- }
-
- static boolean match(String[] schemes, String scheme) {
- if (schemes != null && scheme != null) {
- for (int i = 0; i < schemes.length; i++) {
- if (scheme.equals(schemes[i])) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- /**
- * @see org.eclipse.equinox.internal.io.impl.PrivilegedRunner.PrivilegedDispatcher#dispatchPrivileged(int,
- * java.lang.Object, java.lang.Object, java.lang.Object,
- * java.lang.Object)
- */
- public Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception {
- ConnectionNotifierImpl cn = (ConnectionNotifierImpl) arg1;
- ConnectionFactory factory = (ConnectionFactory) arg2;
- Connection connection = factory.createConnection(cn.url, cn.mode, cn.timeouts);
- if (cn.hasListeners()) {
- cn.notifyCreated(connection);
- } else {
- cn.close();
- }
- return null;
- }
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java
deleted file mode 100644
index 2ecf94ad3d..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectionNotifierImpl.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-import javax.microedition.io.Connection;
-import org.eclipse.equinox.internal.io.ConnectionListener;
-import org.eclipse.equinox.internal.io.ConnectionNotifier;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-class ConnectionNotifierImpl implements ConnectionNotifier, Connection {
- private Vector list;
- String scheme;
- int mode;
- boolean timeouts;
- String url;
- String filter;
-
- boolean notified = false;
- Object context;
-
- ConnectionNotifierImpl(String scheme, String url, int mode, boolean timeouts, String filter) {
- list = new Vector(3, 5);
- this.scheme = scheme;
- this.url = url;
- this.mode = mode;
- this.timeouts = timeouts;
- this.filter = filter;
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- context = System.getSecurityManager().getSecurityContext();
- }
-
- public void addConnectionListener(ConnectionListener l) {
- long timeStart = 0;
- if (ConnectorServiceImpl.hasDebug) {
- ConnectorServiceImpl.debug(16050, l.getClass().getName(), null);
- timeStart = System.currentTimeMillis();
- }
- try {
- synchronized (list) {
- if (!notified) {
- if (!list.contains(l))
- list.addElement(l);
- return;
- }
- }
- Connection c = ConnectorServiceImpl.getConnection(filter, url, mode, timeouts, false);
- if (c != null)
- l.notify(url, ConnectionListener.CONNECTION_CREATED, c);
- } catch (Exception exc) {
- } finally {
- if (ConnectorServiceImpl.hasDebug) {
- ConnectorServiceImpl.debug(16051, String.valueOf(System.currentTimeMillis() - timeStart), null);
- }
- }
- }
-
- public void removeConnectionListener(ConnectionListener l) {
- if (ConnectorServiceImpl.hasDebug) {
- ConnectorServiceImpl.debug(16052, l.getClass().getName(), null);
- }
- list.removeElement(l);
- }
-
- boolean hasListeners() {
- return !list.isEmpty();
- }
-
- void notifyCreated(Connection conn) {
- notify(ConnectionListener.CONNECTION_CREATED, conn);
- }
-
- private void notify(int eventType, Connection conn) {
- if (eventType != ConnectionListener.CONNECTION_CREATED && eventType != ConnectionListener.CONNECTION_CLOSED) {
- return;
- }
-
- synchronized (list) {
- if (notified)
- return;
- notified = true;
- }
- ConnectionFactoryListener.removeConnectionNotifier(url);
- for (Enumeration en = list.elements(); en.hasMoreElements();) {
- ConnectionListener l = (ConnectionListener) en.nextElement();
- l.notify(url, eventType, conn);
- }
- }
-
- public void close() throws IOException {
- if (ConnectorServiceImpl.hasDebug) {
- ConnectorServiceImpl.debug(16053, url, null);
- }
- synchronized (list) {
- if (notified)
- return;
- notified = true;
- }
- ConnectionFactoryListener.removeConnectionNotifier(url);
- }
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java
deleted file mode 100644
index fee1efd578..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/ConnectorServiceImpl.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import java.io.*;
-import javax.microedition.io.*;
-import org.eclipse.equinox.internal.util.ref.Log;
-import org.osgi.framework.*;
-import org.osgi.service.io.ConnectionFactory;
-import org.osgi.service.io.ConnectorService;
-
-/**
- * ConnectorService implementation.
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class ConnectorServiceImpl implements ConnectorService {
- static BundleContext bc;
- ServiceRegistration reg;
- ConnectionFactoryListener listener;
-
- static boolean enableNotification = Activator.getBoolean("eclipse.io.enable.notification");
- public static boolean hasDebug;
- private static Log log;
-
- public ConnectorServiceImpl(BundleContext bc, Log log) {
- ConnectorServiceImpl.log = log;
- ConnectorServiceImpl.hasDebug = log.getDebug();
- init(bc);
- }
-
- public static void debug(int id, String message, Throwable t) {
- log.debug(0x1200, id, message, t, false);
- }
-
- public ConnectorServiceImpl(BundleContext bc) {
- init(bc);
- }
-
- private void init(BundleContext bc) {
- ConnectorServiceImpl.bc = bc;
-
- if (enableNotification) {
- listener = new ConnectionFactoryListener(bc);
- }
-
- reg = bc.registerService(ConnectorService.class.getName(), this, null);
- }
-
- public void close() {
- reg.unregister();
-
- if (listener != null) {
- listener.close();
- }
- }
-
- public Connection open(String uri) throws IOException {
- return open(uri, READ_WRITE);
- }
-
- public Connection open(String uri, int mode) throws IOException {
- return open(uri, mode, false);
- }
-
- static char[] chars = {'~', '='};
-
- public Connection open(String uri, int mode, boolean timeouts) throws IOException {
- long timeStart = 0;
- if (hasDebug) {
- debug(16001, uri + ", " + (mode == READ_WRITE ? "READ_WRITE" : (mode == READ) ? "READ" : "WRITE"), null);
- timeStart = System.currentTimeMillis();
- }
- try {
- if (uri == null) {
- throw new IllegalArgumentException("URL cannot be NULL!");
- }
-
- int sPos = uri.indexOf(":");
-
- if (sPos < 1) { // scheme must be at least with 1 symbol
- throw new IllegalArgumentException("Does not have scheme");
- }
-
- String scheme = uri.substring(0, sPos);
- StringBuffer filter = new StringBuffer(scheme.length() + 13);
- filter.append('(');
- filter.append(ConnectionFactory.IO_SCHEME);
- filter.append(chars);
- filter.append(scheme);
- filter.append(')');
-
- int count = 0;
- if (listener != null)
- count = ConnectionFactoryListener.count;
- Connection c = getConnection(filter.toString(), uri, mode, timeouts, true);
-
- if (c == null && listener != null)
- c = ConnectionFactoryListener.getConnectionNotifier(scheme, uri, mode, timeouts, filter.toString(), count);
- if (c == null)
- throw new ConnectionNotFoundException("Failed to create connection " + uri);
- return c;
- } finally {
- if (hasDebug) {
- debug(16002, String.valueOf(System.currentTimeMillis() - timeStart), null);
- }
- }
- }
-
- static protected Connection getConnection(String filter, String uri, int mode, boolean timeouts, boolean connector) throws IOException {
- ServiceReference[] cfRefs = null;
- Connection ret = null;
- try {
- cfRefs = bc.getServiceReferences(ConnectionFactory.class.getName(), filter);
- } catch (InvalidSyntaxException ex) {
- }
-
- if (cfRefs != null) {
- sort(cfRefs, 0, cfRefs.length);
- }
-
- IOException ioExc = null;
- boolean not_found = false;
- if (cfRefs != null)
- for (int i = 0; i < cfRefs.length; i++) {
- ConnectionFactory prov = (ConnectionFactory) bc.getService(cfRefs[i]);
- if (prov != null)
- try {
- not_found = true;
- ret = prov.createConnection(uri, mode, timeouts);
- } catch (IOException e) {
- if (hasDebug) {
- debug(16003, prov.getClass().getName(), e);
- }
- if (ioExc == null)
- ioExc = e;
- } finally {
- if (ret == null)
- bc.ungetService(cfRefs[i]);
- else {
- if (hasDebug) {
- debug(16004, prov.getClass().getName(), null);
- }
- return ret;
- }
- }
- }
-
- if (connector)
- try {
- ret = Connector.open(uri, mode, timeouts);
- } catch (ConnectionNotFoundException ignore) { // returns null ->
- // ConnectionNotifier
- // is created
- debug(16014, null, ignore);
- } finally {
- if (ret == null) {
- if (ioExc != null)
- throw ioExc;
- if (not_found)
- throw new ConnectionNotFoundException("Failed to create connection " + uri);
-
- } else {
- if (hasDebug) {
- debug(16005, null, null);
- }
- }
- }
- return ret;
- }
-
- private static void sort(ServiceReference[] array, int start, int end) {
- int middle = (start + end) / 2;
- if (start + 1 < middle)
- sort(array, start, middle);
- if (middle + 1 < end)
- sort(array, middle, end);
- if (start + 1 >= end)
- return; // this case can only happen when this method is called by
- // the user
-
- if (getRanking(array[middle - 1]) == getRanking(array[middle])) {
- if (getServiceID(array[middle - 1]) < getServiceID(array[middle])) {
- return;
- }
- } else if (getRanking(array[middle - 1]) >= getRanking(array[middle])) {
- return;
- }
-
- if (start + 2 == end) {
- ServiceReference temp = array[start];
- array[start] = array[middle];
- array[middle] = temp;
- return;
- }
- int i1 = start, i2 = middle, i3 = 0;
- Object[] merge = new Object[end - start];
- while (i1 < middle && i2 < end) {
- if (getRanking(array[i1]) == getRanking(array[i2])) {
- merge[i3++] = getServiceID(array[i1]) < getServiceID(array[i2]) ? array[i1++] : array[i2++];
- } else {
- merge[i3++] = getRanking(array[i1]) >= getRanking(array[i2]) ? array[i1++] : array[i2++];
- }
- }
- if (i1 < middle)
- System.arraycopy(array, i1, merge, i3, middle - i1);
- System.arraycopy(merge, 0, array, start, i2 - start);
- }
-
- private static int getRanking(ServiceReference ref) {
- Object rank = ref.getProperty(Constants.SERVICE_RANKING);
-
- if (rank == null || !(rank instanceof Integer)) {
- return 0;
- }
-
- return ((Integer) rank).intValue();
- }
-
- private static long getServiceID(ServiceReference ref) {
- Object sid = ref.getProperty(Constants.SERVICE_ID);
-
- if (sid == null || !(sid instanceof Long)) {
- return 0;
- }
-
- return ((Long) sid).intValue();
- }
-
- /**
- * Create and open an DataInputStream object for the specified
- * name.
- *
- * @param name
- * the URI for the connection.
- * @throws IOException
- * if and I/O error occurs
- * @throws ConnectionNotFoundException
- * if the Connection object can not be made or if no
- * handler for the requested scheme can be found.
- * @throws IllegalArgumentException
- * if the given uri is invalid
- * @return A DataInputStream to the given URI
- */
- public DataInputStream openDataInputStream(String name) throws IOException {
- long timeBegin = 0;
- if (hasDebug) {
- debug(16006, name, null);
- timeBegin = System.currentTimeMillis();
- }
- try {
- Connection conn = open(name, READ);
-
- if (!(conn instanceof InputConnection)) {
- try {
- conn.close();
- } catch (IOException e) {
- }
- throw new IOException("Connection does not implement InputConnection:" + conn.getClass());
- }
-
- return ((InputConnection) conn).openDataInputStream();
- } finally {
- if (hasDebug) {
- debug(16007, String.valueOf(System.currentTimeMillis() - timeBegin), null);
- }
- }
- }
-
- /**
- * Create and open an DataOutputStream object for the specified
- * name.
- *
- * @param name
- * the URI for the connection.
- * @throws IOException
- * if and I/O error occurs
- * @throws ConnectionNotFoundException
- * if the Connection object can not be made or if no
- * handler for the requested scheme can be found.
- * @throws IllegalArgumentException
- * if the given uri is invalid
- * @return A DataOutputStream to the given URI
- */
- public DataOutputStream openDataOutputStream(String name) throws IOException {
- long timeBegin = 0;
- if (hasDebug) {
- debug(16008, name, null);
- }
- try {
- Connection conn = open(name, WRITE);
-
- if (!(conn instanceof OutputConnection)) {
- try {
- conn.close();
- } catch (IOException e) {
- }
-
- throw new IOException("Connection does not implement OutputConnection:" + conn.getClass());
- }
-
- return ((OutputConnection) conn).openDataOutputStream();
- } finally {
- if (hasDebug) {
- debug(16009, String.valueOf(System.currentTimeMillis() - timeBegin), null);
- }
- }
- }
-
- /**
- * Create and open an InputStream object for the specified name.
- *
- *
- * @param name
- * the URI for the connection.
- * @throws IOException
- * if and I/O error occurs
- * @throws ConnectionNotFoundException
- * if the Connection object can not be made or if no
- * handler for the requested scheme can be found.
- * @throws IllegalArgumentException
- * if the given uri is invalid
- * @return A InputStream to the given URI
- */
- public InputStream openInputStream(String name) throws IOException {
- long timeBegin = 0;
- if (hasDebug) {
- debug(16010, name, null);
- timeBegin = System.currentTimeMillis();
- }
- try {
- Connection conn = open(name, READ);
-
- if (!(conn instanceof InputConnection)) {
- try {
- conn.close();
- } catch (IOException e) {
- }
-
- throw new IOException("Connection does not implement InputConnection:" + conn.getClass());
- }
-
- return ((InputConnection) conn).openInputStream();
- } finally {
- if (hasDebug) {
- debug(16011, String.valueOf(System.currentTimeMillis() - timeBegin), null);
- }
- }
- }
-
- /**
- * Create and open an OutputStream object for the specified name.
- *
- * @param name
- * the URI for the connection.
- * @throws IOException
- * if and I/O error occurs
- * @throws ConnectionNotFoundException
- * if the Connection object can not be made or if no
- * handler for the requested scheme can be found.
- * @throws IllegalArgumentException
- * if the given uri is invalid
- * @return A OutputStream to the given URI
- */
- public OutputStream openOutputStream(String name) throws IOException {
- long timeBegin = 0;
- if (hasDebug) {
- debug(16012, name, null);
- timeBegin = System.currentTimeMillis();
- }
- try {
- Connection conn = open(name, WRITE);
-
- if (!(conn instanceof OutputConnection)) {
- try {
- conn.close();
- } catch (IOException e) {
- }
-
- throw new IOException("Connection does not implement OutputConnection:" + conn.getClass());
- }
-
- return ((OutputConnection) conn).openOutputStream();
- } finally {
- if (hasDebug) {
- debug(16013, String.valueOf(System.currentTimeMillis() - timeBegin), null);
- }
- }
- }
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java
deleted file mode 100644
index 2d5fd7f0c5..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/PrivilegedRunner.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import java.security.*;
-import org.eclipse.equinox.internal.util.pool.ObjectCreator;
-import org.eclipse.equinox.internal.util.pool.ObjectPool;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public final class PrivilegedRunner implements ObjectCreator {
-
- private static ObjectPool POOL;
-
- static {
- try {
- POOL = new ObjectPool(new PrivilegedRunner(), 5, 10);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /* prevent instantiations */
- private PrivilegedRunner() {
- }
-
- /**
- * Same as the longer doPrivileged method, but fills in the first parameter
- * only. All other parameters are set to null
.
- *
- * @param dispatcher
- * the dispatcher which should be called
- * @param type
- * the type of the action - used in the dispatcher
- * @param arg1
- * a parameter received by the dispatcher
- * @see #doPrivileged(PrivilegedDispatcher, int, Object, Object, Object,
- * Object)
- * @return the object returned from the execution
- * @throws Exception
- * if the dispatcher fails
- */
- public static final Object doPrivileged(PrivilegedDispatcher dispatcher, int type, Object arg1) throws Exception {
- return doPrivileged(null, dispatcher, type, arg1, null, null, null);
- }
-
- /**
- * Performs a privileged action. The method calls the dispatcher inside the
- * privileged call passing it the same parameters that were passed to this
- * method.
- *
- * @param dispatcher
- * the dispatcher which should be called
- * @param type
- * the type of the action - used in the dispatcher
- * @param arg1
- * a parameter received by the dispatcher
- * @param arg2
- * a parameter received by the dispatcher
- * @param arg3
- * a parameter received by the dispatcher
- * @param arg4
- * a parameter received by the dispatcher
- * @return the object returned from the execution
- * @throws Exception
- * if the dispatcher fails
- */
- public static final Object doPrivileged(PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception {
- return doPrivileged(null, dispatcher, type, arg1, arg2, arg3, arg4);
- }
-
- /**
- * Performs a privileged action. The method calls the dispatcher inside the
- * privileged call passing it the same parameters that were passed to this
- * method.
- *
- * @param context
- * the access context
- * @param dispatcher
- * the dispatcher which should be called
- * @param type
- * the type of the action - used in the dispatcher
- * @param arg1
- * a parameter received by the dispatcher
- * @param arg2
- * a parameter received by the dispatcher
- * @param arg3
- * a parameter received by the dispatcher
- * @param arg4
- * a parameter received by the dispatcher
- * @return the object returned from the execution
- * @throws Exception
- * if the dispatcher fails
- */
- public static final Object doPrivileged(Object context, PrivilegedDispatcher dispatcher, int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception {
- /* init runner */
- PA runner = (PA) POOL.getObject();
- runner.dispatcher = dispatcher;
- runner.type = type;
- runner.arg1 = arg1;
- runner.arg2 = arg2;
- runner.arg3 = arg3;
- runner.arg4 = arg4;
-
- try {
- if (System.getSecurityManager() != null) {
- /*
- * if security manager is set - then privileged execution is
- * started
- */
- if (context != null) {
- return AccessController.doPrivileged(runner, (AccessControlContext) context);
- }
- return AccessController.doPrivileged(runner);
- }
- /* if no security manager is set - simply run the action */
- return runner.run();
- } catch (PrivilegedActionException e) {
- throw e.getException();
- } finally {
- runner.recycle();
- POOL.releaseObject(runner);
- }
- }
-
- /**
- * @see org.eclipse.equinox.internal.util.pool.ObjectCreator#getInstance()
- */
- public Object getInstance() throws Exception {
- return new PA();
- }
-
- /**
- * This dispatcher is the handler that is called within the privileged call.
- * It should dispatch and perform the requested actions depending on the
- * action type and using the given job parameters.
- *
- * @author Valentin Valchev
- * @version $Revision: 1.1 $
- */
- public static interface PrivilegedDispatcher {
-
- /**
- * @param type
- * the type of the action
- * @param arg1
- * parameter 1 - depends on the action type
- * @param arg2
- * parameter 2 - depends on the action type
- * @param arg3
- * parameter 3 - depends on the action type
- * @param arg4
- * parameter 4 - depends on the action type
- * @return an object which should be returned from the
- * PrivilegedAction.run() method
- * @throws Exception
- * on error
- */
- Object dispatchPrivileged(int type, Object arg1, Object arg2, Object arg3, Object arg4) throws Exception;
- }
-
- static class PA implements PrivilegedExceptionAction {
-
- int type;
- Object arg1, arg2, arg3, arg4;
- PrivilegedDispatcher dispatcher;
-
- void recycle() {
- dispatcher = null;
- type = -1;
- arg1 = arg2 = arg3 = arg4 = null;
- }
-
- /**
- * @see java.security.PrivilegedExceptionAction#run()
- */
- public Object run() throws Exception {
- return dispatcher.dispatchPrivileged(type, arg1, arg2, arg3, arg4);
- }
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java
deleted file mode 100644
index ba43591610..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/impl/TracerConfigConnector.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.io.impl;
-
-import org.eclipse.equinox.internal.util.hash.HashIntObjNS;
-
-/**
- * @author Lubomir Mitev
- * @author Pavlin Dobrev
- * @version 1.0
- */
-public class TracerConfigConnector {
-
- public static HashIntObjNS getMap() {
- /*
- * increase size if you add more dumps in the table - at this moment the
- * entries in table are 159
- */
- HashIntObjNS map = new HashIntObjNS(28);// (int)(28 * 0.7) = 19, 18
- constructMap(map);
- return map;
- }
-
- public static void constructMap(HashIntObjNS map) {
- map.put(-0x1200, "Connector Service");
- map.put(16001, "[BEGIN - open connection] The values of the URI and the access mode are");
- map.put(16002, "[END - open connection] took");
- map.put(16003, "IOException when connection is created from ConnectionFactory");
- map.put(16004, "Connection is created from ConnectionFactory");
- map.put(16005, "Connection is created from javax.microedition.io.Connector");
- map.put(16006, "[BEGIN - open DataInputStream] The URI is");
- map.put(16007, "[END - open DataInputStream] took");
- map.put(16008, "[BEGIN - open DataOutputStream] The URI is");
- map.put(16009, "[END - open DataOutputStream] took");
- map.put(16010, "[BEGIN - open InputStream] The URI is");
- map.put(16011, "[END - open InputStream] took");
- map.put(16012, "[BEGIN - open OutputStream] The URI is");
- map.put(16013, "[END - open OutputStream] took");
- map.put(16014, "ConnectionNotFoundException thrown from system javax.microedition.io.Connector");
- map.put(16050, "[BEGIN - add ConnectionListener] The ConnectionListener is");
- map.put(16051, "[END - add ConnectionListener] took");
- map.put(16052, "Remove ConnectionListener");
- map.put(16053, "Close connection. The URI is");
- }
-}
diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html
deleted file mode 100644
index 32d3d8472c..0000000000
--- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/package.html
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
The OSGi IO Provider Specification Version 1.0. -
Bundles wishing to use this package must list the package -in the Import-Package header of the bundle's manifest. -For example: -
-Import-Package: org.osgi.service.io; specification-version=1.0 -- diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java deleted file mode 100644 index 41ebc558df..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractConnectionNotifier.java +++ /dev/null @@ -1,112 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.util.*; -import javax.microedition.io.Connection; -import org.eclipse.equinox.internal.io.ConnectionListener; -import org.eclipse.equinox.internal.io.ConnectionNotifier; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class AbstractConnectionNotifier extends Dictionary implements ConnectionNotifier { - private Vector list; - private Hashtable info; - - // the local address to which the connection is bound - - public final static String LOCAL_ADDRESS = "local_address"; - - // the local port to which the connection is bound. - - public final static String LOCAL_PORT = "local_port"; - - // the remote address to which the connection is connected. - - public final static String ADDRESS = "address"; - - // the remote port to which the connection is connected. - - public final static String PORT = "port"; - - // the encoder used - - public final static String ENCODER = "enc"; - - public static final String SO_TIMEOUT = "timeout"; - - protected AbstractConnectionNotifier() { - list = new Vector(2, 3); - info = new Hashtable(30); - } - - // ConnectionNotifier methods - public void addConnectionListener(ConnectionListener l) { - if (!list.contains(l)) { - list.addElement(l); - } - } - - public void removeConnectionListener(ConnectionListener l) { - list.removeElement(l); - } - - // returns the url of connection - protected abstract String getURL(); - - // the connection to which this ConnectionLife is bound to - protected abstract Connection getConnection(); - - protected void notifyClosed() { - for (Enumeration en = list.elements(); en.hasMoreElements();) { - ConnectionListener l = (ConnectionListener) en.nextElement(); - l.notify(getURL(), ConnectionListener.CONNECTION_CLOSED, getConnection()); - } - } - - protected void setInfo(String key, Object value) { - if (key != null && value != null) { - info.put(key, value); - } - } - - public int size() { - return info.size(); - } - - public boolean isEmpty() { - return info.isEmpty(); - } - - public Enumeration keys() { - return info.keys(); - } - - public Enumeration elements() { - return info.elements(); - } - - public Object get(Object key) { - return info.get(key); - } - - public Object remove(Object key) { - return info.remove(key); - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java deleted file mode 100644 index 2eb79bc4a4..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/AbstractDatagram.java +++ /dev/null @@ -1,437 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.io.*; -import javax.microedition.io.Datagram; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public abstract class AbstractDatagram implements Datagram { - protected byte[] data; - private int pos; - private int count; - - public AbstractDatagram(int size) { - this(new byte[size]); - } - - public AbstractDatagram(byte[] data) { - this.data = data; - pos = 0; - count = data.length; - } - - public AbstractDatagram(byte[] data, int start, int length) { - if (start > data.length || (start + length) > data.length) { - throw new IllegalArgumentException("Start possition or length is greater than data length"); - } - - this.data = data; - pos = start; - count = length; - } - - public synchronized byte[] getData() { - return data; - } - - public int getLength() { - return count; - } - - public int getOffset() { - return pos; - } - - public void setLength(int len) { - if (len < 0 || len > data.length) { - throw new IllegalArgumentException("Given length is negative or greater than buffer size"); - } - - count = len; - } - - public synchronized void setData(byte[] buffer, int offset, int len) { - if (offset > buffer.length || (offset + len) > buffer.length) { - throw new IllegalArgumentException(); - } - - data = buffer; - pos = offset; - count = len; - } - - public void reset() { - pos = 0; - count = 0; - } - - public int read() { - return (pos < count) ? (data[pos++] & 0xff) : -1; - } - - public void readFully(byte b[]) throws IOException { - readFully(b, 0, b.length); - } - - public void readFully(byte b[], int off, int len) throws IOException { - if (len < 0) { - throw new IndexOutOfBoundsException(); - } - - int n = 0; - - while (n < len) { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - b[off + (n++)] = (byte) ch; - } - } - - public int skipBytes(int n) throws IOException { - if (pos + n > count) { - n = count - pos; - } - - if (n < 0) { - return 0; - } - - pos += n; - return n; - } - - public boolean readBoolean() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return (ch != 0); - } - - public byte readByte() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return (byte) (ch); - } - - public int readUnsignedByte() throws IOException { - int ch = read(); - - if (ch < 0) { - throw new EOFException(); - } - - return ch; - } - - public short readShort() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (short) ((ch1 << 8) + (ch2 << 0)); - } - - public int readUnsignedShort() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (ch1 << 8) + (ch2 << 0); - } - - public char readChar() throws IOException { - int ch1 = read(); - int ch2 = read(); - - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - - return (char) ((ch1 << 8) + (ch2 << 0)); - } - - public int readInt() throws IOException { - int ch1 = read(); - int ch2 = read(); - int ch3 = read(); - int ch4 = read(); - - if ((ch1 | ch2 | ch3 | ch4) < 0) { - throw new EOFException(); - } - - return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); - } - - public long readLong() throws IOException { - return ((long) (readInt()) << 32) + (readInt() & 0xFFFFFFFFL); - } - - public float readFloat() throws IOException { - return Float.intBitsToFloat(readInt()); - } - - public double readDouble() throws IOException { - return Double.longBitsToDouble(readLong()); - } - - public String readLine() throws IOException { - throw new RuntimeException("Function not supported"); - } - - public String readUTF() throws IOException { - return readUTF(this); - } - - public final static String readUTF(DataInput in) throws IOException { - int utflen = in.readUnsignedShort(); - StringBuffer str = new StringBuffer(utflen); - byte bytearr[] = new byte[utflen]; - int c, char2, char3; - int count = 0; - - in.readFully(bytearr, 0, utflen); - - while (count < utflen) { - c = bytearr[count] & 0xff; - - switch (c >> 4) { - case 0 : - case 1 : - case 2 : - case 3 : - case 4 : - case 5 : - case 6 : - case 7 : - /* 0xxxxxxx */ - count++; - str.append((char) c); - break; - - case 12 : - case 13 : - /* 110x xxxx 10xx xxxx */ - count += 2; - - if (count > utflen) { - throw new UTFDataFormatException(); - } - - char2 = bytearr[count - 1]; - - if ((char2 & 0xC0) != 0x80) { - throw new UTFDataFormatException(); - } - - str.append((char) (((c & 0x1F) << 6) | (char2 & 0x3F))); - break; - - case 14 : - /* 1110 xxxx 10xx xxxx 10xx xxxx */ - count += 3; - - if (count > utflen) { - throw new UTFDataFormatException(); - } - - char2 = bytearr[count - 2]; - char3 = bytearr[count - 1]; - - if (((char2 & 0xC0) != 0x80) || ((char3 & 0xC0) != 0x80)) { - throw new UTFDataFormatException(); - } - - str.append((char) (((c & 0x0F) << 12) | ((char2 & 0x3F) << 6) | ((char3 & 0x3F) << 0))); - break; - - default : - /* 10xx xxxx, 1111 xxxx */ - throw new UTFDataFormatException(); - } - } - - // The number of chars produced may be less than utflen - return str.toString(); - } - - // -------------------------------------------------------- - public void write(int b) throws IOException { - - if (pos < data.length) { - data[pos++] = (byte) b; - } else { - byte buf[] = new byte[data.length + 1]; - System.arraycopy(data, 0, buf, 0, count); - data = buf; - data[pos++] = (byte) b; - count++; - } - } - - public void write(byte b[]) throws IOException { - write(b, 0, b.length); - } - - public void write(byte b[], int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - - for (int i = 0; i < len; i++) { - write(b[off + i]); - } - } - - public void writeBoolean(boolean v) throws IOException { - write(v ? 1 : 0); - } - - public void writeByte(int v) throws IOException { - write(v); - } - - public void writeShort(int v) throws IOException { - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeChar(int v) throws IOException { - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeInt(int v) throws IOException { - write((v >>> 24) & 0xFF); - write((v >>> 16) & 0xFF); - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - - public void writeLong(long v) throws IOException { - write((int) (v >>> 56) & 0xFF); - write((int) (v >>> 48) & 0xFF); - write((int) (v >>> 40) & 0xFF); - write((int) (v >>> 32) & 0xFF); - write((int) (v >>> 24) & 0xFF); - write((int) (v >>> 16) & 0xFF); - write((int) (v >>> 8) & 0xFF); - write((int) (v >>> 0) & 0xFF); - } - - public void writeFloat(float v) throws IOException { - writeInt(Float.floatToIntBits(v)); - } - - public void writeDouble(double v) throws IOException { - writeLong(Double.doubleToLongBits(v)); - } - - public void writeBytes(String s) throws IOException { - int len = s.length(); - - for (int i = 0; i < len; i++) { - write((byte) s.charAt(i)); - } - } - - public void writeChars(String s) throws IOException { - int len = s.length(); - - for (int i = 0; i < len; i++) { - int v = s.charAt(i); - write((v >>> 8) & 0xFF); - write((v >>> 0) & 0xFF); - } - } - - public void writeUTF(String str) throws IOException { - writeUTF(str, this); - } - - static int writeUTF(String str, DataOutput out) throws IOException { - int strlen = str.length(); - int utflen = 0; - char[] charr = new char[strlen]; - int c, count = 0; - - str.getChars(0, strlen, charr, 0); - - for (int i = 0; i < strlen; i++) { - c = charr[i]; - - if ((c >= 0x0001) && (c <= 0x007F)) { - utflen++; - } else if (c > 0x07FF) { - utflen += 3; - } else { - utflen += 2; - } - } - - if (utflen > 65535) { - throw new UTFDataFormatException(); - } - - byte[] bytearr = new byte[utflen + 2]; - bytearr[count++] = (byte) ((utflen >>> 8) & 0xFF); - bytearr[count++] = (byte) ((utflen >>> 0) & 0xFF); - - for (int i = 0; i < strlen; i++) { - c = charr[i]; - - if ((c >= 0x0001) && (c <= 0x007F)) { - bytearr[count++] = (byte) c; - } else if (c > 0x07FF) { - bytearr[count++] = (byte) (0xE0 | ((c >> 12) & 0x0F)); - bytearr[count++] = (byte) (0x80 | ((c >> 6) & 0x3F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); - } else { - bytearr[count++] = (byte) (0xC0 | ((c >> 6) & 0x1F)); - bytearr[count++] = (byte) (0x80 | ((c >> 0) & 0x3F)); - } - } - - out.write(bytearr); - return utflen + 2; - } - -} diff --git a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java b/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java deleted file mode 100644 index b9ecd7cdc0..0000000000 --- a/bundles/org.eclipse.equinox.io/src/org/eclipse/equinox/internal/io/util/URI.java +++ /dev/null @@ -1,350 +0,0 @@ -/******************************************************************************* - * Copyright (c) 1997, 2008 by ProSyst Software GmbH - * http://www.prosyst.com - * - * This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * ProSyst Software GmbH - initial API and implementation - *******************************************************************************/ -package org.eclipse.equinox.internal.io.util; - -import java.util.Hashtable; -import java.util.Enumeration; - -/** - * @author Pavlin Dobrev - * @version 1.0 - */ - -public class URI { - - /* - *
November 30, 2017
-- The Eclipse Foundation makes available all content in this plug-in - ("Content"). Unless otherwise indicated below, the Content - is provided to you under the terms and conditions of the Eclipse - Public License Version 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -
- -- If you did not receive this Content directly from the Eclipse - Foundation, the Content is being redistributed by another party - ("Redistributor") and different terms and conditions may - apply to your use of any object code in the Content. Check the - Redistributor's license that was provided with the Content. If no such - license exists, contact the Redistributor. Unless otherwise indicated - below, the terms and conditions of the EPL still apply to any source - code in the Content and such source code may be obtained at http://www.eclipse.org. -
- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/build.properties b/bundles/org.eclipse.equinox.ip/build.properties deleted file mode 100644 index 41490f2f19..0000000000 --- a/bundles/org.eclipse.equinox.ip/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.ip/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.ip/plugin.properties b/bundles/org.eclipse.equinox.ip/plugin.properties deleted file mode 100644 index 4c8bcbb829..0000000000 --- a/bundles/org.eclipse.equinox.ip/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.ip -bundleVendor = Eclipse.org - Equinox -bundleName = Initial Provisioning \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.ip/pom.xml b/bundles/org.eclipse.equinox.ip/pom.xml deleted file mode 100644 index c2a6a85fa7..0000000000 --- a/bundles/org.eclipse.equinox.ip/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - -Dictionary.keys()
method or it evokes action
- * (as ProvisioningService.PROVISIONIN_REFERENCE).
- *
- * @param prvSrv
- * provisioning service reference
- * @return the initial data. It can be null.
- * @throws Exception
- * on initialization error
- */
- public Dictionary init(ProvisioningService prvSrv) throws Exception;
-
- /**
- * Gets a property with a supplied key from the provider. This method is
- * invoked by the Provisioning Agent when
- * Dictionary.get(propertyKey)
is invoked for a propertyKey
- * which is not already stored in the ProvisioningDictionary. The method is
- * invoked subsequently on all registered providers ordered by service
- * ranking until some of them returns value different from null
.
- *
- * @param propertyKey
- * the key.
- * @return the property value or null
if there is no such
- * property.
- */
- public Object get(Object propertyKey);
-}
diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java
deleted file mode 100644
index 489b0a25bd..0000000000
--- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/ProvisioningStorage.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.ip;
-
-import java.util.Dictionary;
-
-/**
- * Provides persistent storage for the Initial Provisioning Dictionary. This
- * service is used by the Provisioning Agent to store the provisioning data.
- *
- * @author Avgustin Marinov, e-mail: a_marinov@prosyst.bg
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public interface ProvisioningStorage {
-
- /**
- * This method is invoked by Provisioning Agent on startup. The storage
- * returns the stored data. After that the provisioning service is
- * responsible to put the data into the provisioning service dictionary.
- *
- * @return the stored info
- * @throws Exception
- * an exception if I/O error occurs
- */
- public Dictionary getStoredInfo() throws Exception;
-
- /**
- * This method is invoked by provisioning service on provisioning data
- * update. The storage must store the data.
- *
- * @param provisioningData
- * Provisioning Data dictionary.
- * @throws Exception
- * if the data cannot be stored
- */
- public void store(Dictionary provisioningData) throws Exception;
-}
diff --git a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java b/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java
deleted file mode 100644
index a53a6c7212..0000000000
--- a/bundles/org.eclipse.equinox.ip/src/org/eclipse/equinox/internal/ip/dscagent/DiscoveryAgent.java
+++ /dev/null
@@ -1,272 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.ip.dscagent;
-
-import java.io.IOException;
-import java.io.InterruptedIOException;
-import java.net.*;
-import java.util.Dictionary;
-import org.eclipse.equinox.internal.ip.ProvisioningInfoProvider;
-import org.eclipse.equinox.internal.ip.impl.Log;
-import org.eclipse.equinox.internal.ip.impl.ProvisioningAgent;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.provisioning.ProvisioningService;
-
-/**
- * Agent who make FW available for UDM multicast discovery. It joins
- * provisioning agent to a MulticastSocket and waits for ping replies. The
- * response contains data that describes gateway. HTTP port is determined using
- * next algorithm: November 30, 2017
-- The Eclipse Foundation makes available all content in this plug-in - ("Content"). Unless otherwise indicated below, the Content - is provided to you under the terms and conditions of the Eclipse - Public License Version 2.0 ("EPL"). A copy of the EPL is - available at http://www.eclipse.org/legal/epl-2.0. - For purposes of the EPL, "Program" will mean the Content. -
- -- If you did not receive this Content directly from the Eclipse - Foundation, the Content is being redistributed by another party - ("Redistributor") and different terms and conditions may - apply to your use of any object code in the Content. Check the - Redistributor's license that was provided with the Content. If no such - license exists, contact the Redistributor. Unless otherwise indicated - below, the terms and conditions of the EPL still apply to any source - code in the Content and such source code may be obtained at http://www.eclipse.org. -
- - - \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/build.properties b/bundles/org.eclipse.equinox.util/build.properties deleted file mode 100644 index 41490f2f19..0000000000 --- a/bundles/org.eclipse.equinox.util/build.properties +++ /dev/null @@ -1,22 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -source.. = src/ -output.. = bin/ -bin.includes = META-INF/,\ - .,\ - about.html,\ - plugin.properties,\ - OSGI-INF/ -src.includes = about.html diff --git a/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt b/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt deleted file mode 100644 index 56f1032a8a..0000000000 --- a/bundles/org.eclipse.equinox.util/forceQualifierUpdate.txt +++ /dev/null @@ -1,2 +0,0 @@ -# To force a version qualifier update add the bug here -Bug 403352 - Update all parent versions to match our build stream diff --git a/bundles/org.eclipse.equinox.util/plugin.properties b/bundles/org.eclipse.equinox.util/plugin.properties deleted file mode 100644 index 4b6309e1b8..0000000000 --- a/bundles/org.eclipse.equinox.util/plugin.properties +++ /dev/null @@ -1,17 +0,0 @@ -############################################################################### -# Copyright (c) 1997-2009 by ProSyst Software GmbH -# http://www.prosyst.com -# -# This program and the accompanying materials -# are made available under the terms of the Eclipse Public License 2.0 -# which accompanies this distribution, and is available at -# https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# -# Contributors: -# ProSyst Software GmbH - initial API and implementation -############################################################################### -#Properties file for org.eclipse.equinox.util -bundleVendor = Eclipse.org - Equinox -bundleName = Equinox Util Bundle \ No newline at end of file diff --git a/bundles/org.eclipse.equinox.util/pom.xml b/bundles/org.eclipse.equinox.util/pom.xml deleted file mode 100644 index da554180b8..0000000000 --- a/bundles/org.eclipse.equinox.util/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - counter
value
- * will be added at the end of the string to construct the full
- * name.
- * @param size
- * The initial number of elements of the events queue
- */
- public EventThread(ThreadGroup group, String name, int size) {
- makeThread(this.group = group, this.name = name + '0');
- baseName = name;
- queue = new Queue(size);
- int priority = getThreadPriority();
- if (priority != Thread.NORM_PRIORITY)
- thread.setPriority(priority);
- }
-
- /**
- * Constructs the first instance of the EventThread
- *
- * @param group
- * The ThreadGroup of the thread, or null for the current thread
- * group
- * @param name
- * The base name of the thread. The counter
value
- * will be added at the end of the string to construct the full
- * name.
- * @param queue
- * The events queue
- */
- public EventThread(ThreadGroup group, String name, Queue queue) {
- makeThread(this.group = group, this.name = name + '0');
- baseName = name;
- this.queue = queue;
- int priority = getThreadPriority();
- if (priority != Thread.NORM_PRIORITY)
- thread.setPriority(priority);
- }
-
- /**
- * Constructs a new EventThread, after the old
event thread
- * has stopped responding
- *
- * @param old
- * The previous instance
- */
- protected EventThread(EventThread old) {
- makeThread(group = old.thread.getThreadGroup(), name = old.baseName + old.counter++);
- baseName = old.baseName;
- counter = old.counter;
- queue = old.queue;
- int priority = getThreadPriority();
- if (priority != Thread.NORM_PRIORITY)
- thread.setPriority(priority);
- }
-
- public void start() {
- thread.start();
- }
-
- /**
- * Adds an event in the event queue. The method must be synchronized
- * outside, on the queue
field.
- *
- * @param event
- * The event to add
- * @param check
- * If true, the method will check if the EventThread is still
- * responding
- */
- public void addEvent(Object event, boolean check) {
- try {
- queue.put(event);
- } catch (Throwable t) {
- print(t);
- return;
- }
- if ((state & 2) != 0)
- queue.notify();
- else if (check && checkTime())
- try {
- state |= 1;
- newEventDispatcher(); // must call start
- } catch (Throwable t) {
- print(t);
- state &= 254;
- }
- }
-
- /**
- * Processes the event queue. Sets the event to be dispathed in the
- * element
field and calls element
field. The method is supposed to perform the
- * following for every listener:
- * queue
check the state of the thread -
- * if it si closed - return
- * bad and time
- * callback
- * set bad to null and time to 0
- */
- public abstract void processEvent();
-
- /**
- * Checks if the thread is still active. The fields time
and
- * bad
must be used. The method is called from the addEvent
- * method - thus should be synchronizes on the queue
field
- * outside and additional synchronization is not needed.
- */
- public abstract boolean checkTime();
-
- /**
- * The method must create a new EventThread instance, using
- * super.EventThread(this)
and start it.
- */
- public abstract void newEventDispatcher();
-
- /**
- * Logs the error.
- *
- * @param t
- */
- public abstract void print(Throwable t);
-}
-
-class PrivilegedActionImpl implements PrivilegedAction {
- private ThreadGroup group;
- private Runnable runnable;
- private String name;
-
- private boolean locked = false;
- private int waiting = 0;
-
- void set(ThreadGroup group, Runnable runnable, String name) {
- lock();
- this.group = group;
- this.runnable = runnable;
- this.name = name;
- }
-
- @Override
- public Thread run() {
- ThreadGroup group1 = this.group;
- Runnable runnable1 = this.runnable;
- String name1 = this.name;
- unlock();
- Thread th = new Thread(group1, runnable1, name1);
- if (!UtilActivator.getBoolean("equinox.disableContextClassLoader")) //$NON-NLS-1$
- th.setContextClassLoader(null);
- th.setDaemon(false);
- return th;
- }
-
- private synchronized void lock() {
- while (locked)
- try {
- waiting++;
- wait();
- waiting--;
- } catch (Exception exc) {
- }
- locked = true;
- }
-
- private synchronized void unlock() {
- locked = false;
- group = null;
- runnable = null;
- name = null;
- if (waiting > 0)
- notifyAll();
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java
deleted file mode 100644
index 4ec3772e8d..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/Queue.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.util.event;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class Queue {
-
- protected Object[] queue;
- protected int first, last = -1;
- protected int initial, count;
- protected int increment;
- protected int decrement;
-
- public Queue(int size) {
- queue = new Object[initial = size];
- increment = initial / 2;
- decrement = increment + (increment / 2);
- }
-
- public void put(Object element) {
- if (count == queue.length)
- resize(true);
- queue[++last == queue.length ? last = 0 : last] = element;
- count++;
- }
-
- public void unget(Object element) {
- if (count == queue.length)
- resize(true);
- queue[--first == -1 ? first = queue.length - 1 : first] = element;
- count++;
- }
-
- public Object get() {
- if (count == 0)
- return null;
- if (queue.length > initial && queue.length - count > decrement)
- resize(false);
- Object element = queue[first];
- queue[first++] = null;
- if (first == queue.length)
- first = 0;
- count--;
- return element;
- }
-
- public void clear() {
- if (queue.length > initial) {
- queue = new Object[initial];
- count = 0;
- } else
- for (; count > 0; count--) {
- queue[first++] = null;
- if (first == queue.length)
- first = 0;
- }
- first = 0;
- last = -1;
- }
-
- public int size() {
- return count;
- }
-
- protected void resize(boolean up) {
- Object[] tmp = new Object[queue.length + (up ? increment : -increment)];
- if (first <= last)
- System.arraycopy(queue, first, tmp, 0, count);
- else {
- int count1 = queue.length - first;
- if (count1 > 0)
- System.arraycopy(queue, first, tmp, 0, count1);
- if (count > count1)
- System.arraycopy(queue, 0, tmp, count1, count - count1);
- }
- queue = tmp;
- first = 0;
- last = count - 1;
-
- increment = queue.length / 2;
- decrement = increment + (increment / 2);
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java
deleted file mode 100644
index 468a882c05..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/SystemListener.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.event;
-
-/**
- * This interface marks any listener implementation as system listener. System
- * listener are very important for the correct functionality of the system. When
- * the execution of user implemented listener's methods is too slow this
- * listener is presumed as "bad" listener and it is removed automatically by the
- * framework unless it is implementing the SystemListener interface. Instead of
- * removing it automatically as a bad listener, the system dispatchers will
- * notify the listener by calling timeoutOccured().
- *
- * @author Stoyan Boshev
- * @author Pavlin Dobrev
- * @version 1.0
- *
- */
-public interface SystemListener {
-
- /**
- * Notifies the listener that a timeout has occured while processing one of
- * its methods. The listeners logic may decide whether it has to be removed
- * as listener or not
- *
- * @return true, if the listener has to be removed from the list of
- * listeners
- */
- public boolean timeoutOccured();
-
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html
deleted file mode 100644
index ef2d0dda5b..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/event/package.html
+++ /dev/null
@@ -1 +0,0 @@
-
This package provides APIs for event dispatching.
Bundles wishing to use this package must list the package
in the Import-Package header of the bundle's manifest.
For example:
Import-Package: org.eclipse.equinox.util.framework.event; specification-version=1.0
\ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java
deleted file mode 100644
index 81b5e16e99..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjNS.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Hashtable for mapping int keys to Object values. The methods of this
- * hashtable are not synchronized, and if used concurently must be externally
- * synchronized
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class HashIntObjNS {
-
- static final float LOAD_FACTOR = 0.75f;
-
- // count of elements available in table
- private int count = 0;
- // used for computation of next position
- private int step = 499979;
-
- /**
- * Used to enumerate the keys in the hash table. The key at index
- * i
is valid only if
- *
- * values[i] != null
- *
- */
- public int[] keys;
-
- /**
- * Used to enumerate the values in the hash table. The value at index
- * i
is valid only if
- *
- * values[i] != null
- *
- */
- public Object[] values;
-
- /**
- * Can be used to check if a key or value is valid. The value or key at
- * index i
is valid if the following expression is true
- *
- * next[i] != -1 && next[i] < next.length
- *
- */
- public int[] next;
-
- private int limit;
- private double loadFactor;
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75) and default capacity (89)
- *
- */
- public HashIntObjNS() {
- this(101, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75).
- *
- * @param capacity
- * initial capacity of the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1.
- */
- public HashIntObjNS(int capacity) {
- this(capacity, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values of type
- * Object.
- *
- * @param capacity
- * initial capacity of the table
- * @param lf
- * load factor ot the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1 or lf
< 0.0
- */
- public HashIntObjNS(int capacity, double lf) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + ".");
- }
-
- if (capacity == 0)
- capacity = 101;
-
- if (lf < 0) {
- throw new IllegalArgumentException("Invalid load factor: " + lf + ".");
- }
-
- if (lf > 1.0) {
- lf = 1.0;
- }
- loadFactor = lf;
- limit = (int) (capacity * lf);
- count = 0;
-
- keys = new int[capacity];
- values = new Object[capacity];
- next = new int[capacity];
- for (int i = 0; i < capacity; i++) {
- keys[i] = 0;
- next[i] = -1;
- }
- }
-
- /**
- * Adds in the hashtable an element with key
key and
- * value
value. If an element with the specified key is
- * already in the table only change it's value.
- *
- * @param key
- * the key of the inserted element
- * @param value
- * the value of the inserted element
- */
- public void put(int key, Object value) {
- if (count >= limit) {
- rehash();
- }
- if (_put(key, value)) {
- count++;
- }
- }
-
- /**
- * Returns an value which is mapped to the key
key.
- *
- * @param key
- * the key we are searching for
- * @return the value this key is mapped to in the table, or null
- */
- public Object get(int key) {
- int pos = find(key);
- return (pos == -1) ? null : values[pos];
- }
-
- /**
- * Removes an element with the specified key from the table. Does nothing if
- * there is no element with this key.
- *
- * @param key
- * the key of the element we want to remove
- * @return the removed value, or null if there was nothing to remove
- */
- public Object remove(int key) {
- int pos = find(key);
- if (pos == -1)
- return null;
- next[pos] += next.length; // mark this field as empty
- count--;
- Object tmp = values[pos];
- values[pos] = null;
- return tmp;
- }
-
- /**
- * Empties the hash table
- */
- public void removeAll() {
- for (int i = 0; i < values.length; i++) {
- values[i] = null;
- keys[i] = 0;
- next[i] = -1;
- }
- count = 0;
- }
-
- /**
- * Rehashes the contents of the hashtable into a hashtable with a larger
- * capacity. This method is called automatically when the number of keys in
- * the hashtable exceeds this hashtable's capacity and load factor.
- */
- public void rehash() {
- int[] tmpKeys = keys;
- Object[] tmpValues = values;
- int[] tmpNext = next;
-
- int capacity = keys.length * 2 + 1;
-
- // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory
- int[] keys = new int[capacity];
- Object[] values = new Object[capacity];
- int[] next = new int[capacity];
- for (int i = 0; i < next.length; i++) {
- next[i] = -1;
- }
-
- this.keys = keys;
- this.values = values;
- this.next = next;
-
- for (int i = 0; i < tmpNext.length; i++) {
- if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) {
- _put(tmpKeys[i], tmpValues[i]);
- }
- }
-
- limit = (int) (capacity * loadFactor);
- }
-
- /**
- * Returns the count of elements currently in the table
- *
- * @return the count of elements
- */
- public int size() {
- return count;
- }
-
- private int find(int key) {
- int pos = (key & 0x7fffffff) % keys.length;
- int i = 0;
-
- while (next[pos] >= 0) {
- if (keys[pos] == key) {
- if (next[pos] < next.length) {
- return pos;
- }
- }
- if ((pos = next[pos]) >= next.length) {
- pos -= next.length;
- }
- if (++i > next.length) {
- return -1;
- }
- }
-
- return -1;
- } // find
-
- private boolean _put(int key, Object value) {
- int index = find(key);
- if (index != -1) {
- values[index] = value;
- return false;
- }
-
- int pos = (key & 0x7fffffff) % keys.length;
-
- while ((next[pos] >= 0) && (next[pos] < next.length)) {
- pos = next[pos];
- }
-
- keys[pos] = key;
- values[pos] = value;
- if (next[pos] < 0) {
- next[pos] = (pos + step) % next.length;
- } else {
- next[pos] -= next.length;
- }
- return true;
- } // _put
-
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java
deleted file mode 100644
index 54c41defcc..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashIntObjS.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashIntObjNS
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public final class HashIntObjS extends HashIntObjNS {
-
- public HashIntObjS() {
- super(101, LOAD_FACTOR);
- }
-
- public HashIntObjS(int capacity) {
- super(capacity, LOAD_FACTOR);
- }
-
- public HashIntObjS(int capacity, double lf) {
- super(capacity, lf);
- }
-
- @Override
- public synchronized void put(int key, Object value) {
- super.put(key, value);
- }
-
- @Override
- public synchronized Object get(int key) {
- return super.get(key);
- }
-
- @Override
- public synchronized Object remove(int key) {
- return super.remove(key);
- }
-
- @Override
- public synchronized int size() {
- return super.size();
- }
-
- @Override
- public synchronized void removeAll() {
- super.removeAll();
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java
deleted file mode 100644
index 9f72d430da..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjNS.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Hashtable for mapping long keys to Object values. The methods of this
- * hashtable are not synchronized, and if used concurently must be externally
- * synchronized
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class HashLongObjNS {
-
- static final float LOAD_FACTOR = 0.75f;
-
- // count of elements available in table
- private int count = 0;
- // used for computation of next position
- private int step = 499979;
-
- /**
- * Used to enumerate the keys in the hash table. The key at index
- * i
is valid only if
- *
- * values[i] != null
- *
- */
- public long[] keys;
-
- /**
- * Used to enumerate the values in the hash table. The value at index
- * i
is valid only if
- *
- * values[i] != null
- *
- */
- public Object[] values;
-
- /**
- * Can be used to check if a key or value is valid. The value or key at
- * index i
is valid if the following expression is true
- *
- * next[i] != -1 && next[i] < next.length
- *
- */
- public int[] next;
-
- private int limit;
- private double loadFactor;
-
- /**
- * Constructs an empty hash table with keys of type long and values af type
- * int. Uses default load factor (0.75) and default capacity (89)
- *
- */
- public HashLongObjNS() {
- this(101, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type long and values af type
- * int. Uses default load factor (0.75).
- *
- * @param capacity
- * initial capacity of the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1.
- */
- public HashLongObjNS(int capacity) {
- this(capacity, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type long and values of type
- * int.
- *
- * @param capacity
- * initial capacity of the table
- * @param lf
- * load factor ot the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1 or lf
< 0.0
- */
- public HashLongObjNS(int capacity, double lf) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + ".");
- }
-
- if (capacity == 0)
- capacity = 101;
-
- if (lf < 0) {
- throw new IllegalArgumentException("Invalid load factor: " + lf + ".");
- }
-
- if (lf > 1.0) {
- lf = 1.0;
- }
- loadFactor = lf;
- limit = (int) (capacity * lf);
- count = 0;
-
- keys = new long[capacity];
- values = new Object[capacity];
- next = new int[capacity];
- for (int i = 0; i < capacity; i++) {
- keys[i] = 0;
- next[i] = -1;
- }
- }
-
- /**
- * Adds in hashtable an element with key
key and
- * value
value. If an element with the specified key is
- * already in the table only change it's value.
- *
- * @param key
- * the key of the inserted element
- * @param value
- * the value of the inserted element
- */
- public void put(long key, Object value) {
- if (count >= limit) {
- rehash();
- }
- if (_put(key, value)) {
- count++;
- }
- }
-
- /**
- * Returns an value which is mapped to the key
key.
- *
- * @param key
- * the key we are searching for
- * @return the value this key is mapped to in the table, or null
- */
- public Object get(long key) {
- int pos = find(key);
- return (pos == -1) ? null : values[pos];
- }
-
- /**
- * Removes an element with the specified key from the table. Does nothing if
- * there is no element with this key.
- *
- * @param key
- * the key of the element we want to remove
- * @return the removed value, or null if there was nothing to remove
- */
- public Object remove(long key) {
- int pos = find(key);
- if (pos == -1)
- return null;
- next[pos] += next.length; // mark this field as empty
- count--;
- Object tmp = values[pos];
- values[pos] = null;
- return tmp;
- }
-
- /**
- * Empties the hash table
- */
- public void removeAll() {
- for (int i = 0; i < values.length; i++) {
- values[i] = null;
- keys[i] = 0;
- next[i] = -1;
- }
- count = 0;
- }
-
- /**
- * Rehashes the contents of the hashtable into a hashtable with a larger
- * capacity. This method is called automatically when the number of keys in
- * the hashtable exceeds this hashtable's capacity and load factor.
- */
- public void rehash() {
- long[] tmpKeys = keys;
- Object[] tmpValues = values;
- int[] tmpNext = next;
-
- int capacity = keys.length * 2 + 1;
-
- // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory
- long[] keys = new long[capacity];
- Object[] values = new Object[capacity];
- int[] next = new int[capacity];
- for (int i = 0; i < next.length; i++) {
- next[i] = -1;
- }
-
- this.keys = keys;
- this.values = values;
- this.next = next;
-
- for (int i = 0; i < tmpNext.length; i++) {
- if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) {
- _put(tmpKeys[i], tmpValues[i]);
- }
- }
-
- limit = (int) (capacity * loadFactor);
- }
-
- /**
- * Returns the count of elements currently in the table
- *
- * @return the count of elements
- */
- public int size() {
- return count;
- }
-
- private int find(long key) {
- int pos = (int) (key & 0x7fffffff) % keys.length;
- int i = 0;
-
- while (next[pos] >= 0) {
- if (keys[pos] == key) {
- if (next[pos] < next.length) {
- return pos;
- }
- }
- if ((pos = next[pos]) >= next.length) {
- pos -= next.length;
- }
- if (++i > next.length) {
- return -1;
- }
- }
-
- return -1;
- } // find
-
- private boolean _put(long key, Object value) {
- int index = find(key);
- if (index != -1) {
- values[index] = value;
- return false;
- }
-
- int pos = (int) (key & 0x7fffffff) % keys.length;
-
- while ((next[pos] >= 0) && (next[pos] < next.length)) {
- pos = next[pos];
- }
-
- keys[pos] = key;
- values[pos] = value;
- if (next[pos] < 0) {
- next[pos] = (pos + step) % next.length;
- } else {
- next[pos] -= next.length;
- }
- return true;
- } // _put
-
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java
deleted file mode 100644
index c026af8d53..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashLongObjS.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashLongObjNS
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public final class HashLongObjS extends HashLongObjNS {
-
- public HashLongObjS() {
- super(101, LOAD_FACTOR);
- }
-
- public HashLongObjS(int capacity) {
- super(capacity, LOAD_FACTOR);
- }
-
- public HashLongObjS(int capacity, double lf) {
- super(capacity, lf);
- }
-
- @Override
- public synchronized void put(long key, Object value) {
- super.put(key, value);
- }
-
- @Override
- public synchronized Object get(long key) {
- return super.get(key);
- }
-
- @Override
- public synchronized Object remove(long key) {
- return super.remove(key);
- }
-
- @Override
- public synchronized int size() {
- return super.size();
- }
-
- @Override
- public synchronized void removeAll() {
- super.removeAll();
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java
deleted file mode 100644
index 8cc336d660..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntNS.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-import java.util.NoSuchElementException;
-
-/**
- * Hashtable for mapping Object keys to int values. The methods of this
- * hashtable are not synchronized, and if used concurently must be externally
- * synchronized
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class HashObjIntNS {
-
- static final float LOAD_FACTOR = 0.75f;
-
- // count of elements available in table
- private int count = 0;
- // used for computation of next position
- private int step = 499979;
-
- /**
- * Used to enumerate the keys in the hash table. The key at index
- * i
is valid only if
- *
- * keys[i] != null
- *
- */
- public Object[] keys;
-
- /**
- * Used to enumerate the values in the hash table. The value at index
- * i
is valid only if
- *
- * keys[i] != null
- *
- */
- public int[] values;
-
- /**
- * Can be used to check if a key or value is valid. The value or key at
- * index i
is valid if the following expression is true
- *
- * next[i] != -1 && next[i] < next.length
- *
- */
- public int[] next;
-
- private int limit;
- private double loadFactor;
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75) and default capacity (89)
- *
- */
- public HashObjIntNS() {
- this(101, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75).
- *
- * @param capacity
- * initial capacity of the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1.
- */
- public HashObjIntNS(int capacity) {
- this(capacity, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values of type
- * Object.
- *
- * @param capacity
- * initial capacity of the table
- * @param lf
- * load factor ot the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1 or lf
< 0.0
- */
- public HashObjIntNS(int capacity, double lf) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + ".");
- }
-
- if (capacity == 0)
- capacity = 101;
-
- if (lf < 0) {
- throw new IllegalArgumentException("Invalid load factor: " + lf + ".");
- }
-
- if (lf > 1.0) {
- lf = 1.0;
- }
- loadFactor = lf;
- limit = (int) (capacity * lf);
- count = 0;
-
- keys = new Object[capacity];
- values = new int[capacity];
- next = new int[capacity];
- for (int i = 0; i < capacity; i++) {
- next[i] = -1;
- }
- }
-
- /**
- * Adds in hashtable an element with key
key and
- * value
value. If an element with the specified key is
- * already in the table only change it's value.
- *
- * @param key
- * the key of the inserted element
- * @param value
- * the value of the inserted element
- */
- public void put(Object key, int value) {
- if (count >= limit) {
- rehash();
- }
- if (_put(key, value)) {
- count++;
- }
- }
-
- /**
- * Returns an value which is mapped to the key
key. If there
- * is no such a key, throws NoSuchElementException
.
- *
- * @param key
- * the key we are searching for
- * @return the value this key is mapped to in the table.
- *
- * @exception NoSuchElementException
- * if there is no element with the specified key.
- */
- public int get(Object key) {
- int pos = find(key);
- if (pos == -1)
- throw new NoSuchElementException();
- return values[pos];
- }
-
- /**
- * Removes an element with the specified key from the table. throws
- * NoSuchElementException
if there is no element with this
- * key.
- *
- * @param key
- * the key of the element we want to remove
- * @exception NoSuchElementException
- * if there is no element with the specified key.
- */
- public int remove(Object key) {
- int pos = find(key);
- if (pos == -1)
- throw new NoSuchElementException();
- next[pos] += next.length; // mark this field as empty
- count--;
- keys[pos] = null;
- return values[pos];
- }
-
- /**
- * Empties the hash table
- */
- public void removeAll() {
- for (int i = 0; i < values.length; i++) {
- keys[i] = null;
- next[i] = -1;
- }
- }
-
- /**
- * Rehashes the contents of the hashtable into a hashtable with a larger
- * capacity. This method is called automatically when the number of keys in
- * the hashtable exceeds this hashtable's capacity and load factor.
- */
- public void rehash() {
- Object[] tmpKeys = keys;
- int[] tmpValues = values;
- int[] tmpNext = next;
-
- int capacity = keys.length * 2 + 1;
-
- // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory
- Object[] keys = new Object[capacity];
- int[] values = new int[capacity];
- int[] next = new int[capacity];
- for (int i = 0; i < next.length; i++) {
- next[i] = -1;
- }
-
- this.keys = keys;
- this.values = values;
- this.next = next;
-
- for (int i = 0; i < tmpNext.length; i++) {
- if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) {
- _put(tmpKeys[i], tmpValues[i]);
- }
- }
-
- limit = (int) (capacity * loadFactor);
- }
-
- /**
- * Returns the count of elements currently in the table
- *
- * @return the count of elements
- */
- public int size() {
- return count;
- }
-
- public Object[] getKeys() {
- return keys;
- }
-
- private int find(Object key) {
- return find(key, (key.hashCode() & 0x7fffffff) % keys.length);
- } // find
-
- private int find(Object key, int pos) {
- int i = 0;
-
- // System.out.println("In Zarko's code");
- //
- // if (key == null)
- // System.out.println("key is null");
- //
- while (next[pos] >= 0) {
-
- if (keys[pos] != null) {
- // System.out.println("is null");
-
- if (key.equals(keys[pos])) {
- if (next[pos] < next.length) {
- return pos;
- }
- }
- }
- if ((pos = next[pos]) >= next.length) {
- pos -= next.length;
- }
- if (++i > next.length) {
- return -1;
- }
- }
-
- return -1;
- }
-
- private boolean _put(Object key, int value) {
- int pos = (key.hashCode() & 0x7fffffff) % keys.length;
- int index = find(key, pos);
- if (index != -1) {
- values[index] = value;
- return false;
- }
-
- while ((next[pos] >= 0) && (next[pos] < next.length)) {
- pos = next[pos];
- }
-
- keys[pos] = key;
- values[pos] = value;
- if (next[pos] < 0) {
- next[pos] = (pos + step) % next.length;
- } else {
- next[pos] -= next.length;
- }
- return true;
- } // _put
-
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java
deleted file mode 100644
index 95f07f8830..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjIntS.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashObjIntNS
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public final class HashObjIntS extends HashObjIntNS {
-
- public HashObjIntS() {
- super(101, LOAD_FACTOR);
- }
-
- public HashObjIntS(int capacity) {
- super(capacity, LOAD_FACTOR);
- }
-
- public HashObjIntS(int capacity, double lf) {
- super(capacity, lf);
- }
-
- @Override
- public synchronized void put(Object key, int value) {
- super.put(key, value);
- }
-
- @Override
- public synchronized int get(Object key) {
- return super.get(key);
- }
-
- @Override
- public synchronized int remove(Object key) {
- return super.remove(key);
- }
-
- @Override
- public synchronized int size() {
- return super.size();
- }
-
- @Override
- public synchronized void removeAll() {
- super.removeAll();
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java
deleted file mode 100644
index bb411959ec..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongNS.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2008 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-import java.util.NoSuchElementException;
-
-/**
- * Hashtable for mapping Object keys to long values. The methods of this
- * hashtable are not synchronized, and if used concurently must be externally
- * synchronized
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public class HashObjLongNS {
-
- static final float LOAD_FACTOR = 0.75f;
-
- // count of elements available in table
- private int count = 0;
- // used for computation of next position
- private int step = 499979;
-
- /**
- * Used to enumerate the keys in the hash table. The key at index
- * i
is valid only if
- *
- * keys[i] != null
- *
- */
- public Object[] keys;
-
- /**
- * Used to enumerate the values in the hash table. The value at index
- * i
is valid only if
- *
- * keys[i] != null
- *
- */
- public long[] values;
-
- /**
- * Can be used to check if a key or value is valid. The value or key at
- * index i
is valid if the following expression is true
- *
- * next[i] != -1 && next[i] < next.length
- *
- */
- public int[] next;
-
- private int limit;
- private double loadFactor;
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75) and default capacity (89)
- *
- */
- public HashObjLongNS() {
- this(101, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values af type
- * Object. Uses default load factor (0.75).
- *
- * @param capacity
- * initial capacity of the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1.
- */
- public HashObjLongNS(int capacity) {
- this(capacity, LOAD_FACTOR);
- }
-
- /**
- * Constructs an empty hash table with keys of type int and values of type
- * Object.
- *
- * @param capacity
- * initial capacity of the table
- * @param lf
- * load factor ot the table
- *
- * @exception IllegalArgumentException
- * if capacity
< 1 or lf
< 0.0
- */
- public HashObjLongNS(int capacity, double lf) {
- if (capacity < 0) {
- throw new IllegalArgumentException("Invalid hashtable capacity: " + capacity + ".");
- }
-
- if (capacity == 0)
- capacity = 101;
-
- if (lf < 0) {
- throw new IllegalArgumentException("Invalid load factor: " + lf + ".");
- }
-
- if (lf > 1.0) {
- lf = 1.0;
- }
- loadFactor = lf;
- limit = (int) (capacity * lf);
- count = 0;
-
- keys = new Object[capacity];
- values = new long[capacity];
- next = new int[capacity];
- for (int i = 0; i < capacity; i++) {
- next[i] = -1;
- }
- }
-
- /**
- * Adds in hashtable an element with key
key and
- * value
value. If an element with the specified key is
- * already in the table only change it's value.
- *
- * @param key
- * the key of the inserted element
- * @param value
- * the value of the inserted element
- */
- public void put(Object key, long value) {
- if (count >= limit) {
- rehash();
- }
- if (_put(key, value)) {
- count++;
- }
- }
-
- /**
- * Returns an value which is mapped to the key
key. If there
- * is no such a key, throws NoSuchElementException
.
- *
- * @param key
- * the key we are searching for
- * @return the value this key is mapped to in the table.
- *
- * @exception NoSuchElementException
- * if there is no element with the specified key.
- */
- public long get(Object key) {
- int pos = find(key);
- if (pos == -1)
- throw new NoSuchElementException();
- return values[pos];
- }
-
- /**
- * Removes an element with the specified key from the table. throws
- * NoSuchElementException
if there is no element with this
- * key.
- *
- * @param key
- * the key of the element we want to remove
- * @exception NoSuchElementException
- * if there is no element with the specified key.
- */
- public long remove(Object key) {
- int pos = find(key);
- if (pos == -1)
- throw new NoSuchElementException();
- next[pos] += next.length; // mark this field as empty
- keys[pos] = null;
- count--;
- return values[pos];
- }
-
- /**
- * Empties the hash table
- */
- public void removeAll() {
- for (int i = 0; i < values.length; i++) {
- keys[i] = null;
- next[i] = -1;
- }
- }
-
- /**
- * Rehashes the contents of the hashtable into a hashtable with a larger
- * capacity. This method is called automatically when the number of keys in
- * the hashtable exceeds this hashtable's capacity and load factor.
- */
- public void rehash() {
- Object[] tmpKeys = keys;
- long[] tmpValues = values;
- int[] tmpNext = next;
-
- int capacity = keys.length * 2 + 1;
-
- // polzwame temp array-i za da ne se namaje hashtable-a pri OutOfMemory
- Object[] keys = new Object[capacity];
- long[] values = new long[capacity];
- int[] next = new int[capacity];
- for (int i = 0; i < next.length; i++) {
- next[i] = -1;
- }
-
- this.keys = keys;
- this.values = values;
- this.next = next;
-
- for (int i = 0; i < tmpNext.length; i++) {
- if ((tmpNext[i] >= 0) && (tmpNext[i] < tmpNext.length)) {
- _put(tmpKeys[i], tmpValues[i]);
- }
- }
-
- limit = (int) (capacity * loadFactor);
- }
-
- /**
- * Returns the count of elements currently in the table
- *
- * @return the count of elements
- */
- public int size() {
- return count;
- }
-
- private int find(Object key) {
- return find(key, (key.hashCode() & 0x7fffffff) % keys.length);
- } // find
-
- private int find(Object key, int pos) {
- int i = 0;
-
- while (next[pos] >= 0) {
- if (key.equals(keys[pos])) {
- if (next[pos] < next.length) {
- return pos;
- }
- }
- if ((pos = next[pos]) >= next.length) {
- pos -= next.length;
- }
- if (++i > next.length) {
- return -1;
- }
- }
-
- return -1;
- }
-
- private boolean _put(Object key, long value) {
- int pos = (key.hashCode() & 0x7fffffff) % keys.length;
- int index = find(key, pos);
- if (index != -1) {
- values[index] = value;
- return false;
- }
-
- while ((next[pos] >= 0) && (next[pos] < next.length)) {
- pos = next[pos];
- }
-
- keys[pos] = key;
- values[pos] = value;
- if (next[pos] < 0) {
- next[pos] = (pos + step) % next.length;
- } else {
- next[pos] -= next.length;
- }
- return true;
- } // _put
-
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java
deleted file mode 100644
index a6934fcc17..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/HashObjLongS.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-package org.eclipse.equinox.internal.util.hash;
-
-/**
- * Synchronized extension of org.eclipse.equinox.internal.util.hash.HashObjLongNS
- *
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public final class HashObjLongS extends HashObjLongNS {
-
- public HashObjLongS() {
- super(101, LOAD_FACTOR);
- }
-
- public HashObjLongS(int capacity) {
- super(capacity, LOAD_FACTOR);
- }
-
- public HashObjLongS(int capacity, double lf) {
- super(capacity, lf);
- }
-
- @Override
- public synchronized void put(Object key, long value) {
- super.put(key, value);
- }
-
- @Override
- public synchronized long get(Object key) {
- return super.get(key);
- }
-
- @Override
- public synchronized long remove(Object key) {
- return super.remove(key);
- }
-
- @Override
- public synchronized int size() {
- return super.size();
- }
-
- @Override
- public synchronized void removeAll() {
- super.removeAll();
- }
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html
deleted file mode 100644
index 9f23940ea4..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/hash/package.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-org.eclipse.equinox.util.hash
-
-
-Provides hashing utilities among which are several Hashtables accepting primitive data types for keys or values.
-
-
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java
deleted file mode 100644
index 3aceab3fef..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/ServiceFactoryImpl.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.util.impl.tpt;
-
-import org.eclipse.equinox.internal.util.UtilActivator;
-import org.eclipse.equinox.internal.util.ref.Log;
-import org.osgi.framework.*;
-
-/**
- * @author Pavlin Dobrev
- * @version 1.0
- */
-
-public abstract class ServiceFactoryImpl implements ServiceFactory {
-
- public String bundleName;
- public static Log log;
-
- private static Bundle systemBundle = null;
- static {
- try {
- systemBundle = UtilActivator.bc.getBundle(0);
- } catch (Exception e) {
- }
- }
- static boolean emptyStorage;
-
- private static boolean security = Log.security();
-
- public static boolean privileged() {
- emptyStorage = UtilActivator.bc.getProperty("equinox.storage.empty") != null;
- return ((systemBundle.getState() != Bundle.STARTING) || emptyStorage) && security;
- }
-
- public static boolean useNames = true;
- static String suseNames;
-
- public ServiceFactoryImpl(String bundleName, Log log) {
- this.bundleName = bundleName;
- ServiceFactoryImpl.log = log;
-
- String tmp = UtilActivator.bc.getProperty("equinox.util.threadpool.useNames");
- if (suseNames != tmp)
- useNames = tmp == null || !tmp.equals("false");
- }
-
- public ServiceFactoryImpl(String bundleName) {
- this.bundleName = bundleName;
- }
-
- @Override
- public T getService(Bundle caller, ServiceRegistration sReg) {
- return getInstance(useNames ? getName(caller) : null);
- }
-
- public static String getName(Bundle caller) {
- StringBuilder bf = new StringBuilder(13);
- bf.append(" (Bundle ");
- bf.append(caller.getBundleId());
- bf.append(')');
- return bf.toString();
- }
-
- /**
- * Nothing to be done here.
- *
- * @param caller
- * caller bundle, which releases the factory instance
- * @param sReg
- * @param service
- * object that is released
- */
- @Override
- public void ungetService(Bundle caller, ServiceRegistration sReg, T service) {
- }
-
- public abstract T getInstance(String bundleName);
-}
diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java
deleted file mode 100644
index c7d1e52556..0000000000
--- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/impl/tpt/threadpool/Executor.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 1997, 2018 by ProSyst Software GmbH
- * http://www.prosyst.com
- *
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License 2.0
- * which accompanies this distribution, and is available at
- * https://www.eclipse.org/legal/epl-2.0/
- *
- * SPDX-License-Identifier: EPL-2.0
- *
- * Contributors:
- * ProSyst Software GmbH - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.equinox.internal.util.impl.tpt.threadpool;
-
-import java.security.*;
-import org.eclipse.equinox.internal.util.UtilActivator;
-import org.eclipse.equinox.internal.util.impl.tpt.ServiceFactoryImpl;
-import org.eclipse.equinox.internal.util.threadpool.ThreadContext;
-
-/**
- * @author Pavlin Dobrev
- */
-public class Executor extends Thread implements ThreadContext {
-
- public static final String iname = "[ThreadPool Manager] - Idle Thread";
- public static final String nullname = "[ThreadPool Manager] - Occupied Thread ";
- public static final String xname = "ThreadPool Manager Thread";
-
- ThreadPoolFactoryImpl factory;
- boolean accessed = false;
-
- private Runnable job = null;
-
- private boolean terminated = false;
-
- AccessControlContext acc;
- PEA pea;
- static ClassLoader defaultTCCL;
-
- static {
- defaultTCCL = Thread.currentThread().getContextClassLoader();
- }
-
- public synchronized void setRunnable(Runnable job, String name, ThreadPoolFactoryImpl factory, AccessControlContext acc) {
- this.job = job;
- this.factory = factory;
-
- if (ServiceFactoryImpl.useNames)
- setName(name == null ? nullname : name);
-
- this.acc = acc;
-
- notify();
- }
-
- @Override
- public void run() {
- while (!terminated) {
- if (job != null) {
- try {
- if (UtilActivator.debugLevel == 2 && UtilActivator.LOG_DEBUG) {
- UtilActivator.log.debug(0x0100, 10003, getName(), null, false);
- }
- accessed = true;
- if (acc != null) {
- if (pea == null)
- pea = new PEA();
- pea.job = job;
- AccessController.doPrivileged(pea, acc);
- } else
- job.run();
- } catch (Throwable t) {
- try { // fix memory leak
- throw new Exception();
- } catch (Exception _) {
- }
- if (ServiceFactoryImpl.log != null) {
- ServiceFactoryImpl.log.error("[ThreadPool Manager]\r\nException while executing: \r\nNAME: " + this + "\r\nJOB: " + job + "\r\n", t);
- }
-
- } finally {
- if (getContextClassLoader() != defaultTCCL) {
- setContextClassLoader(defaultTCCL);
- }
- }
- if (UtilActivator.debugLevel == 2 && UtilActivator.LOG_DEBUG) {
- UtilActivator.log.debug(0x0100, 10004, getName(), null, false);
- }
- job = null;
- if (ServiceFactoryImpl.useNames)
- setName(iname);
- if (ThreadPoolManagerImpl.threadPool == null || (!ThreadPoolManagerImpl.threadPool.releaseObject(this))) {
- terminated = true;
- continue;
- }
- }
-
- if (this.job != null) {
- continue;
- }
- synchronized (this) {
- if (this.job != null || terminated) {
- continue;
- }
-
- try {
- wait();
- } catch (InterruptedException ie) {
- }
- }
- }
-
- clear();
- }
-
- void clear() {
- job = null;
- }
-
- public synchronized void terminate() {
- terminated = true;
- notify();
- }
-
- public Executor() {
- super(ServiceFactoryImpl.useNames ? iname : xname);
- if (getContextClassLoader() != defaultTCCL) {
- setContextClassLoader(defaultTCCL);
- }
- start();
- }
-
- @Override
- public Runnable getRunnable() {
- return job;
- }
-
- public void setPriorityI(int p) {
- if (this.getPriority() != p) {
- setPriority(p);
- }
- }
-}
-
-class PEA implements PrivilegedAction