Source:
<code>public ArrayList<Subscription> getFilteredSubscriptions(boolean isDurable, boolean isActive, String protocolType, String destinationType, String filteredNamePattern, boolean isFilteredNameByExactMatch, String identifierPattern, boolean isIdentifierPatternByExactMatch, String ownNodeId, int pageNumber, int subscriptionCountPerPage) throws SubscriptionManagerException { ArrayList<Subscription> subscriptionDetailsList = new ArrayList<>(); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=SubscriptionManagementInformation," + "name=SubscriptionManagementInformation"); Object[] parameters = new Object[]{isDurable, isActive, protocolType, destinationType, filteredNamePattern, isFilteredNameByExactMatch,identifierPattern, isIdentifierPatternByExactMatch, ownNodeId, pageNumber, subscriptionCountPerPage}; String[] signature = new String[]{boolean.class.getName(), boolean.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), boolean.class.getName(), String.class.getName(), boolean.class.getName(), String.class.getName(), int.class.getName(), int.class.getName()}; Object result = mBeanServer.invoke(objectName, SubscriptionManagementConstants.FILTERED_SUBSCRIPTIONS_MBEAN_ATTRIBUTE, parameters, signature); <START> if (result != null) { <END> String[] subscriptionInformationList = (String[]) result; for (String subscriptionInfo : subscriptionInformationList) { Subscription sub = Utils.parseStringToASubscription(subscriptionInfo); subscriptionDetailsList.add(sub); } } return subscriptionDetailsList; } catch (MalformedObjectNameException | InstanceNotFoundException | MBeanException | ReflectionException e) { throw new SubscriptionManagerException("Error while invoking mBean operations to get " + "subscription list", e); } }</code><technical_language>flip null check</technical_language>

Target:
public ArrayList<Subscription> getFilteredSubscriptions(boolean isDurable, boolean isActive, String protocolType, String destinationType, String filteredNamePattern, boolean isFilteredNameByExactMatch, String identifierPattern, boolean isIdentifierPatternByExactMatch, String ownNodeId, int pageNumber, int subscriptionCountPerPage) throws SubscriptionManagerException { ArrayList<Subscription> subscriptionDetailsList = new ArrayList<>(); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=SubscriptionManagementInformation," + "name=SubscriptionManagementInformation"); Object[] parameters = new Object[]{isDurable, isActive, protocolType, destinationType, filteredNamePattern, isFilteredNameByExactMatch,identifierPattern, isIdentifierPatternByExactMatch, ownNodeId, pageNumber, subscriptionCountPerPage}; String[] signature = new String[]{boolean.class.getName(), boolean.class.getName(), String.class.getName(), String.class.getName(), String.class.getName(), boolean.class.getName(), String.class.getName(), boolean.class.getName(), String.class.getName(), int.class.getName(), int.class.getName()}; Object result = mBeanServer.invoke(objectName, SubscriptionManagementConstants.FILTERED_SUBSCRIPTIONS_MBEAN_ATTRIBUTE, parameters, signature); if (null != result) { String[] subscriptionInformationList = (String[]) result; for (String subscriptionInfo : subscriptionInformationList) { Subscription sub = Utils.parseStringToASubscription(subscriptionInfo); subscriptionDetailsList.add(sub); } } return subscriptionDetailsList; } catch (MalformedObjectNameException | InstanceNotFoundException | MBeanException | ReflectionException e) { throw new SubscriptionManagerException("Error while invoking mBean operations to get " + "subscription list", e); } }