Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work on generic support #835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Thrameos
Copy link
Contributor

@Thrameos Thrameos commented Aug 5, 2020

This is a draft PR which adds support for representing Generics in JPype.

In the PR we make is so that Java class with generics according to reflection can be used like

JA = java.util.ArrayList
JAS = java.util.ArrayList[java.lang.String]
JAS@['yes','no'] # works
JAS@['yes', 1'] # fails 1 is not castable to string.

The intent is to make is so when converting to the generic type the arguments will be checked.

Currently this PR just adds the types to the class. We need to update the converters to make use of them.

@codecov
Copy link

codecov bot commented Aug 5, 2020

Codecov Report

Merging #835 into master will decrease coverage by 0.29%.
The diff coverage is 25.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #835      +/-   ##
============================================
- Coverage     83.06%   82.77%   -0.30%     
- Complexity      442      443       +1     
============================================
  Files           142      142              
  Lines         11822    11875      +53     
  Branches       4462     4496      +34     
============================================
+ Hits           9820     9829       +9     
- Misses         1249     1289      +40     
- Partials        753      757       +4     
Impacted Files Coverage Δ Complexity Δ
native/common/include/jp_class.h 93.33% <0.00%> (-6.67%) 0.00 <0.00> (ø)
native/common/include/jp_modifier.h 87.50% <0.00%> (-5.84%) 0.00 <0.00> (ø)
native/python/include/pyjp.h 100.00% <ø> (ø) 0.00 <0.00> (ø)
native/python/pyjp_class.cpp 80.23% <20.00%> (-4.98%) 0.00 <0.00> (ø)
native/java/org/jpype/manager/ModifierCode.java 100.00% <100.00%> (ø) 7.00 <0.00> (ø)
native/java/org/jpype/manager/TypeManager.java 90.32% <100.00%> (+0.04%) 107.00 <0.00> (+1.00)
native/python/pyjp_module.cpp 83.09% <100.00%> (+0.09%) 0.00 <0.00> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa31348...796556f. Read the comment docs.

@Thrameos Thrameos added the enhancement Improvement in capability planned for future release label Nov 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvement in capability planned for future release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant