auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public PaxosTimestampBoundStore( PaxosProposer proposer, PaxosLearner knowledge, PaxosAcceptorNetworkClient acceptorNetworkClient, PaxosLearnerNetworkClient learnerClient, long maximumWaitBeforeProposalMs) { this.acceptorNetworkClient = acceptorNetworkClient; this.learnerClient = learnerClient; DebugLogger.logger.info("Creating PaxosTimestampBoundStore. The UUID of my proposer is {}. " + "Currently, I believe the timestamp bound is {}.", SafeArg.of("proposerUuid", proposer.getUuid()), SafeArg.of("timestampBound", knowledge.getGreatestLearnedValue())); this.proposer = proposer; this.knowledge = knowledge; this.maximumWaitBeforeProposalMs = maximumWaitBeforeProposalMs; }

Target:
public PaxosTimestampBoundStore( PaxosProposer proposer, PaxosLearner knowledge, PaxosAcceptorNetworkClient acceptorNetworkClient, PaxosLearnerNetworkClient learnerClient, long maximumWaitBeforeProposalMs) { DebugLogger.logger.info("Creating PaxosTimestampBoundStore. The UUID of my proposer is {}. " + "Currently, I believe the timestamp bound is {}.", SafeArg.of("proposerUuid", proposer.getUuid()), SafeArg.of("timestampBound", knowledge.getGreatestLearnedValue())); this.proposer = proposer; this.knowledge = knowledge; this.acceptorNetworkClient = acceptorNetworkClient; this.learnerClient = learnerClient; this.maximumWaitBeforeProposalMs = maximumWaitBeforeProposalMs; }
Source:
public int compare(Viewer viewer, Object e1, Object e2) { if (WorkbenchSWTMessages.ICategory_general.equals(e1)) return -1; if (WorkbenchSWTMessages.ICategory_general.equals(e2)) return 1; String str1; if (e1 instanceof MPartDescriptor) str1 = ((MPartDescriptor) e1).getLocalizedLabel(); else str1 = e1.toString(); String str2; if (e2 instanceof MPartDescriptor) str2 = ((MPartDescriptor) e2).getLocalizedLabel(); else str2 = e2.toString(); if (str1 == null) str1 = EMPTY_STRING; if (str2 == null) str2 = EMPTY_STRING; return getComparator().compare(str1, str2); }

Target:
public int compare(Viewer viewer, Object e1, Object e2) { if (WorkbenchSWTMessages.ICategory_general.equals(e1)) { return -1; } if (WorkbenchSWTMessages.ICategory_general.equals(e2)) { return 1; } String str1; if (e1 instanceof MPartDescriptor) { str1 = ((MPartDescriptor) e1).getLocalizedLabel(); } else { str1 = e1.toString(); } String str2; if (e2 instanceof MPartDescriptor) { str2 = ((MPartDescriptor) e2).getLocalizedLabel(); } else { str2 = e2.toString(); } if (str1 == null) { str1 = EMPTY_STRING; } if (str2 == null) { str2 = EMPTY_STRING; } String s1 = DialogUtil.removeAccel(str1); String s2 = DialogUtil.removeAccel(str2); return getComparator().compare(s1, s2); }
Source:
public HttpClientRequestExecutor(ApiKey apiKey, Proxy proxy, AuthenticationScheme authenticationScheme) { Assert.notNull(apiKey, "apiKey argument is required."); this.apiKey = apiKey; if(authenticationScheme != null) { switch (authenticationScheme) { case Basic: this.requestAuthenticator = new BasicAuthenticationRequestAuthenticator(); break; case SAuthc1: this.requestAuthenticator = new Sauthc1RequestAuthenticator(); break; default: this.requestAuthenticator = new Sauthc1RequestAuthenticator(); break; } } else{ this.requestAuthenticator = new Sauthc1RequestAuthenticator(); } this.httpClientRequestFactory = new HttpClientRequestFactory(); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager(); connMgr.setDefaultMaxPerRoute(10); this.httpClient = new DefaultHttpClient(connMgr); httpClient.getParams().setParameter(AllClientPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); httpClient.getParams().setParameter(AllClientPNames.SO_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(AllClientPNames.CONNECTION_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, false); httpClient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); if (proxy != null) { HttpHost httpProxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpProxyHost); if (proxy.isAuthenticationRequired()) { httpClient.getCredentialsProvider().setCredentials( new AuthScope(proxy.getHost(), proxy.getPort()), new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword())); } } }

