From 370b5415a12123dda5e2b5c1cb90fda6c4ef4cfe Mon Sep 17 00:00:00 2001 From: Michael Pollmeier Date: Wed, 17 Apr 2024 12:49:11 +0200 Subject: [PATCH] codegen: newnodes: propertiesMap should not contain default value properties (#174) this is now the same behaviour as for OverflowDB --- .../codegen/DomainClassesGenerator.scala | 2 +- .../generated/nodes/Annotation.scala | 10 +++++----- .../generated/nodes/AnnotationLiteral.scala | 8 ++++---- .../generated/nodes/AnnotationParameter.scala | 4 ++-- .../nodes/AnnotationParameterAssign.scala | 4 ++-- .../generated/nodes/ArrayInitializer.scala | 6 +++--- .../generated/nodes/Binding.scala | 6 +++--- .../generated/nodes/Block.scala | 8 ++++---- .../generated/nodes/Call.scala | 16 ++++++++-------- .../generated/nodes/ClosureBinding.scala | 2 +- .../generated/nodes/Comment.scala | 6 +++--- .../generated/nodes/ConfigFile.scala | 4 ++-- .../generated/nodes/ControlStructure.scala | 10 +++++----- .../generated/nodes/Dependency.scala | 4 ++-- .../generated/nodes/FieldIdentifier.scala | 8 ++++---- .../generated/nodes/File.scala | 8 ++++---- .../generated/nodes/Identifier.scala | 10 +++++----- .../generated/nodes/Import.scala | 4 ++-- .../generated/nodes/JumpLabel.scala | 8 ++++---- .../generated/nodes/JumpTarget.scala | 10 +++++----- .../generated/nodes/KeyValuePair.scala | 4 ++-- .../generated/nodes/Literal.scala | 8 ++++---- .../generated/nodes/Local.scala | 8 ++++---- .../generated/nodes/Location.scala | 16 ++++++++-------- .../generated/nodes/Member.scala | 12 ++++++------ .../generated/nodes/MetaData.scala | 6 +++--- .../generated/nodes/Method.scala | 18 +++++++++--------- .../generated/nodes/MethodParameterIn.scala | 14 +++++++------- .../generated/nodes/MethodParameterOut.scala | 14 +++++++------- .../generated/nodes/MethodRef.scala | 10 +++++----- .../generated/nodes/MethodReturn.scala | 8 ++++---- .../generated/nodes/Modifier.scala | 6 +++--- .../generated/nodes/Namespace.scala | 6 +++--- .../generated/nodes/NamespaceBlock.scala | 10 +++++----- .../generated/nodes/Return.scala | 6 +++--- .../generated/nodes/Tag.scala | 4 ++-- .../generated/nodes/TemplateDom.scala | 8 ++++---- .../generated/nodes/Type.scala | 6 +++--- .../generated/nodes/TypeArgument.scala | 4 ++-- .../generated/nodes/TypeDecl.scala | 16 ++++++++-------- .../generated/nodes/TypeParameter.scala | 6 +++--- .../generated/nodes/TypeRef.scala | 8 ++++---- .../generated/nodes/Unknown.scala | 12 ++++++------ 43 files changed, 174 insertions(+), 174 deletions(-) diff --git a/domain-classes-generator/src/main/scala/flatgraph/codegen/DomainClassesGenerator.scala b/domain-classes-generator/src/main/scala/flatgraph/codegen/DomainClassesGenerator.scala index a814e77a..78e7e27a 100644 --- a/domain-classes-generator/src/main/scala/flatgraph/codegen/DomainClassesGenerator.scala +++ b/domain-classes-generator/src/main/scala/flatgraph/codegen/DomainClassesGenerator.scala @@ -296,7 +296,7 @@ class DomainClassesGenerator(schema: Schema) { case one: Cardinality.One[?] => newNodeProps.append(s"var $pname: $ptyp = ${unpackDefault(p.valueType, one.default)}") newNodeFluent.append(s"def $pname(value: $ptyp): this.type = {this.$pname = value; this }") - propDictItems.append(s"""res.put("${p.name}", this.$pname )""") + propDictItems.append(s"""if ((${unpackDefault(p.valueType, one.default)}) != this.$pname) res.put("${p.name}", this.$pname )""") flattenItems.append(s"""interface.insertProperty(this, ${propertyKindByProperty(p)}, Iterator(this.$pname))""") } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Annotation.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Annotation.scala index fde1fe9e..405df551 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Annotation.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Annotation.scala @@ -10,14 +10,14 @@ trait AnnotationBase extends AbstractNode with ExpressionBase with StaticType[An override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("FULL_NAME", this.fullName) + if (("": String) != this.fullName) res.put("FULL_NAME", this.fullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationLiteral.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationLiteral.scala index 3b84c20c..be312c60 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationLiteral.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationLiteral.scala @@ -10,13 +10,13 @@ trait AnnotationLiteralBase extends AbstractNode with ExpressionBase with Static override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameter.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameter.scala index 89b1ca00..24a1370c 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameter.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameter.scala @@ -10,10 +10,10 @@ trait AnnotationParameterBase extends AbstractNode with AstNodeBase with StaticT override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameterAssign.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameterAssign.scala index bd98daf5..7d7b9b6f 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameterAssign.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/AnnotationParameterAssign.scala @@ -13,10 +13,10 @@ trait AnnotationParameterAssignBase override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ArrayInitializer.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ArrayInitializer.scala index 61d410eb..58d3f05f 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ArrayInitializer.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ArrayInitializer.scala @@ -10,12 +10,12 @@ trait ArrayInitializerBase extends AbstractNode with ExpressionBase with StaticT override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Binding.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Binding.scala index e62c9c1f..34db3be5 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Binding.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Binding.scala @@ -10,9 +10,9 @@ trait BindingBase extends AbstractNode with StaticType[BindingEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("METHOD_FULL_NAME", this.methodFullName) - res.put("NAME", this.name) - res.put("SIGNATURE", this.signature) + if (("": String) != this.methodFullName) res.put("METHOD_FULL_NAME", this.methodFullName) + if (("": String) != this.name) res.put("NAME", this.name) + if (("": String) != this.signature) res.put("SIGNATURE", this.signature) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Block.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Block.scala index 48ae63d4..ee8899cf 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Block.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Block.scala @@ -15,17 +15,17 @@ trait BlockBase extends AbstractNode with ExpressionBase with StaticType[BlockEM override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Call.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Call.scala index c96f05b2..5b742130 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Call.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Call.scala @@ -18,21 +18,21 @@ trait CallBase extends AbstractNode with CallReprBase with ExpressionBase with S override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("DISPATCH_TYPE", this.dispatchType) + if (("": String) != this.dispatchType) res.put("DISPATCH_TYPE", this.dispatchType) val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("METHOD_FULL_NAME", this.methodFullName) - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.methodFullName) res.put("METHOD_FULL_NAME", this.methodFullName) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("SIGNATURE", this.signature) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.signature) res.put("SIGNATURE", this.signature) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ClosureBinding.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ClosureBinding.scala index 12789ea5..c66c6569 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ClosureBinding.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ClosureBinding.scala @@ -16,7 +16,7 @@ trait ClosureBindingBase extends AbstractNode with StaticType[ClosureBindingEMT] val res = new java.util.HashMap[String, Any]() this.closureBindingId.foreach { p => res.put("CLOSURE_BINDING_ID", p) } this.closureOriginalName.foreach { p => res.put("CLOSURE_ORIGINAL_NAME", p) } - res.put("EVALUATION_STRATEGY", this.evaluationStrategy) + if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Comment.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Comment.scala index 106cb094..d8de66a1 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Comment.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Comment.scala @@ -10,11 +10,11 @@ trait CommentBase extends AbstractNode with AstNodeBase with StaticType[CommentE override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("FILENAME", this.filename) + if (("": String) != this.filename) res.put("FILENAME", this.filename) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ConfigFile.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ConfigFile.scala index fb2d1b16..fd01d899 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ConfigFile.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ConfigFile.scala @@ -10,8 +10,8 @@ trait ConfigFileBase extends AbstractNode with StaticType[ConfigFileEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CONTENT", this.content) - res.put("NAME", this.name) + if (("": String) != this.content) res.put("CONTENT", this.content) + if (("": String) != this.name) res.put("NAME", this.name) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ControlStructure.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ControlStructure.scala index 1e83e3c3..8862cff1 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ControlStructure.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/ControlStructure.scala @@ -10,14 +10,14 @@ trait ControlStructureBase extends AbstractNode with ExpressionBase with StaticT override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("CONTROL_STRUCTURE_TYPE", this.controlStructureType) + if (("": String) != this.controlStructureType) res.put("CONTROL_STRUCTURE_TYPE", this.controlStructureType) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) - res.put("PARSER_TYPE_NAME", this.parserTypeName) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.parserTypeName) res.put("PARSER_TYPE_NAME", this.parserTypeName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Dependency.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Dependency.scala index f955af54..ce4b3db4 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Dependency.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Dependency.scala @@ -11,8 +11,8 @@ trait DependencyBase extends AbstractNode with StaticType[DependencyEMT] { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() this.dependencyGroupId.foreach { p => res.put("DEPENDENCY_GROUP_ID", p) } - res.put("NAME", this.name) - res.put("VERSION", this.version) + if (("": String) != this.name) res.put("NAME", this.name) + if (("": String) != this.version) res.put("VERSION", this.version) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/FieldIdentifier.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/FieldIdentifier.scala index fa6f6da6..eb1f6277 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/FieldIdentifier.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/FieldIdentifier.scala @@ -10,13 +10,13 @@ trait FieldIdentifierBase extends AbstractNode with ExpressionBase with StaticTy override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CANONICAL_NAME", this.canonicalName) - res.put("CODE", this.code) + if (("": String) != this.canonicalName) res.put("CANONICAL_NAME", this.canonicalName) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/File.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/File.scala index fae0971e..2db5557f 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/File.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/File.scala @@ -10,13 +10,13 @@ trait FileBase extends AbstractNode with AstNodeBase with StaticType[FileEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("CONTENT", this.content) + if (("": String) != this.content) res.put("CONTENT", this.content) this.hash.foreach { p => res.put("HASH", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Identifier.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Identifier.scala index 43b0a173..aa083b96 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Identifier.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Identifier.scala @@ -16,18 +16,18 @@ trait IdentifierBase extends AbstractNode with ExpressionBase with StaticType[Id override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Import.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Import.scala index f101d3f2..41dd168f 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Import.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Import.scala @@ -17,7 +17,7 @@ trait ImportBase extends AbstractNode with AstNodeBase with StaticType[ImportEMT override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.explicitAs.foreach { p => res.put("EXPLICIT_AS", p) } this.importedAs.foreach { p => res.put("IMPORTED_AS", p) } @@ -25,7 +25,7 @@ trait ImportBase extends AbstractNode with AstNodeBase with StaticType[ImportEMT this.isExplicit.foreach { p => res.put("IS_EXPLICIT", p) } this.isWildcard.foreach { p => res.put("IS_WILDCARD", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpLabel.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpLabel.scala index c4ac12bb..8935a453 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpLabel.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpLabel.scala @@ -10,12 +10,12 @@ trait JumpLabelBase extends AbstractNode with AstNodeBase with StaticType[JumpLa override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) - res.put("PARSER_TYPE_NAME", this.parserTypeName) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.parserTypeName) res.put("PARSER_TYPE_NAME", this.parserTypeName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpTarget.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpTarget.scala index 4c3bf890..29601ad2 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpTarget.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/JumpTarget.scala @@ -10,13 +10,13 @@ trait JumpTargetBase extends AbstractNode with CfgNodeBase with StaticType[JumpT override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) - res.put("CODE", this.code) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) - res.put("PARSER_TYPE_NAME", this.parserTypeName) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.parserTypeName) res.put("PARSER_TYPE_NAME", this.parserTypeName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/KeyValuePair.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/KeyValuePair.scala index 60b5c911..8bdc216e 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/KeyValuePair.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/KeyValuePair.scala @@ -10,8 +10,8 @@ trait KeyValuePairBase extends AbstractNode with StaticType[KeyValuePairEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("KEY", this.key) - res.put("VALUE", this.value) + if (("": String) != this.key) res.put("KEY", this.key) + if (("": String) != this.value) res.put("VALUE", this.value) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Literal.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Literal.scala index 766c9ac4..65d5dcf8 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Literal.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Literal.scala @@ -15,17 +15,17 @@ trait LiteralBase extends AbstractNode with ExpressionBase with StaticType[Liter override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Local.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Local.scala index 36cbb266..a4ce410e 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Local.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Local.scala @@ -18,16 +18,16 @@ trait LocalBase extends AbstractNode with AstNodeBase with DeclarationBase with import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() this.closureBindingId.foreach { p => res.put("CLOSURE_BINDING_ID", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Location.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Location.scala index 436a6403..18a63246 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Location.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Location.scala @@ -20,15 +20,15 @@ trait LocationBase extends AbstractNode with StaticType[LocationEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CLASS_NAME", this.className) - res.put("CLASS_SHORT_NAME", this.classShortName) - res.put("FILENAME", this.filename) + if (("": String) != this.className) res.put("CLASS_NAME", this.className) + if (("": String) != this.classShortName) res.put("CLASS_SHORT_NAME", this.classShortName) + if (("": String) != this.filename) res.put("FILENAME", this.filename) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("METHOD_FULL_NAME", this.methodFullName) - res.put("METHOD_SHORT_NAME", this.methodShortName) - res.put("NODE_LABEL", this.nodeLabel) - res.put("PACKAGE_NAME", this.packageName) - res.put("SYMBOL", this.symbol) + if (("": String) != this.methodFullName) res.put("METHOD_FULL_NAME", this.methodFullName) + if (("": String) != this.methodShortName) res.put("METHOD_SHORT_NAME", this.methodShortName) + if (("": String) != this.nodeLabel) res.put("NODE_LABEL", this.nodeLabel) + if (("": String) != this.packageName) res.put("PACKAGE_NAME", this.packageName) + if (("": String) != this.symbol) res.put("SYMBOL", this.symbol) this.node.foreach { p => res.put("node", p) } res } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Member.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Member.scala index 9e0236a1..119da7e4 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Member.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Member.scala @@ -18,18 +18,18 @@ trait MemberBase extends AbstractNode with AstNodeBase with DeclarationBase with override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("AST_PARENT_FULL_NAME", this.astParentFullName) - res.put("AST_PARENT_TYPE", this.astParentType) - res.put("CODE", this.code) + if (("": String) != this.astParentFullName) res.put("AST_PARENT_FULL_NAME", this.astParentFullName) + if (("": String) != this.astParentType) res.put("AST_PARENT_TYPE", this.astParentType) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MetaData.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MetaData.scala index 099a97f4..51259731 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MetaData.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MetaData.scala @@ -17,10 +17,10 @@ trait MetaDataBase extends AbstractNode with StaticType[MetaDataEMT] { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() this.hash.foreach { p => res.put("HASH", p) } - res.put("LANGUAGE", this.language) + if (("": String) != this.language) res.put("LANGUAGE", this.language) val tmpOverlays = this.overlays; if (tmpOverlays.nonEmpty) res.put("OVERLAYS", tmpOverlays) - res.put("ROOT", this.root) - res.put("VERSION", this.version) + if (("": String) != this.root) res.put("ROOT", this.root) + if (("": String) != this.version) res.put("VERSION", this.version) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Method.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Method.scala index 1c338aeb..4769a1e2 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Method.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Method.scala @@ -24,22 +24,22 @@ trait MethodBase extends AbstractNode with CfgNodeBase with DeclarationBase with override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("AST_PARENT_FULL_NAME", this.astParentFullName) - res.put("AST_PARENT_TYPE", this.astParentType) - res.put("CODE", this.code) + if (("": String) != this.astParentFullName) res.put("AST_PARENT_FULL_NAME", this.astParentFullName) + if (("": String) != this.astParentType) res.put("AST_PARENT_TYPE", this.astParentType) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.columnNumberEnd.foreach { p => res.put("COLUMN_NUMBER_END", p) } - res.put("FILENAME", this.filename) - res.put("FULL_NAME", this.fullName) + if (("": String) != this.filename) res.put("FILENAME", this.filename) + if (("": String) != this.fullName) res.put("FULL_NAME", this.fullName) this.hash.foreach { p => res.put("HASH", p) } - res.put("IS_EXTERNAL", this.isExternal) + if ((false: Boolean) != this.isExternal) res.put("IS_EXTERNAL", this.isExternal) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } this.lineNumberEnd.foreach { p => res.put("LINE_NUMBER_END", p) } - res.put("NAME", this.name) + if (("": String) != this.name) res.put("NAME", this.name) this.offset.foreach { p => res.put("OFFSET", p) } this.offsetEnd.foreach { p => res.put("OFFSET_END", p) } - res.put("ORDER", this.order) - res.put("SIGNATURE", this.signature) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.signature) res.put("SIGNATURE", this.signature) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala index 64baa249..942023dc 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala @@ -25,19 +25,19 @@ trait MethodParameterInBase import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() this.closureBindingId.foreach { p => res.put("CLOSURE_BINDING_ID", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) - res.put("EVALUATION_STRATEGY", this.evaluationStrategy) - res.put("INDEX", this.index) - res.put("IS_VARIADIC", this.isVariadic) + if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) + if ((-1: Int) != this.index) res.put("INDEX", this.index) + if ((false: Boolean) != this.isVariadic) res.put("IS_VARIADIC", this.isVariadic) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala index 12079bed..1ea09706 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala @@ -21,15 +21,15 @@ trait MethodParameterOutBase override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("EVALUATION_STRATEGY", this.evaluationStrategy) - res.put("INDEX", this.index) - res.put("IS_VARIADIC", this.isVariadic) + if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) + if ((-1: Int) != this.index) res.put("INDEX", this.index) + if ((false: Boolean) != this.isVariadic) res.put("IS_VARIADIC", this.isVariadic) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodRef.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodRef.scala index 341a4351..7bc4fbc5 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodRef.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodRef.scala @@ -16,18 +16,18 @@ trait MethodRefBase extends AbstractNode with ExpressionBase with StaticType[Met override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("METHOD_FULL_NAME", this.methodFullName) - res.put("ORDER", this.order) + if (("": String) != this.methodFullName) res.put("METHOD_FULL_NAME", this.methodFullName) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodReturn.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodReturn.scala index cd682683..b0076189 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodReturn.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/MethodReturn.scala @@ -16,16 +16,16 @@ trait MethodReturnBase extends AbstractNode with CfgNodeBase with StaticType[Met override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) - res.put("EVALUATION_STRATEGY", this.evaluationStrategy) + if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Modifier.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Modifier.scala index 4282c34e..be01bb86 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Modifier.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Modifier.scala @@ -10,11 +10,11 @@ trait ModifierBase extends AbstractNode with AstNodeBase with StaticType[Modifie override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("MODIFIER_TYPE", this.modifierType) - res.put("ORDER", this.order) + if (("": String) != this.modifierType) res.put("MODIFIER_TYPE", this.modifierType) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Namespace.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Namespace.scala index 162ee1f2..9bd81711 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Namespace.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Namespace.scala @@ -10,11 +10,11 @@ trait NamespaceBase extends AbstractNode with AstNodeBase with StaticType[Namesp override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NamespaceBlock.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NamespaceBlock.scala index 2967e899..741b513c 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NamespaceBlock.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/NamespaceBlock.scala @@ -10,13 +10,13 @@ trait NamespaceBlockBase extends AbstractNode with AstNodeBase with StaticType[N override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("FILENAME", this.filename) - res.put("FULL_NAME", this.fullName) + if (("": String) != this.filename) res.put("FILENAME", this.filename) + if (("": String) != this.fullName) res.put("FULL_NAME", this.fullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Return.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Return.scala index 5564f08d..7f4ce637 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Return.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Return.scala @@ -10,12 +10,12 @@ trait ReturnBase extends AbstractNode with ExpressionBase with StaticType[Return override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Tag.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Tag.scala index a303a384..46c40739 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Tag.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Tag.scala @@ -10,8 +10,8 @@ trait TagBase extends AbstractNode with StaticType[TagEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("NAME", this.name) - res.put("VALUE", this.value) + if (("": String) != this.name) res.put("NAME", this.name) + if (("": String) != this.value) res.put("VALUE", this.value) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TemplateDom.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TemplateDom.scala index 1f3606ed..23f70039 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TemplateDom.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TemplateDom.scala @@ -10,13 +10,13 @@ trait TemplateDomBase extends AbstractNode with ExpressionBase with StaticType[T override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Type.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Type.scala index 64b8ebdb..51a2391d 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Type.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Type.scala @@ -10,9 +10,9 @@ trait TypeBase extends AbstractNode with StaticType[TypeEMT] { override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("FULL_NAME", this.fullName) - res.put("NAME", this.name) - res.put("TYPE_DECL_FULL_NAME", this.typeDeclFullName) + if (("": String) != this.fullName) res.put("FULL_NAME", this.fullName) + if (("": String) != this.name) res.put("NAME", this.name) + if (("": String) != this.typeDeclFullName) res.put("TYPE_DECL_FULL_NAME", this.typeDeclFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeArgument.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeArgument.scala index 96c9603c..3f6d1846 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeArgument.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeArgument.scala @@ -10,10 +10,10 @@ trait TypeArgumentBase extends AbstractNode with AstNodeBase with StaticType[Typ override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeDecl.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeDecl.scala index 316539d4..01f11fbe 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeDecl.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeDecl.scala @@ -23,20 +23,20 @@ trait TypeDeclBase extends AbstractNode with AstNodeBase with StaticType[TypeDec import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() this.aliasTypeFullName.foreach { p => res.put("ALIAS_TYPE_FULL_NAME", p) } - res.put("AST_PARENT_FULL_NAME", this.astParentFullName) - res.put("AST_PARENT_TYPE", this.astParentType) - res.put("CODE", this.code) + if (("": String) != this.astParentFullName) res.put("AST_PARENT_FULL_NAME", this.astParentFullName) + if (("": String) != this.astParentType) res.put("AST_PARENT_TYPE", this.astParentType) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("FILENAME", this.filename) - res.put("FULL_NAME", this.fullName) + if (("": String) != this.filename) res.put("FILENAME", this.filename) + if (("": String) != this.fullName) res.put("FULL_NAME", this.fullName) val tmpInheritsFromTypeFullName = this.inheritsFromTypeFullName; if (tmpInheritsFromTypeFullName.nonEmpty) res.put("INHERITS_FROM_TYPE_FULL_NAME", tmpInheritsFromTypeFullName) - res.put("IS_EXTERNAL", this.isExternal) + if ((false: Boolean) != this.isExternal) res.put("IS_EXTERNAL", this.isExternal) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) + if (("": String) != this.name) res.put("NAME", this.name) this.offset.foreach { p => res.put("OFFSET", p) } this.offsetEnd.foreach { p => res.put("OFFSET_END", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeParameter.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeParameter.scala index 1075147c..b6235116 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeParameter.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeParameter.scala @@ -10,11 +10,11 @@ trait TypeParameterBase extends AbstractNode with AstNodeBase with StaticType[Ty override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("NAME", this.name) - res.put("ORDER", this.order) + if (("": String) != this.name) res.put("NAME", this.name) + if ((-1: Int) != this.order) res.put("ORDER", this.order) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeRef.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeRef.scala index 7732b9c2..124d0043 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeRef.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/TypeRef.scala @@ -15,17 +15,17 @@ trait TypeRefBase extends AbstractNode with ExpressionBase with StaticType[TypeR override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) + if ((-1: Int) != this.order) res.put("ORDER", this.order) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } } diff --git a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Unknown.scala b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Unknown.scala index aa2be616..80cd7dcb 100644 --- a/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Unknown.scala +++ b/joern-generated/src/main/scala/io/shiftleft/codepropertygraph/generated/nodes/Unknown.scala @@ -17,19 +17,19 @@ trait UnknownBase extends AbstractNode with ExpressionBase with StaticType[Unkno override def propertiesMap: java.util.Map[String, Any] = { import io.shiftleft.codepropertygraph.generated.accessors.Lang.* val res = new java.util.HashMap[String, Any]() - res.put("ARGUMENT_INDEX", this.argumentIndex) + if ((-1: Int) != this.argumentIndex) res.put("ARGUMENT_INDEX", this.argumentIndex) this.argumentName.foreach { p => res.put("ARGUMENT_NAME", p) } - res.put("CODE", this.code) + if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } - res.put("CONTAINED_REF", this.containedRef) + if (("": String) != this.containedRef) res.put("CONTAINED_REF", this.containedRef) val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) this.lineNumber.foreach { p => res.put("LINE_NUMBER", p) } - res.put("ORDER", this.order) - res.put("PARSER_TYPE_NAME", this.parserTypeName) + if ((-1: Int) != this.order) res.put("ORDER", this.order) + if (("": String) != this.parserTypeName) res.put("PARSER_TYPE_NAME", this.parserTypeName) val tmpPossibleTypes = this.possibleTypes; if (tmpPossibleTypes.nonEmpty) res.put("POSSIBLE_TYPES", tmpPossibleTypes) - res.put("TYPE_FULL_NAME", this.typeFullName) + if (("": String) != this.typeFullName) res.put("TYPE_FULL_NAME", this.typeFullName) res } }