Fixed several compiler warnings

This commit is contained in:
Steffen Schaefer committed 2016-06-22 10:24:45 +02:00
1 parent 97782122ef
commit be867b1ed1
3 files changed
+14 -2

No files matched your search

@@ -53,7 +53,7 @@ public class MongoSensorFixStoreImpl implements MongoSensorFixStore {
DomainObjectFactory domainObjectFactory, TypeBasedServiceFinderFactory serviceFinderFactory) {
mongoOF = (MongoObjectFactoryImpl) mongoObjectFactory;
if (serviceFinderFactory != null) {
fixServiceFinder = (TypeBasedServiceFinder) serviceFinderFactory.createServiceFinder(FixMongoHandler.class);
fixServiceFinder = createFixServiceFinder(serviceFinderFactory);
deviceServiceFinder = serviceFinderFactory.createServiceFinder(DeviceIdentifierMongoHandler.class);
} else {
fixServiceFinder = null;
@@ -63,6 +63,11 @@ public class MongoSensorFixStoreImpl implements MongoSensorFixStore {
metadataCollection = mongoOF.getGPSFixMetadataCollection();
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private TypeBasedServiceFinder<FixMongoHandler<?>> createFixServiceFinder(TypeBasedServiceFinderFactory serviceFinderFactory) {
return (TypeBasedServiceFinder) serviceFinderFactory.createServiceFinder(FixMongoHandler.class);
}
public <T extends Timed> T loadGPSFix(DBObject object) throws TransformationException, NoCorrespondingServiceRegisteredException {
String type = (String) object.get(FieldNames.GPSFIX_TYPE.name());
DBObject fixObject = (DBObject) object.get(FieldNames.GPSFIX.name());
@@ -88,7 +88,7 @@ public class Activator implements BundleActivator {
new MasterDataImportClassLoaderServiceImpl(), null));
registrations.add(context.registerService(SensorFixMapper.class, new BravoDataFixMapper(), null));
sensorFixMapperTracker = (ServiceTracker) ServiceTrackerFactory.createAndOpen(context, SensorFixMapper.class);
sensorFixMapperTracker = createSensorFixMapperServiceTracker(context);
racingEventServiceTracker = ServiceTrackerFactory.createAndOpen(context, RacingEventService.class);
RegattaLogFixTrackerRegattaListener regattaLogSensorDataTrackerTrackedRegattaListener = new RegattaLogFixTrackerRegattaListener(
@@ -101,6 +101,11 @@ public class Activator implements BundleActivator {
logger.log(Level.INFO, "Started "+context.getBundle().getSymbolicName());
}
@SuppressWarnings({ "unchecked", "rawtypes" })
private ServiceTracker<SensorFixMapper<?, ?, ?>, SensorFixMapper<?, ?, ?>> createSensorFixMapperServiceTracker(BundleContext context) {
return (ServiceTracker) ServiceTrackerFactory.createAndOpen(context, SensorFixMapper.class);
}
@Override
public void stop(BundleContext context) throws Exception {
Activator.context = null;
@@ -260,6 +260,7 @@ public class RaceLogFixTracker implements TrackingDataLoader {
}
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void visit(RegattaLogDeviceCompetitorMappingEvent event) {
DynamicGPSFixTrack<Competitor, GPSFixMoving> track = trackedRace.getTrack(event.getMappedTo());
@@ -272,6 +273,7 @@ public class RaceLogFixTracker implements TrackingDataLoader {
}
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public void visit(RegattaLogDeviceMarkMappingEvent event) {
DynamicGPSFixTrack<Mark, GPSFix> track = trackedRace.getOrCreateTrack(event.getMappedTo());