mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[build] Java 25 support (#8775)
Commands v3 had a few changes due to the upgrade: - Java 24 removed the Pinned: MONITOR IllegalStateException when yielding in a synchronized block, so we no longer need to special case for it - Lambda method name generation was tweaked, requiring tests to be updated - Bazel java_rules needed to be bumped to support Java 25 Closes #8425
This commit is contained in:
@@ -58,13 +58,8 @@ class CoroutineTest extends CommandTestBase {
|
||||
.named("Yield In Synchronized Block");
|
||||
|
||||
m_scheduler.schedule(yieldInSynchronized);
|
||||
|
||||
var error = assertThrows(IllegalStateException.class, m_scheduler::run);
|
||||
assertEquals(
|
||||
"Coroutine.yield() cannot be called inside a synchronized block or method. "
|
||||
+ "Consider using a Lock instead of synchronized, "
|
||||
+ "or rewrite your code to avoid locks and mutexes altogether.",
|
||||
error.getMessage());
|
||||
m_scheduler.run();
|
||||
assertEquals(1, i.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -88,8 +88,8 @@ class SchedulerErrorHandlingTests extends CommandTestBase {
|
||||
|
||||
// user code trace for where the command was scheduled (the `.onTrue()` line)
|
||||
assertEquals("=== Command Binding Trace ===", stackTrace[nestedIndex + 2].getClassName());
|
||||
assertEquals("lambda$nestedErrorDetection$4", stackTrace[nestedIndex + 3].getMethodName());
|
||||
assertEquals("lambda$nestedErrorDetection$5", stackTrace[nestedIndex + 4].getMethodName());
|
||||
assertEquals("lambda$nestedErrorDetection$1", stackTrace[nestedIndex + 3].getMethodName());
|
||||
assertEquals("lambda$nestedErrorDetection$0", stackTrace[nestedIndex + 4].getMethodName());
|
||||
assertEquals("nestedErrorDetection", stackTrace[nestedIndex + 5].getMethodName());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user