diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Properties.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Properties.scala index 0ac593be6..6a4fe5134 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Properties.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/Properties.scala @@ -152,7 +152,7 @@ object Properties { /** Specifies an index, e.g., for a parameter or argument. Explicit parameters are numbered from 1 to N, while index 0 * is reserved for implicit self / this parameter. */ - val Index = flatgraph.SinglePropertyKey[Int](kind = 26, name = "INDEX", default = -1: Int) + val Index = flatgraph.SinglePropertyKey[Int](kind = 26, name = "INDEX", default = -2: Int) /** The static types a TYPE_DECL inherits from. This property is matched against the FULL_NAME of TYPE nodes and thus * it is required to have at least one TYPE node for each TYPE_FULL_NAME diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/PropertyDefaults.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/PropertyDefaults.scala index 56a894a24..5a274683e 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/PropertyDefaults.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/PropertyDefaults.scala @@ -14,7 +14,7 @@ object PropertyDefaults { val Filename = "" val FullName = "" val GenericSignature = "" - val Index = -1: Int + val Index = -2: Int val IsExternal = false val IsVariadic = false val Key = "" diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/accessors/Accessors.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/accessors/Accessors.scala index f55d5fde2..f666c5cd0 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/accessors/Accessors.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/accessors/Accessors.scala @@ -182,7 +182,7 @@ object Accessors { nodeKind = node.nodeKind, propertyKind = 26, seq = node.seq(), - default = -1: Int + default = -2: Int ) } final class AccessPropertyInheritsFromTypeFullName(val node: nodes.StoredNode) extends AnyVal { diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala index 3b84ba223..d7f8945ef 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterIn.scala @@ -34,7 +34,7 @@ trait MethodParameterInBase val tmpDynamicTypeHintFullName = this.dynamicTypeHintFullName; if (tmpDynamicTypeHintFullName.nonEmpty) res.put("DYNAMIC_TYPE_HINT_FULL_NAME", tmpDynamicTypeHintFullName) if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) - if ((-1: Int) != this.index) res.put("INDEX", this.index) + if ((-2: 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) } if (("": String) != this.name) res.put("NAME", this.name) @@ -72,7 +72,7 @@ object MethodParameterIn { * passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with * the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made. * - * ▸ Index (Int); Cardinality `one` (mandatory with default value `-1`); Specifies an index, e.g., for a parameter or + * ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or * argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this * parameter. * diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala index a9be28c74..462e08824 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/MethodParameterOut.scala @@ -28,7 +28,7 @@ trait MethodParameterOutBase if (("": String) != this.code) res.put("CODE", this.code) this.columnNumber.foreach { p => res.put("COLUMN_NUMBER", p) } if (("": String) != this.evaluationStrategy) res.put("EVALUATION_STRATEGY", this.evaluationStrategy) - if ((-1: Int) != this.index) res.put("INDEX", this.index) + if ((-2: 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) } if (("": String) != this.name) res.put("NAME", this.name) @@ -58,7 +58,7 @@ object MethodParameterOut { * passed by value, that is, a copy is made, 3) `BY_SHARING` the parameter is a pointer/reference and it is shared with * the caller/callee. While a copy of the pointer is made, a copy of the object that it points to is not made. * - * ▸ Index (Int); Cardinality `one` (mandatory with default value `-1`); Specifies an index, e.g., for a parameter or + * ▸ Index (Int); Cardinality `one` (mandatory with default value `-2`); Specifies an index, e.g., for a parameter or * argument. Explicit parameters are numbered from 1 to N, while index 0 is reserved for implicit self / this * parameter. * diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterIn.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterIn.scala index 83cfd88c0..da0656ee8 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterIn.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterIn.scala @@ -2399,7 +2399,7 @@ class NewMethodParameterIn var columnNumber: Option[Int] = None var dynamicTypeHintFullName: IndexedSeq[String] = ArraySeq.empty var evaluationStrategy: String = "": String - var index: Int = -1: Int + var index: Int = -2: Int var isVariadic: Boolean = false: Boolean var lineNumber: Option[Int] = None var name: String = "": String diff --git a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterOut.scala b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterOut.scala index 6eea4e4ad..6a243666c 100644 --- a/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterOut.scala +++ b/domainClasses/src/main/generated/io/shiftleft/codepropertygraph/generated/nodes/NewMethodParameterOut.scala @@ -2314,7 +2314,7 @@ class NewMethodParameterOut var code: String = "": String var columnNumber: Option[Int] = None var evaluationStrategy: String = "": String - var index: Int = -1: Int + var index: Int = -2: Int var isVariadic: Boolean = false: Boolean var lineNumber: Option[Int] = None var name: String = "": String diff --git a/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Base.scala b/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Base.scala index d2ea1fddf..98d52580a 100644 --- a/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Base.scala +++ b/schema/src/main/scala/io/shiftleft/codepropertygraph/schema/Base.scala @@ -73,7 +73,10 @@ object Base extends SchemaBase { | self / this parameter. |""".stripMargin ) - .mandatory(PropertyDefaults.Int) + // We use a default value that is different from -1 because some code working with parameters and return + // values represent them in a single number plane where -1 encodes the return value and we do not want + // the "value unset" default value to collide with that. + .mandatory(-2) .protoId(ProtoIds.Index) val name = builder