Target:
public HttpClientRequestExecutor(ApiKey apiKey, Proxy proxy, AuthenticationScheme authenticationScheme) { Assert.notNull(apiKey, "apiKey argument is required."); this.apiKey = apiKey; this.requestAuthenticator = requestAuthenticatorFactory.create(authenticationScheme); this.httpClientRequestFactory = new HttpClientRequestFactory(); PoolingClientConnectionManager connMgr = new PoolingClientConnectionManager(); connMgr.setDefaultMaxPerRoute(10); this.httpClient = new DefaultHttpClient(connMgr); httpClient.getParams().setParameter(AllClientPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); httpClient.getParams().setParameter(AllClientPNames.SO_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(AllClientPNames.CONNECTION_TIMEOUT, CONNECTION_TIMEOUT); httpClient.getParams().setParameter(ClientPNames.HANDLE_REDIRECTS, false); httpClient.getParams().setParameter("http.protocol.content-charset", "UTF-8"); if (proxy != null) { HttpHost httpProxyHost = new HttpHost(proxy.getHost(), proxy.getPort()); httpClient.getParams().setParameter(ConnRoutePNames.DEFAULT_PROXY, httpProxyHost); if (proxy.isAuthenticationRequired()) { httpClient.getCredentialsProvider().setCredentials( new AuthScope(proxy.getHost(), proxy.getPort()), new UsernamePasswordCredentials(proxy.getUsername(), proxy.getPassword())); } } }
Source:
public static void setup() { textAreaFormFieldValueProcessor = new TextAreaFormFieldValueProcessor(); multipleSubFormFieldValueProcessor = new MultipleSubFormFieldValueProcessor(); subFormFieldValueProcessor = new SubFormFieldValueProcessor(); localDateFieldValueProcessor = new LocalDateFieldValueProcessor(); localDateFieldValueProcessor.init(); formSerializer = new FormDefinitionSerializerImpl(new FieldSerializer(), new FormModelSerializer(), new TestMetaDataEntryManager()); textAreaTaskForm = getFormDefinition("TextareaTask-taskform.frm"); localDateTaskForm = getFormDefinition("LocalDateFieldTask-taskform.frm"); subformTaskForm = getFormDefinition("SubformTask-taskform.frm"); }

Target:
public static void setup() throws IOException { textAreaTaskForm = getFormDefinition("TextareaTask-taskform.frm"); localDateTaskForm = getFormDefinition("LocalDateFieldTask-taskform.frm"); subformTaskForm = getFormDefinition("SubformTask-taskform.frm"); }
Source:
public static void addRecipe(String recipeName, ItemStack itemstack, Object... obj) { if (Config.isDebug && itemstack.getMetadata() > 15) { Log.error("Tried to register a recipe %s for item %s with invalid metadata", recipeName, itemstack.getUnlocalizedName()); } ShapedRecipeCustom recipe = new ShapedRecipeCustom(itemstack, obj); recipe.setRegistryName(Constants.MOD_ID, recipeName); ForgeRegistries.RECIPES.register(recipe); }

Target:
public static void addRecipe(String recipeName, ItemStack itemstack, Object... obj) { ShapedRecipeCustom recipe = new ShapedRecipeCustom(itemstack, obj); recipe.setRegistryName(Constants.MOD_ID, recipeName); ForgeRegistries.RECIPES.register(recipe); }
Source:
protected void performDefaults() { for(int i=0; i<envVariables.length; i++) envVariables[i].loadDefault(); super.performDefaults(); }

Target:
protected void performDefaults() { for (StringFieldEditor envVariable : envVariables) { envVariable.loadDefault(); } super.performDefaults(); }
Source:
private static void alignStreamNode(StreamNode streamNode, StreamGraph streamGraph) { if (streamNode.getOperatorName().equals(KEYED_STREAM_VALUE_OPERATOR_NAME)) { StreamEdge downStreamEdge = streamNode.getOutEdges().get(0); StreamNode downStreamNode = streamGraph.getStreamNode(downStreamEdge.getTargetId()); chainStreamNode(downStreamEdge, streamNode, downStreamNode); downStreamEdge.setPartitioner(new ForwardPartitioner()); } if (streamNode.getOperatorName().equals(STREAM_KEY_BY_MAP_OPERATOR_NAME) || streamNode.getOperatorName().equals(STREAM_PARTITION_CUSTOM_MAP_OPERATOR_NAME) || streamNode.getOperatorName().equals(STREAM_TIMESTAMP_AND_WATERMARK_OPERATOR_NAME)) { StreamEdge upStreamEdge = streamNode.getInEdges().get(0); StreamNode upStreamNode = streamGraph.getStreamNode(upStreamEdge.getSourceId()); chainStreamNode(upStreamEdge, streamNode, upStreamNode); } }

Target:
private static void alignStreamNode(StreamNode streamNode, StreamGraph streamGraph) { if (streamNode.getOperatorName().equals(KEYED_STREAM_VALUE_OPERATOR_NAME)) { StreamEdge downStreamEdge = streamNode.getOutEdges().get(0); StreamNode downStreamNode = streamGraph.getStreamNode(downStreamEdge.getTargetId()); chainStreamNode(downStreamEdge, streamNode, downStreamNode); downStreamEdge.setPartitioner(new ForwardPartitioner()); } if (streamNode.getOperatorName().equals(STREAM_KEY_BY_MAP_OPERATOR_NAME) || streamNode.getOperatorName().equals(STREAM_PARTITION_CUSTOM_MAP_OPERATOR_NAME)) { StreamEdge upStreamEdge = streamNode.getInEdges().get(0); StreamNode upStreamNode = streamGraph.getStreamNode(upStreamEdge.getSourceId()); chainStreamNode(upStreamEdge, streamNode, upStreamNode); } }
Source:
private Environment readEnvironment(final Properties properties) { final String envName = read(ENV_KEY, properties); if (envName == null) { return DEFAULT_ENV; } for (Environment env : Environment.values()) { if (env.name().toLowerCase().equals(envName)) { return env; } } throw new InvalidEnvironmentException(envName); }

Target:
private Environment readEnvironment(final Properties properties) { final String envName = read(ENV_KEY, properties); if (Strings.isNullOrEmpty(envName)) { return DEFAULT_ENV; } for (Environment env : Environment.values()) { if (env.name().toLowerCase().equals(envName)) { return env; } } throw new InvalidEnvironmentException(envName); }
Source:
public ProcessInstance createAndStartProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition, String businessKey, String processInstanceName, FlowElement initialFlowElement, Process process, Map<String, Object> variables, Map<String, Object> transientVariables, boolean startProcessInstance) { if (processExtensionService.hasExtensionsFor(processDefinition)) { Map<String, Object> processedVariables=getVariablesFromExtensionFile(processDefinition,variables); return super.createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, processInstanceName, initialFlowElement, process, processedVariables, transientVariables, startProcessInstance); } return super.createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, processInstanceName, initialFlowElement, process, variables, transientVariables, startProcessInstance); }

Target:
public ProcessInstance createAndStartProcessInstanceWithInitialFlowElement(ProcessDefinition processDefinition, String businessKey, String processInstanceName, FlowElement initialFlowElement, Process process, Map<String, Object> variables, Map<String, Object> transientVariables, boolean startProcessInstance) { if (processExtensionService.hasExtensionsFor(processDefinition)) { Map<String, Object> processedVariables = calculateVariablesFromExtensionFile(processDefinition, variables); return super.createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, processInstanceName, initialFlowElement, process, processedVariables, transientVariables, startProcessInstance); } return super.createAndStartProcessInstanceWithInitialFlowElement(processDefinition, businessKey, processInstanceName, initialFlowElement, process, variables, transientVariables, startProcessInstance); }
Source:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("version: ").append(version); sb.append(" lastUpdateTime: ").append(lastUpdateTime); sb.append(" bytesRead: ").append(bytesRead); sb.append(" numLastUpdateTimeBlobsRead: ").append(lastUpdateTimeReadBlobIds); return sb.toString(); }

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("version: ").append(version); sb.append(" lastUpdateTime: ").append(lastUpdateTime); sb.append(" bytesRead: ").append(bytesRead); sb.append(" lastUpdateTimeReadBlobIds: ").append(lastUpdateTimeReadBlobIds); return sb.toString(); }
Source:
public Optional<DecorrelationResult> visitProject(ProjectNode node, Void context) { Optional<DecorrelationResult> childDecorrelationResultOptional = lookup.resolve(node.getSource()).accept(this, null); if (!childDecorrelationResultOptional.isPresent()) { return Optional.empty(); } DecorrelationResult childDecorrelationResult = childDecorrelationResultOptional.get(); List<Symbol> symbolsToAdd = childDecorrelationResult.symbolsToPropagate.stream() .filter(symbol -> !node.getOutputSymbols().contains(symbol)) .collect(toImmutableList()); Assignments assignments = Assignments.builder() .putAll(node.getAssignments()) .putIdentities(symbolsToAdd) .build(); return Optional.of(new DecorrelationResult( new ProjectNode(idAllocator.getNextId(), childDecorrelationResult.node, assignments), childDecorrelationResult.symbolsToPropagate, childDecorrelationResult.correlatedPredicates)); }

Target:
public Optional<DecorrelationResult> visitProject(ProjectNode node, Void context) { Optional<DecorrelationResult> childDecorrelationResultOptional = lookup.resolve(node.getSource()).accept(this, null); if (!childDecorrelationResultOptional.isPresent()) { return Optional.empty(); } DecorrelationResult childDecorrelationResult = childDecorrelationResultOptional.get(); Set<Symbol> nodeOutputSymbols = ImmutableSet.copyOf(node.getOutputSymbols()); List<Symbol> symbolsToAdd = childDecorrelationResult.symbolsToPropagate.stream() .filter(symbol -> !nodeOutputSymbols.contains(symbol)) .collect(toImmutableList()); Assignments assignments = Assignments.builder() .putAll(node.getAssignments()) .putIdentities(symbolsToAdd) .build(); return Optional.of(new DecorrelationResult( new ProjectNode(idAllocator.getNextId(), childDecorrelationResult.node, assignments), childDecorrelationResult.symbolsToPropagate, childDecorrelationResult.correlatedPredicates, childDecorrelationResult.correlatedSymbolsMapping, childDecorrelationResult.atMostSingleRow)); }
Source:
public boolean reacquireLocks() { return acquireLock(); }

Target:
public boolean reacquireLocks() { return acquireLockAsyncTask(); }
Source:
public void tearDown() throws Exception { if (factoryWsName != null) { workspaceServiceClient.delete(factoryWsName, user.getName()); } }

Target:
public void tearDown() throws Exception { workspaceServiceClient.deleteFactoryWorkspaces(testWorkspace.getName(), user.getName()); factoryServiceClient.deleteFactory(FACTORY_NAME); }
Source:
protected boolean isCreatingNamespace(String workspaceId) throws InfrastructureException { boolean legacyWithPlaceholders = isNullOrEmpty(legacyNamespaceName) || hasPlaceholders(legacyNamespaceName); boolean legacyExists = checkNamespaceExists( resolveLegacyNamespaceName(EnvironmentContext.getCurrent().getSubject(), workspaceId)); if (isNullOrEmpty(defaultNamespaceName) && !legacyExists) { throw new InfrastructureException( "Cannot determine whether a new namespace and service account should be" + " created for workspace %s. There is no pre-existing workspace namespace to be found using the legacy" + " `che.infra.kubernetes.namespace` property yet the `che.infra.kubernetes.namespace.default` property" + " is undefined."); } boolean defaultHasPlaceholders = hasPlaceholders(defaultNamespaceName); return (legacyWithPlaceholders && legacyExists) || (!legacyExists && defaultHasPlaceholders); }

Target:
protected boolean isCreatingNamespace(String workspaceId) throws InfrastructureException { boolean legacyExists = checkNamespaceExists( resolveLegacyNamespaceName(EnvironmentContext.getCurrent().getSubject(), workspaceId)); if (legacyExists) { return isNullOrEmpty(legacyNamespaceName) || hasPlaceholders(legacyNamespaceName); } if (isNullOrEmpty(defaultNamespaceName)) { throw new InfrastructureException( "Cannot determine whether a new namespace and service account should be" + " created for workspace %s. There is no pre-existing workspace namespace to be" + " found using the legacy `che.infra.kubernetes.namespace` property yet the" + " `che.infra.kubernetes.namespace.default` property is undefined."); } return hasPlaceholders(defaultNamespaceName); }
Source:
protected void executeQueryCommand() { log.info("arik " + getParameters().getOvf()); VM vm = new VM(); vm.setClusterArch(ArchitectureType.x86_64); Pattern p = Pattern.compile("<Name>(.*?)</Name>"); Matcher m = p.matcher(getParameters().getOvf()); if (m.find()) { String name = m.group(1); vm.setName(name); } setReturnValue(vm); }

Target:
protected void executeQueryCommand() { String ovfstring = getParameters().getOvf(); log.info("arik " + ovfstring); ovfstring = ovfstring.replaceAll("[\r\n]+", "").replaceAll("xmlns=[^-\\s]*", ""); VM vm = new VM(); List<DiskImage> images = new ArrayList<>(); List<VmNetworkInterface> interfaces = new ArrayList<>(); try { ovfManager.importVm(ovfstring, vm, images, interfaces); } catch (OvfReaderException e) { } setReturnValue(vm); }
Source:
private LineConsumer[] appendTo(LineConsumer[] base, LineConsumer... toAppend ) { List<LineConsumer> allElements = new ArrayList<>(Arrays.asList(base)); allElements.addAll(Arrays.asList(toAppend)); return allElements.toArray(new LineConsumer[allElements.size()]); }

