Skip to content

Commit

Permalink
use codgen that produces stable results (ShiftLeftSecurity#1709)
Browse files Browse the repository at this point in the history
* use codgen that produces stable results

* sbt clean: also delete generated files

* use released codegen
  • Loading branch information
mpollmeier authored Jun 1, 2023
1 parent b6e5a47 commit b387979
Show file tree
Hide file tree
Showing 38 changed files with 5,632 additions and 5,630 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name := "codepropertygraph"

// parsed by project/Versions.scala, updated by updateDependencies.sh
val overflowdbVersion = "1.174"
val overflowdbCodegenVersion = "2.88"
val overflowdbCodegenVersion = "2.94"

inThisBuild(
List(
Expand Down
2 changes: 2 additions & 0 deletions domainClasses/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ Compile/compile := (Compile/compile).dependsOn(Projects.schema/Compile/generateD
* to fail the build because of them
*/
Compile / scalacOptions --= Seq("-Wconf:cat=deprecation:w,any:e", "-Wunused", "-Ywarn-unused")

cleanFiles += baseDirectory.value / "src/main/generated"
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ object Annotation {
Label,
PropertyNames.allAsJava,
List(
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Argument.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Ast.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Argument.layoutInformation
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation
).asJava,
List(
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Ast.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.ReachingDef.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Cfg.layoutInformation
io.shiftleft.codepropertygraph.generated.edges.Cfg.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.ReachingDef.layoutInformation
).asJava
)

Expand Down Expand Up @@ -109,8 +109,8 @@ class Annotation(graph_4762: Graph, id_4762: Long /*cf https://github.com/scala/
case _ => super.propertyDefaultValue(propertyKey)
}

def pointsToOut: Iterator[CfgNode] = get().pointsToOut
override def _pointsToOut = get()._pointsToOut
def argumentOut: Iterator[TemplateDom] = get().argumentOut
override def _argumentOut = get()._argumentOut

def astOut: Iterator[AnnotationParameterAssign] = get().astOut
override def _astOut = get()._astOut
Expand All @@ -120,42 +120,42 @@ class Annotation(graph_4762: Graph, id_4762: Long /*cf https://github.com/scala/
def _annotationParameterAssignViaAstOut: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
get()._annotationParameterAssignViaAstOut

def argumentOut: Iterator[TemplateDom] = get().argumentOut
override def _argumentOut = get()._argumentOut

def pointsToIn: Iterator[CfgNode] = get().pointsToIn
override def _pointsToIn = get()._pointsToIn
def pointsToOut: Iterator[CfgNode] = get().pointsToOut
override def _pointsToOut = get()._pointsToOut

def astIn: Iterator[AstNode] = get().astIn
override def _astIn = get()._astIn

/** Traverse to METHOD via AST IN edge.
/** Traverse to ANNOTATION_PARAMETER_ASSIGN via AST IN edge.
*/
def _methodViaAstIn: overflowdb.traversal.Traversal[Method] = get()._methodViaAstIn
def _annotationParameterAssignViaAstIn: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
get()._annotationParameterAssignViaAstIn

/** Traverse to TYPE_DECL via AST IN edge.
/** Traverse to MEMBER via AST IN edge.
*/
def _typeDeclViaAstIn: overflowdb.traversal.Traversal[TypeDecl] = get()._typeDeclViaAstIn
def _memberViaAstIn: overflowdb.traversal.Traversal[Member] = get()._memberViaAstIn

/** Traverse to METHOD via AST IN edge.
*/
def _methodViaAstIn: overflowdb.traversal.Traversal[Method] = get()._methodViaAstIn

/** Traverse to METHOD_PARAMETER_IN via AST IN edge.
*/
def _methodParameterInViaAstIn: overflowdb.traversal.Traversal[MethodParameterIn] = get()._methodParameterInViaAstIn

/** Traverse to ANNOTATION_PARAMETER_ASSIGN via AST IN edge.
/** Traverse to TYPE_DECL via AST IN edge.
*/
def _annotationParameterAssignViaAstIn: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
get()._annotationParameterAssignViaAstIn
def _typeDeclViaAstIn: overflowdb.traversal.Traversal[TypeDecl] = get()._typeDeclViaAstIn

/** Traverse to MEMBER via AST IN edge.
*/
def _memberViaAstIn: overflowdb.traversal.Traversal[Member] = get()._memberViaAstIn
def cfgIn: Iterator[CfgNode] = get().cfgIn
override def _cfgIn = get()._cfgIn

def pointsToIn: Iterator[CfgNode] = get().pointsToIn
override def _pointsToIn = get()._pointsToIn

def reachingDefIn: Iterator[TemplateDom] = get().reachingDefIn
override def _reachingDefIn = get()._reachingDefIn

def cfgIn: Iterator[CfgNode] = get().cfgIn
override def _cfgIn = get()._cfgIn

// In view of https://github.com/scala/bug/issues/4762 it is advisable to use different variable names in
// patterns like `class Base(x:Int)` and `class Derived(x:Int) extends Base(x)`.
// This must become `class Derived(x_4762:Int) extends Base(x_4762)`.
Expand Down Expand Up @@ -254,36 +254,36 @@ class AnnotationDb(ref: NodeRef[NodeDb]) extends NodeDb(ref) with StoredNode wit
}

import overflowdb.traversal._
def pointsToOut: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](0)
override def _pointsToOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](0)
def argumentOut: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](0)
override def _argumentOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](0)

