Skip to content

Support for hotpatch of static fields#1354

Open
Thrameos wants to merge 7 commits intojpype-project:masterfrom
Thrameos:hotpatch
Open

Support for hotpatch of static fields#1354
Thrameos wants to merge 7 commits intojpype-project:masterfrom
Thrameos:hotpatch

Conversation

@Thrameos
Copy link
Copy Markdown
Contributor

@Thrameos Thrameos commented Apr 7, 2026

This is a specific edge case. It is an edge case where you want to be able to get to an aliased copy of a member. To make it nicer deal with the descriptors I have added a "." leader which prevent descriptors from being dereference.

Fixes #1328

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 77.14286% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.26%. Comparing base (eeefa8d) to head (18c5ffd).

Files with missing lines Patch % Lines
native/python/pyjp_class.cpp 79.31% 2 Missing and 4 partials ⚠️
jpype/_jcustomizer.py 66.66% 1 Missing ⚠️
jpype/beans.py 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1354      +/-   ##
==========================================
- Coverage   86.30%   86.26%   -0.05%     
==========================================
  Files         113      113              
  Lines       10532    10551      +19     
  Branches     4041     4055      +14     
==========================================
+ Hits         9090     9102      +12     
- Misses        840      847       +7     
  Partials      602      602              
Files with missing lines Coverage Δ
jpype/_jclass.py 99.25% <100.00%> (+<0.01%) ⬆️
jpype/_jcustomizer.py 82.35% <66.66%> (ø)
jpype/beans.py 0.00% <0.00%> (ø)
native/python/pyjp_class.cpp 84.72% <79.31%> (-0.65%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Thrameos
Copy link
Copy Markdown
Contributor Author

I will need to refresh this one. Unfortunately it exposed a bug that it is impossible to access members that start with underscore from java because we unconditionally gave that space to Python. I also found it very difficult to perform renaming tasks. This PR will fix both those issues.

PyObject *value = nullptr;
if (!PyArg_ParseTuple(args, "OO", &name, &value))
return nullptr;
// PyErr_WarnEx(PyExc_DeprecationWarning, "_customize() is deprecated, use "setattr(cls,'.'+name,value)" syntax instead", 1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accessing Java variables with illegal Python characters

2 participants