Target:
private LineConsumer[] appendTo(LineConsumer[] base, LineConsumer... toAppend ) { List<LineConsumer> allElements = new ArrayList<>(); allElements.addAll(Arrays.asList(base)); allElements.addAll(Arrays.asList(toAppend)); return allElements.toArray(new LineConsumer[allElements.size()]); }
Source:
public LinkedMultiValueMap<String, String> getSubscriptions(String destination, Message<?> message) { LinkedMultiValueMap<String, String> copiedSubscriptions = new LinkedMultiValueMap<>(); if (notSubscriptionCache.asMap().keySet().contains(destination)) { return copiedSubscriptions; } this.accessCache.compute(destination, (key, value) -> { if (value == null) { LinkedMultiValueMap<String, String> result = new LinkedMultiValueMap<>(); for (SessionSubscriptionInfo info : subscriptionRegistry.getAllSubscriptions()) { for (String destinationPattern : info.getDestinations()) { if (destinationPattern.equals(destination)) { for (Subscription subscription : info.getSubscriptions(destinationPattern)) { result.add(info.sessionId, subscription.getId()); } } } } if (!result.isEmpty()) { copiedSubscriptions.addAll(result.deepCopy()); return result; } else { notSubscriptionCache.put(destination, ""); return null; } } else { copiedSubscriptions.addAll(value.deepCopy()); return value; } }); return copiedSubscriptions; }

Target:
public LinkedMultiValueMap<String, String> getSubscriptions(String destination, Message<?> message) { LinkedMultiValueMap<String, String> copiedSubscriptions = new LinkedMultiValueMap<>(); if (notSubscriptionCache.asMap().keySet().contains(destination)) { return copiedSubscriptions; } this.accessCache.compute(destination, (key, value) -> { if (value == null) { LinkedMultiValueMap<String, String> result = new LinkedMultiValueMap<>(); subscriptionRegistry.getAllSubscriptions().forEach((info) -> { info.getDestinations().forEach((destinationPattern) -> { if (destinationPattern.equals(destination)) { info.getSubscriptions(destinationPattern).forEach((subscription) -> { result.add(info.sessionId, subscription.getId()); }); } }); }); if (!result.isEmpty()) { copiedSubscriptions.addAll(result.deepCopy()); return result; } else { notSubscriptionCache.put(destination, ""); return null; } } else { copiedSubscriptions.addAll(value.deepCopy()); return value; } }); return copiedSubscriptions; }
Source:
public <T> T getMetadataNode(Class<T> fieldClass) { T field = (T) customNodes.get(fieldClass.getName()); if (field == null) { try { field = fieldClass.newInstance(); customNodes.put(field.getClass().getName(), field); } catch (InstantiationException e) { } catch (IllegalAccessException e) { } } return field; }

Target:
public <T> T getMetadataNode(Class<T> fieldClass) { T field = (T) customNodes.get(fieldClass.getName()); if (field == null) { try { field = fieldClass.newInstance(); customNodes.put(field.getClass().getName(), field); } catch (InstantiationException | IllegalAccessException e) { s_logger.debug("No default constructor available in class " + fieldClass.getName() + ", ignoring exception", e); } } return field; }
Source:
public void redraw () { if (display.inPaint) { display.asyncExec(() -> redraw()); return; } checkWidget(); view.setNeedsDisplay(true); }

Target:
public void redraw() { checkWidget(); if (display.inPaint) { display.asyncExec(() -> { if (!isDisposed()) setNeedsDisplay(); }); return; } setNeedsDisplay(); }
Source:
private KLabelConstant(String label, Definition definition) { this.label = label; productions = definition != null ? ImmutableList.<Production>copyOf(definition.context().productionsOf(label)) : ImmutableList.<Production>of(); boolean isFunction = false; boolean isPattern = false; if (!label.startsWith("is")) { predicateSort = null; Iterator<Production> iterator = productions.iterator(); if (iterator.hasNext()) { Production fstProd = iterator.next(); isFunction = fstProd.containsAttribute(Attribute.FUNCTION.getKey()) || fstProd.containsAttribute(Attribute.PREDICATE.getKey()); isPattern = fstProd.containsAttribute("pattern"); } while (iterator.hasNext()) { Production production = iterator.next(); assert isFunction == (production .containsAttribute(Attribute.FUNCTION.getKey()) || production .containsAttribute(Attribute.PREDICATE.getKey())) : "Cannot determine if the KLabel " + label + " is a function symbol because there are multiple productions associated with this KLabel: " + productions; assert isPattern == production.containsAttribute("pattern") : "Cannot determine if the KLabel " + label + " is a pattern symbol because there are multiple productions associated with this KLabel: " + productions; } } else { isFunction = true; predicateSort = Sort.of(label.substring("is".length())); } this.isSortPredicate = predicateSort != null; this.isFunction = isFunction; this.isPattern = isPattern; this.listTerminator = buildListTerminator(definition); this.isListLabel = listTerminator != null; }

Target:
private KLabelConstant(String label, Definition definition) { this.label = label; productions = definition != null ? ImmutableList.<Production>copyOf(definition.context().productionsOf(label)) : ImmutableList.<Production>of(); boolean isFunction = false; boolean isPattern = false; if (!label.startsWith("is")) { predicateSort = null; Iterator<Production> iterator = productions.iterator(); if (iterator.hasNext()) { Production fstProd = iterator.next(); isFunction = fstProd.containsAttribute(Attribute.FUNCTION.getKey()) || fstProd.containsAttribute(Attribute.PREDICATE.getKey()); isPattern = fstProd.containsAttribute(Attribute.PATTERN_KEY); } while (iterator.hasNext()) { Production production = iterator.next(); assert isFunction == (production .containsAttribute(Attribute.FUNCTION.getKey()) || production .containsAttribute(Attribute.PREDICATE.getKey())) : "Cannot determine if the KLabel " + label + " is a function symbol because there are multiple productions associated with this KLabel: " + productions; assert isPattern == production.containsAttribute(Attribute.PATTERN_KEY) : "Cannot determine if the KLabel " + label + " is a pattern symbol because there are multiple productions associated with this KLabel: " + productions; } } else { isFunction = true; predicateSort = Sort.of(label.substring("is".length())); } this.isSortPredicate = predicateSort != null; this.isFunction = isFunction; this.isPattern = isPattern; this.listTerminator = buildListTerminator(definition); this.isListLabel = listTerminator != null; }
Source:
public CloudConfig getCloudConfig(String clusterName) { if (!ZKUtil.isClusterSetup(clusterName, zkClient)) { throw new HelixException("fail to get config. cluster: " + clusterName + " is NOT setup."); } HelixConfigScope scope = new HelixConfigScopeBuilder(ConfigScopeProperty.CLOUD).forCluster(clusterName).build(); ZNRecord record = getConfigZnRecord(scope); if (record == null) { LOG.warn("No cloud config found at " + scope.getZkPath()); return null; } return new CloudConfig(record); }

