Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Thrameos committed Nov 29, 2024
1 parent 81f5687 commit b657fbe
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
2 changes: 2 additions & 0 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Latest Changes:

- Roll back agent change due to misbehaving JVM installs.

- Correct issues with non-ascii path for jdbc connections and forName.

- **1.5.1 - 2024-11-09**

- Future proofing for Python 3.14
Expand Down
4 changes: 2 additions & 2 deletions native/common/include/jp_method.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class JPMethod : public JPResource
*
*/
JPMatch::Type matches(JPJavaFrame &frame, JPMethodMatch& match, bool isInstance, JPPyObjectVector& args);
JPPyObject invoke(JPJavaFrame &frame, JPMethodMatch& match, JPPyObjectVector& arg, bool instance, bool caller);
JPPyObject invoke(JPJavaFrame &frame, JPMethodMatch& match, JPPyObjectVector& arg, bool instance);
JPPyObject invokeCallerSensitive(JPMethodMatch& match, JPPyObjectVector& arg, bool instance);
JPValue invokeConstructor(JPJavaFrame &frame, JPMethodMatch& match, JPPyObjectVector& arg);

Expand Down Expand Up @@ -116,4 +116,4 @@ class JPMethod : public JPResource
jint m_Modifiers{};
} ;

#endif // _JPMETHOD_H_
#endif // _JPMETHOD_H_
4 changes: 2 additions & 2 deletions native/common/include/jp_methoddispatch.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class JPMethodDispatch : public JPResource
return JPModifier::isBeanAccessor(m_Modifiers);
}

JPPyObject invoke(JPJavaFrame& frame, JPPyObjectVector& vargs, bool instance, bool no_caller);
JPPyObject invoke(JPJavaFrame& frame, JPPyObjectVector& vargs, bool instance);
JPValue invokeConstructor(JPJavaFrame& frame, JPPyObjectVector& vargs);
bool matches(JPJavaFrame& frame, JPPyObjectVector& args, bool instance);

Expand All @@ -89,4 +89,4 @@ class JPMethodDispatch : public JPResource
JPMethodCache m_LastCache{};
} ;

#endif // _JPMETHODDISPATCH_H_
#endif // _JPMETHODDISPATCH_H_
4 changes: 2 additions & 2 deletions native/common/jp_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ void JPMethod::packArgs(JPJavaFrame &frame, JPMethodMatch &match,
JP_TRACE_OUT; // GCOVR_EXCL_LINE
}

JPPyObject JPMethod::invoke(JPJavaFrame& frame, JPMethodMatch& match, JPPyObjectVector& arg, bool instance, bool caller)
JPPyObject JPMethod::invoke(JPJavaFrame& frame, JPMethodMatch& match, JPPyObjectVector& arg, bool instance)
{
JP_TRACE_IN("JPMethod::invoke");
// Check if it is caller sensitive
if (caller && isCallerSensitive())
if (isCallerSensitive())
return invokeCallerSensitive(match, arg, instance);

size_t alen = m_ParameterTypes.size();
Expand Down
4 changes: 2 additions & 2 deletions native/common/jp_methoddispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,12 +209,12 @@ bool JPMethodDispatch::findOverload(JPJavaFrame& frame, JPMethodMatch &bestMatch
JP_TRACE_OUT;
}

JPPyObject JPMethodDispatch::invoke(JPJavaFrame& frame, JPPyObjectVector& args, bool instance, bool caller)
JPPyObject JPMethodDispatch::invoke(JPJavaFrame& frame, JPPyObjectVector& args, bool instance)
{
JP_TRACE_IN("JPMethodDispatch::invoke");
JPMethodMatch match(frame, args, instance);
findOverload(frame, match, args, instance, true);
return match.m_Overload->invoke(frame, match, args, instance, caller);
return match.m_Overload->invoke(frame, match, args, instance);
JP_TRACE_OUT;
}

Expand Down
7 changes: 2 additions & 5 deletions native/python/pyjp_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,15 @@ static PyObject *PyJPMethod_call(PyJPMethod *self, PyObject *args, PyObject *kwa
// Clear any pending interrupts if we are on the main thread
if (hasInterrupt())
frame.clearInterrupt(false);
bool caller = true;
if (kwargs != nullptr && PyDict_GetItemString(kwargs, "caller") == Py_False)
caller = false;
PyObject *out = nullptr;
if (self->m_Instance == nullptr)
{
JPPyObjectVector vargs(args);
out = self->m_Method->invoke(frame, vargs, false, caller).keep();
out = self->m_Method->invoke(frame, vargs, false).keep();
} else
{
JPPyObjectVector vargs(self->m_Instance, args);
out = self->m_Method->invoke(frame, vargs, true, caller).keep();
out = self->m_Method->invoke(frame, vargs, true).keep();
}
return out;
JP_PY_CATCH(nullptr); // GCOVR_EXCL_LINE
Expand Down

0 comments on commit b657fbe

Please sign in to comment.