Skip to content

Commit

Permalink
Throw an exception if a BackedConfigLeaf is made with a non-accessibl…
Browse files Browse the repository at this point in the history
…e field
  • Loading branch information
zeroeightysix committed Jan 24, 2021
1 parent a3bf276 commit 041bfa5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class BackedConfigLeaf<R, S> implements ConfigLeaf<S> {
private ConfigBranch parent;

public BackedConfigLeaf(ConfigLeaf<S> backing, ConfigType<R, S, ?> type, Object pojo, Field backingField) {
if (!backingField.isAccessible()) throw new RuntimeFiberException("A BackedConfigLeaf may only be made for an accessible field!");

this.backing = backing;
this.type = type;
this.pojo = pojo;
Expand Down

0 comments on commit 041bfa5

Please sign in to comment.