Target:
public CloudConfig getCloudConfig(String clusterName) { if (!ZKUtil.isClusterSetup(clusterName, zkClient)) { throw new HelixException( String.format("Failed to get config. cluster: %s is not setup.", clusterName)); } HelixConfigScope scope = new HelixConfigScopeBuilder(ConfigScopeProperty.CLOUD).forCluster(clusterName).build(); ZNRecord record = getConfigZnRecord(scope); if (record == null) { LOG.warn("No cloud config found at {}.", scope.getZkPath()); return null; } return new CloudConfig(record); }
Source:
public Status isMet(AbstractBuild<?,?> build) { List<PromotionBadge> badges = new ArrayList<PromotionBadge>(); for (PromotionCondition cond : conditions) { PromotionBadge b = cond.isMet(this, build); LOGGER.log(Level.INFO, "PromotionProcess.isMet(): any_met_condition={0}", this.any_met_condition); if (this.any_met_condition) { if (b!=null) badges.add(b); } else { if(b==null) return null; badges.add(b); } } if (badges.isEmpty()) { return null; } else { return new Status(this,badges); } }

Target:
public Status isMet(AbstractBuild<?,?> build) { List<PromotionBadge> badges = new ArrayList<PromotionBadge>(); for (PromotionCondition cond : conditions) { PromotionBadge b = cond.isMet(this, build); if (this.anyMetCondition) { if (b!=null) { badges.add(b); } } else { if(b==null) { return null; } badges.add(b); } } if (badges.isEmpty()) { return null; } else { return new Status(this,badges); } }
Source:
public void stop() { this.getLifeCycleLock().writeLock().lock(); try { if (!this.isRunning()) { return; } stopProcessing(); stompProxyDead(); for (AsyncEventListener listener : this.listeners) { listener.close(); } ((ConcurrentParallelGatewaySenderQueue) this.eventProcessor.getQueue()).cleanUp(); logger.info("Stopped {}", this); InternalDistributedSystem system = (InternalDistributedSystem) this.cache.getDistributedSystem(); system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_STOP, this); clearTempEventsAfterSenderStopped(); stopTime = System.currentTimeMillis(); } finally { this.getLifeCycleLock().writeLock().unlock(); } }

Target:
public void stop() { this.getLifeCycleLock().writeLock().lock(); try { if (!this.isRunning()) { return; } stopProcessing(); stompProxyDead(); for (AsyncEventListener listener : this.listeners) { listener.close(); } ((ConcurrentParallelGatewaySenderQueue) this.eventProcessor.getQueue()).cleanUp(); stopTime = System.currentTimeMillis(); logger.info("Stopped {}", this); InternalDistributedSystem system = (InternalDistributedSystem) this.cache.getDistributedSystem(); system.handleResourceEvent(ResourceEvent.GATEWAYSENDER_STOP, this); clearTempEventsAfterSenderStopped(); } finally { this.getLifeCycleLock().writeLock().unlock(); } }
Source:
private void saveChangesAndDispose(IResource resource) { if (saving == true) { return; } saving = true; inlinedResource = resource; final String newName = textEditor.getText(); Runnable query = () -> { try { if (!newName.equals(inlinedResource.getName())) { IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace(); IStatus status = workspace.validateName(newName, inlinedResource.getType()); if (!status.isOK()) { displayError(status.getMessage()); } else { if (!LTKLauncher.openRenameWizard(newName, getStructuredSelection())) { IPath newPath = inlinedResource.getFullPath().removeLastSegments(1).append(newName); runWithNewPath(newPath, inlinedResource); } } } inlinedResource = null; disposeTextWidget(); if (navigatorTree != null && !navigatorTree.isDisposed()) { navigatorTree.setFocus(); } } finally { saving = false; } }; getTree().getShell().getDisplay().asyncExec(query); }

Target:
private void saveChangesAndDispose(IResource resource) { if (saving == true) { return; } saving = true; inlinedResource = resource; final String newName = textEditor.getText(); Runnable query = () -> { try { if (!newName.equals(inlinedResource.getName())) { IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace(); IStatus status = workspace.validateName(newName, inlinedResource.getType()); if (!status.isOK()) { displayError(status.getMessage()); } else { if (!LTKLauncher.renameResource(newName, getStructuredSelection())) { IPath newPath = inlinedResource.getFullPath().removeLastSegments(1).append(newName); runWithNewPath(newPath, inlinedResource); } } } inlinedResource = null; disposeTextWidget(); if (navigatorTree != null && !navigatorTree.isDisposed()) { navigatorTree.setFocus(); } } finally { saving = false; } }; getTree().getShell().getDisplay().asyncExec(query); }
Source:
protected int getQuarkAbsoluteAndAdd(String... path) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { throw new IllegalStateException("The state system hasn't been initialized yet"); } return Integer.max(ss.optQuarkAbsolute(path), IXmlStateSystemContainer.ERROR_QUARK); }

Target:
protected int getQuarkAbsoluteAndAdd(String... path) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { throw new IllegalStateException("The state system hasn't been initialized yet"); } int quark = ss.optQuarkAbsolute(path); return quark != ITmfStateSystem.INVALID_ATTRIBUTE ? quark : IXmlStateSystemContainer.ERROR_QUARK; }
Source:
public void uploadLargeFile(String regionId) throws IOException, InterruptedException { List<Segment> list1 = new ArrayList<Segment>(); int partNumber = 1; int total_size = 0; while (partNumber < 3) { String objName = objectName + "/dlo/" + String.valueOf(partNumber); String data = "data".concat(String.valueOf(partNumber)); String etag = getApi().getDynamicLargeObjectApi(regionId, defaultContainerName).uploadLargeFile( defaultContainerName, objName, Payloads.newPayload(data), ImmutableMap.of("myfoo", "Bar"), ImmutableMap.of("myfoo", "Bar")); Segment s = new Segment(objName, etag, data.length()); assertNotNull(etag); list1.add(s); partNumber++; total_size = total_size + data.length(); } String etagOfEtags = getApi().getDynamicLargeObjectApi(regionId, defaultContainerName).replaceManifest( defaultContainerName, objectName, list1, ImmutableMap.of("MyFoo", "Bar"), ImmutableMap.of("MyFoo", "Bar")); SwiftObject bigObject = getApi().getObjectApi(regionId, defaultContainerName).get(objectName); assertEquals(bigObject.getETag(), etagOfEtags); assertEquals(bigObject.getPayload().getContentMetadata().getContentLength(), Long.valueOf(total_size)); assertEquals(bigObject.getMetadata(), ImmutableMap.of("myfoo", "Bar")); assertEquals(getApi().getContainerApi(regionId).get(defaultContainerName).getObjectCount(), Long.valueOf(3)); }

