Skip to content

Commit

Permalink
Java 21
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Subramanian <prabhu@appthreat.com>
  • Loading branch information
prabhu committed Nov 10, 2023
1 parent a251ac1 commit fb9cf8e
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nodejstests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
java-version: ['17', '19', '20', '21']
node-version: ['20.x']
java-version: ['21']
node-version: ['21.x']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/npm-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
node-version: '21.x'
registry-url: https://registry.npmjs.org/
- uses: coursier/cache-action@v6
- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '19'
java-version: '21'
- name: Release
run: |
sbt scalafmtCheck stage assembly createDistribution
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/repotests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
java-version: ['17', '19', '20', '21']
java-version: ['21']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: '20.x'
node-version: '21.x'
- run: |
sbt stage astGenDlTask
./atom.sh -o /tmp/java.atom -l java $GITHUB_WORKSPACE/repotests/shiftleft-java-example -Dlog4j.configurationFile=log4j2.xml
Expand Down
10 changes: 5 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ val astGenVersion = "3.5.0"
libraryDependencies ++= Seq(
"com.github.pathikrit" %% "better-files" % "3.9.2",
"com.github.scopt" %% "scopt" % "4.1.0",
"org.apache.logging.log4j" % "log4j-core" % "2.20.0" % Optional,
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.20.0" % Optional,
"org.apache.logging.log4j" % "log4j-core" % "2.21.1" % Optional,
"org.apache.logging.log4j" % "log4j-slf4j2-impl" % "2.21.1" % Optional,
"io.appthreat" %% "c2cpg" % Versions.chen excludeAll (
ExclusionRule(organization = "com.ibm.icu", name = "icu4j"),
ExclusionRule(organization = "org.eclipse.platform", name = "org.eclipse.jface"),
Expand All @@ -35,17 +35,17 @@ Compile / doc / scalacOptions ++= Seq("-doc-title", "atom apidocs", "-doc-versio
ThisBuild / scalacOptions ++= Seq(
"-deprecation", // Emit warning and location for usages of deprecated APIs.
"--release",
"17",
"21",
)

ThisBuild / compile / javacOptions ++= Seq(
"-g", // debug symbols
"-Xlint",
"--release=17"
"--release=21"
) ++ {
// fail early if users with JDK11 try to run this
val javaVersion = sys.props("java.specification.version").toFloat
assert(javaVersion.toInt >= 17, s"this build requires JDK17+ - you're using $javaVersion")
assert(javaVersion.toInt >= 21, s"this build requires JDK21+ - you're using $javaVersion")
Nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ object DataFlowGraph:
private def DF_EDGES =
Set(EdgeTypes.REACHING_DEF, EdgeTypes.CALL, EdgeTypes.REF)
val exec: ExecutorService =
Executors.newWorkStealingPool(Runtime.getRuntime.availableProcessors / 2)
Executors.newVirtualThreadPerTaskExecutor()

def buildFromSlice(slice: DataFlowSlice): DataFlowGraph =
val dfNodes = slice.nodes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class DataFlowSlicing:

implicit val resolver: ICallResolver = NoResolve
protected val exec: ExecutorService =
Executors.newWorkStealingPool(Runtime.getRuntime.availableProcessors() / 2)
Executors.newVirtualThreadPerTaskExecutor()
private val excludeOperatorCalls = new AtomicBoolean(true)
private val nodeCache = new TrieMap[Long, SliceNode]()
private var language: Option[String] = _
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object UsageSlicing:

private val resolver = NoResolve
val exec: ExecutorService =
Executors.newWorkStealingPool(Runtime.getRuntime.availableProcessors() / 2)
Executors.newVirtualThreadPerTaskExecutor()
private val constructorTypeMatcher = Pattern.compile(".*new (\\w+)\\(.*")
private val excludeOperatorCalls = new AtomicBoolean(true)
private val FRAMEWORK_ROUTE = "framework-route"
Expand Down

0 comments on commit fb9cf8e

Please # to comment.