Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2018-11-23 08:08:16 -0500
committerHenrik Rentz-Reichert2018-11-23 11:07:24 -0500
commit5f90e312dbeeffaa057b682e3becb2cee79f6ea0 (patch)
tree714ee95ab99632e9f6a612024ae28458e0c2bce1 /plugins/org.eclipse.etrice.generator.cpp
parent4c57977d9e3f098ffae44ee5f3373878b351feca (diff)
downloadorg.eclipse.etrice-5f90e312dbeeffaa057b682e3becb2cee79f6ea0.tar.gz
org.eclipse.etrice-5f90e312dbeeffaa057b682e3becb2cee79f6ea0.tar.xz
org.eclipse.etrice-5f90e312dbeeffaa057b682e3becb2cee79f6ea0.zip
reduced warnings in eTrice Java and Xtend sources
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp')
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend14
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend14
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend6
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend6
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend11
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend2
9 files changed, 28 insertions, 30 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF b/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
index ef9eb9cb5..f25a85762 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.etrice.generator.cpp/META-INF/MANIFEST.MF
@@ -21,3 +21,4 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Export-Package: org.eclipse.etrice.generator.cpp,
org.eclipse.etrice.generator.cpp.gen,
org.eclipse.etrice.generator.cpp.setup
+Automatic-Module-Name: org.eclipse.etrice.generator.cpp
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
index 031979876..0991f4d33 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ConfigGenAddon.xtend
@@ -43,13 +43,13 @@ class ConfigGenAddon {
// For SubSystemClassGen
- def public genActorInstanceConfig(ActorInstance ai, String aiVariableName){'''
+ def genActorInstanceConfig(ActorInstance ai, String aiVariableName){'''
«FOR a : ai.actorClass.allAttributes»
«applyInstanceConfig(ai, aiVariableName, new ArrayList<Attribute>().union(a))»
«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»
@@ -77,7 +77,7 @@ class ConfigGenAddon {
// TODO-Enum
if(aType.primitive){
var value = typeHelpers.getAttrInstanceConfigValue(path, instance)
- if(value == null)
+ if(value === null)
''''''
else if(a.size == 0 || aType.characterType)
'''«invokes».«a.name.invokeSetter(null, (aType as PrimitiveType).toValueLiteral(value))»;'''
@@ -100,7 +100,7 @@ class ConfigGenAddon {
// For ActorClassGen
- def public genDynConfigGetterSetter(ActorClass ac){'''
+ def genDynConfigGetterSetter(ActorClass ac){'''
«FOR a : dataConfigExt.getDynConfigReadAttributes(ac)»
public «a.type.type.typeName»«IF a.size>0»[]«ENDIF» get«a.name.toFirstUpper»(){
if(lock_«a.name» == null)
@@ -130,7 +130,7 @@ class ConfigGenAddon {
«ENDFOR»
'''}
- def public genMinMaxConstants(ActorClass ac){
+ def genMinMaxConstants(ActorClass ac){
var result = '''
«FOR a : ac.attributes»
«genMinMaxConstantsRec(ac, a.name, new ArrayList<Attribute>().union(a))»
@@ -159,10 +159,10 @@ class ConfigGenAddon {
{
var aType = (path.last.type.type as PrimitiveType)
'''
- «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.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
index d34e5375a..1cb380830 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/DataClassGen.xtend
@@ -56,7 +56,7 @@ class DataClassGen {
«generateIncludeGuardBegin(dc, '')»
#include "common/etDatatypesCpp.hpp"
- «IF dc.base!=null»#include "«dc.base.path»«dc.base.name».h"«ENDIF»
+ «IF dc.base!==null»#include "«dc.base.path»«dc.base.name».h"«ENDIF»
«FOR classes : root.getReferencedDataClasses(dc)»
#include "«classes.path»«classes.name».h"
«ENDFOR»
@@ -72,7 +72,7 @@ class DataClassGen {
«dc.generateNamespaceBegin»
- class «dc.name»«IF dc.base!=null» : public «dc.base.name»«ENDIF» {
+ class «dc.name»«IF dc.base!==null» : public «dc.base.name»«ENDIF» {
public:
«helpers.userCode(dc.userCode2)»
@@ -143,7 +143,7 @@ class DataClassGen {
«dc.name»& «dc.name»::operator=(const «dc.name»& rhs)
{
if (this == &rhs) { return *this; };
- «IF dc.base!=null»«dc.base.name»::operator=(rhs);«ENDIF»
+ «IF dc.base!==null»«dc.base.name»::operator=(rhs);«ENDIF»
«FOR attr : dc.attributes»
this->«attr.name» = rhs.«attr.name»;
«ENDFOR»
@@ -160,7 +160,7 @@ class DataClassGen {
val extension initHelper = initHelper
var initList = <CharSequence>newArrayList
- if(dataClass.base != null) initList += dataClass.base.name + '()'
+ if(dataClass.base !== null) initList += dataClass.base.name + '()'
initList += dataClass.attributes.map['''«name»(«initializerListValue»)''']
initList.generateCtorInitializerList
@@ -170,7 +170,7 @@ class DataClassGen {
val extension initHelper = initHelper
var initList = <CharSequence>newArrayList
- if(dataClass.base != null) initList += dataClass.base.name + '(rhs)'
+ if(dataClass.base !== null) initList += dataClass.base.name + '(rhs)'
initList += dataClass.attributes.map['''«name»(rhs.«name»)''']
initList.generateCtorInitializerList
@@ -180,7 +180,7 @@ class DataClassGen {
val extension initHelper = initHelper
var initList = <CharSequence>newArrayList
- if(dataClass.base != null)
+ if(dataClass.base !== null)
initList += '''«dataClass.base.name»(«dataClass.base.allAttributes.map[name].join(', ')»)'''
initList += dataClass.attributes.map['''«name»(«name»)''']
@@ -222,7 +222,7 @@ class DataClassGen {
def 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.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
index 9131665c3..ded45f78b 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/Initialization.xtend
@@ -40,7 +40,7 @@ class Initialization {
* Generate array and struct initialization
*/
def genExtraInitializers(Iterable<Attribute> attributes) {
- val extraInitAttrs = attributes.filter[initializerListValue == null && initValue != null && initValue.startsWith('{')]
+ val extraInitAttrs = attributes.filter[initializerListValue === null && initValue !== null && initValue.startsWith('{')]
if(extraInitAttrs.empty) return ''
'''
// extra initialization
@@ -57,12 +57,12 @@ class Initialization {
def String getInitializerListValue(Attribute attribute) {
val initValue = attribute.initValue
- return if(initValue != null && initValue.startsWith('{')) null else initValue
+ return if(initValue !== null && initValue.startsWith('{')) null else initValue
}
def protected getInitValue(Attribute attribute) {
switch it : attribute {
- case defaultValueLiteral != null: defaultValueLiteral
+ case defaultValueLiteral !== null: defaultValueLiteral
case type.ref: languageExt.nullPointer
default: languageExt.defaultValue(type.type)
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
index f5c5bcf89..eda8112e2 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/MainGen.xtend
@@ -35,7 +35,7 @@ class MainGen {
prepFS.prepare
for (e: resource.contents){
if (e instanceof Root) {
- doGenerate(e as Root)
+ doGenerate(e)
}
}
}
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
index bea58540a..da7cbef94 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
@@ -54,7 +54,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.getPath
@@ -71,7 +71,7 @@ class NodeGen {
def generateHeaderFile(Root root, SubSystemInstance comp, WiredSubSystemClass wired, Collection<PhysicalThread> usedThreads) {
val cc = comp.subSystemClass
- val models = root.getReferencedModels(cc)
+// val models = root.getReferencedModels(cc)
val nr = ETMapUtil::getNodeRef(comp)
val clsname = nr.getCppClassName(comp)
val threads = nr.type.threads.filter(t|usedThreads.contains(t))
@@ -170,7 +170,7 @@ class NodeGen {
def generateSourceFile(Root root, SubSystemInstance comp, WiredSubSystemClass wired, Collection<PhysicalThread> usedThreads) {
val cc = comp.subSystemClass
- val models = root.getReferencedModels(cc)
+// val models = root.getReferencedModels(cc)
val nr = ETMapUtil::getNodeRef(comp)
val clsname = nr.getCppClassName(comp)
val threads = nr.type.threads.filter(t|usedThreads.contains(t))
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend
index 4ae998776..575cb51f1 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeRunnerGen.xtend
@@ -39,7 +39,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 filepath = ssi.subSystemClass.getPath
fileIO.generateFile("generating SubSystemRunner declaration", filepath + nr.getCppClassName(ssi)+"Runner.h", root.generateHeaderFile(ssi))
fileIO.generateFile("generating SubSystemRunner implementation", filepath + nr.getCppClassName(ssi)+"Runner.cpp", root.generateSourceFile(ssi))
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
index 9cb81b539..815e4c17e 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/ProtocolClassGen.xtend
@@ -529,17 +529,14 @@ class ProtocolClassGen extends GenericProtocolClassGenerator {
override getMessageID(Message msg, InterfaceItem item) {
if (item instanceof Port) {
- var p = item as Port;
- var direction = if (p.isConjugated())"OUT_" else "IN_"
- return enumInUse(p.getProtocol().getName(), direction+msg.getName())
+ var direction = if (item.isConjugated())"OUT_" else "IN_"
+ return enumInUse(item.getProtocol().getName(), direction+msg.getName())
}
else if (item instanceof SAP) {
- var sap = item as SAP;
- return enumInUse(sap.getProtocol().getName(), "OUT_"+msg.getName())
+ return enumInUse(item.getProtocol().getName(), "OUT_"+msg.getName())
}
else if (item instanceof SPP) {
- var spp = item as SPP;
- return enumInUse(spp.getProtocol().getName(), "IN_"+msg.getName())
+ return enumInUse(item.getProtocol().getName(), "IN_"+msg.getName())
}
return "unknown interface item";
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
index 6cbb9d3e4..9d0344a3c 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/StateMachineGen.xtend
@@ -78,7 +78,7 @@ class StateMachineGen extends GenericStateMachineGenerator {
'''
}
- override public stateType() {
+ override stateType() {
"etInt16"
}

Back to the top