Target:
public void uploadLargeFile(String regionId) throws IOException, InterruptedException { long total_size = 0; RegionScopedBlobStoreContext ctx = RegionScopedBlobStoreContext.class.cast(view); BlobStore blobStore = ctx.getBlobStore(); String defaultContainerName = getContainerName(); for (int partNumber = 0; partNumber < 3; partNumber++) { String objName = String.format("%s/%s/%s", objectName, "dlo", partNumber); String data = "data" + partNumber; ByteSource payload = ByteSource.wrap(data.getBytes(Charsets.UTF_8)); Blob blob = blobStore.blobBuilder(objName) .payload(payload) .build(); String etag = blobStore.putBlob(defaultContainerName, blob); assertNotNull(etag); total_size += data.length(); } getApi().getDynamicLargeObjectApi(regionId, defaultContainerName).putManifest(objectName, ImmutableMap.of("myfoo", "Bar")); SwiftObject bigObject = getApi().getObjectApi(regionId, defaultContainerName).get(objectName); assertThat(bigObject.getETag()).isEqualTo("54bc1337d7a51660c40db39759cc1944"); assertThat(bigObject.getPayload().getContentMetadata().getContentLength()).isEqualTo(total_size); assertThat(getApi().getContainerApi(regionId).get(defaultContainerName).getObjectCount()).isEqualTo(Long.valueOf(4)); }
Source:
public BaseLuceneLock makeLock(Directory dir, String lockName) { if (!(dir instanceof DirectoryLuceneV5)) { throw new UnsupportedOperationException("BaseLuceneLock can only be used with DirectoryLuceneV5, got: " + dir); } DirectoryLuceneV5 infinispanDirectory = (DirectoryLuceneV5) dir; Cache distLockCache = infinispanDirectory.getDistLockCache(); String indexName = infinispanDirectory.getIndexName(); BaseLuceneLock lock = new BaseLuceneLock(distLockCache, indexName, lockName); if (log.isTraceEnabled()) { log.tracef("Lock prepared, not acquired: %s for index %s", lockName, indexName); } return lock; }

Target:
public BaseLuceneLock makeLock(Directory dir, String lockName) { if (!(dir instanceof DirectoryLucene)) { throw new UnsupportedOperationException("BaseLuceneLock can only be used with DirectoryLucene, got: " + dir); } DirectoryLucene infinispanDirectory = (DirectoryLucene) dir; Cache distLockCache = infinispanDirectory.getDistLockCache(); String indexName = infinispanDirectory.getIndexName(); BaseLuceneLock lock = new BaseLuceneLock(distLockCache, indexName, lockName); if (log.isTraceEnabled()) { log.tracef("Lock prepared, not acquired: %s for index %s", lockName, indexName); } return lock; }
Source:
private File extractFromResource(String resource) { File file = null; URL res = getClass().getResource(resource); if (res.toString().startsWith("jar:")) { try { InputStream input = getClass().getResourceAsStream(resource); file = File.createTempFile("tempfile", ".tmp"); OutputStream out = new FileOutputStream(file); int read; byte[] bytes = new byte[1024]; while ((read = input.read(bytes)) != -1) { out.write(bytes, 0, read); } file.deleteOnExit(); } catch (IOException ex) { Log.log(Log.ERROR, "TLP", ex.toString()); } } else { file = new File(res.getFile()); } if (file != null && !file.exists()) { throw new RuntimeException("Error: File " + file + " not found!"); } return file; }

Target:
private File extractFromResource(String resource) { File file = null; URL res = getClass().getResource(resource); if (res.toString().startsWith("jar:")) { try { InputStream input = getClass().getResourceAsStream(resource); file = File.createTempFile("tempfile", ".tmp"); OutputStream out = new FileOutputStream(file); int read; byte[] bytes = new byte[1024]; while ((read = input.read(bytes)) != -1) { out.write(bytes, 0, read); } file.deleteOnExit(); } catch (IOException ex) { Log.log(Log.ERROR, TAG, ex.toString()); } } else { file = new File(res.getFile()); } if (file == null || !file.exists()) { Log.log(Log.ERROR, TAG, "Error: File " + file + " not found!"); } return file; }
Source:
public MetadataField getMetadataField(@PathParam("field_id") Integer fieldId, @QueryParam("expand") @DefaultValue("parentSchema") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading metadata field."); org.dspace.core.Context context = null; MetadataField metadataField = null; try { context = createContext(getUser(headers)); org.dspace.content.MetadataField field = metadataFieldService.find(context, fieldId); if (field == null) { log.error(String.format("Metadata Field %d not found", fieldId)); throw new WebApplicationException(Response.Status.NOT_FOUND); } org.dspace.content.MetadataSchema schema = field.getMetadataSchema(); if (schema == null) { log.error(String.format("Parent Schema not found for Metadata Field %d not found", fieldId)); throw new WebApplicationException(Response.Status.NOT_FOUND); } metadataField = new MetadataField(schema, field, expand, context); context.complete(); } catch (SQLException e) { processException("Could not read metadata field, SQLException. Message:" + e, context); log.error(e.getMessage()); throw new WebApplicationException(Response.Status.INTERNAL_SERVER_ERROR); } catch (ContextException e) { processException("Could not read metadata field, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("Metadata field successfully read."); return metadataField; }

