diff options
Diffstat (limited to 'framework/bundles/org.eclipse.ecf/src/org')
75 files changed, 884 insertions, 603 deletions
diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainer.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainer.java index 6daa6c3fc..21e06d2bb 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainer.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainer.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2006 IBM, Inc and Composent, Inc. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2006 IBM, Inc and Composent, Inc. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Chris Aniszczyk <zx@us.ibm.com> - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import java.util.*; @@ -62,17 +65,17 @@ public abstract class AbstractContainer implements IContainer { } } - public Object getAdapter(Class serviceType) { + public <T> T getAdapter(Class<T> serviceType) { if (serviceType == null) return null; if (serviceType.isInstance(this)) { - return this; + return serviceType.cast(this); } ECFPlugin plugin = ECFPlugin.getDefault(); if (plugin == null) return null; IAdapterManager adapterManager = plugin.getAdapterManager(); - return (adapterManager == null) ? null : adapterManager.loadAdapter(this, serviceType.getName()); + return (T) ((adapterManager == null) ? null : adapterManager.loadAdapter(this, serviceType.getName())); } protected String getPasswordFromConnectContext(IConnectContext connectContext) throws ContainerConnectException { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainerAdapterFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainerAdapterFactory.java index 4bab37a35..d5b0f86c6 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainerAdapterFactory.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/AbstractContainerAdapterFactory.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core; @@ -25,11 +27,11 @@ public abstract class AbstractContainerAdapterFactory implements IAdapterFactory * @see org.eclipse.core.runtime.IAdapterFactory#getAdapter(java.lang.Object, * java.lang.Class) */ - public Object getAdapter(Object adaptableObject, Class adapterType) { + public <T> T getAdapter(Object adaptableObject, Class<T> adapterType) { if (adaptableObject == null || adapterType == null) return null; if (IContainer.class.isInstance(adaptableObject)) - return getContainerAdapter((IContainer) adaptableObject, adapterType); + return adapterType.cast(getContainerAdapter((IContainer) adaptableObject, adapterType)); return null; } @@ -49,6 +51,6 @@ public abstract class AbstractContainerAdapterFactory implements IAdapterFactory * * @see org.eclipse.core.runtime.IAdapterFactory#getAdapterList() */ - public abstract Class[] getAdapterList(); + public abstract Class<?>[] getAdapterList(); } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/BaseContainer.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/BaseContainer.java index e35c41a7c..81215d413 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/BaseContainer.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/BaseContainer.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerAuthenticationException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerAuthenticationException.java index 4ffc632d3..8563a6a8d 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerAuthenticationException.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerAuthenticationException.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerConnectException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerConnectException.java index 220819649..230bfe09b 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerConnectException.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerConnectException.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import org.eclipse.core.runtime.IStatus; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerCreateException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerCreateException.java index 5ece183d2..13c1a6e5b 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerCreateException.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerCreateException.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import org.eclipse.core.runtime.IStatus; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerFactory.java index 100df7067..68f18cc86 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerFactory.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerFactory.java @@ -1,13 +1,15 @@ -/******************************************************************************* +/**************************************************************************** * Copyright (c) 2004, 2007 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import java.util.*; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java index 0efea0df7..fb7d278dd 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/ContainerTypeDescription.java @@ -1,13 +1,17 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; +import java.lang.reflect.InvocationTargetException; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.ecf.core.provider.IContainerInstantiator; @@ -121,7 +125,15 @@ public class ContainerTypeDescription { // Load instantiator class Class clazz = Class.forName(instantiatorClass); // Make new instance - instantiator = (IContainerInstantiator) clazz.newInstance(); + try { + instantiator = (IContainerInstantiator) clazz.getDeclaredConstructor().newInstance(); + } catch (InvocationTargetException e) { + throw new ClassNotFoundException("Invocation target exception accessing null constructor for class=" + clazz, e); //$NON-NLS-1$ + } catch (NoSuchMethodException e) { + throw new ClassNotFoundException("No null constructor found on class=" + clazz, e); //$NON-NLS-1$ + } catch (SecurityException e) { + throw new ClassNotFoundException("Security exception accessing null constructor for class=" + clazz, e); //$NON-NLS-1$ + } } /** @@ -168,9 +180,7 @@ public class ContainerTypeDescription { traceAndLogException(IStatus.ERROR, "getSupportedAdapterTypes", e); //$NON-NLS-1$ } List resultList = new ArrayList(); - for (int i = 0; i < result.length; i++) { - resultList.add(result[i]); - } + resultList.addAll(Arrays.asList(result)); if (!resultList.contains(IContainer.class.getName())) resultList.add(IContainer.class.getName()); return (String[]) resultList.toArray(new String[] {}); diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainer.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainer.java index 5c28a4446..5b5618a46 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainer.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainer.java @@ -1,13 +1,15 @@ -/******************************************************************************* +/**************************************************************************** * Copyright (c) 2004, 2007 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import org.eclipse.core.runtime.IAdaptable; @@ -158,7 +160,7 @@ public interface IContainer extends IAdaptable, IIdentifiable { * <code>null</code> if this container does not support the given * service */ - public Object getAdapter(Class serviceType); + public <T> T getAdapter(Class<T> serviceType); /** * Dispose this IContainer instance. The container instance will be made diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerFactory.java index 2fa6ccee5..a8bc67ff3 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerFactory.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerFactory.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import java.util.List; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java index eb00c59a7..40b179afb 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerListener.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import org.eclipse.ecf.core.events.IContainerEvent; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManager.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManager.java index 6e4f885cb..a8cd2f170 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManager.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManager.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManagerListener.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManagerListener.java index 3fffc3e1f..5cfa6f0e1 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManagerListener.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IContainerManagerListener.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IReliableContainer.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IReliableContainer.java index ddd3fa428..4ca8b66d2 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IReliableContainer.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/IReliableContainer.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectedEvent.java index 79deb2a4b..2c6db38e8 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectedEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectingEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectingEvent.java index e7d68e1bd..3bb0e2942 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectingEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerConnectingEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectedEvent.java index ce8e6a4f1..8b96f157f 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectedEvent.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004, 2007 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.events; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectingEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectingEvent.java index c5497bee3..7211c71ac 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectingEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisconnectingEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisposeEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisposeEvent.java index 583729a14..f968e9fe0 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisposeEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerDisposeEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerEjectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerEjectedEvent.java index 79ee375c7..49c8b54ac 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerEjectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/ContainerEjectedEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import java.io.Serializable; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectedEvent.java index 22c12d058..766ee7a7f 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectedEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectingEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectingEvent.java index 56f4d4ba4..ee5f84098 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectingEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerConnectingEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectedEvent.java index 9a33ca736..f78bd017e 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectedEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectingEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectingEvent.java index 2f15dfc31..d5a4a2a09 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectingEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisconnectingEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisposeEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisposeEvent.java index cc8628691..0d72aa38f 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisposeEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerDisposeEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEjectedEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEjectedEvent.java index ca968ef71..3789f2251 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEjectedEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEjectedEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import java.io.Serializable; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEvent.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEvent.java index f8fbe5332..e0e8048f5 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEvent.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/events/IContainerEvent.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.events; import org.eclipse.ecf.core.identity.ID; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/jobs/JobsExecutor.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/jobs/JobsExecutor.java index 7f832689e..7ca01f8c0 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/jobs/JobsExecutor.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/jobs/JobsExecutor.java @@ -1,13 +1,16 @@ -/******************************************************************************* -* Copyright (c) 2008 EclipseSource, IBM, and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* EclipseSource - initial API and implementation -* IBM Corporation - initial API and implementation -******************************************************************************/ +/**************************************************************************** + * Copyright (c) 2008 EclipseSource, IBM, and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * EclipseSource - initial API and implementation + * IBM Corporation - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.jobs; import org.eclipse.core.runtime.*; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java index 7a8938cfc..42f57616b 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseContainerInstantiator.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.provider; @@ -39,7 +41,7 @@ public class BaseContainerInstantiator implements IContainerInstantiator { if (arg instanceof Integer) return (Integer) arg; else if (arg instanceof String) { - return new Integer((String) arg); + return Integer.valueOf((String) arg); } else throw new IllegalArgumentException("arg=" + arg + " is not of integer type"); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java index 360225432..65b5b012f 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/BaseRemoteServiceContainerInstantiator.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.provider; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerInstantiatorUtils.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerInstantiatorUtils.java index 72e469d03..77853c695 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerInstantiatorUtils.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerInstantiatorUtils.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.provider; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerIntentException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerIntentException.java index bc1ce5e8b..f6661ed81 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerIntentException.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/ContainerIntentException.java @@ -1,12 +1,15 @@ -/******************************************************************************* -* Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -******************************************************************************/ +/**************************************************************************** + * Copyright (c) 2018 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.provider; import org.eclipse.core.runtime.IStatus; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java index a541110d2..0e1b85f96 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IContainerInstantiator.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.provider; import org.eclipse.ecf.core.*; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java index 00cfc8928..e76905053 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/provider/IRemoteServiceContainerInstantiator.java @@ -1,12 +1,15 @@ -/******************************************************************************* -* Copyright (c) 2009 Composent, Inc. and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* Composent, Inc. - initial API and implementation -******************************************************************************/ +/**************************************************************************** + * Copyright (c) 2009 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.provider; import java.util.Dictionary; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java index f7176aa90..dc4e5f3b2 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/BooleanCallback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/Callback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/Callback.java index dc8ffb803..3a1fa5c84 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/Callback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/Callback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; public interface Callback { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/CallbackHandler.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/CallbackHandler.java index dad313239..b04a7c4c6 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/CallbackHandler.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/CallbackHandler.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; public interface CallbackHandler { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ConnectContextFactory.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ConnectContextFactory.java index 18a469ed6..053e0c234 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ConnectContextFactory.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ConnectContextFactory.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; import java.io.IOException; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectContext.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectContext.java index a5bd2b428..3b785d69a 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectContext.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectContext.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectHandlerPolicy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectHandlerPolicy.java index bac48a6d1..48427e07c 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectHandlerPolicy.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectHandlerPolicy.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; import java.security.PermissionCollection; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectInitiatorPolicy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectInitiatorPolicy.java index 43c3d0fdd..f2a61b501 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectInitiatorPolicy.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IConnectInitiatorPolicy.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; import org.eclipse.ecf.core.IContainer; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IContainerPolicy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IContainerPolicy.java index 6b4019742..3e70a2143 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IContainerPolicy.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/IContainerPolicy.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; public interface IContainerPolicy { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java index 0e0115c95..419aa02ca 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/NameCallback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ObjectCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ObjectCallback.java index 72c346d07..ef2360272 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ObjectCallback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/ObjectCallback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PassphraseCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PassphraseCallback.java index 67d2c7a60..f3c824257 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PassphraseCallback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PassphraseCallback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PasswordCallback.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PasswordCallback.java index 92a1c81c4..f0f6e78ea 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PasswordCallback.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/PasswordCallback.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/UnsupportedCallbackException.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/UnsupportedCallbackException.java index 761275b4c..5a2055e3c 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/UnsupportedCallbackException.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/security/UnsupportedCallbackException.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.security; public class UnsupportedCallbackException extends Exception { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java index fa07b84ec..a0ce785dd 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/ECFStartJob.java @@ -1,13 +1,15 @@ -/******************************************************************************* +/**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.start; import org.eclipse.core.runtime.IProgressMonitor; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java index 6e36cd7c0..8fdbc0553 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/start/IECFStart.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.start; import org.eclipse.core.runtime.IProgressMonitor; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableMultiStatus.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableMultiStatus.java index 8c30df7cc..f095dd8ad 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableMultiStatus.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableMultiStatus.java @@ -1,12 +1,15 @@ -/******************************************************************************* - * Copyright (c) 2008 EclipseSource and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html +/**************************************************************************** + * Copyright (c) 2008 EclipseSource and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * EclipseSource - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.status; import org.eclipse.core.runtime.*; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableStatus.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableStatus.java index 16ea24a39..b60075d04 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableStatus.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/status/SerializableStatus.java @@ -1,12 +1,15 @@ -/******************************************************************************* - * Copyright (c) 2008 EclipseSource and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html +/**************************************************************************** + * Copyright (c) 2008 EclipseSource and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * EclipseSource - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.status; import java.io.*; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/IUser.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/IUser.java index 56d548e8f..e8aed6dd8 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/IUser.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/IUser.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.user; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/User.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/User.java index 0b142b0bc..7330432c7 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/User.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/user/User.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.user; @@ -88,14 +90,14 @@ public class User implements IUser { this.nickname = nickname; } - public Object getAdapter(Class adapter) { + public <T> T getAdapter(Class<T> adapter) { if (adapter.isInstance(this)) { - return this; + return adapter.cast(this); } IAdapterManager adapterManager = ECFPlugin.getDefault().getAdapterManager(); if (adapterManager == null) return null; - return adapterManager.loadAdapter(this, adapter.getName()); + return (T) adapterManager.loadAdapter(this, adapter.getName()); } public String toString() { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/AdapterContainerFilter.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/AdapterContainerFilter.java index 2c8b89892..843b32b6b 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/AdapterContainerFilter.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/AdapterContainerFilter.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2008 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.util; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/BundleClassResolver.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/BundleClassResolver.java index 017e42a4e..7f0467bb8 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/BundleClassResolver.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/BundleClassResolver.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2015 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2015 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import java.io.ObjectStreamClass; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ClassResolverObjectInputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ClassResolverObjectInputStream.java index 00d35d6be..553d7b6d7 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ClassResolverObjectInputStream.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ClassResolverObjectInputStream.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2015 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2015 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import java.io.*; @@ -80,16 +83,6 @@ public class ClassResolverObjectInputStream extends ObjectInputStream { return this.bundleContext; } - private IClassResolver getClassResolver() { - IClassResolver result = null; - if (this.classResolverST != null) { - this.classResolverST.open(); - result = this.classResolverST.getService(); - this.classResolverST.close(); - } - return result; - } - @SuppressWarnings("unused") @Override protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ConnectedContainerFilter.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ConnectedContainerFilter.java index 1f4e97891..ef28b50c0 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ConnectedContainerFilter.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ConnectedContainerFilter.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2008 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.util; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerFactoryTracker.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerFactoryTracker.java index 872b875ca..875198ac2 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerFactoryTracker.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerFactoryTracker.java @@ -1,12 +1,15 @@ -/******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* EclipseSource - initial API and implementation -******************************************************************************/ +/**************************************************************************** + * Copyright (c) 2009 EclipseSource and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * EclipseSource - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import org.eclipse.ecf.core.IContainerFactory; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerManagerTracker.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerManagerTracker.java index 5ffb3b081..e9b51d246 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerManagerTracker.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ContainerManagerTracker.java @@ -1,12 +1,15 @@ -/******************************************************************************* -* Copyright (c) 2009 EclipseSource and others. All rights reserved. This -* program and the accompanying materials are made available under the terms of -* the Eclipse Public License v1.0 which accompanies this distribution, and is -* available at http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* EclipseSource - initial API and implementation -******************************************************************************/ +/**************************************************************************** + * Copyright (c) 2009 EclipseSource and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * EclipseSource - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import org.eclipse.ecf.core.IContainerManager; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Event.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Event.java index d1143dbca..d56a2c2a8 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Event.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Event.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IClassResolver.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IClassResolver.java index 88972cf9f..a74fab53c 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IClassResolver.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IClassResolver.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2015 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2015 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import java.io.ObjectStreamClass; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IContainerFilter.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IContainerFilter.java index 10b8bddca..0d566db8c 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IContainerFilter.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IContainerFilter.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2008 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.util; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventProcessor.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventProcessor.java index b3d70a402..fd8ba2f0d 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventProcessor.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IEventProcessor.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IExceptionHandler.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IExceptionHandler.java index 5801397bc..6aa6ce102 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IExceptionHandler.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/IExceptionHandler.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import org.eclipse.core.runtime.IStatus; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java index 1d0c70293..c2057b6de 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectInputStream.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2018, 2020 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import java.io.*; @@ -20,14 +23,54 @@ import org.osgi.service.log.LogService; */ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObjectStreamConstants { - protected final ObjectInputStream in; + protected ObjectInputStream in; protected final Bundle b; protected LogService logger; + /** + * @since 3.10 + */ + ClassLoader classLoader; + + class ReplaceableObjectInputStream extends ObjectInputStream { + public ReplaceableObjectInputStream(InputStream ins) throws IOException { + super(ins); + enableResolveObject(true); + } + + @Override + protected Object resolveObject(Object obj) throws IOException { + if (obj instanceof SerVersion) { + return ((SerVersion) obj).toVersion(); + } + if (obj instanceof SerDTO) { + SerDTO serDTO = (SerDTO) obj; + String className = serDTO.getClassname(); + Class<?> clazz = null; + try { + clazz = loadClass(className); + } catch (Exception e) { + throw new IOException("Could not load class for instance of SerDTO with className=" + className); //$NON-NLS-1$ + } + return serDTO.readObject(clazz); + } + return super.resolveObject(obj); + } + + @Override + protected Class<?> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException { + try { + return loadClass(desc.getName()); + } catch (Exception e) { + return super.resolveClass(desc); + } + } + } + public OSGIObjectInputStream(Bundle b, InputStream in, LogService logger) throws IOException { super(); this.b = b; - this.in = new ObjectInputStream(in); + this.in = new ReplaceableObjectInputStream(in); this.logger = logger; } @@ -35,6 +78,13 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje this(b, in, null); } + /** + * @since 3.10 + */ + public void setClassLoader(ClassLoader cl) { + this.classLoader = cl; + } + public void setLogService(LogService log) { this.logger = log; } @@ -48,7 +98,15 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje } protected Class loadClass(String classname) throws ClassNotFoundException { + ClassLoader cl = this.classLoader; Bundle bundle = b; + if (cl != null) { + try { + return Class.forName(classname, false, cl); + } catch (Exception e) { + // Try bundle loading + } + } return (bundle == null) ? Class.forName(classname) : bundle.loadClass(classname); } @@ -77,17 +135,13 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje final byte type = in.readByte(); switch (type) { case C_NULL : // null - trace("null"); //$NON-NLS-1$ return null; case C_SER : // Serializable - trace("readSerializedObject"); //$NON-NLS-1$ return readSerializedObject(); case C_VER : // Version - trace("readVersion"); //$NON-NLS-1$ return Version.parseVersion(in.readUTF()); case C_ARRAY : // Object[] // read array length - trace("readArray"); //$NON-NLS-1$ int ol = in.readInt(); // read component type and create array for that component type Class<?> clazz = getClassForType(in.readUTF()); @@ -95,11 +149,7 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje for (int i = 0; i < ol; i++) Array.set(oresult, i, readObjectOverride()); return oresult; - case C_DTO : // DTO - trace("readDTO"); //$NON-NLS-1$ - return readDTO(); case C_DICT : // Dictionary - trace("readDictionary"); //$NON-NLS-1$ Class<?> dictClazz = loadClass(in.readUTF()); Dictionary dict = null; Constructor cons; @@ -120,7 +170,6 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje case C_MAP : // Map // read map length int ms = in.readInt(); - trace("readMap=" + ms); //$NON-NLS-1$ Map mr = new HashMap(); for (int i = 0; i < ms; i++) { Object key = readObjectOverride(); @@ -130,28 +179,24 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje return mr; case C_LIST : // List int lsize = in.readInt(); - trace("readList=" + lsize); //$NON-NLS-1$ List l = new ArrayList(lsize); for (int i = 0; i < lsize; i++) l.add(readObjectOverride()); return l; case C_SET : // Set int ssize = in.readInt(); - trace("readSet=" + ssize); //$NON-NLS-1$ Set s = new HashSet(ssize); for (int i = 0; i < ssize; i++) s.add(readObjectOverride()); return s; case C_COLL : // Collection int csize = in.readInt(); - trace("readCol=" + csize); //$NON-NLS-1$ Collection c = new ArrayList(csize); for (int i = 0; i < csize; i++) c.add(readObjectOverride()); return c; case C_ITER : // Iterable int isize = in.readInt(); - trace("readIter=" + isize); //$NON-NLS-1$ List itr = new ArrayList(isize); for (int i = 0; i < isize; i++) itr.add(readObjectOverride()); @@ -159,42 +204,32 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje case C_EXTER : // Externalizable return in.readObject(); case C_STRING : // String - trace("readString"); //$NON-NLS-1$ return in.readUTF(); case C_LONG : case C_OLONG : - trace("readLong"); //$NON-NLS-1$ return in.readLong(); case C_INT : case C_OINT : - trace("readInt"); //$NON-NLS-1$ return in.readInt(); case C_SHORT : case C_OSHORT : - trace("readShort"); //$NON-NLS-1$ return in.readShort(); case C_BOOL : case C_OBOOL : - trace("readBool"); //$NON-NLS-1$ return in.readBoolean(); case C_BYTE : case C_OBYTE : - trace("readByte"); //$NON-NLS-1$ return in.readByte(); case C_CHAR : case C_OCHAR : - trace("readChar"); //$NON-NLS-1$ return in.readChar(); case C_DOUBLE : case C_ODOUBLE : - trace("readDouble"); //$NON-NLS-1$ return in.readDouble(); case C_FLOAT : case C_OFLOAT : - trace("readFloat"); //$NON-NLS-1$ return in.readFloat(); case C_ENUM : - trace("readEnum"); //$NON-NLS-1$ return Enum.valueOf(loadClass(in.readUTF()), in.readUTF()); case C_OBJECT : return readNonSerializedObject(); @@ -203,25 +238,6 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje } } - private Object readDTO() throws IOException, ClassNotFoundException { - Class<?> clazz = loadClass(in.readUTF()); - Object result = null; - try { - result = clazz.newInstance(); - for (Field f : clazz.getFields()) { - final int mod = f.getModifiers(); - // If it's static or transient then ignore - if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) - continue; - // Else read and set value of field - f.set(result, readObjectOverride()); - } - } catch (Exception e) { - throw new IOException("Cannot deserialize DTO because of exception: " + e.getMessage()); //$NON-NLS-1$ - } - return result; - } - protected Object readExternalizable() throws ClassNotFoundException, IOException { return in.readObject(); } @@ -254,7 +270,7 @@ public class OSGIObjectInputStream extends ObjectInputStream implements OSGIObje protected Object createInstance(Class<?> clazz) throws IOException { try { - return clazz.newInstance(); + return clazz.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new IOException("Could create new instance of class=" + clazz.getName() + ". Class must have public no-arg constructor"); //$NON-NLS-1$ //$NON-NLS-2$ } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java index 25324866a..c6ab29cd7 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectOutputStream.java @@ -1,17 +1,19 @@ -/******************************************************************************* - * Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2018 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; import java.io.*; import java.lang.reflect.*; import java.util.*; -import org.osgi.dto.DTO; import org.osgi.framework.Version; import org.osgi.service.log.LogService; @@ -24,9 +26,27 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb protected LogService logger; protected boolean allowNonSerializable = false; + class ReplaceableObjectOutputStream extends ObjectOutputStream { + + public ReplaceableObjectOutputStream(OutputStream out) throws IOException { + super(out); + enableReplaceObject(true); + } + + @Override + protected Object replaceObject(Object obj) throws IOException { + if (obj instanceof Version) { + return new SerVersion(((Version) obj)); + } else if (!(obj instanceof Serializable)) { + return new SerDTO(obj); + } + return super.replaceObject(obj); + } + } + public OSGIObjectOutputStream(OutputStream out, boolean allowNonSerializable, LogService log) throws IOException { super(); - this.out = new ObjectOutputStream(out); + this.out = new ReplaceableObjectOutputStream(out); this.allowNonSerializable = allowNonSerializable; this.logger = log; } @@ -48,7 +68,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb } protected void writeExternalizable(Externalizable obj, Class<?> clazz) throws IOException { - trace("writeExternalizable " + clazz.getName()); //$NON-NLS-1$ out.writeObject(obj); } @@ -99,8 +118,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb } protected void writeNonSerializable(Object obj, Class<?> clazz) throws IOException { - // lookup object stream class - trace("writeNonSerializable " + clazz.getName()); //$NON-NLS-1$ // write class name out.writeObject(clazz.getName()); writeFields(obj, clazz); @@ -118,7 +135,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb } Class<?> clazz = obj.getClass(); if (clazz.isArray()) { - trace("writing array"); //$NON-NLS-1$ out.writeByte(C_ARRAY); int len = Array.getLength(obj); // write length @@ -130,88 +146,70 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb writeObjectOverride(Array.get(obj, i)); return; } else if (obj instanceof Long) { - trace("writing Long"); //$NON-NLS-1$ if (clazz.isPrimitive()) { - trace("writing long"); //$NON-NLS-1$ out.writeByte(C_LONG); } else { - trace("writing Long"); //$NON-NLS-1$ out.writeByte(C_OLONG); } out.writeLong((Long) obj); return; } else if (obj instanceof Integer) { if (clazz.isPrimitive()) { - trace("writing int"); //$NON-NLS-1$ out.writeByte(C_INT); } else { - trace("writing Integer"); //$NON-NLS-1$ out.writeByte(C_OINT); } out.writeInt((Integer) obj); return; } else if (obj instanceof Short) { if (clazz.isPrimitive()) { - trace("writing short"); //$NON-NLS-1$ out.writeByte(C_SHORT); } else { - trace("writing Short"); //$NON-NLS-1$ out.writeByte(C_OSHORT); } out.writeShort((Short) obj); return; } else if (obj instanceof Boolean) { if (clazz.isPrimitive()) { - trace("writing bool"); //$NON-NLS-1$ out.writeByte(C_BOOL); } else { - trace("writing Boolean"); //$NON-NLS-1$ out.writeByte(C_OBOOL); } out.writeBoolean((Boolean) obj); return; } else if (obj instanceof Byte) { if (clazz.isPrimitive()) { - trace("writing byte"); //$NON-NLS-1$ out.writeByte(C_BYTE); } else { - trace("writing Byte"); //$NON-NLS-1$ out.writeByte(C_OBYTE); } out.writeByte((Byte) obj); return; } else if (obj instanceof Character) { if (clazz.isPrimitive()) { - trace("writing char"); //$NON-NLS-1$ out.writeByte(C_CHAR); } else { - trace("writing Character"); //$NON-NLS-1$ out.writeByte(C_OCHAR); } out.writeChar((Character) obj); return; } else if (obj instanceof Float) { if (clazz.isPrimitive()) { - trace("writing float"); //$NON-NLS-1$ out.writeByte(C_FLOAT); } else { - trace("writing Float"); //$NON-NLS-1$ out.writeByte(C_OFLOAT); } out.writeFloat((Float) obj); return; } else if (obj instanceof Double) { if (clazz.isPrimitive()) { - trace("writing double"); //$NON-NLS-1$ out.writeByte(C_DOUBLE); } else { - trace("writing Double"); //$NON-NLS-1$ out.writeByte(C_ODOUBLE); } out.writeDouble((Double) obj); return; } else if (obj instanceof String) { - trace("writing String"); //$NON-NLS-1$ out.writeByte(C_STRING); out.writeUTF((String) obj); return; @@ -222,7 +220,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb Dictionary dict = (Dictionary) obj; // write size int ds = dict.size(); - trace("writing Dictionary=" + ds); //$NON-NLS-1$ out.writeInt(ds); // for each element in Map for (Enumeration e = dict.keys(); e.hasMoreElements();) { @@ -236,7 +233,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb Map map = (Map) obj; // write size int size = map.size(); - trace("writing Map=" + size); //$NON-NLS-1$ out.writeInt(size); // for each element in Map for (Object key : map.keySet()) { @@ -251,7 +247,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb List list = (List) obj; // write size int size = list.size(); - trace("writing List=" + size); //$NON-NLS-1$ out.writeInt(size); // write each element for (Object item : list) @@ -262,7 +257,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb Set set = (Set) obj; // write size int size = set.size(); - trace("writing Set=" + size); //$NON-NLS-1$ out.writeInt(size); // then elements for (Object item : set) @@ -273,7 +267,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb Collection col = (Collection) obj; // write size int size = col.size(); - trace("writing col=" + size); //$NON-NLS-1$ out.writeInt(size); // then elements for (Object item : col) @@ -288,7 +281,6 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb Object v : itr) size++; // write size - trace("writing Iterable=" + size); //$NON-NLS-1$ out.writeInt(size); // write elements for (Object item : itr) @@ -308,38 +300,10 @@ public class OSGIObjectOutputStream extends ObjectOutputStream implements OSGIOb writeSerializable(obj, clazz); return; } else if (obj instanceof Version) { - trace("writing Version"); //$NON-NLS-1$ - out.writeByte(C_VER); - out.writeUTF(((Version) obj).toString()); - return; - } else if (obj instanceof DTO) { - out.writeByte(C_DTO); - writeDTO(obj, clazz); - return; + writeObjectOverride(new SerVersion((Version) obj)); } else { - if (allowNonSerializable) { - out.writeByte(C_OBJECT); - writeNonSerializable(obj, clazz); - return; - } - throw new NotSerializableException("Cannot serialize instance of class=" + clazz.getName()); //$NON-NLS-1$ - } - } - - private void writeDTO(Object obj, Class<?> clazz) throws IOException { - trace("writing DTO"); //$NON-NLS-1$ - // Write out class name - out.writeUTF(clazz.getName()); - for (Field f : clazz.getFields()) { - final int mod = f.getModifiers(); - if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) - continue; - try { - writeObjectOverride(f.get(obj)); - } catch (Exception e) { - // Should not happen for DTO - throw new NotSerializableException(clazz.getName()); - } + writeObjectOverride(new SerDTO(obj)); + return; } } diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectStreamConstants.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectStreamConstants.java index b1cfaaa77..7163854ba 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectStreamConstants.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/OSGIObjectStreamConstants.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2018 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2018 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util; /** diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Proxy.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Proxy.java index 786549ac4..8b99e8520 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Proxy.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/Proxy.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.util; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ProxyAddress.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ProxyAddress.java index 152b9d02e..d393ac181 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ProxyAddress.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/ProxyAddress.java @@ -1,12 +1,14 @@ /**************************************************************************** * Copyright (c) 2004 Composent, Inc. and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Composent, Inc. - initial API and implementation + * + * SPDX-License-Identifier: EPL-2.0 *****************************************************************************/ package org.eclipse.ecf.core.util; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerDTO.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerDTO.java new file mode 100644 index 000000000..876888455 --- /dev/null +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerDTO.java @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2021 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * Composent, Inc. - initial API and implementation + * + *****************************************************************************/ +package org.eclipse.ecf.core.util; + +import java.io.IOException; +import java.io.Serializable; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.HashMap; +import java.util.Map; + +/** + * @since 3.10 + */ +public class SerDTO implements Serializable { + + private static final long serialVersionUID = -1739849704193630352L; + private String className; + private Map<String, Object> fields; + + public SerDTO(Object obj) { + Class<?> clazz = obj.getClass(); + this.className = clazz.getName(); + this.fields = new HashMap<String, Object>(); + for (Field f : clazz.getFields()) { + final int mod = f.getModifiers(); + if (Modifier.isStatic(mod) || Modifier.isTransient(mod)) + continue; + Object value = null; + try { + value = f.get(obj); + } catch (Exception e) { + // + } + if (value != null) { + fields.put(f.getName(), value); + } + } + } + + public String getClassname() { + return this.className; + } + + public Map<String, Object> getFields() { + return fields; + } + + public Object readObject(Class<?> clazz) throws IOException { + Object result = null; + try { + result = clazz.getConstructor(new Class[] {}).newInstance(); + for (Field f : clazz.getFields()) { + Object v = fields.get(f.getName()); + if (v != null) { + f.setAccessible(true); + try { + f.set(result, v); + } catch (Exception e) { + // ignore + } + } + } + } catch (Throwable e) { + throw new IOException("Unexpected exception reading DTO in SerDTO.readObject: " + e.getLocalizedMessage()); //$NON-NLS-1$ + } + return result; + + } +} diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerVersion.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerVersion.java new file mode 100644 index 000000000..dd20c732c --- /dev/null +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/SerVersion.java @@ -0,0 +1,31 @@ +/**************************************************************************** + * Copyright (c) 2021 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * Contributors: + * Composent, Inc. - initial API and implementation + * + *****************************************************************************/ +package org.eclipse.ecf.core.util; + +import java.io.Serializable; +import org.osgi.framework.Version; + +/** + * @since 3.10 + */ +public final class SerVersion implements Serializable { + private static final long serialVersionUID = 4785952431053485808L; + private String versionStr; + + public SerVersion(Version v) { + this.versionStr = v.toString(); + } + + public Version toVersion() { + return Version.parseVersion(this.versionStr); + } +}
\ No newline at end of file diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/reflection/ClassUtil.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/reflection/ClassUtil.java index 128ade165..92456b1a8 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/reflection/ClassUtil.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/core/util/reflection/ClassUtil.java @@ -1,13 +1,15 @@ -/******************************************************************************* +/**************************************************************************** * Copyright (c) 2010 Markus Alexander Kuppe. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ * * Contributors: * Markus Alexander Kuppe (ecf-dev_eclipse.org <at> lemmster <dot> de) - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.core.util.reflection; import java.lang.reflect.Method; diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFDebugOptions.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFDebugOptions.java index 595f32ad3..6ae8fc32b 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFDebugOptions.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFDebugOptions.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.internal.core; public interface ECFDebugOptions { diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java index 6610f8aaf..0ba112fff 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/ECFPlugin.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004, 2020 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.internal.core; import java.util.*; @@ -138,7 +141,7 @@ public class ECFPlugin implements BundleActivator { // initialize the default ssl socket factory try { Class ecfSocketFactoryClass = Class.forName("org.eclipse.ecf.internal.ssl.ECFTrustManager"); //$NON-NLS-1$ - ecfTrustManager = (BundleActivator) ecfSocketFactoryClass.newInstance(); + ecfTrustManager = (BundleActivator) ecfSocketFactoryClass.getDeclaredConstructor().newInstance(); ecfTrustManager.start(ctxt); } catch (ClassNotFoundException e) { // will occur if fragment is not installed or not on proper execution environment diff --git a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/IDisposable.java b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/IDisposable.java index e8b0318f8..54a4c2062 100644 --- a/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/IDisposable.java +++ b/framework/bundles/org.eclipse.ecf/src/org/eclipse/ecf/internal/core/IDisposable.java @@ -1,11 +1,14 @@ -/******************************************************************************* - * Copyright (c) 2004 Composent, Inc. and others. All rights reserved. This - * program and the accompanying materials are made available under the terms of - * the Eclipse Public License v1.0 which accompanies this distribution, and is - * available at http://www.eclipse.org/legal/epl-v10.html - * +/**************************************************************************** + * Copyright (c) 2004 Composent, Inc. and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * * Contributors: Composent, Inc. - initial API and implementation - ******************************************************************************/ + * + * SPDX-License-Identifier: EPL-2.0 + *****************************************************************************/ package org.eclipse.ecf.internal.core; public interface IDisposable { |