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

Overload JavaClass.getConstructor() and JavaClass.getMethod() #246

Merged
merged 2 commits into from
Nov 3, 2019

Conversation

rweisleder
Copy link
Contributor

@rweisleder rweisleder commented Oct 7, 2019

This commit adds the methods

  • JavaClass.getConstructor(String... parameters)
  • JavaClass.getMethod(String name, String... parameters)
  • JavaClass.tryGetMethod(String name, String... parameters)

to retrieve constructors/methods even if a parameter type is not present on the classpath.

The methods

  • JavaClass.getConstructor()
  • JavaClass.getMethod(String name)
  • JavaClass.tryGetMethod(String name)

to retrieve constructors/methods without parameters where added to avoid ambiguous method calls.

Resolves #236

@ghost
Copy link

ghost commented Oct 7, 2019

DeepCode Report (#1e2401)

DeepCode analyzed this pull request.
There are no new issues.

This commit adds the methods
  JavaClass.getConstructor(String... parameters)
  JavaClass.getMethod(String name, String... parameters)
  JavaClass.tryGetMethod(String name, String... parameters)
to retrieve constructors/methods even if a parameter type is not present
on the classpath.

The methods
  JavaClass.getConstructor()
  JavaClass.getMethod(String name)
  JavaClass.tryGetMethod(String name)
to retrieve constructors/methods without parameters where added to avoid
ambiguous method calls.

Resolves TNG#236

Signed-off-by: Roland Weisleder <[email protected]>
@codecholeric
Copy link
Collaborator

Nice, thanks a lot for your support!! 😃 I extracted some local variables in the test, since the clutter I originally added got even worse to read now 😉

@codecholeric codecholeric merged commit 40625a3 into TNG:master Nov 3, 2019
@rweisleder rweisleder deleted the gh-236 branch November 3, 2019 16:30
codecholeric added a commit that referenced this pull request Feb 21, 2021
Overload JavaClass.getConstructor() and JavaClass.getMethod()
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.

JavaClass should offer getters for methods and constructors independent of the classpath
2 participants