Skip to content

Commit

Permalink
Fix feature detection bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
gchallen committed Sep 30, 2021
1 parent e611322 commit 28e5d46
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .intellijlogger.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
destination: https://cs125-cloud.cs.illinois.edu/intellijlogger/
destination: https://cloud.cs124.org/intellijlogger/
name: jeed
emailLocation: email.txt
2 changes: 1 addition & 1 deletion containerrunner/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
kotlin("jvm")
application
id("com.github.johnrengelman.shadow") version "7.0.0"
id("com.palantir.docker") version "0.29.0"
id("com.palantir.docker") version "0.30.0"
id("org.jmailen.kotlinter")
id("io.gitlab.arturbosch.detekt")
}
Expand Down
2 changes: 1 addition & 1 deletion core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies {
implementation("org.slf4j:slf4j-api:1.7.32")
implementation("ch.qos.logback:logback-classic:1.2.6")
implementation("io.github.microutils:kotlin-logging:2.0.11")
implementation("io.github.classgraph:classgraph:4.8.116")
implementation("io.github.classgraph:classgraph:4.8.117")
implementation("net.java.dev.jna:jna:5.9.0")
implementation("io.github.java-diff-utils:java-diff-utils:4.11")
implementation("com.google.googlejavaformat:google-java-format:1.11.0")
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/kotlin/Features.kt
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@ private class FeatureListener(val source: Source, entry: Map.Entry<String, Strin
}
ctx.methodCall()?.also {
if (featureStack[0].name.contains(ctx.methodCall()?.identifier()?.text ?: "")) {
if (ctx.methodCall().expressionList().text.filter { it == ',' }.length
if (ctx.methodCall().expressionList()?.text?.filter { it == ',' }?.length
== featureStack[0].name.filter { it == ',' }.length
) {
count(FeatureName.RECURSION, 1)
Expand Down
17 changes: 17 additions & 0 deletions core/src/test/kotlin/TestFeatures.kt
Original file line number Diff line number Diff line change
Expand Up @@ -833,4 +833,21 @@ public class Test {
)
).features()
}
"should not choke on pseudo-recursion" {
Source(
mapOf(
"Catcher.java" to """
public class Catcher {
public static int getValue(Faulter faulter) {
while (true) {
try {
return faulter.getValue();
} catch (Exception e) {
}
}
}
}""".trim()
)
).features()
}
})
2 changes: 1 addition & 1 deletion server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
application
`maven-publish`
id("com.github.johnrengelman.shadow") version "7.0.0"
id("com.palantir.docker") version "0.29.0"
id("com.palantir.docker") version "0.30.0"
id("org.jmailen.kotlinter")
id("io.gitlab.arturbosch.detekt")
}
Expand Down

0 comments on commit 28e5d46

Please sign in to comment.