alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525288216
##########
File path:
modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -116,15 +125,28 @@ public IgniteUuid serviceId() {
}
/** {@inheritDoc} */
- @SuppressWarnings("unchecked")
@Override public Class<? extends Service> serviceClass() {
if (cfg instanceof LazyServiceConfiguration) {
+ if (srvcCls != null)
+ return srvcCls;
+
String clsName =
((LazyServiceConfiguration)cfg).serviceClassName();
try {
- return (Class<? extends Service>)Class.forName(clsName);
+ srvcCls = (Class<? extends Service>)Class.forName(clsName);
+
+ return srvcCls;
}
catch (ClassNotFoundException e) {
+ GridDeployment srvcDep = ctx.deploy().getDeployment(clsName);
Review comment:
It's only one line of code can be reused, I think it's not such a good
idea to make a new method to reuse only `ctx.deploy().getDeployment(clsName)`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]