geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From u..@apache.org
Subject [12/14] geode git commit: GEODE-3471: Identify NPE in MBeanProxyFactory
Date Tue, 22 Aug 2017 16:39:31 GMT
GEODE-3471: Identify NPE in MBeanProxyFactory


Project: http://git-wip-us.apache.org/repos/asf/geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/geode/commit/68e8b7e7
Tree: http://git-wip-us.apache.org/repos/asf/geode/tree/68e8b7e7
Diff: http://git-wip-us.apache.org/repos/asf/geode/diff/68e8b7e7

Branch: refs/heads/feature/GEODE-3416
Commit: 68e8b7e7ffe3d337f947f212c35b9a35305a8346
Parents: 6a7f362
Author: Jared Stewart <jstewart@pivotal.io>
Authored: Fri Aug 18 14:54:34 2017 -0700
Committer: Jared Stewart <jstewart@pivotal.io>
Committed: Mon Aug 21 15:33:55 2017 -0700

----------------------------------------------------------------------
 .../management/internal/MBeanProxyFactory.java      | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/geode/blob/68e8b7e7/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
----------------------------------------------------------------------
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
b/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
index 0cce0be..4f8366a 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/MBeanProxyFactory.java
@@ -32,14 +32,12 @@ import org.apache.geode.management.ManagementException;
 
 /**
  * Instance of this class is responsible for proxy creation/deletion etc.
- * 
+ *
  * If a member is added/removed proxy factory is responsible for creating removing the corresponding
  * proxies for that member.
- * 
+ *
  * It also maintains a proxy repository {@link MBeanProxyInfoRepository} for quick access
to the
  * proxy instances
- * 
- * 
  */
 public class MBeanProxyFactory {
   private static final Logger logger = LogService.getLogger();
@@ -80,10 +78,11 @@ public class MBeanProxyFactory {
       Region<String, Object> monitoringRegion, Object newVal) {
 
     try {
+      String name = objectName.toString();
+      FederationComponent federationComponent = (FederationComponent) monitoringRegion.get(name);
+      String interfaceClassName = federationComponent.getMBeanInterfaceClass();
 
-      Class interfaceClass = ClassLoadUtil
-          .classFromName(((FederationComponent) monitoringRegion.get(objectName.toString()))
-              .getMBeanInterfaceClass());
+      Class interfaceClass = ClassLoadUtil.classFromName(interfaceClassName);
 
       Object object = MBeanProxyInvocationHandler.newProxyInstance(member, monitoringRegion,
           objectName, interfaceClass);
@@ -112,7 +111,7 @@ public class MBeanProxyFactory {
   /**
    * This method will create all the proxies for a given DistributedMember. It does not throw
any
    * exception to its caller. It handles the error and logs error messages
-   * 
+   *
    * It will be called from GII or when a member joins the system
    * 
    * @param member {@link org.apache.geode.distributed.DistributedMember}
@@ -234,7 +233,6 @@ public class MBeanProxyFactory {
    */
   public <T> T findProxy(ObjectName objectName, Class<T> interfaceClass) {
 
-
     return proxyRepo.findProxyByName(objectName, interfaceClass);
 
 


Mime
View raw message