Skip to content

Change MigrateClassNewInstanceToGetDeclaredConstructorNewInstance to an imperative recipe #51

@traceyyoshima

Description

@traceyyoshima

The recipe replaces Class#newInstance() (deprecated in java 9) withClass#getDeclaredConstructor().newInstance().
The changes introduce 2 checked exceptions:

  • NoSuchMethodException in getDeclaredConstructor()
  • InvocationTargetException in newInstance()

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions