Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-02-16 09:38:38 -0500
committerHenrik Rentz-Reichert2018-02-16 10:35:57 -0500
commit2e3a3cc96a07e27faa05b6a7224b1b10bc6ec86b (patch)
tree5b8655cf0040b1a2d687c162c52f124c6e8be466 /plugins/org.eclipse.etrice.generator.java/src/org
parent6ad339c4c13a2b032235ad9a1c4341ea33394013 (diff)
downloadorg.eclipse.etrice-2e3a3cc96a07e27faa05b6a7224b1b10bc6ec86b.tar.gz
org.eclipse.etrice-2e3a3cc96a07e27faa05b6a7224b1b10bc6ec86b.tar.xz
org.eclipse.etrice-2e3a3cc96a07e27faa05b6a7224b1b10bc6ec86b.zip
optimized length of history array for C generation
Also reduced the number of warnings. Change-Id: I2316274b4d7ebed7dc38549aa03e7245a84920a4
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.java/src/org')
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend10
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend10
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend14
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/VariableServiceGen.xtend4
8 files changed, 23 insertions, 23 deletions
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
index 6e248ab2f..6d045f7f9 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassDataGen.xtend
@@ -51,7 +51,7 @@ class ActorClassDataGen {
val ac = xpac.actorClass
val clsname = ac.name+"_DataObject"
val models = root.getReferencedModels(ac)
- val baseClass = if (ac.base!=null) "extends "+ac.actorBase.name+"_DataObject " else ""
+ val baseClass = if (ac.base!==null) "extends "+ac.actorBase.name+"_DataObject " else ""
'''
package «ac.getPackage»;
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend
index 2dc1894dc..bb25bc481 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ConfigGenAddon.xtend
@@ -46,7 +46,7 @@ class ConfigGenAddon {
«ENDFOR»
«FOR pi : ai.orderedIfItemInstances»
«var attribs = getPortClass(pi.interfaceItem)?.attributes»
- «IF attribs != null»
+ «IF attribs !== null»
«FOR a : attribs»
«applyInstanceConfig(pi, aiVariableName+"."+invokeGetter(pi.name, null), new ArrayList<Attribute>().union(a))»
«ENDFOR»
@@ -61,12 +61,12 @@ class ConfigGenAddon {
switch aType {
PrimitiveType: {
var value = typeHelpers.getAttrInstanceConfigValue(path, instance)
- if(value != null)
+ if(value !== null)
initGen.genAttributeInitializer(a, toValueLiteral(aType, value), invokes)
}
EnumerationType: {
var value = typeHelpers.getAttrInstanceConfigValue(path, instance)
- if(value != null)
+ if(value !== null)
initGen.genAttributeInitializer(a, value, invokes)
}
DataClass:
@@ -133,10 +133,10 @@ class ConfigGenAddon {
PrimitiveType:{
var temp = null as String
'''
- «IF (temp = dataConfigExt.getAttrClassConfigMinValue(ac, path)) != null»
+ «IF (temp = dataConfigExt.getAttrClassConfigMinValue(ac, path)) !== null»
public static «aType.minMaxType» MIN_«varNamePath» = «aType.toValueLiteral(temp)»;
«ENDIF»
- «IF (temp = dataConfigExt.getAttrClassConfigMaxValue(ac, path)) != null»
+ «IF (temp = dataConfigExt.getAttrClassConfigMaxValue(ac, path)) !== null»
public static «aType.minMaxType» MAX_«varNamePath» = «aType.toValueLiteral(temp)»;
«ENDIF»
'''
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
index 6f10d38d0..a4530f774 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend
@@ -60,7 +60,7 @@ class DataClassGen {
«dc.userCode(1)»
- public class «dc.name»«IF dc.base!=null» extends «dc.base.name»«ENDIF» implements Serializable {
+ public class «dc.name»«IF dc.base!==null» extends «dc.base.name»«ENDIF» implements Serializable {
private static final long serialVersionUID = «(dc.package+dc.name).hashCode»L;
@@ -83,7 +83,7 @@ class DataClassGen {
// constructor using fields
public «dc.name»(«dc.argList») {
- «IF dc.base!=null»
+ «IF dc.base!==null»
super(«dc.base.paramList»);
«ELSE»
super();
@@ -109,10 +109,10 @@ class DataClassGen {
def paramList(DataClass _dc) {
var result = ""
var dc = _dc
- while (dc!=null) {
+ while (dc!==null) {
result = dc.attributes.paramList.toString + result
dc = dc.base
- if (dc!=null)
+ if (dc!==null)
result = ", "+result
}
return result
@@ -129,7 +129,7 @@ class DataClassGen {
def private deepCopy(DataClass _dc) {
var result = ""
var dc = _dc
- while (dc!=null) {
+ while (dc!==null) {
result = deepCopy(dc.attributes).toString + result
dc = dc.base
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend
index f1506768c..302dd5929 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/Initialization.xtend
@@ -51,20 +51,20 @@ class Initialization {
switch (aType) {
case (a.type.ref):
- if (a.defaultValueLiteral != null)
+ if (a.defaultValueLiteral !== null)
attributeInit(a, a.defaultValueLiteral)
else if (languageExt.needsInitialization(a))
attributeInit(a, languageExt.nullPointer)
PrimitiveType: {
var value = getDataConfigValue(new ArrayList<Attribute>.union(a), roomClass)
- if(value == null) value = a.defaultValueLiteral
- if(value != null) attributeInit(a, languageExt.toValueLiteral(aType, value)) else if(!useClassDefaultsOnly ||
+ if(value === null) value = a.defaultValueLiteral
+ if(value !== null) attributeInit(a, languageExt.toValueLiteral(aType, value)) else if(!useClassDefaultsOnly ||
languageExt.needsInitialization(a)) attributeInit(a, languageExt.defaultValue(aType))
}
EnumerationType: {
var value = getDataConfigValue(new ArrayList<Attribute>.union(a), roomClass)
- if(value == null) value = a.defaultValueLiteral
- if(value != null) attributeInit(a, languageExt.toEnumLiteral(aType, value)) else if(!useClassDefaultsOnly ||
+ if(value === null) value = a.defaultValueLiteral
+ if(value !== null) attributeInit(a, languageExt.toEnumLiteral(aType, value)) else if(!useClassDefaultsOnly ||
languageExt.needsInitialization(a)) attributeInit(a, languageExt.defaultValue(aType))
}
default:
@@ -85,11 +85,11 @@ class Initialization {
'''
PrimitiveType: {
var value = getDataConfigValue(path, roomClass)
- return if(value != null) attributeInit(path, languageExt.toValueLiteral(aType, value))
+ return if(value !== null) attributeInit(path, languageExt.toValueLiteral(aType, value))
}
EnumerationType: {
var value = getDataConfigValue(path, roomClass)
- return if(value != null) attributeInit(path, languageExt.toEnumLiteral(aType, value))
+ return if(value !== null) attributeInit(path, languageExt.toEnumLiteral(aType, value))
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
index 67e516e5d..e77e89409 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeGen.xtend
@@ -64,7 +64,7 @@ class NodeGen {
for (nr : ETMapUtil::getNodeRefs()) {
for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
val ssi = root.getInstance(instpath) as SubSystemInstance
- if (ssi!=null && ssi.subSystemClass.validGenerationLocation) {
+ if (ssi!==null && ssi.subSystemClass.validGenerationLocation) {
val wired = sscc2wired.get(ssi.subSystemClass)
val path = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.xtend
index 336b5523b..987c01008 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/NodeRunnerGen.xtend
@@ -35,7 +35,7 @@ class NodeRunnerGen {
for (nr : ETMapUtil::getNodeRefs()) {
for (instpath : ETMapUtil::getSubSystemInstancePaths(nr)) {
val ssi = root.getInstance(instpath) as SubSystemInstance
- if (ssi!=null && ssi.subSystemClass.validGenerationLocation) {
+ if (ssi!==null && ssi.subSystemClass.validGenerationLocation) {
val file = nr.getJavaClassName(ssi)+"Runner.java"
val filepath = ssi.subSystemClass.generationTargetPath+ssi.subSystemClass.getPath
val infopath = ssi.subSystemClass.generationInfoPath+ssi.subSystemClass.getPath
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
index f342e9f87..369d92c64 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.xtend
@@ -173,7 +173,7 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
}
}
- «IF pclass!=null»
+ «IF pclass!==null»
«pclass.attributes.attributes»
««« // TODO JH: Avoid collision attr getters/setter <-> user operations
«attributeSettersGettersImplementation(pclass.attributes, null)»
diff --git a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/VariableServiceGen.xtend b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/VariableServiceGen.xtend
index 7aeb82895..fe827aeac 100644
--- a/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/VariableServiceGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/VariableServiceGen.xtend
@@ -167,8 +167,8 @@ class VariableServiceGen {
def private genMinMaxCheck(List<Attribute> path, ActorClass ac){
var a = path.last
var aVarName = path.toAbsolutePath("_")
- var min = configExt.getAttrClassConfigMinValue(ac, path) != null
- var max = configExt.getAttrClassConfigMaxValue(ac, path) != null
+ var min = configExt.getAttrClassConfigMinValue(ac, path) !== null
+ var max = configExt.getAttrClassConfigMaxValue(ac, path) !== null
if(min || max)
'''
«IF a.size>0»for(«a.type.type.typeName» e : «aVarName»)

Back to the top