diff options
Diffstat (limited to 'bundles/org.eclipse.equinox.metatype/src')
9 files changed, 39 insertions, 40 deletions
diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java index 3daf3f4f3..2a4786390 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/Activator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -10,11 +10,10 @@ *******************************************************************************/ package org.eclipse.equinox.metatype.impl; -import org.eclipse.equinox.metatype.EquinoxMetaTypeService; - import java.util.Dictionary; import java.util.Hashtable; import javax.xml.parsers.SAXParserFactory; +import org.eclipse.equinox.metatype.EquinoxMetaTypeService; import org.osgi.framework.*; import org.osgi.service.cm.ManagedService; import org.osgi.service.log.LogService; @@ -95,14 +94,14 @@ public class Activator implements BundleActivator { private class SAXParserFactoryTrackerCustomizer implements ServiceTrackerCustomizer<SAXParserFactory, SAXParserFactory> { private final BundleContext bundleCtx; - private final LogService logService; + private final LogTracker logService; private final ServiceTracker<Object, Object> mtpTracker; private MetaTypeServiceImpl metaTypeService; private ServiceRegistration<?> metaTypeServiceRegistration; private SAXParserFactory saxParserFactory; - public SAXParserFactoryTrackerCustomizer(BundleContext bundleContext, LogService logService, ServiceTracker<Object, Object> metaTypeProviderTracker) { + public SAXParserFactoryTrackerCustomizer(BundleContext bundleContext, LogTracker logService, ServiceTracker<Object, Object> metaTypeProviderTracker) { this.bundleCtx = bundleContext; this.logService = logService; this.mtpTracker = metaTypeProviderTracker; @@ -125,8 +124,8 @@ public class Activator implements BundleActivator { else if (saxParserFactory.isNamespaceAware()) { return parserFactory; } else if (parserFactory.isNamespaceAware() || // Previous factory not set for namespace awareness but the new one is case. - // Now the fun case. Neither factory is set for namespace awareness. Need to see if we're currently using - // a factory incapable of creating namespace aware parsers and, if so, if it can be replaced with the new one. + // Now the fun case. Neither factory is set for namespace awareness. Need to see if we're currently using + // a factory incapable of creating namespace aware parsers and, if so, if it can be replaced with the new one. (!supportsNamespaceAwareness(saxParserFactory) && supportsNamespaceAwareness(parserFactory))) { oldFactory = saxParserFactory; saxParserFactory = parserFactory; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java index 2e671d6c4..176518122 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/AttributeDefinitionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -33,17 +33,17 @@ public class AttributeDefinitionImpl extends LocalizationElement implements Equi Vector<String> _values = new Vector<String>(7); Vector<String> _labels = new Vector<String>(7); - private final LogService logger; + private final LogTracker logger; private final ExtendableHelper helper; /** * Constructor of class AttributeDefinitionImpl. */ - public AttributeDefinitionImpl(String id, String name, String description, int type, int cardinality, Object min, Object max, boolean isRequired, String localization, LogService logger, Map<String, Map<String, String>> extensionAttributes) { + public AttributeDefinitionImpl(String id, String name, String description, int type, int cardinality, Object min, Object max, boolean isRequired, String localization, LogTracker logger, Map<String, Map<String, String>> extensionAttributes) { this(id, name, description, type, cardinality, min, max, isRequired, localization, logger, new ExtendableHelper(extensionAttributes)); } - private AttributeDefinitionImpl(String id, String name, String description, int type, int cardinality, Object min, Object max, boolean isRequired, String localization, LogService logger, ExtendableHelper helper) { + private AttributeDefinitionImpl(String id, String name, String description, int type, int cardinality, Object min, Object max, boolean isRequired, String localization, LogTracker logger, ExtendableHelper helper) { super(localization); this._id = id; this._name = name; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java index 5128d9ab8..a4fb715b2 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/DataParser.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2014 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -83,13 +83,13 @@ public class DataParser { String _dp_localization; // Default visibility to avoid a plethora of synthetic accessor method warnings. - final LogService logger; + final LogTracker logger; final Collection<Designate> designates = new ArrayList<Designate>(7); /* * Constructor of class DataParser. */ - public DataParser(Bundle bundle, URL url, SAXParser parser, LogService logger) { + public DataParser(Bundle bundle, URL url, SAXParser parser, LogTracker logger) { this._dp_bundle = bundle; this._dp_url = url; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java index d23b46707..f7e794c00 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/LogTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 1998, 2013 IBM Corporation and others. + * Copyright (c) 1998, 2017 IBM Corporation 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 @@ -23,7 +23,7 @@ import org.osgi.util.tracker.ServiceTracker; * and handles all issues such as the service coming and going. */ -public class LogTracker extends ServiceTracker<LogService, LogService> implements LogService { +public class LogTracker extends ServiceTracker<LogService, LogService> { /** LogService interface class name */ protected final static String clazz = "org.osgi.service.log.LogService"; //$NON-NLS-1$ @@ -55,11 +55,12 @@ public class LogTracker extends ServiceTracker<LogService, LogService> implement log(null, level, message, exception); } - public void log(ServiceReference reference, int level, String message) { + public void log(ServiceReference<?> reference, int level, String message) { log(reference, level, message, null); } - public synchronized void log(ServiceReference reference, int level, String message, Throwable exception) { + @SuppressWarnings("deprecation") + public synchronized void log(ServiceReference<?> reference, int level, String message, Throwable exception) { ServiceReference<LogService>[] references = getServiceReferences(); if (references != null) { @@ -90,6 +91,7 @@ public class LogTracker extends ServiceTracker<LogService, LogService> implement * @param throwable Log exception or null if none. * @param reference ServiceReference associated with message or null if none. */ + @SuppressWarnings("deprecation") protected void noLogService(int level, String message, Throwable throwable, ServiceReference<?> reference) { if (out != null) { synchronized (out) { @@ -99,22 +101,22 @@ public class LogTracker extends ServiceTracker<LogService, LogService> implement out.print(timestamp + " "); //$NON-NLS-1$ switch (level) { - case LOG_DEBUG : { + case LogService.LOG_DEBUG : { out.print(LogTrackerMsg.Debug); break; } - case LOG_INFO : { + case LogService.LOG_INFO : { out.print(LogTrackerMsg.Info); break; } - case LOG_WARNING : { + case LogService.LOG_WARNING : { out.print(LogTrackerMsg.Warning); break; } - case LOG_ERROR : { + case LogService.LOG_ERROR : { out.print(LogTrackerMsg.Error); break; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java index a9780ff68..a88ec193e 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeInformationImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2011 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -10,13 +10,11 @@ *******************************************************************************/ package org.eclipse.equinox.metatype.impl; -import org.eclipse.equinox.metatype.EquinoxMetaTypeInformation; - import java.util.Enumeration; import java.util.Vector; import javax.xml.parsers.SAXParser; +import org.eclipse.equinox.metatype.EquinoxMetaTypeInformation; import org.osgi.framework.Bundle; -import org.osgi.service.log.LogService; /** * Implementation of MetaTypeProvider @@ -33,7 +31,7 @@ public class MetaTypeInformationImpl extends MetaTypeProviderImpl implements Equ /** * Constructor of class MetaTypeInformationImpl. */ - MetaTypeInformationImpl(Bundle bundle, SAXParser parser, LogService logger) { + MetaTypeInformationImpl(Bundle bundle, SAXParser parser, LogTracker logger) { super(bundle, parser, logger); } diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java index 333b10a68..3ef511d0d 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -45,12 +45,12 @@ public class MetaTypeProviderImpl implements MetaTypeProvider { boolean _isThereMeta = false; // Give access to subclasses. - protected final LogService logger; + protected final LogTracker logger; /** * Constructor of class MetaTypeProviderImpl. */ - MetaTypeProviderImpl(Bundle bundle, SAXParser parser, LogService logger) { + MetaTypeProviderImpl(Bundle bundle, SAXParser parser, LogTracker logger) { this._bundle = bundle; this.logger = logger; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java index 71fcb4956..e599bd5e6 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeProviderTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -25,7 +25,7 @@ import org.osgi.util.tracker.ServiceTracker; public class MetaTypeProviderTracker implements EquinoxMetaTypeInformation { private final Bundle _bundle; - private final LogService log; + private final LogTracker log; private final ServiceTracker<Object, Object> _tracker; /** @@ -35,7 +35,7 @@ public class MetaTypeProviderTracker implements EquinoxMetaTypeInformation { * @param bundle The bundle to track all MetaTypeProviders for. * @param log The {@code LogService} to use for logging messages. */ - public MetaTypeProviderTracker(Bundle bundle, LogService log, ServiceTracker<Object, Object> tracker) { + public MetaTypeProviderTracker(Bundle bundle, LogTracker log, ServiceTracker<Object, Object> tracker) { this._bundle = bundle; this._tracker = tracker; this.log = log; diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java index 127de74e3..afae7cefe 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/MetaTypeServiceImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -30,13 +30,13 @@ public class MetaTypeServiceImpl implements EquinoxMetaTypeService, SynchronousB SAXParserFactory _parserFactory; private Hashtable<Long, EquinoxMetaTypeInformation> _mtps = new Hashtable<Long, EquinoxMetaTypeInformation>(7); - private final LogService logger; + private final LogTracker logger; private final ServiceTracker<Object, Object> metaTypeProviderTracker; /** * Constructor of class MetaTypeServiceImpl. */ - public MetaTypeServiceImpl(SAXParserFactory parserFactory, LogService logger, ServiceTracker<Object, Object> metaTypeProviderTracker) { + public MetaTypeServiceImpl(SAXParserFactory parserFactory, LogTracker logger, ServiceTracker<Object, Object> metaTypeProviderTracker) { this._parserFactory = parserFactory; this.logger = logger; this.metaTypeProviderTracker = metaTypeProviderTracker; @@ -56,7 +56,7 @@ public class MetaTypeServiceImpl implements EquinoxMetaTypeService, SynchronousB */ private EquinoxMetaTypeInformation getMetaTypeProvider(final Bundle b) { // Avoid synthetic accessor method warnings. - final LogService loggerTemp = this.logger; + final LogTracker loggerTemp = this.logger; final ServiceTracker<Object, Object> tracker = this.metaTypeProviderTracker; Long bID = Long.valueOf(b.getBundleId()); synchronized (_mtps) { diff --git a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ValueTokenizer.java b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ValueTokenizer.java index 4f374baaa..2dfdfb6a4 100644 --- a/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ValueTokenizer.java +++ b/bundles/org.eclipse.equinox.metatype/src/org/eclipse/equinox/metatype/impl/ValueTokenizer.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2013 IBM Corporation and others. + * Copyright (c) 2005, 2017 IBM Corporation 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 @@ -21,13 +21,13 @@ public class ValueTokenizer { private static final char DELIMITER = ','; private static final char ESCAPE = '\\'; - private final LogService logger; + private final LogTracker logger; private final List<String> values = new ArrayList<String>(); /* * Constructor of class ValueTokenizer */ - public ValueTokenizer(String values_str, LogService logger) { + public ValueTokenizer(String values_str, LogTracker logger) { this.logger = logger; if (values_str == null) return; |