Missing a common interface between MethodGenericsContext and ConstructorGenericsContext
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Start by reading MethodGenericsContext and ConstructorGenericsContext, especially their parameter-inspection methods such as resolveParametersTypes() and parameterType(int). Decide whether a shared interface or parent class best exposes the common API while avoiding duplication. Done means callers can use one common type for both contexts and the existing behavior remains available.
Written by the indexing model from the issue text.
Description
java.lang.reflect.Constructor and java.lang.reflect.Method all inherit from java.lang.reflect.Executable, which defines all methods related to inspection of the arguments.
This allows to make some common code for inspecting the parameters of either a constructor or a method.
Generics-Resolver does not currently expose any such common parent between ConstructorGenericsContext and MethodGenericsContext, so it becomes difficult to share this kind of code when working with generics. (I am currently using a wrapper class around both objects, but this is not very nice)
A quick suggestion is to create an ExecutableGenericsContext interface defining the resolveParametersTypes() and parameterType(final int pos) methods, and a few others.
You could probably refactor the lib code a bit to make this a common parent class instead and avoid code duplication, but that's up to you - for the end user, the result will be the same :-)
- Dominant language
- Java
- Stars
- 52
- Forks
- 9
- Avg merge
- 4h 4m
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from xvik/generics-resolver
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
xvik/generics-resolver#10 · 2 comments ·
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 38/100
xvik/generics-resolver#9 · 1 comment ·
All issues in xvik/generics-resolver
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spring-projects/spring-modulith#1895 ·