Target:
public MetadataField getMetadataField(@PathParam("field_id") Integer fieldId, @QueryParam("expand") @DefaultValue("parentSchema") String expand, @QueryParam("userIP") String user_ip, @QueryParam("userAgent") String user_agent, @QueryParam("xforwarderfor") String xforwarderfor, @Context HttpHeaders headers, @Context HttpServletRequest request) throws WebApplicationException { log.info("Reading metadata field."); org.dspace.core.Context context = null; MetadataField metadataField = null; try { context = createContext(getUser(headers)); org.dspace.content.MetadataField field = metadataFieldService.find(context, fieldId); if (field == null) { log.error(String.format("Metadata Field %d not found", fieldId)); throw new WebApplicationException(Response.Status.NOT_FOUND); } org.dspace.content.MetadataSchema schema = field.getMetadataSchema(); if (schema == null) { log.error(String.format("Parent Schema not found for Metadata Field %d not found", fieldId)); throw new WebApplicationException(Response.Status.NOT_FOUND); } metadataField = new MetadataField(schema, field, expand, context); context.complete(); } catch (SQLException e) { processException("Could not read metadata field, SQLException. Message:" + e, context); } catch (ContextException e) { processException("Could not read metadata field, ContextException. Message:" + e.getMessage(), context); } finally { processFinally(context); } log.trace("Metadata field successfully read."); return metadataField; }
Source:
public void pause(final String user) throws IllegalStateException { synchronized (this.mainSyncObj) { this.logger.info("Flow paused by " + user); if (!this.isKilled() && !this.flowFinished) { this.logger.info("Execution " + this.execId + " has been paused."); this.flowPaused = true; this.flow.setStatus(Status.PAUSED); updateFlow(); } else { final String errorMessage = "Execution " + this.execId + " with status " + this.flow.getStatus() + " cannot be paused."; this.logger.warn(errorMessage); throw new IllegalStateException(errorMessage); } } interrupt(); }

Target:
public void pause(final String user) throws IllegalStateException { synchronized (this.mainSyncObj) { this.logger.info("Execution pause requested by " + user); if (!this.isKilled() && !this.flowFinished) { this.flowPaused = true; this.flow.setStatus(Status.PAUSED); updateFlow(); this.logger.info("Execution " + this.execId + " has been paused."); } else { final String errorMessage = "Execution " + this.execId + " with status " + this.flow.getStatus() + " cannot be paused."; this.logger.warn(errorMessage); throw new IllegalStateException(errorMessage); } } interrupt(); }
Source:
public void testDestroyCommands() throws Exception { final ClientSession clientSession = mock(ClientSession.class); final CanvasHandler canvasHandler = mock(CanvasHandler.class); final Diagram diagram = mock(Diagram.class); final Metadata metadata = mock(Metadata.class); final String definitionSetId = "definitionSetId"; when(clientSession.getCanvasHandler()).thenReturn(canvasHandler); when(canvasHandler.getDiagram()).thenReturn(diagram); when(diagram.getMetadata()).thenReturn(metadata); when(metadata.getDefinitionSetId()).thenReturn(definitionSetId); final Annotation qualifier = mock(Annotation.class); when(definitionUtils.getQualifier(eq(definitionSetId))).thenReturn(qualifier); final ManagedInstance managedInstance = mock(ManagedInstance.class); final ClientSessionCommand clientSessionCommand = mock(ClientSessionCommand.class); when(sessionCommands.select(eq(MockClientSessionCommand.class), eq(qualifier))).thenReturn(managedInstance); when(managedInstance.get()).thenReturn(clientSessionCommand); tested.register(MockClientSessionCommand.class); tested.bind(clientSession); tested.clearCommands(); verify(clientSessionCommand, times(1)).destroy(); verify(sessionCommands, times(1)).destroy(eq(clientSessionCommand)); }

Target:
public void testDestroyCommands() { final ClientSession clientSession = mock(ClientSession.class); final CanvasHandler canvasHandler = mock(CanvasHandler.class); final Diagram diagram = mock(Diagram.class); final Metadata metadata = mock(Metadata.class); final String definitionSetId = "definitionSetId"; when(clientSession.getCanvasHandler()).thenReturn(canvasHandler); when(canvasHandler.getDiagram()).thenReturn(diagram); when(diagram.getMetadata()).thenReturn(metadata); when(metadata.getDefinitionSetId()).thenReturn(definitionSetId); final Annotation qualifier = mock(Annotation.class); when(definitionUtils.getQualifier(eq(definitionSetId))).thenReturn(qualifier); final ManagedInstance managedInstance = mock(ManagedInstance.class); final ClientSessionCommand clientSessionCommand = mock(ClientSessionCommand.class); when(sessionCommands.select(eq(MockClientSessionCommand.class), eq(qualifier))).thenReturn(managedInstance); when(managedInstance.get()).thenReturn(clientSessionCommand); tested.register(MockClientSessionCommand.class); tested.bind(clientSession); tested.clearCommands(); verify(clientSessionCommand, times(1)).destroy(); verify(sessionCommands, times(1)).destroy(eq(clientSessionCommand)); }
Source:
public static String readString(JSONResourceRef resource) throws IOException { InputStream istream = resource.getResourceClass().getResourceAsStream(resource.getFileName()); if (istream == null) { throw new IOException("Cannot retrieve resource " + resource.getFileName()); } return IOUtils.toString(istream, "UTF-8"); }

Target:
public static String readString(JSONResourceRef resource) throws IOException { try (InputStream istream = resource.getResourceClass().getResourceAsStream(resource.getFileName())) { if (istream == null) { throw new IOException("Cannot retrieve resource " + resource.getFileName()); } return IOUtils.toString(istream, "UTF-8"); } }
Source:
public void transformOffset(){ final ITmfTimestampTransform offset = TimestampTransformFactory.create(100); final ITmfTimestampTransform compositeTransform = offset.composeWith(TimestampTransformFactory.create(new TmfNanoTimestamp(-100))); assertEquals(tn100, offset.transform(t0)); assertEquals(tn100, offset.transform(tn0)); assertEquals(tn0, compositeTransform.transform(t0)); assertEquals(t0, compositeTransform.transform(t0)); }

