Deepthought icon indicating copy to clipboard operation
Deepthought copied to clipboard

why is updatesHandlerBase final in ChatUpdatesBuilderImpl?

Open afshar-mohammad opened this issue 8 years ago • 0 comments

In ChatUpdatesBuilderImpl class we have private final Class<CustomUpdatesHandler> updatesHandlerBase; as a field.

Then in public UpdatesHandlerBase build() function we have:

final Constructor<CustomUpdatesHandler> constructor = updatesHandlerBase.getConstructor(IKernelComm.class,
            IDifferenceParametersService.class, DatabaseManager.class);
final CustomUpdatesHandler updatesHandler =
            constructor.newInstance(kernelComm, differenceParametersService, getDatabaseManager());

Why is it made final and then a new instance is made and returned? Couldn't it be just not final and the same instance returned after changes?

afshar-mohammad avatar Oct 25 '16 06:10 afshar-mohammad