Skip to content

Commit

Permalink
Merge pull request #174 from orphan-oss/fix-illegal-argument
Browse files Browse the repository at this point in the history
Passes instance of MemberAccess to OgnlContext to avoid IllegalArgumentException
  • Loading branch information
lukaszlenart authored Sep 5, 2022
2 parents 693cf0b + 90dff32 commit 9fe5c32
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/ognl/Ognl.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public boolean isAccessible(Map context, Object target, Member member, String pr
return Modifier.isPublic(modifiers);
}
};
return addDefaultContext(root, memberAccess, classResolver, null, new OgnlContext(classResolver, null, null));
return addDefaultContext(root, memberAccess, classResolver, null, new OgnlContext(classResolver, null, memberAccess));
}

/**
Expand All @@ -277,7 +277,7 @@ public boolean isAccessible(Map context, Object target, Member member, String pr
return Modifier.isPublic(modifiers);
}
};
return addDefaultContext(root, memberAccess, classResolver, converter, new OgnlContext(classResolver, converter, null));
return addDefaultContext(root, memberAccess, classResolver, converter, new OgnlContext(classResolver, converter, memberAccess));
}

/**
Expand Down Expand Up @@ -830,11 +830,11 @@ public static void setValue(Object tree, Map context, Object root, Object value)
}

/**
* Sets the value given using the pre-compiled expression on the specified root
* Sets the value given using the pre-compiled expression on the specified root
* object.
*
* @param expression
* The pre-compiled expression, as found in {@link Node#getAccessor()}.
* The pre-compiled expression, as found in {@link Node#getAccessor()}.
* @param context
* The ognl context.
* @param root
Expand Down

0 comments on commit 9fe5c32

Please sign in to comment.