Rewrite your app in Rust, piece by piece, checked against the original at every step. Works with TypeScript, JavaScript, Python, Go, Ruby, Java, C, PHP, C#, Kotlin, PowerShell and Swift.
Rust agent-skillsclaude-codeclicode-migrationcodexffigolangjavajavascriptmcpmigrationnapiperformanceportingpyo3pythonrewriterubyrusttypescript
Java and Kotlin: count ThreadLocalRandom, SecureRandom and java.util.Random as randomness (#1363)
jakalijeyc33632ee1044
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 74f9a0aa..078f008f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -188,6 +188,9 @@fails. Before, a Python unit built on `BeautifulSoup(html, "html.parser")`, which no cratereproduces, could only meet the cap by dropping behavior. The skill and TASK.md tell the agentto ask the user instead of writing one (#1189 by @sungkilhan221).+- Java and Kotlin: `ThreadLocalRandom.`, `SecureRandom(` and a full `new java.util.Random(` count+ as randomness, so `bridge` keeps a function that rolls with one of them and `analyze` lists it as+ a clock and random risk. Before, only `new Random(` and `Random.` were seen (#1339 by @jakalijey).- Swift: `NSHomeDirectory()`, `NSTemporaryDirectory()`, `getenv()` and`FileManager.default.homeDirectoryForCurrentUser` count as reading the environment, so `bridge`keeps a function that reads one in Swift and `analyze` lists it. Before, only `ProcessInfo` and@@ -197,6 +200,10 @@as `Environment.CurrentDirectory` already did, so `bridge` keeps a function that builds a path fromone in C# and `analyze` lists it. Before, its recording held this machine's folders (#1347 by@jakalijey).+- Java and Kotlin: `ThreadLocalRandom.` and `SecureRandom(`, with or without their package, and a+ full `new java.util.Random(` count as randomness, so `bridge` keeps a function that rolls with one+ of them and `analyze` lists it as a clock and random risk. Before, only `new Random(` and+ `Random.` were seen (#1339 by @jakalijey).## 5.1.1 (2026-12-02)diff --git a/src/lang/effects.rs b/src/lang/effects.rsindex 5a3be92c..fb2efee6 100644--- a/src/lang/effects.rs+++ b/src/lang/effects.rs@@ -233,6 +233,12 @@ fn clock_and_random(lang: Lang) -> &'static [&'static str] {"Collections.shuffle(",// `java.util.Collections.shuffle(`: a name after `.` is skipped unless the entry starts with one.".Collections.shuffle(",+ // `Random.` and `new Random(` do not match inside a longer name or a full one.+ "ThreadLocalRandom.",+ "SecureRandom(",+ ".Random(",+ ".ThreadLocalRandom.",+ ".SecureRandom(",],Lang::Ruby => &["Time.now",@@ -1457,6 +1463,42 @@ mod tests {"class Deck { static java.util.List<String> f() { java.util.List<String> xs = new java.util.ArrayList<>(java.util.List.of(\"a\", \"b\")); java.util.Collections.shuffle(xs); return xs; } }",Risk::ClockAndRandom,),+ (+ Lang::Java,+ "Dice.java",+ "class Dice { static int f() { return ThreadLocalRandom.current().nextInt(1, 7); } }",+ Risk::ClockAndRandom,+ ),+ (+ Lang::Java,+ "Dice.java",+ "class Dice { static int f() { return new SecureRandom().nextInt(6) + 1; } }",+ Risk::ClockAndRandom,+ ),+ (+ Lang::Java,+ "Dice.java",+ "class Dice { static int f() { return new java.util.Random().nextInt(6) + 1; } }",+ Risk::ClockAndRandom,+ ),+ (+ Lang::Java,+ "Dice.java",+ "class Dice { static int f() { return java.util.concurrent.ThreadLocalRandom.current().nextInt(1, 7); } }",+ Risk::ClockAndRandom,+ ),+ (+ Lang::Java,+ "Dice.java",+ "class Dice { static int f() { return new java.security.SecureRandom().nextInt(6) + 1; } }",+ Risk::ClockAndRandom,+ ),+ (+ Lang::Kotlin,+ "Dice.kt",+ "fun roll(): Int = ThreadLocalRandom.current().nextInt(6)\n",+ Risk::ClockAndRandom,+ ),(Lang::Go,"x.go",