/*
 * generated by Xtext
 */
package de.beyondjava.xtext.jsf.generator

import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.generator.IGenerator

/**
 * Generates code from your model files on save.
 *
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
 */
class ComponentLanguageGenerator implements IGenerator {

	override void doGenerate(Resource resource, IFileSystemAccess fsa) {
		new TaglibGenerator().doGenerate(resource, fsa);
		new ComponentGenerator().doGenerate(resource, fsa);
		new RendererGenerator().doGenerate(resource, fsa);
		new DocumentationGenerator().doGenerate(resource, fsa);
		new AttributesDocumentationGenerator().doGenerate(resource, fsa);
	}

}

Add new generation to master build

/*
 * generated by Xtext
 */
package de.beyondjava.xtext.jsf.generator

import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.generator.IGenerator

/**
 * Generates code from your model files on save.
 *
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#code-generation
 */
class ComponentLanguageGenerator implements IGenerator {

	override void doGenerate(Resource resource, IFileSystemAccess fsa) {
		new TaglibGenerator().doGenerate(resource, fsa);
		new ComponentGenerator().doGenerate(resource, fsa);
		new RendererGenerator().doGenerate(resource, fsa);
		new DocumentationGenerator().doGenerate(resource, fsa);
		new AttributesDocumentationGenerator().doGenerate(resource, fsa);
		new BeanInfoGenerator().doGenerate(resource, fsa);
	}

}


package org.xtext.xrobot.dsl.scoping

import org.eclipse.xtext.xbase.scoping.batch.ImplicitlyImportedFeatures
import org.xtext.xrobot.api.GeometryExtensions
import org.xtext.xrobot.api.Sample

class XRobotImplicitlyImportedFeatures extends ImplicitlyImportedFeatures {

	override protected getExtensionClasses() {
		val result = super.getExtensionClasses
		result += Math
		result += GeometryExtensions
		result
	}

	override protected getStaticImportClasses() {
		val result = super.getStaticImportClasses
		result += Math
		result += Sample
		result += GeometryExtensions
		result
	}
}

Improve type inference performance for binary operations by removing unnecessary overloads

package org.xtext.xrobot.dsl.scoping

import org.eclipse.xtext.xbase.scoping.batch.ImplicitlyImportedFeatures
import org.xtext.xrobot.api.GeometryExtensions
import org.xtext.xrobot.api.Sample

class XRobotImplicitlyImportedFeatures extends ImplicitlyImportedFeatures {

	/**
	 * Reduce inference time for binary operations by skipping some overloaded
	 * variants that will not be needed
	 */
	override protected getExtensionClasses() {
		newArrayList(
			ArrayExtensions,
//			BigDecimalExtensions,
//			BigIntegerExtensions,
			BooleanExtensions,
//			ByteExtensions,
//			CharacterExtensions,
			CollectionExtensions,
			ComparableExtensions,
			DoubleExtensions,
//			FloatExtensions,
			FunctionExtensions,
			IntegerExtensions,
			IterableExtensions,
			IteratorExtensions,
			ListExtensions,
			LongExtensions,
			MapExtensions,
			ObjectExtensions,
			ProcedureExtensions,
//			ShortExtensions,
			StringExtensions,
			Math,
			GeometryExtensions)
	}

	override protected getStaticImportClasses() {
		val result = super.getStaticImportClasses
		result += Math
		result += Sample
		result += GeometryExtensions
		result
	}

}


package eu.indenica.config.runtime.generator.common

import eu.indenica.config.runtime.runtime.IndenicaAdaptationRule
import eu.indenica.config.runtime.runtime.DroolsAdaptationRule
import org.eclipse.xtext.naming.IQualifiedNameProvider
import com.google.inject.Inject
import eu.indenica.config.runtime.runtime.AdaptationRule

class DroolsRuleConverter {
	@Inject extension IQualifiedNameProvider

	def dispatch convert(IndenicaAdaptationRule it) '''
		«ruleHead»

		// TODO: convert indenica adaptation rule
	'''

	def dispatch convert(DroolsAdaptationRule it) '''
		«ruleHead»

		rule "«name»"
«««			when, then are in <<statement>>
			«statement»
		end
	'''

	def ruleHead(AdaptationRule it) '''
		package «eContainer.fullyQualifiedName»

		«FOR inputFact : sources.map[s | s.fact]»
			«IF eContainer.fullyQualifiedName != inputFact.eContainer.fullyQualifiedName»
				import «inputFact.fullyQualifiedName»
			«ENDIF»
		«ENDFOR»
		import eu.indenica.events.ActionEvent

		global eu.indenica.adaptation.AdaptationEngine publisher
	'''
}

Rename global reference to engine in adaptation engine.

package eu.indenica.config.runtime.generator.common

import eu.indenica.config.runtime.runtime.IndenicaAdaptationRule
import eu.indenica.config.runtime.runtime.DroolsAdaptationRule
import org.eclipse.xtext.naming.IQualifiedNameProvider
import com.google.inject.Inject
import eu.indenica.config.runtime.runtime.AdaptationRule

class DroolsRuleConverter {
	@Inject extension IQualifiedNameProvider

	def dispatch convert(IndenicaAdaptationRule it) '''
		«ruleHead»

		// TODO: convert indenica adaptation rule
	'''

	def dispatch convert(DroolsAdaptationRule it) '''
		«ruleHead»

		rule "«name»"
«««			when, then are in <<statement>>
			«statement»
		end
	'''

	def ruleHead(AdaptationRule it) '''
		package «eContainer.fullyQualifiedName»

		«FOR inputFact : sources.map[s | s.fact]»
			«IF eContainer.fullyQualifiedName != inputFact.eContainer.fullyQualifiedName»
				import «inputFact.fullyQualifiedName»
			«ENDIF»
		«ENDFOR»
		import eu.indenica.events.ActionEvent

		global eu.indenica.adaptation.AdaptationEngine engine
	'''
}


package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
//
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}

Test commit - integration with Jenkins CI

package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}


package tools.vitruv.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.apache.log4j",
		"com.google.guava",
		"org.eclipse.emf.ecore",
		"org.eclipse.core.resources",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
		"tools.vitruv.framework.util",
		"tools.vitruv.framework.change",
		"tools.vitruv.framework.change.processing",
		"tools.vitruv.framework.correspondence",
		"tools.vitruv.framework.userinteraction",
 		"tools.vitruv.extensions.dslsruntime.reactions",
 		"tools.vitruv.extensions.dslsruntime.mapping"
	]
}

Correct DSLs plugin dependencies hotfix

package tools.vitruv.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.apache.log4j",
		"com.google.guava",
		"org.eclipse.emf.ecore",
		"org.eclipse.core.resources",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
		"tools.vitruv.framework.util",
		"tools.vitruv.framework.change",
		"tools.vitruv.framework.change.processing",
		"tools.vitruv.framework.correspondence",
		"tools.vitruv.framework.userinteraction",
 		"tools.vitruv.extensions.dslsruntime.reactions",
 		"tools.vitruv.extensions.dslsruntime.mappings"
	]
}


