Scope implementation and transition capping to package-qualified types
When an interface simple name is ambiguous, resolve FQN implementation lookups within the requested package only, and stop capping polymorphic candidates to machine transitions by constant name across enum types. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -263,6 +263,16 @@ class MachineEnumCanonicalizerTest {
|
||||
assertThat(enriched.getPolymorphicEvents()).isNullOrEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldNotCapForeignPackageEnumConstantToMachineTransition() {
|
||||
List<String> capped = MachineEnumCanonicalizer.capToConfiguredTransitionEvents(
|
||||
List.of("b.OrderEvent.PAY"),
|
||||
List.of("a.OrderEvent.PAY"),
|
||||
"a.OrderEvent");
|
||||
|
||||
assertThat(capped).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldValidateRawNameConsistencyForCanonicalHelpers() {
|
||||
assertThat(MachineEnumCanonicalizer.isRawNameConsistentWithFullIdentifier(
|
||||
|
||||
@@ -271,8 +271,8 @@ class CodebaseContextTest {
|
||||
assertThat(context.getImplementations("Service"))
|
||||
.as("ambiguous simple interface name must not widen to arbitrary impls")
|
||||
.isEmpty();
|
||||
assertThat(context.getImplementations("a.Service")).contains("a.AServiceImpl");
|
||||
assertThat(context.getImplementations("b.Service")).contains("b.BServiceImpl");
|
||||
assertThat(context.getImplementations("a.Service")).containsExactly("a.AServiceImpl");
|
||||
assertThat(context.getImplementations("b.Service")).containsExactly("b.BServiceImpl");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user