Source:
<code><R> List<R> executeAndGetFunctionResult(Function function, AbstractConfiguration configuration, CacheElementOperation operation, Set<DistributedMember> targetMembers) { if (targetMembers.size() == 0) { return Collections.emptyList(); } List<R> results = new ArrayList(); File file = null; RemoteStreamExporter exporter = null; if (configuration instanceof HasFile) { ManagementAgent agent = ((SystemManagementService) ManagementService.getExistingManagementService(cache)) .getManagementAgent(); exporter = agent.getRemoteStreamExporter(); file = ((HasFile) configuration).getFile(); } for (DistributedMember member : targetMembers) { RemoteInputStream remoteInputStream = null; if (file != null && exporter != null) { try { remoteInputStream = exporter .export(new SimpleRemoteInputStream(new FileInputStream(file.getAbsolutePath()))); <START> } catch (Exception e) { <END> raise(StatusCode.ILLEGAL_ARGUMENT, "Invalid file: " + file.getAbsolutePath()); } } Execution execution = FunctionService.onMember(member) .setArguments(Arrays.asList(configuration, operation, remoteInputStream)); ((AbstractExecution) execution).setIgnoreDepartedMembers(true); results.add(((List<R>) execution.execute(function).getResult()).get(0)); if (remoteInputStream != null) { try { remoteInputStream.close(true); } catch (IOException ex) { } } } return results; }</code><technical_language>another catch Exception a</technical_language>

Target:
<R> List<R> executeAndGetFunctionResult(Function function, AbstractConfiguration configuration, CacheElementOperation operation, Set<DistributedMember> targetMembers) { if (targetMembers.size() == 0) { return Collections.emptyList(); } List<R> results = new ArrayList(); File file = null; if (configuration instanceof HasFile) { file = ((HasFile) configuration).getFile(); } if (file == null) { Execution execution = FunctionService.onMembers(targetMembers) .setArguments(Arrays.asList(configuration, operation, null)); ((AbstractExecution) execution).setIgnoreDepartedMembers(true); ResultCollector rc = execution.execute(function); return (List<R>) rc.getResult(); } RemoteStreamExporter exporter = null; ManagementAgent agent = ((SystemManagementService) ManagementService.getExistingManagementService(cache)) .getManagementAgent(); exporter = agent.getRemoteStreamExporter(); for (DistributedMember member : targetMembers) { FileInputStream fileInputStream = null; SimpleRemoteInputStream inputStream = null; RemoteInputStream remoteInputStream = null; try { fileInputStream = new FileInputStream(file.getAbsolutePath()); inputStream = new SimpleRemoteInputStream(fileInputStream); remoteInputStream = exporter.export(inputStream); Execution execution = FunctionService.onMember(member) .setArguments(Arrays.asList(configuration, operation, remoteInputStream)); ((AbstractExecution) execution).setIgnoreDepartedMembers(true); results.add(((List<R>) execution.execute(function).getResult()).get(0)); } catch (IOException e) { raise(StatusCode.ILLEGAL_ARGUMENT, "Invalid file: " + file.getAbsolutePath()); } finally { try { if (fileInputStream != null) { fileInputStream.close(); } if (inputStream != null) { inputStream.close(); } if (remoteInputStream != null) { remoteInputStream.close(true); } } catch (IOException ex) { } } } return results; }