Skip to content

Commit

Permalink
Remove Void wrapper registration in ReflectionUtils
Browse files Browse the repository at this point in the history
Closes #4048
  • Loading branch information
sbrannen committed Jan 20, 2025
1 parent dde72a9 commit 5fd9e88
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ JUnit repository on GitHub.
* The `ReflectionSupport.tryToLoadClass(...)` utility methods now support lookups for the
`"void"` pseudo-type, which indirectly supports `String` to `Class` conversion for
`"void"` in parameterized tests in JUnit Jupiter.
* `ReflectionUtils` now treats `Void` as a _wrapper_ type for the `void` pseudo-type.
* New `addResourceContainerSelectorResolver()` method in
`EngineDiscoveryRequestResolver.Builder` which supports the discovery of class path
resource based tests, analogous to the existing `addClassContainerSelectorResolver()`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ public enum HierarchyTraversalMode {
primitivesToWrappers.put(long.class, Long.class);
primitivesToWrappers.put(float.class, Float.class);
primitivesToWrappers.put(double.class, Double.class);
primitivesToWrappers.put(void.class, Void.class);

primitiveToWrapperMap = Collections.unmodifiableMap(primitivesToWrappers);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ void isAssignableTo() {
// Wrappers to Primitives
assertTrue(ReflectionUtils.isAssignableTo(Integer.class, int.class));
assertTrue(ReflectionUtils.isAssignableTo(Boolean.class, boolean.class));
assertTrue(ReflectionUtils.isAssignableTo(Void.class, void.class));

// Void to void
assertFalse(ReflectionUtils.isAssignableTo(Void.class, void.class));

// Widening Conversions from Wrappers to Primitives
assertTrue(ReflectionUtils.isAssignableTo(Integer.class, long.class));
Expand Down

0 comments on commit 5fd9e88

Please sign in to comment.