package io.joynr.generator.util
/*
 * !!!
 *
 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class TemplateBase {

	def warning()
	'''

		// #####################################################
		//#######################################################
		//###                                                 ###
		//##    WARNING: This file is generated. DO NOT EDIT   ##
		//##             All changes will be lost!             ##
		//###                                                 ###
		//#######################################################
		// #####################################################

	'''

}

Add license header to generated sources

package io.joynr.generator.util
/*
 * !!!
 *
 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class TemplateBase {

	def warning()
	'''
	/*
	 *
	 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
	 *
	 * Licensed under the Apache License, Version 2.0 (the "License");
	 * you may not use this file except in compliance with the License.
	 * You may obtain a copy of the License at
	 *
	 *      http://www.apache.org/licenses/LICENSE-2.0
	 *
	 * Unless required by applicable law or agreed to in writing, software
	 * distributed under the License is distributed on an "AS IS" BASIS,
	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 * See the License for the specific language governing permissions and
	 * limitations under the License.
	 */

	// #####################################################
	//#######################################################
	//###                                                 ###
	//##    WARNING: This file is generated. DO NOT EDIT   ##
	//##             All changes will be lost!             ##
	//###                                                 ###
	//#######################################################
	// #####################################################
	'''
}


package edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.responses.pcm2java

import mir.responses.AbstractChange2CommandTransforming5_1ToJava

class Change2CommandTransformingPcmToJava extends AbstractChange2CommandTransforming5_1ToJava {

}

Redefine setup method because the superclass is not exported, thus the method cannot be overwritten in subclasses otherwise.

package edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.responses.pcm2java

import mir.responses.AbstractChange2CommandTransforming5_1ToJava

class Change2CommandTransformingPcmToJava extends AbstractChange2CommandTransforming5_1ToJava {

	override protected setup() {
		super.setup()
	}

}


package edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.responses.java2pcm

import mir.responses.AbstractChange2CommandTransformingJavaTo5_1
import edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.seffstatements.Java2PcmPackageMappingMethodBodyChangePreprocessor
import edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.util.Java2PcmPackagePreprocessor

class Change2CommandTransformingJavaToPcm extends AbstractChange2CommandTransformingJavaTo5_1 {
	public override setup() {
		addChangeProcessor(new Java2PcmPackagePreprocessor(userInteracting));
		addChangeProcessor(new Java2PcmPackageMappingMethodBodyChangePreprocessor(userInteracting));
		addChangeProcessor(new Java2PcmTransformationsPreprocessor(userInteracting));
		super.setup();
	}
}

Correct the visibility of the transformer setup method.

package edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.responses.java2pcm

import mir.responses.AbstractChange2CommandTransformingJavaTo5_1
import edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.seffstatements.Java2PcmPackageMappingMethodBodyChangePreprocessor
import edu.kit.ipd.sdq.vitruvius.casestudies.pcmjava.transformations.packagemapping.util.Java2PcmPackagePreprocessor

class Change2CommandTransformingJavaToPcm extends AbstractChange2CommandTransformingJavaTo5_1 {
	protected override setup() {
		addChangeProcessor(new Java2PcmPackagePreprocessor(userInteracting));
		addChangeProcessor(new Java2PcmPackageMappingMethodBodyChangePreprocessor(userInteracting));
		addChangeProcessor(new Java2PcmTransformationsPreprocessor(userInteracting));
		super.setup();
	}
}


package org.tetrabox.minijava.semantics

import fr.inria.diverse.k3.al.annotationprocessor.Aspect
import fr.inria.diverse.k3.al.annotationprocessor.Main
import fr.inria.diverse.k3.al.annotationprocessor.Step
import org.tetrabox.minijava.dynamic.minijavadynamicdata.MinijavadynamicdataFactory
import org.tetrabox.minijava.dynamic.minijavadynamicdata.State
import org.tetrabox.minijava.xtext.miniJava.Method
import org.tetrabox.minijava.xtext.miniJava.Program

import static extension org.tetrabox.minijava.semantics.BlockAspect.*

@Aspect(className=Program)
class ProgramAspect {

	@Main
	@Step
	def State execute() {
		val main = _self.classes.map[members].flatten.filter(Method).findFirst[it.name == "main" && it.static]
		val state = MinijavadynamicdataFactory::eINSTANCE.createState => [
			outputStream = MinijavadynamicdataFactory::eINSTANCE.createOutputStream
			rootFrame = MinijavadynamicdataFactory::eINSTANCE.createFrame
		]
		if (main !== null) {
			main.body.evaluateStatementKeepContext(state)
			return state
		} else
			throw new RuntimeException("No main method found.")
	}

}

Create "main" separated from Program "evaluate"

package org.tetrabox.minijava.semantics

import fr.inria.diverse.k3.al.annotationprocessor.Aspect
import fr.inria.diverse.k3.al.annotationprocessor.Main
import fr.inria.diverse.k3.al.annotationprocessor.Step
import org.tetrabox.minijava.dynamic.minijavadynamicdata.MinijavadynamicdataFactory
import org.tetrabox.minijava.dynamic.minijavadynamicdata.State
import org.tetrabox.minijava.xtext.miniJava.Method
import org.tetrabox.minijava.xtext.miniJava.Program

import static extension org.tetrabox.minijava.semantics.BlockAspect.*

@Aspect(className=Program)
class ProgramAspect {

	@Main
	@Step
	def void main() {
		_self.execute
	}

	def State execute() {
		val main = _self.classes.map[members].flatten.filter(Method).findFirst[it.name == "main" && it.static]
		val state = MinijavadynamicdataFactory::eINSTANCE.createState => [
			outputStream = MinijavadynamicdataFactory::eINSTANCE.createOutputStream
			rootFrame = MinijavadynamicdataFactory::eINSTANCE.createFrame
		]
		if (main !== null) {
			main.body.evaluateStatementKeepContext(state)
			return state
		} else
			throw new RuntimeException("No main method found.")
	}

}


package tools.vitruv.framework.change.description

import org.eclipse.xtend.lib.annotations.Data

@Data
class PropagatedChange {
	private val VitruviusChange originalChange;
	private val VitruviusChange consequentialChanges;

	override toString() '''
	Original change:
		«originalChange»
	Consequential change: «consequentialChanges»
	'''

	def applyBackward() {
		consequentialChanges.applyBackward();
		originalChange.applyBackward();
	}

}

Correct propagated change rollback for unresolved changes

package tools.vitruv.framework.change.description

import org.eclipse.xtend.lib.annotations.Data
import tools.vitruv.framework.change.uuid.UuidResolver

@Data
class PropagatedChange {
	private val VitruviusChange originalChange;
	private val VitruviusChange consequentialChanges;

	override toString() '''
	Original change:
		«originalChange»
	Consequential change: «consequentialChanges»
	'''

	def applyBackward(UuidResolver uuidResolver) {
		consequentialChanges.resolveAfterAndApplyBackward(uuidResolver);
		originalChange.applyBackward;
	}

}


/*
 * generated by Xtext 2.9.0
 */
package tools.vitruv.dsls.reactions

/**
 * Initialization support for running Xtext languages without Equinox extension registry.
 */
class ReactionsLanguageStandaloneSetup extends ReactionsLanguageStandaloneSetupGenerated {

	def static void doSetup() {
		new ReactionsLanguageStandaloneSetup().createInjectorAndDoEMFRegistration()
	}
}

Initialize metamodels when running Reactions language generator

/*
 * generated by Xtext 2.9.0
 */
package tools.vitruv.dsls.reactions

import org.eclipse.emf.ecore.plugin.EcorePlugin

/**
 * Initialization support for running Xtext languages without Equinox extension registry.
 */
class ReactionsLanguageStandaloneSetup extends ReactionsLanguageStandaloneSetupGenerated {

	def static void doSetup() {
		// Makes ECore register our custom implementations of EPackages
		EcorePlugin.ExtensionProcessor.process(null)
		new ReactionsLanguageStandaloneSetup().createInjectorAndDoEMFRegistration()
	}
}


package io.joynr.generator.cpp.util
/*
 * !!!
 *
 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class TemplateBase {

	def warning()
	'''

		// #####################################################
		//#######################################################
		//###                                                 ###
		//##    WARNING: This file is generated. DO NOT EDIT   ##
		//##             All changes will be lost!             ##
		//###                                                 ###
		//#######################################################
		// #####################################################

	'''

}

Add license header to generated sources

package io.joynr.generator.cpp.util
/*
 * !!!
 *
 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

class TemplateBase {

	def warning()
	'''
	/*
	 *
	 * Copyright (C) 2011 - 2013 BMW Car IT GmbH
	 *
	 * Licensed under the Apache License, Version 2.0 (the "License");
	 * you may not use this file except in compliance with the License.
	 * You may obtain a copy of the License at
	 *
	 *      http://www.apache.org/licenses/LICENSE-2.0
	 *
	 * Unless required by applicable law or agreed to in writing, software
	 * distributed under the License is distributed on an "AS IS" BASIS,
	 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 * See the License for the specific language governing permissions and
	 * limitations under the License.
	 */

	// #####################################################
	//#######################################################
	//###                                                 ###
	//##    WARNING: This file is generated. DO NOT EDIT   ##
	//##             All changes will be lost!             ##
	//###                                                 ###
	//#######################################################
	// #####################################################
	'''
}


package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}

Test commit - integration with Jenkins CI

package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
//
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}


package edu.kit.ipd.sdq.vitruvius.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.eclipse.emf.ecore",
		"edu.kit.ipd.sdq.vitruvius.framework.util",
		"edu.kit.ipd.sdq.vitruvius.framework.contracts",
		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.apidesign",
		"edu.kit.ipd.sdq.vitruvius.framework.meta.change",
		"com.google.guava",
		"org.eclipse.core.resources",
		"org.apache.log4j",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.testframework",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.api",
 		"edu.kit.ipd.sdq.vitruvius.dsls.response.api",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.transformationexecuter",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.userinteractor"
	]
}

Remove mapping.apidesign project from list of required projects for MIR files.

package edu.kit.ipd.sdq.vitruvius.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.eclipse.emf.ecore",
		"edu.kit.ipd.sdq.vitruvius.framework.util",
		"edu.kit.ipd.sdq.vitruvius.framework.contracts",
		"edu.kit.ipd.sdq.vitruvius.framework.meta.change",
		"com.google.guava",
		"org.eclipse.core.resources",
		"org.apache.log4j",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.testframework",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.api",
 		"edu.kit.ipd.sdq.vitruvius.dsls.response.api",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.transformationexecuter",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.userinteractor"
	]
}


package eu.netide.configuration.utils

import org.eclipse.core.runtime.Path
import org.eclipse.core.resources.ResourcesPlugin
import org.eclipse.core.runtime.Platform

/**
 * Some useful methods for everyday use
 *
 * @author Christian Stritzke
 */
class NetIDEUtil {

	static def absolutePath(String e) {
		if (e != null && e.startsWith("platform:/resource")) {
					if (Platform.getOS == Platform.OS_WIN32)
						ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(e).removeFirstSegments(1)).rawLocation
					else if (Platform.getOS == Platform.OS_LINUX || Platform.getOS == Platform.OS_MACOSX)
						ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(e).removeFirstSegments(2)).rawLocation

        } else {
        	var p = new Path(e)
            if (e.startsWith("file:/"))
            	new Path("/" + p.removeFirstSegments(1))
            else
                p
        }
	}
}

Fix possible null pointer exception, clean up absolutePath

package eu.netide.configuration.utils

import org.eclipse.core.runtime.Path
import org.eclipse.core.resources.ResourcesPlugin
import org.eclipse.core.runtime.Platform

/**
 * Some useful methods for everyday use
 *
 * @author Christian Stritzke
 */
class NetIDEUtil {
	static def absolutePath(String e) {
		if (e == null)
			return null;

		if (e.startsWith("platform:/resource")) {
            if (Platform.getOS == Platform.OS_WIN32)
                    ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(e).removeFirstSegments(1)).rawLocation
            else if (Platform.getOS == Platform.OS_LINUX || Platform.getOS == Platform.OS_MACOSX)
                    ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(e).removeFirstSegments(2)).rawLocation
        } else if (e.startsWith("file:/")) {
            new Path("/" + new Path(e).removeFirstSegments(1))
        } else {
            new Path(e)
        }
	}
}


/*
 * generated by Xtext 2.12.0
 */
package tools.vitruv.dsls.commonalities.ui.labeling

import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.resource.IEObjectDescription
import org.eclipse.xtext.xbase.ui.labeling.XbaseDescriptionLabelProvider

/**
 * Provides labels for IEObjectDescriptions and IResourceDescriptions.
 *
 * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
 */
class CommonalitiesLanguageDescriptionLabelProvider extends XbaseDescriptionLabelProvider {

	override text(IEObjectDescription description) {
		text(description.EObjectOrProxy, description)
	}

	def dispatch text(EObject object, IEObjectDescription description) {
		super.text(description)
	}

/* 	def dispatch text(Metaclass metaclass, IEObjectDescription description) {
		new StyledString().append(description.name.firstSegment, QUALIFIER_STYLER).append(DOMAIN_METACLASS_SEPARATOR, QUALIFIER_STYLER).append(description.name.getSegment(1))
	}*/

	// Labels and icons can be computed like this:

//	override text(IEObjectDescription ele) {
//		ele.name.toString
//	}
//
	override image(IEObjectDescription ele) {
		ele.EClass.name + '.gif'
	}
}

Remove dispatch from single operation

/*
 * generated by Xtext 2.12.0
 */
package tools.vitruv.dsls.commonalities.ui.labeling

import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.resource.IEObjectDescription
import org.eclipse.xtext.xbase.ui.labeling.XbaseDescriptionLabelProvider

/**
 * Provides labels for IEObjectDescriptions and IResourceDescriptions.
 *
 * See https://www.eclipse.org/Xtext/documentation/304_ide_concepts.html#label-provider
 */
class CommonalitiesLanguageDescriptionLabelProvider extends XbaseDescriptionLabelProvider {

	override text(IEObjectDescription description) {
		text(description.EObjectOrProxy, description)
	}

	// REMARK: should be dispatch when the other operations are not commented out
	def text(EObject object, IEObjectDescription description) {
		super.text(description)
	}

/* 	def dispatch text(Metaclass metaclass, IEObjectDescription description) {
		new StyledString().append(description.name.firstSegment, QUALIFIER_STYLER).append(DOMAIN_METACLASS_SEPARATOR, QUALIFIER_STYLER).append(description.name.getSegment(1))
	}*/

	// Labels and icons can be computed like this:

//	override text(IEObjectDescription ele) {
//		ele.name.toString
//	}
//
	override image(IEObjectDescription ele) {
		ele.EClass.name + '.gif'
	}
}


package net.exkazuu

import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader

class FileManager {
	String root

	new(String root) {
		this.root = root
	}

	def getDirList() {
		return new File(root).listFiles
	}

	def List<String> getSourceCodeAbsolutePath(String path, String name) {
		val result = new ArrayList<String>
		val file = new File(path)

		if (file.isFile) {
			val fileName = file.getName
			if (fileName.contains(".java")) {
				val length = fileName.length
				if (fileName.substring(length - 5, length).equals(".java")) {
					result += file.getAbsolutePath
				}
			}
		} else {
			val files = file.listFiles
			for (f : files) {
				result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
			}
		}

		return result
	}

	def int getSourceCodeLOC(String absolutePath) {
		val reader = new LineNumberReader(new FileReader(absolutePath))

		while (null != reader.readLine) {
		}

		val result = reader.getLineNumber
		reader.close

		return result
	}
}

Modify code by the comment.

package net.exkazuu

import java.io.File
import java.util.List
import java.util.ArrayList
import java.io.FileReader
import java.io.LineNumberReader

class FileManager {
	String root

	new(String root) {
		this.root = root
	}

	def getDirList() {
		return new File(root).listFiles
	}

	def List<String> getSourceCodeAbsolutePath(String path, String name) {
		val result = new ArrayList<String>
		val file = new File(path)

		if (file.isFile) {
			if (file.getName.endsWith(".java")) {
				result += file.getAbsolutePath
			}
		} else {
			val files = file.listFiles
			for (f : files) {
				result += getSourceCodeAbsolutePath(f.getAbsolutePath, name)
			}
		}

		return result
	}

	def int getSourceCodeLOC(String absolutePath) {
		val reader = new LineNumberReader(new FileReader(absolutePath))

		while (null != reader.readLine) {
		}

		val result = reader.getLineNumber
		reader.close

		return result
	}
}


package tools.vitruv.framework.ui.monitorededitor

import tools.vitruv.framework.vsum.VirtualModel
import org.eclipse.xtend.lib.annotations.Accessors

abstract class AbstractMonitoredEditor implements MonitoredEditor {
	@Accessors(PROTECTED_GETTER)
	val VirtualModel virtualModel
	@Accessors(PUBLIC_GETTER, PUBLIC_SETTER)
	var int automaticPropagationAfterMilliseconds

	/**
	 * Sets the time after which change propagation is executed automatically if no further change
	 * occurs. Setting the value to -1 disables automatic propagation.
	 * @param millisecondsAfterLastChange the time after which change propagation is
	 * performed if no further change occurs
	 */
	override void setAutomaticPropagationAfterMilliseconds(int millisecondsAfterLastChange) {
		this.automaticPropagationAfterMilliseconds = millisecondsAfterLastChange
	}

	new(VirtualModel virtualModel) {
		this.virtualModel = virtualModel
	}

}

Set default value for automatic change propagation

package tools.vitruv.framework.ui.monitorededitor

import tools.vitruv.framework.vsum.VirtualModel
import org.eclipse.xtend.lib.annotations.Accessors

abstract class AbstractMonitoredEditor implements MonitoredEditor {
	@Accessors(PROTECTED_GETTER)
	val VirtualModel virtualModel
	@Accessors(PUBLIC_GETTER, PUBLIC_SETTER)
	var int automaticPropagationAfterMilliseconds

	/**
	 * Sets the time after which change propagation is executed automatically if no further change
	 * occurs. Setting the value to -1 disables automatic propagation.
	 * @param millisecondsAfterLastChange the time after which change propagation is
	 * performed if no further change occurs
	 */
	override void setAutomaticPropagationAfterMilliseconds(int millisecondsAfterLastChange) {
		this.automaticPropagationAfterMilliseconds = millisecondsAfterLastChange
	}

	new(VirtualModel virtualModel) {
		this.virtualModel = virtualModel
		this.automaticPropagationAfterMilliseconds = -1
	}

}


package org.xtext.gradle.tasks.internal

import java.util.Map
import org.gradle.api.Project
import org.xtext.gradle.tasks.Outlet
import org.xtext.gradle.tasks.XtextExtension
import org.xtext.gradle.tasks.XtextSourceSetOutputs

class DefaultXtextSourceSetOutputs implements XtextSourceSetOutputs {
	val Project project
	val Map<Outlet, Object> dirs = newHashMap

	new(Project project, XtextExtension xtext) {
		this.project = project
		xtext.languages.all[
			generator.outlets.whenObjectRemoved[
				dirs.remove(it)
			]
		]
	}

	override getDirs() {
		project.files(dirs.values)
	}

	override getDir(Outlet outlet) {
		project.file(dirs.get(outlet))
	}

	override dir(Outlet outlet, Object path) {
		dirs.put(outlet, path)
	}
}

Fix incremental compilation on Gradle 3.0

package org.xtext.gradle.tasks.internal

import java.util.Map
import org.gradle.api.Project
import org.xtext.gradle.tasks.Outlet
import org.xtext.gradle.tasks.XtextExtension
import org.xtext.gradle.tasks.XtextSourceSetOutputs

class DefaultXtextSourceSetOutputs implements XtextSourceSetOutputs {
	val Project project
	val Map<Outlet, Object> dirs = newLinkedHashMap

	new(Project project, XtextExtension xtext) {
		this.project = project
		xtext.languages.all[
			generator.outlets.whenObjectRemoved[
				dirs.remove(it)
			]
		]
	}

	override getDirs() {
		project.files(dirs.values)
	}

	override getDir(Outlet outlet) {
		project.file(dirs.get(outlet))
	}

	override dir(Outlet outlet, Object path) {
		dirs.put(outlet, path)
	}
}


/*
 * Copyright (c) SSI Schaefer IT Solutions
 */
package com.wamas.ide.launching.scoping

/**
 * This class contains custom scoping description.
 *
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
 * on how and when to use it.
 */
class LcDslScopeProvider extends AbstractLcDslScopeProvider {

}

Allow referencing super configs from all over the world (workspace)

/*
 * Copyright (c) SSI Schaefer IT Solutions
 */
package com.wamas.ide.launching.scoping

import org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider
import com.wamas.ide.launching.lcDsl.LaunchConfig
import org.eclipse.emf.ecore.EReference
import org.eclipse.xtext.resource.IResourceDescriptions
import com.google.inject.Inject
import com.wamas.ide.launching.lcDsl.LcDslPackage
import org.eclipse.xtext.scoping.Scopes
import org.eclipse.emf.ecore.util.EcoreUtil

/**
 * This class contains custom scoping description.
 *
 * See https://www.eclipse.org/Xtext/documentation/303_runtime_concepts.html#scoping
 * on how and when to use it.
 */
class LcDslScopeProvider extends AbstractDeclarativeScopeProvider {

	@Inject
	IResourceDescriptions index;

	def scope_LaunchConfig_superConfig(LaunchConfig config, EReference ref) {
		val allLcs = index.getExportedObjectsByType(LcDslPackage.eINSTANCE.launchConfig);

		Scopes.scopeFor(allLcs.filter[!name.lastSegment.equals(config.name)].map[EcoreUtil.resolve(EObjectOrProxy, config)])
	}

}


package eu.indenica.config.runtime.generator.common

import eu.indenica.config.runtime.runtime.IndenicaAdaptationRule
import eu.indenica.config.runtime.runtime.DroolsAdaptationRule
import org.eclipse.xtext.naming.IQualifiedNameProvider
import com.google.inject.Inject
import eu.indenica.config.runtime.runtime.AdaptationRule

class DroolsRuleConverter {
	@Inject extension IQualifiedNameProvider

	def dispatch convert(IndenicaAdaptationRule it) '''
		«ruleHead»

		// TODO: convert indenica adaptation rule
	'''

	def dispatch convert(DroolsAdaptationRule it) '''
		«ruleHead»

		rule "«name»"