def astOut: Iterator[AnnotationParameterAssign] =
createAdjacentNodeScalaIteratorByOffSet[AnnotationParameterAssign](1)
override def _astOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](1)
def _annotationParameterAssignViaAstOut: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
astOut.collectAll[AnnotationParameterAssign]

def argumentOut: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](2)
override def _argumentOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](2)

def pointsToIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](3)
override def _pointsToIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)
def pointsToOut: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](2)
override def _pointsToOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](2)

def astIn: Iterator[AstNode] = createAdjacentNodeScalaIteratorByOffSet[AstNode](4)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](4)
def _methodViaAstIn: overflowdb.traversal.Traversal[Method] = astIn.collectAll[Method]
def _typeDeclViaAstIn: overflowdb.traversal.Traversal[TypeDecl] = astIn.collectAll[TypeDecl]
def _methodParameterInViaAstIn: overflowdb.traversal.Traversal[MethodParameterIn] =
astIn.collectAll[MethodParameterIn]
def astIn: Iterator[AstNode] = createAdjacentNodeScalaIteratorByOffSet[AstNode](3)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)
def _annotationParameterAssignViaAstIn: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
astIn.collectAll[AnnotationParameterAssign]
def _memberViaAstIn: overflowdb.traversal.Traversal[Member] = astIn.collectAll[Member]
def _methodViaAstIn: overflowdb.traversal.Traversal[Method] = astIn.collectAll[Method]
def _methodParameterInViaAstIn: overflowdb.traversal.Traversal[MethodParameterIn] =
astIn.collectAll[MethodParameterIn]
def _typeDeclViaAstIn: overflowdb.traversal.Traversal[TypeDecl] = astIn.collectAll[TypeDecl]

def cfgIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](4)
override def _cfgIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](4)

def reachingDefIn: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](5)
override def _reachingDefIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](5)
def pointsToIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](5)
override def _pointsToIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](5)

def cfgIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](6)
override def _cfgIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](6)
def reachingDefIn: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](6)
override def _reachingDefIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](6)