Target:
public void transformOffset() { final ITmfTimestampTransform offset = offset1; final ITmfTimestampTransform compositeTransform = offset.composeWith(TimestampTransformFactory.create(new TmfNanoTimestamp(-100))); assertEquals(tn100, offset.transform(t0)); assertEquals(tn100, offset.transform(tn0)); assertEquals(tn0, compositeTransform.transform(tn0)); assertEquals(t0, compositeTransform.transform(t0)); assertEquals(200, offset1.transform(100)); assertEquals(200, offset2.transform(100)); assertEquals(200, offset3.transform(100)); assertEquals(200, offset4.transform(100)); }
Source:
public List<String> listSchemaNames() { try { ImmutableList.Builder<String> schemaNamesListBuilder = ImmutableList.builder(); for (String table : pinotPrestoConnection.getTableNames()) { schemaNamesListBuilder.add(table.toLowerCase(ENGLISH)); } return schemaNamesListBuilder.build(); } catch (Exception e) { return ImmutableList.of(); } }

Target:
public List<String> listSchemaNames() { try { ImmutableList.Builder<String> schemaNamesListBuilder = ImmutableList.builder(); pinotPrestoConnection.getTableNames().forEach(table -> schemaNamesListBuilder.add(table.toLowerCase(ENGLISH))); return schemaNamesListBuilder.build(); } catch (Exception e) { throw new PrestoException( PINOT_FAILURE_GETTING_SCHEMA, "Failed to list schema names.", e); } }
Source:
public static BoBExtension from(Message message) { return (BoBExtension) message.getExtension(ELEMENT, NAMESPACE); }

Target:
public static BoBExtension from(Message message) { return message.getExtension(ELEMENT, NAMESPACE); }
Source:
static Migrator createVersionOneToVersionTwoMigrator(Context context, File databasePath, Migrator.Callback migrationCallback) { if (!databasePath.exists()) { return Migrator.NO_OP; } if (INSTANCE == null) { SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); MigrationExtractor migrationExtractor = new MigrationExtractor(database); RoomDownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); INSTANCE = new VersionOneToVersionTwoMigrator(migrationExtractor, downloadsPersistence, internalFilePersistence, database, migrationCallback); } return INSTANCE; }

Target:
static Migrator createVersionOneToVersionTwoMigrator(Context context, File databasePath, Migrator.Callback migrationCallback) { if (!databasePath.exists()) { return Migrator.NO_OP; } SQLiteDatabase sqLiteDatabase = SQLiteDatabase.openDatabase(databasePath.getAbsolutePath(), null, 0); SqlDatabaseWrapper database = new SqlDatabaseWrapper(sqLiteDatabase); MigrationExtractor migrationExtractor = new MigrationExtractor(database); RoomDownloadsPersistence downloadsPersistence = RoomDownloadsPersistence.newInstance(context); InternalFilePersistence internalFilePersistence = new InternalFilePersistence(); internalFilePersistence.initialiseWith(context); return new VersionOneToVersionTwoMigrator(migrationExtractor, downloadsPersistence, internalFilePersistence, database, migrationCallback); }
Source:
public void equalsTest() { ArrayDeclaration a = new ArrayDeclaration(1, IntegerDeclaration.INT_32B_DECL); ArrayDeclaration b = new ArrayDeclaration(2, IntegerDeclaration.INT_32B_DECL); ArrayDeclaration c = new ArrayDeclaration(1, new StringDeclaration()); ArrayDeclaration d = new ArrayDeclaration(1, IntegerDeclaration.INT_32B_DECL); assertNotEquals(a, null); assertNotEquals(a, new Object()); assertNotEquals(a, b); assertNotEquals(a, c); assertEquals(a, d); assertEquals(a, a); assertFalse(a.isBinaryEquivalent(b)); assertFalse(a.isBinaryEquivalent(c)); assertTrue(a.isBinaryEquivalent(d)); assertTrue(a.isBinaryEquivalent(a)); }

Target:
public void equalsTest() { ArrayDeclaration a = new ArrayDeclaration(1, IntegerDeclaration.INT_32B_DECL); ArrayDeclaration b = new ArrayDeclaration(2, IntegerDeclaration.INT_32B_DECL); ArrayDeclaration c = new ArrayDeclaration(1, new StringDeclaration()); ArrayDeclaration d = new ArrayDeclaration(1, IntegerDeclaration.INT_32B_DECL); assertNotEquals(a, null); assertNotEquals(a, new Object()); assertNotEquals(a, b); assertNotEquals(a, c); assertEquals(a, d); assertEquals(a, a); assertNotEquals(b, a); assertNotEquals(c, a); assertEquals(d, a); assertEquals(a, a); assertFalse(a.isBinaryEquivalent(b)); assertFalse(b.isBinaryEquivalent(a)); assertFalse(a.isBinaryEquivalent(c)); assertFalse(c.isBinaryEquivalent(a)); assertTrue(a.isBinaryEquivalent(d)); assertTrue(d.isBinaryEquivalent(a)); assertTrue(a.isBinaryEquivalent(a)); }
Source:
public LocalSshDaoImpl(LocalStorageFactory storageFactory) throws IOException { pairs = new ArrayList<>(); sshStorage = storageFactory.create("ssh.json"); }

Target:
public LocalSshDaoImpl(LocalStorageFactory storageFactory) throws IOException { pairs = ArrayListMultimap.create(); lock = new ReentrantReadWriteLock(); sshStorage = storageFactory.create("ssh.json"); }
Source:
private QueryResponse getResponse(Query parameter, long totalHits, List<String> ids, String scrollId) { if (ids.isEmpty()) { return QueryResponse .builder() .documents(Collections.emptyList()) .totalHits(0) .scrollResponse(true) .build(); } return QueryResponse .builder() .documents(getQueryStore() .getAll(parameter.getTable(), ids, true)) .totalHits(totalHits) .scrollId(scrollId) .scrollResponse(true) .build(); }

Target:
private QueryResponse getResponse(Query parameter, long totalHits, List<String> ids, String scrollId) { if (ids.isEmpty()) { return QueryResponse .builder() .documents(Collections.emptyList()) .totalHits(0) .moreDataAvailable(false) .build(); } return QueryResponse .builder() .documents(getQueryStore() .getAll(parameter.getTable(), ids, true)) .totalHits(totalHits) .scrollId(scrollId) .moreDataAvailable(StringUtils.isNotEmpty(scrollId) ? true : false) .build(); }