«««			when, then are in <<statement>>
			«statement»
		end
	'''

	def ruleHead(AdaptationRule it) '''
		package «eContainer.fullyQualifiedName»

		«FOR inputFact : sources.map[s | s.fact]»
		«IF eContainer.fullyQualifiedName != inputFact.eContainer.fullyQualifiedName»
		import «inputFact.fullyQualifiedName»
		«ENDIF»
		«ENDFOR»
		import eu.indenica.events.ActionEvent

		global eu.indenica.runtime.adaptation.AdaptationEngine publisher
	'''
}

Fix global `publisher` reference in rule.

package eu.indenica.config.runtime.generator.common

import eu.indenica.config.runtime.runtime.IndenicaAdaptationRule
import eu.indenica.config.runtime.runtime.DroolsAdaptationRule
import org.eclipse.xtext.naming.IQualifiedNameProvider
import com.google.inject.Inject
import eu.indenica.config.runtime.runtime.AdaptationRule

class DroolsRuleConverter {
	@Inject extension IQualifiedNameProvider

	def dispatch convert(IndenicaAdaptationRule it) '''
		«ruleHead»

		// TODO: convert indenica adaptation rule
	'''

	def dispatch convert(DroolsAdaptationRule it) '''
		«ruleHead»

		rule "«name»"