override def label: String = {
Annotation.Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,14 @@ object AnnotationLiteral {
Label,
PropertyNames.allAsJava,
List(
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Argument.layoutInformation
io.shiftleft.codepropertygraph.generated.edges.Argument.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation
).asJava,
List(
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Ast.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.ReachingDef.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.Cfg.layoutInformation
io.shiftleft.codepropertygraph.generated.edges.Cfg.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.PointsTo.layoutInformation,
io.shiftleft.codepropertygraph.generated.edges.ReachingDef.layoutInformation
).asJava
)

Expand Down Expand Up @@ -102,14 +102,11 @@ class AnnotationLiteral(graph_4762: Graph, id_4762: Long /*cf https://github.com
case _ => super.propertyDefaultValue(propertyKey)
}

def pointsToOut: Iterator[CfgNode] = get().pointsToOut
override def _pointsToOut = get()._pointsToOut

def argumentOut: Iterator[TemplateDom] = get().argumentOut
override def _argumentOut = get()._argumentOut

def pointsToIn: Iterator[CfgNode] = get().pointsToIn
override def _pointsToIn = get()._pointsToIn
def pointsToOut: Iterator[CfgNode] = get().pointsToOut
override def _pointsToOut = get()._pointsToOut

def astIn: Iterator[AstNode] = get().astIn
override def _astIn = get()._astIn
Expand All @@ -119,12 +116,15 @@ class AnnotationLiteral(graph_4762: Graph, id_4762: Long /*cf https://github.com
def _annotationParameterAssignViaAstIn: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
get()._annotationParameterAssignViaAstIn

def reachingDefIn: Iterator[TemplateDom] = get().reachingDefIn
override def _reachingDefIn = get()._reachingDefIn

def cfgIn: Iterator[CfgNode] = get().cfgIn
override def _cfgIn = get()._cfgIn

def pointsToIn: Iterator[CfgNode] = get().pointsToIn
override def _pointsToIn = get()._pointsToIn

def reachingDefIn: Iterator[TemplateDom] = get().reachingDefIn
override def _reachingDefIn = get()._reachingDefIn

// In view of https://github.com/scala/bug/issues/4762 it is advisable to use different variable names in
// patterns like `class Base(x:Int)` and `class Derived(x:Int) extends Base(x)`.
// This must become `class Derived(x_4762:Int) extends Base(x_4762)`.
Expand Down Expand Up @@ -221,25 +221,25 @@ class AnnotationLiteralDb(ref: NodeRef[NodeDb])
}

import overflowdb.traversal._
def pointsToOut: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](0)
override def _pointsToOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](0)
def argumentOut: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](0)
override def _argumentOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](0)

def argumentOut: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](1)
override def _argumentOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](1)
def pointsToOut: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](1)
override def _pointsToOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](1)

def pointsToIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](2)
override def _pointsToIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](2)

def astIn: Iterator[AstNode] = createAdjacentNodeScalaIteratorByOffSet[AstNode](3)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)
def astIn: Iterator[AstNode] = createAdjacentNodeScalaIteratorByOffSet[AstNode](2)
override def _astIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](2)
def _annotationParameterAssignViaAstIn: overflowdb.traversal.Traversal[AnnotationParameterAssign] =
astIn.collectAll[AnnotationParameterAssign]

def reachingDefIn: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](4)
override def _reachingDefIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](4)
def cfgIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](3)
override def _cfgIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](3)

def pointsToIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](4)
override def _pointsToIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](4)

def cfgIn: Iterator[CfgNode] = createAdjacentNodeScalaIteratorByOffSet[CfgNode](5)
override def _cfgIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](5)
def reachingDefIn: Iterator[TemplateDom] = createAdjacentNodeScalaIteratorByOffSet[TemplateDom](5)
override def _reachingDefIn = createAdjacentNodeScalaIteratorByOffSet[StoredNode](5)

override def label: String = {
AnnotationLiteral.Label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ class AnnotationParameterAssign(graph_4762: Graph, id_4762: Long /*cf https://gi
def astOut: Iterator[AstNode] = get().astOut
override def _astOut = get()._astOut

/** Traverse to ANNOTATION_LITERAL via AST OUT edge.
*/
def _annotationLiteralViaAstOut: overflowdb.traversal.Traversal[AnnotationLiteral] = get()._annotationLiteralViaAstOut

/** Traverse to ANNOTATION via AST OUT edge.
*/
def _annotationViaAstOut: overflowdb.traversal.Traversal[Annotation] = get()._annotationViaAstOut

/** Traverse to ANNOTATION_LITERAL via AST OUT edge.
*/
def _annotationLiteralViaAstOut: overflowdb.traversal.Traversal[AnnotationLiteral] = get()._annotationLiteralViaAstOut

/** Traverse to ANNOTATION_PARAMETER via AST OUT edge.
*/
def _annotationParameterViaAstOut: overflowdb.traversal.Traversal[AnnotationParameter] =
Expand Down Expand Up @@ -185,9 +185,9 @@ class AnnotationParameterAssignDb(ref: NodeRef[NodeDb])
import overflowdb.traversal._
def astOut: Iterator[AstNode] = createAdjacentNodeScalaIteratorByOffSet[AstNode](0)
override def _astOut = createAdjacentNodeScalaIteratorByOffSet[StoredNode](0)
def _annotationViaAstOut: overflowdb.traversal.Traversal[Annotation] = astOut.collectAll[Annotation]
def _annotationLiteralViaAstOut: overflowdb.traversal.Traversal[AnnotationLiteral] =
astOut.collectAll[AnnotationLiteral]
def _annotationViaAstOut: overflowdb.traversal.Traversal[Annotation] = astOut.collectAll[Annotation]
def _annotationParameterViaAstOut: overflowdb.traversal.Traversal[AnnotationParameter] =
astOut.collectAll[AnnotationParameter]
def _arrayInitializerViaAstOut: overflowdb.traversal.Traversal[ArrayInitializer] = astOut.collectAll[ArrayInitializer]
Expand Down
Loading

0 comments on commit b387979

Please sign in to comment.