Skip to content

Commit

Permalink
Make FrameworkField ctor public. Fixes #1668
Browse files Browse the repository at this point in the history
Prior to this change, custom runners could make `FrameworkMethod`
instances, but not `FrameworkField` instances. This small change
allows for both now, because `FrameworkField`'s constructor has been
promoted to `public` from package-private.
  • Loading branch information
Paul Holser committed Jul 20, 2020
1 parent c53a277 commit c1203e0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/junit/runners/model/FrameworkField.java
Expand Up @@ -15,6 +15,11 @@
public class FrameworkField extends FrameworkMember<FrameworkField> {
private final Field field;

/**
* Returns a new {@code FrameworkField} for {@code field}.
*
* Access relaxed to {@code public} since version 4.14.
*/
FrameworkField(Field field) {
if (field == null) {
throw new NullPointerException(
Expand All @@ -26,7 +31,7 @@ public class FrameworkField extends FrameworkMember<FrameworkField> {
// This field could be a public field in a package-scope base class
try {
field.setAccessible(true);
} catch (SecurityException e) {
} catch (SecurityException e) {
// We may get an IllegalAccessException when we try to access the field
}
}
Expand Down

0 comments on commit c1203e0

Please sign in to comment.