«««			when, then are in <<statement>>
			«statement»
		end
	'''

	def ruleHead(AdaptationRule it) '''
		package «eContainer.fullyQualifiedName»

		«FOR inputFact : sources.map[s | s.fact]»
		«IF eContainer.fullyQualifiedName != inputFact.eContainer.fullyQualifiedName»
		import «inputFact.fullyQualifiedName»
		«ENDIF»
		«ENDFOR»
		import eu.indenica.events.ActionEvent

		global eu.indenica.adaptation.AdaptationEngine publisher
	'''
}


package fr.inria.diverse.trace.commons.testutil

import org.eclipse.emf.ecore.EObject
import java.util.Set
import java.util.HashSet
import java.util.Collection
import java.util.function.Predicate

class Investigation {

	public static def Set<EObject> findObjectThatPointTo(EObject root, Predicate<EObject> predicateReferencedObject) {
		val Set<EObject> result = new HashSet
		for (o : root.eAllContents.toSet) {
			for (f : o.eClass.EAllReferences) {
				val Set<EObject> allObjectsRefed = new HashSet
				val Object stuffRefed = o.eGet(f)
				if (f.many) {
					allObjectsRefed.addAll(stuffRefed as Collection<EObject>)
				} else {
					allObjectsRefed.add(stuffRefed as EObject)
				}
				if (allObjectsRefed.exists[y|predicateReferencedObject.test(y)]) {
					result.add(o)
				}
			}
		}
		return result
	}

}

Add test operation to find objects with no resources

package fr.inria.diverse.trace.commons.testutil

import org.eclipse.emf.ecore.EObject
import java.util.Set
import java.util.HashSet
import java.util.Collection
import java.util.function.Predicate

class Investigation {

	public static def Set<EObject> findObjectsThatPointTo(EObject root, Predicate<EObject> predicateReferencedObject, Set<EObject> pointedObjects) {
		val Set<EObject> result = new HashSet
		for (o : root.eAllContents.toSet) {
			for (f : o.eClass.EAllReferences) {
				val Set<EObject> allObjectsRefed = new HashSet
				val Object stuffRefed = o.eGet(f)
				if (f.many) {
					allObjectsRefed.addAll(stuffRefed as Collection<EObject>)
				} else {
					allObjectsRefed.add(stuffRefed as EObject)
				}
				val filtered = allObjectsRefed.filter[y|predicateReferencedObject.test(y)]
				if (!filtered.empty
				) {
					result.add(o)
					pointedObjects.addAll(filtered)
				}
			}
		}
		return result
	}

	public static def Set<EObject> findObjectsThatPointToObjectsWithoutResource(EObject root, Set<EObject> pointedObjects) {
		return findObjectsThatPointTo(root, [o|o != null && o.eResource == null], pointedObjects)
	}

	public static def EObject findRoot(EObject o) {
		if (o.eContainer == null)
			return o
		else
			return findRoot(o.eContainer)
	}

}


package tools.vitruv.extensions.dslsruntime.reactions

import tools.vitruv.extensions.dslsruntime.reactions.IReactionRealization
import tools.vitruv.extensions.dslsruntime.reactions.structure.CallHierarchyHaving
import tools.vitruv.framework.change.echange.EChange
import tools.vitruv.framework.tuid.TuidManager

abstract class AbstractReactionRealization extends CallHierarchyHaving implements IReactionRealization {
	protected ReactionExecutionState executionState;

	override applyEvent(EChange change, ReactionExecutionState reactionExecutionState) {
		getLogger().debug("Called reactions " + this.getClass().getSimpleName() + " with event: " + change);

    	this.executionState = reactionExecutionState;

    	if (checkPrecondition(change)) {
    		try {
				executeReaction(change);
			} finally {
				// The reactions was completely executed, so remove all objects registered for modification
				// by the effects as they are no longer under modification
				// even if there was an exception!
				TuidManager.instance.flushRegisteredObjectsUnderModification();
			}
		}

		return executionState.transformationResult;
	}

	protected def void executeReaction(EChange change);

}

Make userInteracting accessible in Reactions

package tools.vitruv.extensions.dslsruntime.reactions

import tools.vitruv.extensions.dslsruntime.reactions.IReactionRealization
import tools.vitruv.extensions.dslsruntime.reactions.structure.CallHierarchyHaving
import tools.vitruv.framework.change.echange.EChange
import tools.vitruv.framework.tuid.TuidManager
import tools.vitruv.framework.userinteraction.UserInteracting

abstract class AbstractReactionRealization extends CallHierarchyHaving implements IReactionRealization {
	protected UserInteracting userInteracting;
	protected ReactionExecutionState executionState;

	override applyEvent(EChange change, ReactionExecutionState reactionExecutionState) {
		getLogger().debug("Called reactions " + this.getClass().getSimpleName() + " with event: " + change);

    	this.executionState = reactionExecutionState;
    	this.userInteracting = reactionExecutionState.userInteracting;

    	if (checkPrecondition(change)) {
    		try {
				executeReaction(change);
			} finally {
				// The reactions was completely executed, so remove all objects registered for modification
				// by the effects as they are no longer under modification
				// even if there was an exception!
				TuidManager.instance.flushRegisteredObjectsUnderModification();
			}
		}

		return executionState.transformationResult;
	}

	protected def void executeReaction(EChange change);

}


/*
 * generated by Xtext
 */
package org.nanosite.xtendency.tracer.validation
//import org.eclipse.xtext.validation.Check

/**
 * Custom validation rules.
 *
 * see http://www.eclipse.org/Xtext/documentation.html#validation
 */
class TracingExecutionContextValidator extends AbstractTracingExecutionContextValidator {

//  public static val INVALID_NAME = 'invalidName'
//
//	@Check
//	def checkGreetingStartsWithCapital(Greeting greeting) {
//		if (!Character.isUpperCase(greeting.name.charAt(0))) {
//			warning('Name should start with a capital',
//					MyDslPackage.Literals.GREETING__NAME,
//					INVALID_NAME)
//		}
//	}
}

Put DSL validation back in

/*
 * generated by Xtext
 */
package org.nanosite.xtendency.tracer.validation

import org.eclipse.xtext.validation.Check
import org.nanosite.xtendency.tracer.tracingExecutionContext.ExecutionContext
import org.eclipse.xtend.core.xtend.XtendField
import org.nanosite.xtendency.tracer.tracingExecutionContext.TracingExecutionContextPackage

//import org.eclipse.xtext.validation.Check

/**
 * Custom validation rules.
 *
 * see http://www.eclipse.org/Xtext/documentation.html#validation
 */
class TracingExecutionContextValidator extends AbstractTracingExecutionContextValidator {

	@Check
	def checkAllParametersDefined(ExecutionContext ec){
		if (ec.function != null){
			val params = ec.function.parameters.map[name]
			val fields = ec.clazz.members.filter(XtendField).map[name]
			val args = ec.inits.map[it.param]
			for (p : params){
				if (!args.contains(p)){
					error("Parameter " + p + " must be initialized.", TracingExecutionContextPackage.Literals.EXECUTION_CONTEXT__FUNCTION)
				}
			}
			for (a : args){
				if (!params.contains(a) && a != "this" && !fields.exists[it == a]){
					warning("Function " + ec.function.name + " does not have a parameter named " + a + " and its class has no field with this name.", TracingExecutionContextPackage.Literals.EXECUTION_CONTEXT__INITS, args.indexOf(a))
				}
			}
		}
	}
}


package tools.vitruv.framework.change.description.impl

import tools.vitruv.framework.change.description.CompositeContainerChange
import tools.vitruv.framework.change.description.VitruviusChange

class CompositeContainerChangeImpl extends AbstractCompositeChangeImpl<VitruviusChange> implements CompositeContainerChange {

}

Extend debug output for container changes

package tools.vitruv.framework.change.description.impl

import tools.vitruv.framework.change.description.CompositeContainerChange
import tools.vitruv.framework.change.description.VitruviusChange

class CompositeContainerChangeImpl extends AbstractCompositeChangeImpl<VitruviusChange> implements CompositeContainerChange {

	override toString() '''
		Container change:
		«FOR change : changes»  «change»«ENDFOR»'''

}


package org.muml.psm.allocation.algorithm.ui

class GenericCreateASLFileHandler extends AbstractCreateASLFileHandler {

	override protected getTemplate(String name) {
		'''
		«name» {
			import 'http://www.eclipse.org/emf/2002/Ecore'

			nameProvider  'org.muml.psm.allocation.language.xtext.provider.EcoreNameProvider';
			storageProvider 'org.muml.psm.allocation.language.xtext.provider.StdoutStorageProvider' ;

			oclContext ecore::EPackage;

		}
		'''
	}

}

Adjust ASL file templates to the preamble change

package org.muml.psm.allocation.algorithm.ui

class GenericCreateASLFileHandler extends AbstractCreateASLFileHandler {

	override protected getTemplate(String name) {
		'''
		«name» {
			import 'http://www.eclipse.org/emf/2002/Ecore'

			nameProvider 'org.muml.psm.allocation.language.xtext.provider.EcoreNameProvider'
			storageProvider 'org.muml.psm.allocation.language.xtext.provider.StdoutStorageProvider'

			oclContext ecore::EPackage

		}
		'''
	}

}


package fr.inria.diverse.k3.al.annotationprocessor.stepmanager

interface IStepManager {

	def Object execute(Object caller, StepCommand command, String methodName);

	def boolean canHandle(Object caller);

}

Fix execute: renamed executeStep and no return

package fr.inria.diverse.k3.al.annotationprocessor.stepmanager

interface IStepManager {

	def void executeStep(Object caller, StepCommand command, String methodName);

	def boolean canHandle(Object caller);

}


package tools.vitruv.domains.asem

import org.eclipse.emf.ecore.EPackage
import edu.kit.ipd.sdq.ASEM.ASEMPackage

class AsemNamespace {
	private new() {
	}

	// file extensions
	public static final String FILE_EXTENSION = "asem";

	// MM Namespaces
	public static final EPackage ROOT_PACKAGE = ASEMPackage.eINSTANCE;
	public static final String METAMODEL_NAMESPACE = ASEMPackage.eNS_URI;

}

Make utility class for ASEM namespace final.

package tools.vitruv.domains.asem

import org.eclipse.emf.ecore.EPackage
import edu.kit.ipd.sdq.ASEM.ASEMPackage

final class AsemNamespace {
	private new() {
	}

	// file extensions
	public static final String FILE_EXTENSION = "asem";

	// MM Namespaces
	public static final EPackage ROOT_PACKAGE = ASEMPackage.eINSTANCE;
	public static final String METAMODEL_NAMESPACE = ASEMPackage.eNS_URI;

}


package edu.kit.ipd.sdq.vitruvius.dsls.response.api.environment

import edu.kit.ipd.sdq.vitruvius.dsls.response.api.interfaces.IResponseRealization
import org.apache.log4j.Logger
import org.eclipse.emf.ecore.EObject
import java.util.Collections
import org.eclipse.emf.ecore.util.EcoreUtil

abstract class AbstractResponseRealization implements IResponseRealization {
	protected abstract def Logger getLogger();

	protected def void deleteElement(EObject element) {
		if (element.eContainer() == null) {
			logger.debug("Deleting root object: " + element);
			element.eResource().delete(Collections.EMPTY_MAP);
		} else {
			logger.debug("Removing non-root object: " + element);
			EcoreUtil.remove(element);
		}
	}
}

Make response execution only show a warning instead of throwing an exception when a model element to delete was already deleted.

package edu.kit.ipd.sdq.vitruvius.dsls.response.api.environment

import edu.kit.ipd.sdq.vitruvius.dsls.response.api.interfaces.IResponseRealization
import org.apache.log4j.Logger
import org.eclipse.emf.ecore.EObject
import java.util.Collections
import org.eclipse.emf.ecore.util.EcoreUtil

abstract class AbstractResponseRealization implements IResponseRealization {
	protected abstract def Logger getLogger();

	protected def void deleteElement(EObject element) {
		if (element.eContainer() == null) {
			if (element.eResource() != null) {
				logger.debug("Deleting root object: " + element);
				element.eResource().delete(Collections.EMPTY_MAP);
			} else {
				logger.warn("The element to delete was already removed: " + element);
			}
		} else {
			logger.debug("Removing non-root object: " + element);
			EcoreUtil.remove(element);
		}
	}
}


package tools.vitruv.dsls.reactions.generator;

import org.eclipse.xtext.xbase.impl.XBlockExpressionImpl
import org.eclipse.xtend2.lib.StringConcatenationClient

class SimpleTextXBlockExpression extends XBlockExpressionImpl {
	private val StringConcatenationClient text;

	public new(StringConcatenationClient text) {
		this.text = text;
	}

	public def StringConcatenationClient getText() {
		return text;
	}
}

Mark XExpression fake class deprecated

package tools.vitruv.dsls.reactions.generator;

import org.eclipse.xtext.xbase.impl.XBlockExpressionImpl
import org.eclipse.xtend2.lib.StringConcatenationClient

/**
 * @deprecated Instantiate a correct {@link XExpression} instead
 */
@Deprecated
class SimpleTextXBlockExpression extends XBlockExpressionImpl {
	private val StringConcatenationClient text;

	public new(StringConcatenationClient text) {
		this.text = text;
	}

	public def StringConcatenationClient getText() {
		return text;
	}
}


package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}

Test - integration with CI

package org.foam.transform.utils.graphviz

import static junit.framework.Assert.*
import org.junit.Test
import java.io.IOException
import org.junit.Ignore

// Tests added to ignore - running them at compile time makes little sense
// as they only discover whether build server has or has not graphviz
// installed.
//
// They should be executed at test environment.
@Ignore
class GraphvizWrapperTest {

	extension GraphvizWrapper = new GraphvizWrapper

	@Test def void testGraphvizVersion() {
		assertNotNull(graphvizVersion)
		assertTrue( graphvizVersion.startsWith("dot - graphviz version") )
	}

	@Test def void testRunGraphviz() {

		// this should succeed without throwing any IOException
		#["-V"].runGraphviz

		// this should thrown and exception
		try {
			runGraphviz(#["this-should-fail"])
			fail
		} catch(IOException e) {
			assertTrue(e.message.startsWith("Cannot run program"))
		}
	}
}


/*
 * generated by Xtext 2.12.0
 */
package org.tetrabox.minijava.xtext.tests

import com.google.inject.Inject
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.XtextRunner
import org.eclipse.xtext.testing.util.ParseHelper
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.tetrabox.minijava.xtext.miniJava.Program

@RunWith(XtextRunner)
@InjectWith(MiniJavaInjectorProvider)
class MiniJavaParsingTest {
	@Inject
	ParseHelper<Program> parseHelper

	@Test
	def void loadModel() {
		val result = parseHelper.parse('''
			Hello Xtext!
		''')
		Assert.assertNotNull(result)
		Assert.assertTrue(result.eResource.errors.isEmpty)
	}
}

Edit default test to as ultra simple model

/*
 * generated by Xtext 2.12.0
 */
package org.tetrabox.minijava.xtext.tests

import com.google.inject.Inject
import org.eclipse.xtext.testing.InjectWith
import org.eclipse.xtext.testing.XtextRunner
import org.eclipse.xtext.testing.util.ParseHelper
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.tetrabox.minijava.xtext.miniJava.Program

@RunWith(XtextRunner)
@InjectWith(MiniJavaInjectorProvider)
class MiniJavaParsingTest {
	@Inject
	ParseHelper<Program> parseHelper

	@Test
	def void loadModel() {
		val result = parseHelper.parse('''
			class X {}
		''')
		Assert.assertNotNull(result)
		Assert.assertTrue(result.eResource.errors.isEmpty)
	}
}


package edu.kit.ipd.sdq.vitruvius.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.eclipse.emf.ecore",
		"edu.kit.ipd.sdq.vitruvius.framework.util",
		"edu.kit.ipd.sdq.vitruvius.framework.contracts",
		"edu.kit.ipd.sdq.vitruvius.framework.meta.change",
		"com.google.guava",
		"org.eclipse.core.resources",
		"org.apache.log4j",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.testframework",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.api",
 		"edu.kit.ipd.sdq.vitruvius.dsls.response.runtime",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.transformationexecuter",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.userinteractor"
	]
}

Update MIR runtime dependencies due to new change meta-model.

package edu.kit.ipd.sdq.vitruvius.dsls.common

class VitruviusDslsCommonConstants {
	public final static String[] VITRUVIUS_DEPENDENCIES = #[
		"org.eclipse.emf.ecore",
		"edu.kit.ipd.sdq.vitruvius.framework.util",
		"edu.kit.ipd.sdq.vitruvius.framework.contracts",
//		"edu.kit.ipd.sdq.vitruvius.framework.meta.change",
		"com.google.guava",
		"org.eclipse.core.resources",
		"org.apache.log4j",
		"org.eclipse.xtend.lib",
 		"org.eclipse.xtend.lib.macro",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.testframework",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping",
 		"edu.kit.ipd.sdq.vitruvius.dsls.mapping.api",
 		"edu.kit.ipd.sdq.vitruvius.dsls.response.runtime",
 		//"edu.kit.ipd.sdq.vitruvius.framework.run.transformationexecuter",
 		"edu.kit.ipd.sdq.vitruvius.framework.run.userinteractor"
	]
}


package org.lilychant.tests

import com.google.inject.Inject
import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.util.ParseHelper
import org.eclipse.xtext.junit4.validation.ValidationTestHelper
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.lilychant.lilyChantScript.Script

@RunWith(XtextRunner)
@InjectWith(LilyChantInjectorProvider)
class LilyChantParsingTest{

	@Inject ParseHelper<Script> parseHelper;
	@Inject ValidationTestHelper validationHelper;

	@Test
	def void loadModel() {
		val result = parseHelper.parse('''
			Tone one in A:
				Voices: Sop Alt
				Phrase one:
					Voice Sop:
						c4 d e f2
					Voice Alt:
						g4 a b c2
				Phrase two:
					Voice Sop:
						d4 e f1
					Voice Alt:
						g4 a b c2
			Chant in Tone one in F:
				This -- is __ a test
				This -- is __ b test
		''')

		result.assertParsedWithoutError;
	}

	private def assertParsedWithoutError(EObject obj) {
		Assert.assertNotNull(obj)
		validationHelper.assertNoErrors(obj)
	}
}

Test update to reflect language changes

package org.lilychant.tests

import com.google.inject.Inject
import org.eclipse.emf.ecore.EObject
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.util.ParseHelper
import org.eclipse.xtext.junit4.validation.ValidationTestHelper
import org.junit.Assert
import org.junit.Test
import org.junit.runner.RunWith
import org.lilychant.lilyChantScript.Script

@RunWith(XtextRunner)
@InjectWith(LilyChantInjectorProvider)
class LilyChantParsingTest{

	@Inject ParseHelper<Script> parseHelper;
	@Inject ValidationTestHelper validationHelper;

	@Test
	def void loadModel() {
		val result = parseHelper.parse('''
			Tone one in A
				Voices
					Sop Alt
				Phrase one
					Voice Sop
						c4 d e f2
					Voice Alt
						g4 a b c2
				Phrase two
					Voice Sop
						d4 e f1
					Voice Alt
						g4 a b c2
			Chant in Tone one in F
				Phrase one
					<This--s> is__ <a test>
				Phrase two
					<This--s> is__ <a test>
			''')

		result.assertParsedWithoutError;
	}

	private def assertParsedWithoutError(EObject obj) {
		Assert.assertNotNull(obj)
		validationHelper.assertNoErrors(obj)
	}
}


package jbase.tests

import com.google.inject.Inject
import jbase.JbaseInjectorProvider
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.serializer.impl.Serializer
import org.junit.Test
import org.junit.runner.RunWith

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(JbaseInjectorProvider))
class JbaseSerializerTest extends JbaseAbstractTest {

	@Inject Serializer serializer

	@Test def void testAssignmentLeft() {
		assertSerialize('''
		i = 1;
		''')
	}

	@Test def void testVariableDeclarations() {
		'''
		int  i , j , k ;
		'''.assertSerialize
	}

	def private assertSerialize(CharSequence input) {
		val o = input.parse
		serializer.serialize(o)
	}
}

Test the Serializer with member call and array access

package jbase.tests

import com.google.inject.Inject
import jbase.JbaseInjectorProvider
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.serializer.impl.Serializer
import org.junit.Test
import org.junit.runner.RunWith

import static extension org.junit.Assert.*

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(JbaseInjectorProvider))
class JbaseSerializerTest extends JbaseAbstractTest {

	@Inject Serializer serializer

	@Test def void testAssignmentLeft() {
		assertSerialize('''
			i = 1;
		''')
	}

	@Test def void testVariableDeclarations() {
		'''
			int  i , j , k ;
		'''.assertSerialize
	}

	@Test def void testMemberFeatureCallArrayAccesses() {
		'''
			args  [ 0 ]   . length;
		'''.assertSerialize
	}

	def private assertSerialize(CharSequence input) {
		val o = input.parse
		input.toString.assertEquals(serializer.serialize(o))
	}
}


package fr.inria.diverse.kcvl.validation

import org.eclipse.xtext.validation.Check

import org.omg.CVLMetamodelMaster.cvl.ObjectHandle
import org.omg.CVLMetamodelMaster.cvl.CvlPackage
import org.omg.CVLMetamodelMaster.cvl.BaseModelHandle

class KCVLValidator extends AbstractKCVLValidator
{
	// TODO: Consider throwing a meaningful message
	@Check
	def checkReferencedEObjectExists(BaseModelHandle obj) {
		if (obj.reference === null)
			error("Cannot resolve reference to EObject", CvlPackage.Literals.BASE_MODEL_HANDLE__REFERENCE_STRING)
	}

	@Check
	def checkMofRefIsValid(ObjectHandle obj) {
		// ...
	}

}

Put back meaningful error messages in validator

package fr.inria.diverse.kcvl.validation

import fr.inria.diverse.kcvl.KCvlUtils

import org.omg.CVLMetamodelMaster.cvl.ObjectHandle
import org.omg.CVLMetamodelMaster.cvl.CvlPackage
import org.omg.CVLMetamodelMaster.cvl.BaseModelHandle

import org.eclipse.xtext.validation.Check

class KCVLValidator extends AbstractKCVLValidator
{
	// TODO: Consider throwing a meaningful message
	@Check
	def checkReferencedEObjectExists(BaseModelHandle obj) {
		if (obj.reference === null)
			try {
				KCvlUtils.resolve(obj)
				error("Cannot resolve reference to EObject", CvlPackage.Literals.BASE_MODEL_HANDLE__REFERENCE_STRING)
			} catch (Exception e) {
				error("Cannot resolve reference to EObject: " + e.message, CvlPackage.Literals.BASE_MODEL_HANDLE__REFERENCE_STRING)
			}
	}

	@Check
	def checkMofRefIsValid(ObjectHandle obj) {
		// ...
	}

}


package blang

import org.junit.Test
import blang.validation.ExactInvarianceTest

class TestDeep {

  // One model, many iterations
  @Test
  def void test() {
    val test = new ExactInvarianceTest => [
      nPosteriorSamplesPerIndep = 1_000
      add(new Examples().shm)
    ]
    test.check
  }
}


package eu.indenica.config.runtime.tests

import com.google.inject.Inject
import eu.indenica.config.runtime.RuntimeInjectorProvider
import eu.indenica.config.runtime.runtime.RuntimeModel
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.util.ParseHelper
import org.junit.Test
import org.junit.runner.RunWith
import eu.indenica.config.runtime.runtime.System

import static org.junit.Assert.*
import org.junit.Assert;
import org.eclipse.xtext.junit4.validation.ValidationTestHelper
import eu.indenica.config.runtime.runtime.Event
import eu.indenica.config.runtime.runtime.EventRef

@InjectWith(typeof(RuntimeInjectorProvider))
@RunWith(typeof(XtextRunner))
class RuntimeDslParserTest {
	@Inject ParseHelper<RuntimeModel> parser
	@Inject extension ValidationTestHelper

	@Test
	def void parseRuntimeDsl() {
		val model = parser.parse('''
			event eventOne {
				attr1 : String
			}

			system sOne {
				event eventOne
			}
		''')
		val e = model.elements.head as Event
		val s = model.elements.get(1) as System
		assertEquals(s.name, 'sOne')
		assertEquals(e.name, 'eventOne')
		assertSame((s.elements.head as EventRef).name, e)
	}

	@Test
	def void checkSyntax() {
		println("foo")
		'''
			event eventOne {
				attr1 : String
			}

			event eventTwo {
				attr2 : String
			}

			event eventThree {
				attr3 : String
				attrThree : String
			}

			system sOne {
				event eventOne
			}

			system sTwo {
				event eventOne
				event eventTwo
			}

			monitoringrule ruleOne {
				emit eventThree(foo as attr3)
				from sources sOne, sTwo event eventOne as attr1
				window 10s
				where foo
			}

			monitoringrule ruleTwo {
				from source sOne, sTwo events eventTwo, eventOne
				from source sTwo event eventTwo
				emit eventThree(foo as attrThree)
				window 500
			}
		'''.checkModel
	}

	def checkModel(CharSequence prog) {
        val model = parser.parse(prog)
        Assert::assertNotNull(model)
        model.assertNoErrors
        model
    }
}


Add an adapter reacting to additions of resources in a resource set

package tools.vitruv.framework.uuid

import org.eclipse.emf.common.notify.Adapter
import org.eclipse.emf.ecore.resource.ResourceSet
import java.util.function.Consumer
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.emf.common.notify.Notification
import org.eclipse.emf.common.notify.Notifier

/**
 * An adapter that reacts to additions of resources in a {@link ResourceSet} to call the
 * callback function for that resource given to the constructor.
 */
package class ResourceRegistrationAdapter implements Adapter {
	ResourceSet monitoredResourceSet;
	val Consumer<Resource> resourceRegistrationFunction;

	new(Consumer<Resource> resourceRegistrationFunction) {
		this.resourceRegistrationFunction = resourceRegistrationFunction;
	}

	override getTarget() {
		return null;
	}

	override isAdapterForType(Object type) {
		return false;
	}

	override notifyChanged(Notification notification) {
		if (notification.eventType == Notification.ADD) {
			if (notification.notifier instanceof ResourceSet) {
				if (notification.newValue instanceof Resource) {
					val resource = notification.newValue as Resource
					resourceRegistrationFunction.accept(resource);
				}
			}
		}
	}

	override setTarget(Notifier newTarget) {
		if (!(newTarget instanceof ResourceSet)) {
			throw new IllegalArgumentException();
		}
		this.monitoredResourceSet = newTarget as ResourceSet;
	}

}


Add basic confirmation dialog implementation

package tools.vitruv.framework.userinteraction.impl

import tools.vitruv.framework.userinteraction.impl.BaseDialog
import org.eclipse.swt.widgets.Shell
import tools.vitruv.framework.userinteraction.WindowModality
import org.eclipse.swt.widgets.Composite
import org.eclipse.swt.widgets.Control
import org.eclipse.swt.layout.GridLayout
import org.eclipse.swt.widgets.Label
import org.eclipse.swt.SWT
import org.eclipse.swt.layout.GridData
import org.eclipse.jface.dialogs.IDialogConstants
import org.eclipse.swt.widgets.Display
import org.eclipse.swt.graphics.Point

class ConfirmationDialog extends BaseDialog {

	new(Shell parentShell, WindowModality windowModality, String title, String message) {
		super(parentShell, windowModality, title, message)
	}

	protected override Control createDialogArea(Composite parent) {
        var composite = super.createDialogArea(parent) as Composite

    	val margins = 20
    	val spacing = 40
    	val iconSideLength = 96

    	val display = parent.getDisplay();
        val icon = display.getSystemImage(SWT.ICON_QUESTION)

    	val shell = composite.getShell()
        shell.setImage(icon)

        val gridLayout = new GridLayout(2, false)
    	gridLayout.marginWidth = margins
    	gridLayout.marginHeight = margins
    	gridLayout.horizontalSpacing = spacing
    	composite.layout = gridLayout

        val iconLabel = new Label(composite, SWT.NONE);
        var gridData = new GridData()
        gridData.verticalAlignment = SWT.CENTER
        gridData.grabExcessVerticalSpace = true
        iconLabel.setImage(icon);
        iconLabel.setSize(new Point(iconSideLength, iconSideLength));
        iconLabel.layoutData = gridData

        val messageLabel = new Label(composite, SWT.WRAP)
        gridData = new GridData()
        gridData.grabExcessHorizontalSpace = true
        gridData.verticalAlignment = SWT.CENTER
        messageLabel.setText(message);
        messageLabel.layoutData = gridData

        return composite
    }

    protected override void createButtonsForButtonBar(Composite parent) {
        createButton(parent, IDialogConstants.OK_ID, positiveButtonText, true)
        createButton(parent, IDialogConstants.CANCEL_ID, cancelButtonText, true)
    }

    override okPressed() {
    	close()
    }

    override cancelPressed() {
    	close()
    }

    def static void main(String[] args) {
		val display = new Display()
		val shell = new Shell(display)

	    val dialog = new ConfirmationDialog(shell, WindowModality.MODAL, "Title", "Message?")
		dialog.blockOnOpen = true
		dialog.show()
		display.dispose()
	}

}


package tools.vitruv.framework.vsum.ui.util

import tools.vitruv.framework.tests.util.TestUtil

class ProjectCreator {
	private val String projectName;

	new(String projectName) {
		this.projectName = projectName;
	}

	public def createProject() {
		TestUtil.createPlatformProject(projectName, false);
	}
}


package net.exkazuu.probe

import java.io.File
import java.util.List
import net.exkazuu.probe.git.GitManager
import net.exkazuu.probe.github.GithubRepositoryInfo
import net.exkazuu.probe.maven.MavenManager
import net.exkazuu.probe.sonar.SonarManager
import org.openqa.selenium.phantomjs.PhantomJSDriver
import org.openqa.selenium.phantomjs.PhantomJSDriverService
import org.openqa.selenium.remote.DesiredCapabilities

/**
 * A class for measuring metrics by execution SonarQube.
 *
 * @author Ryohei Takasawa
 */
class SonarExecutor {
	protected val File csvFile
	protected val List<GithubRepositoryInfo> infos
	val File mvnDir
	val int skipCount

	new(File csvFile, int skipCount, File mvnDir) {
		this.csvFile = csvFile
		this.skipCount = skipCount
		this.infos = GithubRepositoryInfo.readList(csvFile)
		this.mvnDir = mvnDir
		mvnDir.mkdirs()
	}

	def run() {
		val caps = new DesiredCapabilities
		caps.setCapability(
			PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,
			"C:/Program Files/phantomjs-1.9.7-windows/phantomjs.exe"
		)

		val driver = new PhantomJSDriver(caps)
		val sonar = new SonarManager(driver)
		infos.drop(skipCount).forEach [ info, i |
			try {
				if (info.killedMutantCountWithXMutator >= 0 && info.loc == -1) {
					System.out.println((i + skipCount + 1) + ": " + info.url)
					val userDir = new File(mvnDir.path, info.userName)
					val projectDir = new File(userDir.path, info.projectName)
					userDir.mkdirs()
					System.out.print("Clone repository ... ")
					new GitManager(projectDir).cloneAndCheckout(info.url, info.mainBranch, info.latestCommitSha)
					System.out.println("done")
					System.out.print("Execute sonar ... ")
					sonar.execute(new MavenManager(projectDir), info)
					System.out.println("done")
					GithubRepositoryInfo.write(csvFile, infos)
				}
			} catch (Exception e) {
			}
		]
		driver.close
	}

	def static void main(String[] args) {
		if (args.length <= 1) {
			System.out.println("Please specify two argument indicating a csv file and a skip count.")
			System.exit(-1)
		}

		val csvFile = new File(args.get(0))
		val skipCount = Integer.parseInt(args.get(1))
		val executor = new SonarExecutor(csvFile, skipCount, new File("repos"))
		executor.run()
	}
}


Add full build command for the context menu on .melange

package fr.inria.diverse.melange.ui.menu

import org.eclipse.core.commands.AbstractHandler
import org.eclipse.core.commands.ExecutionEvent
import org.eclipse.core.commands.ExecutionException
import org.eclipse.ui.handlers.HandlerUtil
import org.eclipse.swt.widgets.Shell
import org.eclipse.jface.viewers.ISelection
import org.eclipse.jface.viewers.IStructuredSelection
import org.eclipse.core.resources.IResource
import org.eclipse.core.resources.IncrementalProjectBuilder
import org.eclipse.jface.wizard.ProgressMonitorPart
import org.eclipse.core.runtime.jobs.Job
import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.core.runtime.Status

class Compile extends AbstractHandler{

	override execute(ExecutionEvent event) throws ExecutionException {

		val Job job = new Job("Full Melange build"){

			override protected run(IProgressMonitor monitor) {
				val Shell shell = HandlerUtil.getActiveShell(event)
		    	val ISelection sel = HandlerUtil.getActiveMenuSelection(event)
		    	val IStructuredSelection selection =  sel as IStructuredSelection
				val IResource resource = selection.firstElement as IResource
				val project = resource.project
				project.build(IncrementalProjectBuilder.FULL_BUILD, monitor)
				return Status.OK_STATUS
			}

		}
		job.schedule

		return null
	}
}


Add test util class to help find bad references in generated model

package fr.inria.diverse.trace.commons.testutil

import org.eclipse.emf.ecore.EObject
import java.util.Set
import java.util.HashSet
import java.util.Collection
import java.util.function.Predicate

class Investigation {

	public static def Set<EObject> findObjectThatPointTo(EObject root, Predicate<EObject> predicateReferencedObject) {
		val Set<EObject> result = new HashSet
		for (o : root.eAllContents.toSet) {
			for (f : o.eClass.EAllReferences) {
				val Set<EObject> allObjectsRefed = new HashSet
				val Object stuffRefed = o.eGet(f)
				if (f.many) {
					allObjectsRefed.addAll(stuffRefed as Collection<EObject>)
				} else {
					allObjectsRefed.add(stuffRefed as EObject)
				}
				if (allObjectsRefed.exists[y|predicateReferencedObject.test(y)]) {
					result.add(o)
				}
			}
		}
		return result
	}

}


Create stub for CustomEvent transformation

package de.wwu.md2.framework.generator.util.preprocessor

class ProcessCustomEvents {

	// main step that calls all substeps

	//   create entity

	//   create contentProvider for entity

	//   foreach CustomEvent: create CustomAction

	//   foreach CustomEvent: create __registerCustomEventName action and add it to startUpAction

	//   create setters to bind event and replace the original event binding with the set task

}


package eu.quanticol.carma.core.tests

import com.google.inject.Inject
import eu.quanticol.carma.core.carma.Model
import org.eclipse.xtext.junit4.InjectWith
import org.eclipse.xtext.junit4.XtextRunner
import org.eclipse.xtext.junit4.util.ParseHelper
import org.eclipse.xtext.junit4.validation.ValidationTestHelper
import org.eclipse.xtext.xbase.compiler.CompilationTestHelper
import org.junit.Test
import org.junit.runner.RunWith
import static extension org.junit.Assert.*
import eu.quanticol.carma.simulator.CarmaModel

@RunWith(typeof(XtextRunner))
@InjectWith(typeof(CARMAInjectorProviderCustom))
class Test_List_Error {
	@Inject extension ParseHelper<Model>
	@Inject extension ValidationTestHelper
	@Inject extension CompilationTestHelper

	CharSequence code = 	'''
