Commit bb5cc216 authored by Daniel Honsel's avatar Daniel Honsel
Browse files

removed warnings

parent ce0339ea
Loading
Loading
Loading
Loading
+23 −22
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import de.ugoe.cs.swe.validation.TTCN3StatisticsProvider;
public class Analyzer implements Callable<TTCN3Output> {
	private final Resource resource;
	private final LoggingInterface logger;
	private final boolean printUnresolvedObjects = false;

	public Analyzer(Resource resource, LoggingInterface logger) {
		this.resource = resource;
@@ -42,23 +43,23 @@ public class Analyzer implements Callable<TTCN3Output> {
		}

		// TODO: make this configurable for debug purposes
//		for (Diagnostic d : this.resource.getErrors()) {
//			TTCN3StatisticsProvider.getInstance().incrementCountUniversal();
//			logger.logInformation(this.resource.getURI(), d.getLine(), d.getLine(),
//					MessageClass.UNIVERSAL, d.getMessage());
//		}
//		for (Diagnostic d : this.resource.getWarnings()) {
//			TTCN3StatisticsProvider.getInstance().incrementCountUniversal();
//			logger.logInformation(this.resource.getURI(), d.getLine(), d.getLine(),
//					MessageClass.UNIVERSAL, d.getMessage());
//		}
		if (printUnresolvedObjects) {
			for (Diagnostic d : this.resource.getErrors()) {
				TTCN3StatisticsProvider.getInstance().incrementCountUniversal();
				logger.logInformation(this.resource.getURI(), d.getLine(), d.getLine(), MessageClass.UNIVERSAL,
						d.getMessage());
			}
			for (Diagnostic d : this.resource.getWarnings()) {
				TTCN3StatisticsProvider.getInstance().incrementCountUniversal();
				logger.logInformation(this.resource.getURI(), d.getLine(), d.getLine(), MessageClass.UNIVERSAL,
						d.getMessage());
			}
		}

		stopwatch.stop();

		System.out.println("Analyzing  file: " + this.resource.getURI().devicePath().replaceFirst("///", "") 
				+ '\n' + "       ...done in "
				+ stopwatch.elapsed(TimeUnit.MILLISECONDS)
				+ " ms ("
		System.out.println("Analyzing  file: " + this.resource.getURI().devicePath().replaceFirst("///", "") + '\n'
				+ "       ...done in " + stopwatch.elapsed(TimeUnit.MILLISECONDS) + " ms ("
				+ MiscTools.secondsToString(stopwatch.elapsed(TimeUnit.SECONDS)) + " minutes).");

		return output;
+0 −29
Original line number Diff line number Diff line
@@ -7,7 +7,6 @@ import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@@ -24,19 +23,12 @@ import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.Resource.Diagnostic;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.Diagnostician;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
import org.eclipse.xtext.resource.SynchronizedXtextResourceSet;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.validation.FeatureBasedDiagnostic;

import com.google.common.base.Stopwatch;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
import com.google.inject.Injector;

import de.ugoe.cs.swe.TTCN3StandaloneSetup;
@@ -308,27 +300,6 @@ public class TTCN3ResourceProvider {
		}
	}

	// @SuppressWarnings({ "rawtypes", "unchecked" })
	// private Resource loadResourceFromXMI(String inputPath, String extension)
	// {
	// Resource.Factory.Registry reg = Resource.Factory.Registry.INSTANCE;
	// Map<String, Object> m = reg.getExtensionToFactoryMap();
	// m.put(extension, new XMIResourceFactoryImpl());
	// ResourceSet resSetIn = new ResourceSetImpl();
	// Resource inputResource =
	// resSetIn.createResource(URI.createURI(inputPath));
	// try {
	// Map options = new HashMap<>();
	// options.put(XMIResourceImpl.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE);
	// // options.put(XMIResourceImpl.OPTION_PROCESS_DANGLING_HREF,
	// XMIResourceImpl.OPTION_PROCESS_DANGLING_HREF_DISCARD);
	// inputResource.load(options);
	// } catch (IOException e) {
	// e.printStackTrace();
	// }
	// return inputResource;
	// }

	private static String fileExtensionOrPath(String filename, boolean extension) {
		String[] res = filename.split("\\.");
		int size = res.length;