fun real getElementAt( list<list<real>> l , int i , int j ){
	return l[i][j];
}

space Grid (){
	universe <int x, int y>
	nodes {
		[0,0];
	}
	connections{}
	areas{}
}

const DISTANCES = [: [:0.0, 1.0:], [:1.0, 1.0:] :];

component Robot(location myLocation){
	store{
		attrib location currentLocation := myLocation;
	}
	behaviour{
		ReadyToMove = move*[false]<>{}.kill;
	}
	init{ReadyToMove}
}

measure RobotsAt00 = #{Robot[ReadyToMove] | my.currentLocation == [0,0]};

system Test{
	space Grid()

	collective{
		new Robot([0,0]);
	}
	environment{
		store{
			attrib list<list<real>> attributes := [: [:0.0, 1.0:], [:1.0, 1.0:] :];
		}
		prob{}
		weight{}
		rate{
// This getElementAt call works. DISTANCE defined as a global constant.
//		move* {return getElementAt(DISTANCES, 0, 0);}
// This getElementAt call throws a compile error. LinkedList cannot be resolved to a variable.
		move* {return getElementAt(global.attributes, 0, 0);}
			default {
				return 1.0;
			}
		}
		update{}
	}
}

	'''

	@Test
	def void test_Parser(){
		code.parse.assertNoErrors
	}

	@Test
	def void test_Compiler(){
		class.classLoader.setJavaCompilerClassPath
		code.compile[
					var o = getCompiledClass.newInstance
			assertNotNull( o )
			assertTrue( o instanceof CarmaModel )
			var m = o as CarmaModel
			assertEquals( 2 , m.systems.length )
			assertEquals( 3 , m.measures.length )

	]
	}

}


package {
  import stdio.Sprite

  [SWF(width=0, height=0)]
  public class flash_test extends Sprite {
    public function main(): void {
      test_body()
    }
  }
}

Add colors to Flash test to ease debugging.

package {
  import stdio.Sprite

  [SWF(width=100, height=100)]
  public class flash_test extends Sprite {
    public function flash_test(): void {
      graphics.beginFill(0xff0000)
      graphics.drawRect(10, 10, 80, 80)
      graphics.endFill()
    }

    public function main(): void {
      graphics.beginFill(0x0000ff)
      graphics.drawRect(30, 30, 40, 40)
      graphics.endFill()

      test_body()
    }
  }
}


/*
#
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the MIT License as found
# in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licenses/mit-license.php.
#
# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of merchantability
# or fitness for a particular purpose. See the MIT License for full details.
*/

package com.rpath.raf.views
{
    import mx.core.UIComponent;
    import mx.events.ValidationResultEvent;

    import spark.components.Group;

    public class CompoundInputItem extends Group
    {
        public function CompoundInputItem()
        {
            super();

            // force height computation
            minHeight = 0;
        }

        [Bindable]
        public var inputFields:Array;

        public override function validationResultHandler(event:ValidationResultEvent):void
        {
            // let our specific input controls mark themselves appropriately
            for each (var elem:UIComponent in inputFields)
            {
                elem.validationResultHandler(event);
            }

            // propagate events beyond ourselves
            super.validationResultHandler(event);
        }

    }
}

Handle null in validation elem iteration

/*
#
# Copyright (c) 2009 rPath, Inc.
#
# This program is distributed under the terms of the MIT License as found
# in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/licenses/mit-license.php.
#
# This program is distributed in the hope that it will be useful, but
# without any warranty; without even the implied warranty of merchantability
# or fitness for a particular purpose. See the MIT License for full details.
*/

package com.rpath.raf.views
{
    import mx.core.UIComponent;
    import mx.events.ValidationResultEvent;

    import spark.components.Group;

    public class CompoundInputItem extends Group
    {
        public function CompoundInputItem()
        {
            super();

            // force height computation
            minHeight = 0;
        }

        [Bindable]
        public var inputFields:Array;

        public override function validationResultHandler(event:ValidationResultEvent):void
        {
            // let our specific input controls mark themselves appropriately
            for each (var elem:UIComponent in inputFields)
            {
                if (elem)
                    elem.validationResultHandler(event);
            }

            // propagate events beyond ourselves
            super.validationResultHandler(event);
        }

    }
}


package io.github.jwhile.impetus
{
    import flash.media.Sound;
    import flash.media.SoundChannel;

    public class ImpetusSound
    {
        private var url:String;
        private var sound:Sound;

        private var channels:Vector.<SoundChannel>;

        public function ImpetusSound(url:String):void
        {
            this.url = url;
            this.sound = new Sound();

            this.channels = new Vector.<SoundChannel>;
        }
    }
}

Load sound directly on constructor

package io.github.jwhile.impetus
{
    import flash.media.Sound;
    import flash.media.SoundChannel;
    import flash.net.URLRequest;

    public class ImpetusSound
    {
        private var sound:Sound;

        private var channels:Vector.<SoundChannel>;

        public function ImpetusSound(url:String):void
        {
            this.sound = new Sound();

            this.channels = new Vector.<SoundChannel>;

            this.sound.load(new URLRequest(url));
        }
    }
}


package org.flexunit.experimental.theories.internals.cases
{
	import org.flexunit.Assert;
	import org.flexunit.experimental.theories.internals.ParameterizedAssertionError;

	public class ParameterizedAssertionErrorCase
	{
		//TODO: Ensure that these tests and this test case are being implemented correctly.
		//It is currently impossible to test the stringValueOf function.

		[Test(description="Ensure that the ParameterizedAssertionError constructor is correctly assigning parameter values")]
		public function constructorTest():void {
			var targetException:Error = new Error();
			var methodName:String = "methodName";
			var params:Array = new Array("valueOne", "valueTwo");

			var parameterizedAssertionError:ParameterizedAssertionError = new ParameterizedAssertionError(targetException, methodName, "valueOne", "valueTwo");

			var message:String = methodName + " " + params.join( ", " );
			Assert.assertEquals( message, parameterizedAssertionError.message);
			Assert.assertEquals( targetException, parameterizedAssertionError.targetException );
		}

		[Test(description="Ensure that the join function is correctly joining the delimiter to the other parameters")]
		public function joinTest():void {
			var delimiter:String = ", ";
			var params:Array = new Array("valueOne", "valueTwo", "valueThree");

			var message:String = params.join( delimiter );
			Assert.assertEquals( message, ParameterizedAssertionError.join(delimiter, "valueOne", "valueTwo", "valueThree") );
		}
	}
}

Set test to ignore while stack trace is still under investigation

package org.flexunit.experimental.theories.internals.cases
{
	import org.flexunit.Assert;
	import org.flexunit.experimental.theories.internals.ParameterizedAssertionError;

	public class ParameterizedAssertionErrorCase
	{
		//TODO: Ensure that these tests and this test case are being implemented correctly.
		//It is currently impossible to test the stringValueOf function.

		[Ignore("Currently Ignoring Test as this functionality is under investigation due to Max stack overflow issue")]
		[Test(description="Ensure that the ParameterizedAssertionError constructor is correctly assigning parameter values")]
		public function constructorTest():void {
			var targetException:Error = new Error();
			var methodName:String = "methodName";
			var params:Array = new Array("valueOne", "valueTwo");

			var parameterizedAssertionError:ParameterizedAssertionError = new ParameterizedAssertionError(targetException, methodName, "valueOne", "valueTwo");

			var message:String = methodName + " " + params.join( ", " );
			Assert.assertEquals( message, parameterizedAssertionError.message);
			Assert.assertEquals( targetException, parameterizedAssertionError.targetException );
		}

		[Test(description="Ensure that the join function is correctly joining the delimiter to the other parameters")]
		public function joinTest():void {
			var delimiter:String = ", ";
			var params:Array = new Array("valueOne", "valueTwo", "valueThree");

			var message:String = params.join( delimiter );
			Assert.assertEquals( message, ParameterizedAssertionError.join(delimiter, "valueOne", "valueTwo", "valueThree") );
		}
	}
}


import Drawable;
import Lobe;
import Core;

class Brain{
    static var brain = new Array();
    var mSelectionManager:SelectionManager;
    static function makenewlobe(){
      var newmov=(new Lobe(_root,_root.getNextHighestDepth()));
      var topleft = new Point(100,40);
      var botright = new Point(200,140);
      newmov.commitBox(topleft, botright, 0);
              var keyListener = {};
        keyListener.onKeyDown = function()
        {
            var k = Key.getCode();
            if(k == Key.DELETEKEY){
                Brain.makenewlobe();
            }
        };
    }
    function Brain (root_mc:MovieClip) {
       mSelectionManager = new SelectionManager(root_mc);
    }
}

Delete is now a non-core function

import Drawable;
import Lobe;
import Core;

class Brain{
    static var brain = new Array();
    var mSelectionManager:SelectionManager;
    static function makenewlobe(){
      var newmov=(new Lobe(_root,_root.getNextHighestDepth()));
      var topleft = new Point(100,40);
      var botright = new Point(200,140);
      newmov.commitBox(topleft, botright, 0);
    }

    function Brain (root_mc:MovieClip) {
       mSelectionManager = new SelectionManager(root_mc);
               var keyListener = {};
        keyListener.onKeyDown = function()
        {
            var k = Key.getCode();
            if(k == Key.DELETEKEY){
                Brain.makenewlobe();
            }
        };
        Key.addListener( keyListener );
    }
}


// [ ] Variable declaration
let name: type = expression;

// [ ] Basic types (arrow)
/*

byte (8-bit, unsigned)
bool (1-bit[*])

int8
int16
int32
int64
int128

uint8
uint16
uint32
uint64
uint128

intptr (size of a pointer, signed)
uintptr (size of a pointer, unsigned)

char (32-bit, unsigned)

float16
float32
float64
float128

*/

// [ ] Expressions
// [ ]    - Add
// [ ]    - Subtract
// [ ]    - Multiply
// [ ]    - Divide
// [ ]    - Modulo
// [ ]    - Logical And
// [ ]    - Logical Or
// [ ]    - Logical Not
// [ ]    - Relational GT
// [ ]    - Relational GE
// [ ]    - Relational LT
// [ ]    - Relational LE
// [ ]    - Relational And
// [ ]    - Relational Or
// [ ]    - Bitwise And
// [ ]    - Bitwise Or
// [ ]    - Bitwise Xor
// [ ]    - Bitwise Not

// [ ] Pointers
// [ ]    - Type
// [ ]    - Address Of
// [ ]    - Dereference

// [ ] Cast

// [ ] Function declaration
def main() {
}

// [ ] Extern function declaration
extern def puts(s: *byte);

// [ ] Extern function declaration w/ABI
extern "stdcall" def CreateWindowExA();

// [ ] Function call (extern AND local)
main();
puts("Hello");

// [ ] Extern import
extern import "stdint.h";

// [ ] Module (namespace)
module cstdint { extern import "stdint.h"; }

// [ ] c module (built-in)
import "c";

/*

// [ ] Basic types (in C)
c.char
c.uchar
c.schar
c.int
c.uint
c.short
c.ushort
c.long
c.ulong
c.float
c.double
c.ldouble

*/

// [ ] BigInt
int  // (∞-bit, signed)


//
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package com.threerings.crowd.data {

public class ManagerCaller
{
    public function ManagerCaller (plobj :PlaceObject)
    {
        _plobj = plobj;
    }

    /**
     * Called to call a method on the manager.
     */
    public function invoke (method :String, args :Array = null) :void
    {
        _plobj.postMessage(method, args);
    }

    /** The place object we're thingy-ing for. */
    protected var _plobj :PlaceObject;
}
}

Change this instance back. Varargs are still a nightmare and should generally be avoided, but nobody's going to override this method and we're always calling a regular method on the server, not a varargs method.

//
// $Id$
//
// Narya library - tools for developing networked games
// Copyright (C) 2002-2007 Three Rings Design, Inc., All Rights Reserved
// http://www.threerings.net/code/narya/
//
// This library is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published
// by the Free Software Foundation; either version 2.1 of the License, or
// (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

package com.threerings.crowd.data {

public class ManagerCaller
{
    public function ManagerCaller (plobj :PlaceObject)
    {
        _plobj = plobj;
    }

    /**
     * Called to call a method on the manager.
     */
    public function invoke (method :String, ... args) :void
    {
        _plobj.postMessage(method, args);
    }

    /** The place object we're thingy-ing for. */
    protected var _plobj :PlaceObject;
}
}


package com.threerings.flex {

import mx.containers.HBox;

import mx.controls.Label;

import mx.controls.sliderClasses.Slider;

import mx.events.SliderEvent;

/**
 * A simple component that displays a label to the left of a slider.
 */
public class LabeledSlider extends HBox
{
    /** The slider, all public and accessable. Don't fuck it up! */
    public var slider :Slider;

    /**
     * Create a LabeledSlider holding the specified slider.
     */
    public function LabeledSlider (slider :Slider)
    {
        _label = new Label();
        _label.text = String(slider.value);

        addChild(_label);
        this.slider = slider;
        slider.showDataTip = false; // because we do it...
        addChild(slider);

        slider.addEventListener(SliderEvent.CHANGE, handleSliderChange, false, 0, true);
    }

    protected function handleSliderChange (event :SliderEvent) :void
    {
        _label.text = String(event.value);
    }

    protected var _label :Label;
}
}

Clean up my comment, this is in a public API (and my comment wasn't helpful).

package com.threerings.flex {

import mx.containers.HBox;

import mx.controls.Label;

import mx.controls.sliderClasses.Slider;

import mx.events.SliderEvent;

/**
 * A simple component that displays a label to the left of a slider.
 */
public class LabeledSlider extends HBox
{
    /** The actual slider. */
    public var slider :Slider;

    /**
     * Create a LabeledSlider holding the specified slider.
     */
    public function LabeledSlider (slider :Slider)
    {
        _label = new Label();
        _label.text = String(slider.value);

        addChild(_label);
        this.slider = slider;
        slider.showDataTip = false; // because we do it...
        addChild(slider);

        slider.addEventListener(SliderEvent.CHANGE, handleSliderChange, false, 0, true);
    }

    protected function handleSliderChange (event :SliderEvent) :void
    {
        _label.text = String(event.value);
    }

    protected var _label :Label;
}
}


package org.denivip.osmf.utils
{
	import org.osmf.utils.URL;

	public class Utils
	{
		public static function createFullUrl(rootUrl:String, url:String):String{

			if(url.search(/(ftp|file|https?):\/\/\/?/) == 0)
				return url;

			// other manipulations :)
			if(url.charAt(0) == '/'){
				return URL.getRootUrl(rootUrl) + url;
			}

			if(rootUrl.lastIndexOf('/') != rootUrl.length)
				rootUrl += '/';

			return rootUrl + url;
		}
	}
}

Fix issue where check for final slash was comparing zero-based index with length

package org.denivip.osmf.utils
{
	import org.osmf.utils.URL;

	public class Utils
	{
		public static function createFullUrl(rootUrl:String, url:String):String {
			if(url.search(/(ftp|file|https?):\/\/\/?/) == 0)
				return url;

			// other manipulations :)
			if(url.charAt(0) == '/'){
				return URL.getRootUrl(rootUrl) + url;
			}

			if(rootUrl.lastIndexOf('/') != rootUrl.length - 1)
				rootUrl += '/';

			return rootUrl + url;
		}
	}
}


package com.threerings.util {

import flash.net.URLRequest;
//import flash.net.navigateToURL; // function import

public class NetUtil
{
    /**
     * Convenience method to load a web page in the browser window without
     * having to worry about SecurityErrors in various conditions.
     */
    public static function navigateToURL (
            url :String, preferSameWindowOrTab :Boolean = true) :void
    {
        var ureq :URLRequest = new URLRequest(url);
        if (preferSameWindowOrTab) {
            try {
                flash.net.navigateToURL(ureq, "_self");
                return;
            } catch (err :SecurityError) {
                // ignore; fall back to using a blank window, below...
            }
        }

        // open in a blank window
        try {
            flash.net.navigateToURL(ureq);
        } catch (err :SecurityError) {
            Log.getLog(NetUtil).warning(
                "Unable to navigate to URL [e=" + err + "].");
        }
    }

}
}

Return true if we succeeded.

package com.threerings.util {

import flash.net.URLRequest;
//import flash.net.navigateToURL; // function import

public class NetUtil
{
    /**
     * Convenience method to load a web page in the browser window without
     * having to worry about SecurityErrors in various conditions.
     *
     * @return true if the url was unable to be loaded.
     */
    public static function navigateToURL (
            url :String, preferSameWindowOrTab :Boolean = true) :Boolean
    {
        var ureq :URLRequest = new URLRequest(url);
        if (preferSameWindowOrTab) {
            try {
                flash.net.navigateToURL(ureq, "_self");
                return true;
            } catch (err :SecurityError) {
                // ignore; fall back to using a blank window, below...
            }
        }

        // open in a blank window
        try {
            flash.net.navigateToURL(ureq);
            return true;
        } catch (err :SecurityError) {
            Log.getLog(NetUtil).warning(
                "Unable to navigate to URL [e=" + err + "].");
        }

        return false; // failure!
    }
}
}


package laml.display {
	import flash.display.DisplayObject;
	import flash.display.Sprite;

	public class Skin extends Sprite implements ISkin {

		public function getBitmapByName(alias:String):DisplayObject {
			if(hasOwnProperty(alias)) {
				return new this[alias]() as DisplayObject;
			}

			return null;
		}
	}
}

Put MX dependencies in skin

package laml.display {
	import flash.display.DisplayObject;
	import flash.display.Sprite;

	import mx.core.BitmapAsset;
	import mx.core.FontAsset;
	import mx.core.IFlexAsset;
	import mx.core.IFlexDisplayObject;
	import mx.core.SpriteAsset;

	public class Skin extends Sprite implements ISkin {
 		private var bitmapAsset:BitmapAsset;
		private var fontAsset:FontAsset;
		private var iFlexAsset:IFlexAsset;
		private var iFlexDisplayObject:IFlexDisplayObject;
		private var spriteAsset:SpriteAsset;

		public function getBitmapByName(alias:String):DisplayObject {
			if(hasOwnProperty(alias)) {
				return new this[alias]() as DisplayObject;
			}

			return null;
		}
	}
}


package Components
{
	[Bindable]
	public class Association
	{
		public var associatedNode:String;
		public var associatedLink:String;
		public var operatorIndex:int;

		public function Association(associatedNode:String,associatedLink:String,operatorIndex:int)
		{
			this.associatedLink = associatedLink;
			this.associatedNode = associatedNode;
			this.operatorIndex  = operatorIndex;
		}

	}
}

Order vairable added todecide order of association

package Components
{
	[Bindable]
	public class Association
	{
		public var associatedNode:String;
		public var associatedLink:String;
		public var operatorIndex:int;
		public var order:int=0;

		public function Association(associatedNode:String,associatedLink:String,operatorIndex:int,order:int)
		{
			this.associatedLink = associatedLink;
			this.associatedNode = associatedNode;
			this.operatorIndex  = operatorIndex;
			this.order=order;
		}

	}
}


package org.osflash.signals {
	import asunit4.ui.MinimalRunnerUI;
	import org.osflash.signals.AllTests;

	public class AllTestsRunner extends MinimalRunnerUI
	{
		public function AllTestsRunner()
		{
			run(org.osflash.signals.AllTests);
		}
	}
}

Put [SWF] tag in test runner app.

package org.osflash.signals {
	import asunit4.ui.MinimalRunnerUI;
	import org.osflash.signals.AllTests;

	[SWF(width='1000', height='800', backgroundColor='#333333', frameRate='31')]
	public class AllTestsRunner extends MinimalRunnerUI
	{
		public function AllTestsRunner()
		{
			run(org.osflash.signals.AllTests);
		}
	}
}


package com.axis.rtspclient {
  import flash.events.Event;
  import flash.external.ExternalInterface;
  import flash.utils.ByteArray;

  public class NALU extends Event {
    public static const NEW_NALU:String = "NEW_NALU";

    private var data:ByteArray;
    public var ntype:uint;
    public var nri:uint;
    public var timestamp:uint;
    public var bodySize:uint;

    public function NALU(ntype:uint, nri:uint, data:ByteArray, timestamp:uint) {
      super(NEW_NALU);

      this.data      = data;
      this.ntype     = ntype;
      this.nri       = nri;
      this.timestamp = timestamp;
      this.bodySize  = data.bytesAvailable;
    }

    public function appendData(idata:ByteArray):void {
      ByteArrayUtils.appendByteArray(data, idata);
      this.bodySize = data.bytesAvailable;
    }

    public function isIDR():Boolean {
      return (5 === ntype);
    }

    public function writeSize():uint {
      return 2 + 2 + 1 + data.bytesAvailable;
    }

    public function writeStream(output:ByteArray):void {
      output.writeUnsignedInt(data.bytesAvailable + 1); // NALU length + header
      output.writeByte((0x0 & 0x80) | (nri & 0x60) | (ntype & 0x1F)); // NAL header
      output.writeBytes(data, data.position);
    }
  }
}

Implement getPayload() method to extract SPS/PPS bytes

package com.axis.rtspclient {
  import flash.events.Event;
  import flash.external.ExternalInterface;
  import flash.utils.ByteArray;

  public class NALU extends Event {
    public static const NEW_NALU:String = "NEW_NALU";

    private var data:ByteArray;
    public var ntype:uint;
    public var nri:uint;
    public var timestamp:uint;
    public var bodySize:uint;

    public function NALU(ntype:uint, nri:uint, data:ByteArray, timestamp:uint) {
      super(NEW_NALU);

      this.data      = data;
      this.ntype     = ntype;
      this.nri       = nri;
      this.timestamp = timestamp;
      this.bodySize  = data.bytesAvailable;
    }

    public function appendData(idata:ByteArray):void {
      ByteArrayUtils.appendByteArray(data, idata);
      this.bodySize = data.bytesAvailable;
    }

    public function isIDR():Boolean {
      return (5 === ntype);
    }

    public function writeSize():uint {
      return 2 + 2 + 1 + data.bytesAvailable;
    }

    public function writeStream(output:ByteArray):void {
      output.writeUnsignedInt(data.bytesAvailable + 1); // NALU length + header
      output.writeByte((0x0 & 0x80) | (nri & 0x60) | (ntype & 0x1F)); // NAL header
      output.writeBytes(data, data.position);
    }

    public function getPayload():ByteArray {
      var payload:ByteArray = new ByteArray();
      data.position -= 1;
      data.readBytes(payload, 0, data.bytesAvailable);
      return payload;
    }
  }
}