auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void populateTemplates() { if (state_ != STATE_EMPTY) return; progressPanel_.showProgress(250); server_.getRmdTemplates( new ServerRequestCallback<JsArray<RmdDocumentTemplate>>() { @Override public void onResponseReceived(JsArray<RmdDocumentTemplate> templates) { JsArrayUtil.fillList(templates, templates_); templates_.sort((RmdDocumentTemplate a, RmdDocumentTemplate b) -> { return (a.getPackage() + a.getName()).compareTo( (b.getPackage() + b.getName())); }); for (RmdDocumentTemplate template: templates_) { String preferredTemplate = RStudioGinjector.INSTANCE.getUserPrefs() .rmdPreferredTemplatePath().getValue(); listTemplates_.addItem(new RmdDiscoveredTemplateItem(template), template.getPath() != preferredTemplate); } state_ = STATE_POPULATED; completeDiscovery(); } @Override public void onError(ServerError error) { RStudioGinjector.INSTANCE.getGlobalDisplay().showErrorMessage( "R Markdown Templates Not Found", "An error occurred while looking for R Markdown templates. " + error.getMessage()); } }); state_ = STATE_POPULATING; }

Target:
public void populateTemplates() { if (state_ != STATE_EMPTY) return; progressPanel_.showProgress(250); server_.getRmdTemplates( new ServerRequestCallback<JsArray<RmdDocumentTemplate>>() { @Override public void onResponseReceived(JsArray<RmdDocumentTemplate> templates) { JsArrayUtil.fillList(templates, templates_); templates_.sort((RmdDocumentTemplate a, RmdDocumentTemplate b) -> { int result = a.getPackage().compareTo(b.getPackage()); if (result == 0) { return a.getName().compareTo(b.getName()); } return result; }); for (RmdDocumentTemplate template: templates_) { String preferredTemplate = RStudioGinjector.INSTANCE.getUserPrefs() .rmdPreferredTemplatePath().getValue(); listTemplates_.addItem(new RmdDiscoveredTemplateItem(template), template.getPath() != preferredTemplate); } state_ = STATE_POPULATED; completeDiscovery(); } @Override public void onError(ServerError error) { RStudioGinjector.INSTANCE.getGlobalDisplay().showErrorMessage( "R Markdown Templates Not Found", "An error occurred while looking for R Markdown templates. " + error.getMessage()); } }); state_ = STATE_POPULATING; }
Source:
public Optional<char[]> getValue(final String variableKey) { char[] fromCache = getFromCache(variableKey, () -> loadValueFromStore(variableKey)); return Arrays.equals(fromCache, CACHE_404) ? Optional.empty() : Optional.ofNullable(decrypt(fromCache)); }

Target:
public Optional<char[]> getValue(final String variableKey) { final char[] fromCache = getFromCache(variableKey, () -> loadValueFromStore(variableKey)); return Arrays.equals(fromCache, CACHE_404) ? Optional.empty() : Optional.ofNullable(decrypt(fromCache)); }
Source:
public static void assertErrorMessage(final WhoisResources whoisResources, final int number, final String severity, final String text, final String... argument) { ErrorMessage errorMsg = whoisResources.getErrorMessages().get(number); assertEquals(text, errorMsg.getText()); assertThat(errorMsg.getSeverity(), is(severity)); if (argument.length > 0) { assertThat(errorMsg.getArgs(), hasSize(argument.length)); for (int i = 0; i < argument.length; i++) { assertThat(errorMsg.getArgs().get(i).getValue(), is(argument[i])); } } }

Target:
public static void assertErrorMessage(final WhoisResources whoisResources, final int number, final String severity, final String text, final String... argument) { ErrorMessage errorMsg = whoisResources.getErrorMessages().get(number); assertThat(errorMsg.getText(), is(text)); assertThat(errorMsg.getSeverity(), is(severity)); if (argument.length > 0) { assertThat(errorMsg.getArgs(), hasSize(argument.length)); for (int i = 0; i < argument.length; i++) { assertThat(errorMsg.getArgs().get(i).getValue(), is(argument[i])); } } }
Source:
private void spongeImpl$onBlockFallenUpon( final Block block, final net.minecraft.world.World world, final BlockPos pos, final Entity entity, final float fallDistance) { if (world.isRemote) { block.onFallenUpon(world, pos, entity, fallDistance); return; } final BlockState state = world.getBlockState(pos); if (!SpongeCommonEventFactory.handleCollideBlockEvent(block, world, pos, state, entity, Direction.UP)) { block.onFallenUpon(world, pos, entity, fallDistance); this.lastCollidedBlockPos = pos; } }

Target:
private void impl$onBlockFallenUpon( final Block block, final net.minecraft.world.World world, final BlockPos pos, final Entity entity, final float fallDistance) { if (world.isRemote) { block.onFallenUpon(world, pos, entity, fallDistance); return; } final BlockState state = world.getBlockState(pos); if (!SpongeCommonEventFactory.handleCollideBlockEvent(block, world, pos, state, entity, Direction.UP)) { block.onFallenUpon(world, pos, entity, fallDistance); this.impl$lastCollidedBlockPos = pos; } }
Source:
public <T> Iterable<T> findVariableOfType(Class<T> type) { for (Map<String, Iterable<? extends WindupVertexFrame>> topOfStack : deque) { for (Iterable<? extends WindupVertexFrame> frames : topOfStack.values()) { List<T> result = new ArrayList<>(); for (WindupVertexFrame frame : frames) { if (!type.isAssignableFrom(frame.getClass())) { break; } result.add((T) frame); } if(!result.isEmpty()) return result; } } return null; }

Target:
public <T extends WindupVertexFrame> Iterable<T> findVariableOfType(Class<T> type) { for (Map<String, Iterable<? extends WindupVertexFrame>> topOfStack : deque) { for (Iterable<? extends WindupVertexFrame> frames : topOfStack.values()) { boolean empty = true; for (WindupVertexFrame frame : frames) { if (!type.isAssignableFrom(frame.getClass())) { break; } else { empty =false; } } if(!empty) return (Iterable<T>)frames; } } return null; }
Source:
private Playlist getPlaylist() { try { return playlistServiceServiceLocator.getService().getPlaylist(); } catch (ServiceNotBoundException e) { e.printStackTrace(); return null; } }

Target:
private Playlist getPlaylist() { Playlist playlist = null; try { playlist = playlistServiceServiceLocator.getService().getPlaylist(); } catch (ServiceNotBoundException e) { Log.wtf(TAG, e); } return playlist; }
Source:
public String getWorldpayChallengeJwt() { return worldpayChallengeJwt; }

Target:
public Optional<String> getWorldpayChallengeJwt() { return Optional.ofNullable(worldpayChallengeJwt); }
Source:
private void unlock() { Comparator<Entry<String, ReentrantLock>> reversed = (o1, o2) -> o2.getKey().compareTo(o1.getKey()); Set<Entry<String, ReentrantLock>> reversedEntrySet = idSync.entrySet() .stream() .sorted(reversed) .collect(Collectors.toSet()); String[] beanDefinitionNames = getBeanDefinitionNames(); for (Entry<String, ReentrantLock> entry : reversedEntrySet) { String id = entry.getKey(); if (!Arrays.stream(beanDefinitionNames).anyMatch(n -> n.equals(id))) { continue; } ReentrantLock lock = entry.getValue(); if (lock.isLocked()) { lock.unlock(); logger.info(String.format("Test resource [%s] unlocked.", id)); } } }

Target:
private void unlock() { Comparator<Entry<String, ReentrantLock>> reversed = (o1, o2) -> o2.getKey().compareTo(o1.getKey()); Set<Entry<String, ReentrantLock>> reversedEntrySet = idSync.entrySet() .stream() .sorted(reversed) .collect(Collectors.toSet()); String[] beanDefinitionNames = getBeanDefinitionNames(); for (Entry<String, ReentrantLock> entry : reversedEntrySet) { String id = entry.getKey(); if (!Arrays.stream(beanDefinitionNames).anyMatch(n -> n.equals(id))) { continue; } ReentrantLock lock = entry.getValue(); lock.unlock(); logger.info(String.format("Test resource [%s] unlocked.", id)); } }
Source:
@Override public boolean canSeeSky(BlockPos pos) { Cube cube = getCube(pos.getX(), pos.getY(), pos.getZ()); if (cube == null) return true; IColumn IColumn = cube.getColumn(); int height = IColumn.getHeightValue(blockToLocal(pos.getX()), blockToLocal(pos.getZ())); return height <= pos.getY(); }

Target:
@Override public boolean canSeeSky(BlockPos pos) { int blockX = pos.getX(); int blockY = pos.getY(); int blockZ = pos.getZ(); int cubeX = Coords.blockToCube(blockX); int cubeZ = Coords.blockToCube(blockZ); if (cubeX < originX || cubeZ < originZ) return false; cubeX -= originX; cubeZ -= originZ; if (cubeX >= dx || cubeZ >= dz) return false; IColumn column = columns[cubeX][cubeZ]; if (column == null) return false; int height = column.getHeightValue(blockToLocal(blockX), blockToLocal(blockZ)); return height <= blockY; }
Source:
public static List<DateTime> getDatesOnEitherSide(DateTime startDate, DateTime endDate, FEED_TYPE feedType) { int counter = 0, skip = 0; List<DateTime> dates = new ArrayList<DateTime>(); while (!startDate.isAfter(endDate) && counter < 1000) { if (counter == 1 && skip == 0) { skip = 1; } switch (feedType) { case MINUTELY: startDate = startDate.plusMinutes(skip); dates.add(startDate); break; case HOURLY: startDate = startDate.plusHours(skip); dates.add(startDate); break; case DAILY: startDate = startDate.plusDays(skip); dates.add(startDate); break; case MONTHLY: startDate = startDate.plusMonths(skip); dates.add(startDate); break; case YEARLY: startDate = startDate.plusYears(skip); dates.add(startDate); break; default: Assert.fail("Unexpected feedType = " + feedType); } ++counter; } return dates; }

Target:
public static List<DateTime> getDatesOnEitherSide(DateTime startDate, DateTime endDate, FEED_TYPE feedType) { final List<DateTime> dates = new ArrayList<DateTime>(); if(!startDate.isAfter(endDate)) { dates.add(startDate); } for (int counter = 0; !startDate.isAfter(endDate) && counter < 1000; ++counter) { switch (feedType) { case MINUTELY: startDate = startDate.plusMinutes(1); dates.add(startDate); break; case HOURLY: startDate = startDate.plusHours(1); dates.add(startDate); break; case DAILY: startDate = startDate.plusDays(1); dates.add(startDate); break; case MONTHLY: startDate = startDate.plusMonths(1); dates.add(startDate); break; case YEARLY: startDate = startDate.plusYears(1); dates.add(startDate); break; default: Assert.fail("Unexpected feedType = " + feedType); } } return dates; }
Source:
protected boolean shouldGenerate() { return frontDeps != null && connectClientTsApiFolder != null; }

Target:
protected boolean shouldGenerate() { return frontDeps != null; }
Source:
protected Set<String> getAllWorkspaceNames( Set<String> alreadyKnownNames ) { Set<String> cacheNames = null; if (cacheContainer instanceof EmbeddedCacheManager) { cacheNames = new HashSet<String>(((EmbeddedCacheManager)cacheContainer).getCacheNames()); } else if (cacheContainer instanceof RemoteCacheManager) { cacheNames = alreadyKnownNames; } else { cacheNames = alreadyKnownNames; } if (cacheNames.equals(alreadyKnownNames)) { return cacheNames; } final UUID rootNodeUuid = getRootNodeUuid(); Set<String> nonWorkspaceCacheNames = new HashSet<String>(); for (String cacheName : cacheNames) { if (alreadyKnownNames.contains(cacheName)) continue; BasicCache<UUID, InfinispanNode> cache = cacheContainer.getCache(cacheName); if (!cache.containsKey(rootNodeUuid)) { nonWorkspaceCacheNames.add(cacheName); } } if (!nonWorkspaceCacheNames.isEmpty()) cacheNames.removeAll(nonWorkspaceCacheNames); return cacheNames; }

Target:
protected Set<String> getAllWorkspaceNames( Set<String> alreadyKnownNames ) { Set<String> cacheNames = null; if (cacheContainer instanceof EmbeddedCacheManager) { cacheNames = new HashSet<String>(((EmbeddedCacheManager)cacheContainer).getCacheNames()); } else { cacheNames = alreadyKnownNames; } if (cacheNames.equals(alreadyKnownNames)) { return cacheNames; } final UUID rootNodeUuid = getRootNodeUuid(); Set<String> nonWorkspaceCacheNames = new HashSet<String>(); for (String cacheName : cacheNames) { if (alreadyKnownNames.contains(cacheName)) continue; BasicCache<UUID, InfinispanNode> cache = cacheContainer.getCache(cacheName); if (!cache.containsKey(rootNodeUuid)) { nonWorkspaceCacheNames.add(cacheName); } } if (!nonWorkspaceCacheNames.isEmpty()) cacheNames.removeAll(nonWorkspaceCacheNames); return cacheNames; }
Source:
public static TextFlow highlight(String text, String filter ) { int filterIndex = text.toLowerCase().indexOf(filter.toLowerCase()); Text textBefore = new Text(text.substring(0, filterIndex)); Text textAfter = new Text(text.substring(filterIndex + filter.length())); Text textFilter = new Text(text.substring(filterIndex, filterIndex + filter.length())); textFilter.setFill(Color.ORANGE); textFilter.setFont(Font.font("Helvetica", FontWeight.BOLD, 12)); return new TextFlow(textBefore, textFilter, textAfter); }

Target:
public static TextFlow highlight(String text, String filter) { int filterIndex = text.toLowerCase(Locale.getDefault()).indexOf(filter.toLowerCase(Locale.getDefault())); Text textBefore = new Text(text.substring(0, filterIndex)); Text textAfter = new Text(text.substring(filterIndex + filter.length())); Text textFilter = new Text(text.substring(filterIndex, filterIndex + filter.length())); textFilter.setFill(Color.ORANGE); return new TextFlow(textBefore, textFilter, textAfter); }
Source:
private String formatPlanNodeStatsAndCost(PlanNode node) { PlanNodeStatsEstimate stats = estimatedStatsAndCosts.getStats().getOrDefault(node.getId(), PlanNodeStatsEstimate.unknown()); PlanNodeCostEstimate cost = estimatedStatsAndCosts.getCosts().getOrDefault(node.getId(), PlanNodeCostEstimate.unknown()); return String.format("{rows: %s (%s), cpu: %s, memory: %s, network: %s}", formatAsLong(stats.getOutputRowCount()), formatEstimateAsDataSize(stats.getOutputSizeInBytes(node.getOutputSymbols(), types)), formatDouble(cost.getCpuCost()), formatDouble(cost.getMemoryCost()), formatDouble(cost.getNetworkCost())); }

Target:
private String formatPlanNodeStatsAndCost(PlanNode node) { PlanNodeStatsEstimate stats = estimatedStatsAndCosts.getStats().getOrDefault(node.getId(), PlanNodeStatsEstimate.unknown()); PlanNodeCostEstimate cost = estimatedStatsAndCosts.getCosts().getOrDefault(node.getId(), PlanNodeCostEstimate.unknown()); return format("{rows: %s (%s), cpu: %s, memory: %s, network: %s}", formatAsLong(stats.getOutputRowCount()), formatEstimateAsDataSize(stats.getOutputSizeInBytes(node.getOutputSymbols(), types)), formatDouble(cost.getCpuCost()), formatDouble(cost.getMemoryCost()), formatDouble(cost.getNetworkCost())); }
Source:
public ICPPExecution instantiate(InstantiationContext context, int maxDepth) { ICPPEvaluation newControllerExprEval = controllerExprEval != null ? controllerExprEval.instantiate(context, maxDepth) : null; ExecSimpleDeclaration newControllerDeclExec = controllerDeclExec != null ? (ExecSimpleDeclaration)controllerDeclExec.instantiate(context, maxDepth) : null; ICPPExecution[] newBodyStmtExecutions = new ICPPExecution[bodyStmtExecutions.length]; boolean evaluationsDidChange = false; for(int i = 0; i < bodyStmtExecutions.length; i++) { ICPPExecution bodyStmtExec = bodyStmtExecutions[i]; ICPPExecution newBodyStmtExec = bodyStmtExec.instantiate(context, maxDepth); if(newBodyStmtExec != bodyStmtExec) { evaluationsDidChange = true; } newBodyStmtExecutions[i] = newBodyStmtExec; } if (newControllerExprEval == controllerExprEval && newControllerDeclExec == controllerDeclExec && !evaluationsDidChange) { return this; } return new ExecSwitch(newControllerExprEval, newControllerDeclExec, newBodyStmtExecutions); }

Target:
public ICPPExecution instantiate(InstantiationContext context, int maxDepth) { ICPPEvaluation newControllerExprEval = controllerExprEval != null ? controllerExprEval.instantiate(context, maxDepth) : null; ExecSimpleDeclaration newControllerDeclExec = controllerDeclExec != null ? (ExecSimpleDeclaration)controllerDeclExec.instantiate(context, maxDepth) : null; ICPPExecution[] newBodyStmtExecutions = new ICPPExecution[bodyStmtExecutions.length]; boolean executionsDidChange = false; for(int i = 0; i < bodyStmtExecutions.length; i++) { ICPPExecution bodyStmtExec = bodyStmtExecutions[i]; ICPPExecution newBodyStmtExec = bodyStmtExec.instantiate(context, maxDepth); if(newBodyStmtExec != bodyStmtExec) { executionsDidChange = true; } newBodyStmtExecutions[i] = newBodyStmtExec; } if (newControllerExprEval == controllerExprEval && newControllerDeclExec == controllerDeclExec && !executionsDidChange) { return this; } return new ExecSwitch(newControllerExprEval, newControllerDeclExec, newBodyStmtExecutions); }
Source:
public void onClose(int closeCode, String message) { LOGGER.info("onClose( closeCode={}, message={})", connection, message); if (null != closeListener) { closeListener.onClose(closeCode, message, this.session); } if (this.session != null) { this.session.close(); this.session = null; } syncEventBus.unregister(this); asyncEventBus.unregister(this); }

Target:
public void onClose(int closeCode, String message) { LOGGER.info("onClose( closeCode={}, message={})", connection, message); try { if (null != closeListener) { closeListener.onClose(closeCode, message, this.session); } } finally { if (this.session != null) { this.session.close(); this.session = null; } syncEventBus.unregister(this); asyncEventBus.unregister(this); } }
Source:
protected Set<Value.Immutable<?>> api$getVanillaValues() { Set<Value.Immutable<?>> vanillaValues = super.api$getVanillaValues(); if (this.shadow$getOwnerUniqueId() != null) { this.tamer().map(Value::asImmutable).ifPresent(vanillaValues::add); } return vanillaValues; }

Target:
protected Set<Value.Immutable<?>> api$getVanillaValues() { final Set<Value.Immutable<?>> values = super.api$getVanillaValues(); this.tamer().map(Value::asImmutable).ifPresent(values::add); return values; }
Source:
public String getGiverTypeForQuestion(int qnNumber) { WebElement giverDropdownForQuestion= browser.driver.findElement(By.id("questionedittext-" + qnNumber)); return giverDropdownForQuestion.getAttribute("value"); }

Target:
public String getGiverTypeForQuestion(int qnNumber) { WebElement giverDropdownForQuestion = browser.driver.findElement(By.id("givertype-" + qnNumber)); return giverDropdownForQuestion.getAttribute("value"); }
Source:
public Map<String, String> load() { final Map<String, String> preferences = new HashMap<String, String>(); final String property = System.getProperty( GuidedDecisionTableEditorService.DTABLE_VERIFICATION_ENABLED ); log.info( "Setting preference '" + GuidedDecisionTableEditorService.DTABLE_VERIFICATION_ENABLED + "' to '" + property + "'." ); preferences.put( GuidedDecisionTableEditorService.DTABLE_VERIFICATION_ENABLED, property ); return preferences; }

Target:
public Map<String, String> load() { final Map<String, String> preferences = new HashMap<String, String>(); final String property = getProperty(); log.info( "Setting preference '" + GuidedDecisionTableEditorService.DTABLE_VERIFICATION_ENABLED + "' to '" + property + "'." ); preferences.put( GuidedDecisionTableEditorService.DTABLE_VERIFICATION_ENABLED, property ); return preferences; }
Source:
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { logger.debug("Executed RebuildMetadataCronJob."); CronTaskConfiguration config = (CronTaskConfiguration) jobExecutionContext.getMergedJobDataMap().get("config"); try { String storageId = config.getProperty("storageId"); String repositoryId = config.getProperty("repositoryId"); String basePath = config.getProperty("basePath"); if (storageId == null) { List<String> storagesId = getStoragesId(); for (String storage : storagesId) { Path storagePath = Paths.get(getStoragesBasePath(), storage); List<String> repositoriesId = getRepositoriesId(storagePath); rebuildRepositories(repositoriesId, storage, basePath); } } else if (repositoryId == null) { Path storagePath = Paths.get(getStoragesBasePath(), storageId); List<String> repositoriesId = getRepositoriesId(storagePath); rebuildRepositories(repositoriesId, storageId, basePath); } else { artifactMetadataService.rebuildMetadata(storageId, repositoryId, basePath); } } catch (IOException | XmlPullParserException | NoSuchAlgorithmException e) { e.printStackTrace(); logger.error("IOException: ", e); } manager.addExecutedJob(config.getName(), true); }

Target:
protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException { logger.debug("Executed RebuildMetadataCronJob."); CronTaskConfiguration config = (CronTaskConfiguration) jobExecutionContext.getMergedJobDataMap().get("config"); try { String storageId = config.getProperty("storageId"); String repositoryId = config.getProperty("repositoryId"); String basePath = config.getProperty("basePath"); if (storageId == null) { Map<String, Storage> storages = getStorages(); for (String storage : storages.keySet()) { rebuildRepositories(storage); } } else if (repositoryId == null) { rebuildRepositories(storageId); } else { artifactMetadataService.rebuildMetadata(storageId, repositoryId, basePath); } } catch (IOException | XmlPullParserException | NoSuchAlgorithmException e) { logger.error(e.getMessage(), e); } manager.addExecutedJob(config.getName(), true); }
Source:
public ContentItemImpl( String id, String qualifier, ByteSource byteSource, String mimeTypeRawData, String filename, long size, Metacard metacard) { this.byteSource = byteSource; this.id = id; if (StringUtils.isNotBlank(qualifier)) { this.qualifier = qualifier; } else { this.qualifier = null; } this.mimeType = null; this.size = size; if (filename != null) { this.filename = filename; } else { this.filename = DEFAULT_FILE_NAME; } this.metacard = metacard; this.mimeTypeRawData = DEFAULT_MIME_TYPE; if (StringUtils.isNotBlank(mimeTypeRawData)) { this.mimeTypeRawData = mimeTypeRawData; } try { this.mimeType = new MimeType(this.mimeTypeRawData); uri = new URI(CONTENT_SCHEME, this.id, this.qualifier); } catch (MimeTypeParseException e) { LOGGER.debug("Unable to create MimeType from raw data {}", mimeTypeRawData); } catch (URISyntaxException e) { throw new IllegalArgumentException("Unable to create content URI.", e); } }

Target:
public ContentItemImpl( String id, String qualifier, ByteSource byteSource, String mimeTypeRawData, String filename, long size, Metacard metacard) { this.byteSource = byteSource; this.id = id; if (StringUtils.isNotBlank(qualifier)) { this.qualifier = qualifier; } else { this.qualifier = null; } this.mimeType = null; this.size = size; if (filename != null) { this.filename = filename; } else { this.filename = DEFAULT_FILE_NAME; } this.metacard = metacard; this.mimeTypeRawData = DEFAULT_MIME_TYPE; if (StringUtils.isNotBlank(mimeTypeRawData)) { this.mimeTypeRawData = mimeTypeRawData; } try { this.mimeType = new MimeType(this.mimeTypeRawData); } catch (MimeTypeParseException e) { LOGGER.debug("Unable to create MimeType from raw data {}", mimeTypeRawData); } try { uri = new URI(CONTENT_SCHEME, this.id, this.qualifier); } catch (URISyntaxException e) { throw new IllegalArgumentException("Unable to create content URI.", e); } }
Source:
public static ModelNode parseAttributeValue(final String value, final boolean isExpressionAllowed, final ModelType attributeType) { final String trimmed = value == null ? null : value.trim(); ModelNode node; if (trimmed != null) { if (isExpressionAllowed && isExpression(value)) { node = new ModelNode(new ValueExpression(value)); } else { if(attributeType == STRING || attributeType == PROPERTY) { node = new ModelNode().set(value); } else { node = new ModelNode().set(trimmed); } } if (node.getType() != ModelType.EXPRESSION) { try { switch (attributeType) { case BIG_DECIMAL: node.set(node.asBigDecimal()); break; case BIG_INTEGER: node.set(node.asBigInteger()); break; case BOOLEAN: node.set(node.asBoolean()); break; case BYTES: node.set(node.asBytes()); break; case DOUBLE: node.set(node.asDouble()); break; case INT: node.set(node.asInt()); break; case LONG: node.set(node.asLong()); break; } } catch (IllegalArgumentException iae) { } } } else { node = new ModelNode(); } return node; }

Target:
public static ModelNode parseAttributeValue(final String value, final boolean isExpressionAllowed, final ModelType attributeType) { final String trimmed = value == null ? null : value.trim(); ModelNode node; if (trimmed != null) { if (isExpressionAllowed && isExpression(value)) { if(attributeType == STRING || attributeType == PROPERTY) { node = new ModelNode(new ValueExpression(value)); } else { node = new ModelNode(new ValueExpression(trimmed)); } } else { if(attributeType == STRING || attributeType == PROPERTY) { node = new ModelNode().set(value); } else { node = new ModelNode().set(trimmed); } } if (node.getType() != ModelType.EXPRESSION) { try { switch (attributeType) { case BIG_DECIMAL: node.set(node.asBigDecimal()); break; case BIG_INTEGER: node.set(node.asBigInteger()); break; case BOOLEAN: node.set(node.asBoolean()); break; case BYTES: node.set(node.asBytes()); break; case DOUBLE: node.set(node.asDouble()); break; case INT: node.set(node.asInt()); break; case LONG: node.set(node.asLong()); break; } } catch (IllegalArgumentException iae) { } } } else { node = new ModelNode(); } return node; }
Source:
public RandomNodeSelection( NodeMap nodeMap, boolean includeCoordinator, int minCandidates, int maxTasksPerStage, List<RemoteTask> existingTasks) { this.nodeMap = nodeMap; this.includeCoordinator = includeCoordinator; this.minCandidates = minCandidates; randomCandidates = getRandomCandidates(maxTasksPerStage, this.nodeMap, existingTasks); }

Target:
public RandomNodeSelection( NodeMap nodeMap, boolean includeCoordinator, int minCandidates, int maxTasksPerStage, List<RemoteTask> existingTasks) { requireNonNull(nodeMap, "nodeMap is null"); requireNonNull(existingTasks, "existingTasks is null"); this.includeCoordinator = includeCoordinator; this.minCandidates = minCandidates; this.randomCandidates = getRandomCandidates(maxTasksPerStage, nodeMap, existingTasks); }
Source:
public void send_telemetry_data_at_startup() throws Exception { String serverId = randomAlphanumeric(40); orchestrator = Orchestrator.builderEnv() .addPlugin(xooPlugin()) .setServerProperty("sonar.telemetry.url", url) .setServerProperty("sonar.telemetry.frequency", "1") .setServerProperty("sonar.core.id", serverId) .build(); orchestrator.start(); RecordedRequest request = server.takeRequest(1, TimeUnit.SECONDS); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getBody().readUtf8()).contains(serverId); assertThat(request.getHeader(HttpHeaders.USER_AGENT)).contains("SonarQube"); orchestrator.stop(); }

Target:
public void send_telemetry_data_at_startup() throws Exception { String serverId = randomAlphanumeric(40); orchestrator = Orchestrator.builderEnv() .addPlugin(xooPlugin()) .setServerProperty("sonar.telemetry.url", url) .setServerProperty("sonar.telemetry.frequencyInSeconds", "1") .setServerProperty("sonar.core.id", serverId) .build(); orchestrator.start(); RecordedRequest request = server.takeRequest(1, TimeUnit.SECONDS); assertThat(request.getMethod()).isEqualTo("POST"); assertThat(request.getBody().readUtf8()).contains(serverId); assertThat(request.getHeader(HttpHeaders.USER_AGENT)).contains("SonarQube"); orchestrator.stop(); }
Source:
protected RemoteOperationResult<ShareParserResult> run(OwnCloudClient client) { CreateRemoteShareOperation createOp = new CreateRemoteShareOperation( mPath, ShareType.PUBLIC_LINK, "", mPublicUpload, mPassword, mPermissions ); createOp.setGetShareDetails(true); createOp.setName(mName); createOp.setPublicUpload(mPublicUpload); createOp.setPermissions(mPermissions); createOp.setExpirationDate(mExpirationDateInMillis); RemoteOperationResult<ShareParserResult> result = createOp.execute(client); if (result.isSuccess()) { if (result.getData().getShares().size() > 0) { ShareParserResult shareParserResult = result.getData(); if(shareParserResult.getShares().size() != 0) { updateData(shareParserResult.getShares().get(0)); } else { result = new RemoteOperationResult<>( RemoteOperationResult.ResultCode.SHARE_NOT_FOUND); result.setData(shareParserResult); } } else { result = new RemoteOperationResult<>(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND); } } return result; }

Target:
protected RemoteOperationResult<ShareParserResult> run(OwnCloudClient client) { CreateRemoteShareOperation createOp = new CreateRemoteShareOperation( mPath, ShareType.PUBLIC_LINK, "", mPublicUpload, mPassword, mPermissions ); createOp.setGetShareDetails(true); createOp.setName(mName); createOp.setPublicUpload(mPublicUpload); createOp.setPermissions(mPermissions); createOp.setExpirationDate(mExpirationDateInMillis); RemoteOperationResult<ShareParserResult> result = createOp.execute(client); if (result.isSuccess()) { if (result.getData() != null && result.getData().getShares() != null && result.getData().getShares().size() > 0) { ShareParserResult shareParserResult = result.getData(); updateData(shareParserResult.getShares().get(0)); } else { result = new RemoteOperationResult<>(RemoteOperationResult.ResultCode.SHARE_NOT_FOUND); } } return result; }
Source:
public void logRetry(Logger log, String message, Throwable t) { long now = System.nanoTime(); if (lastRetryLog < 0) { if (log.isDebugEnabled()) { log.debug(getMessage(message, t)); } lastRetryLog = now; } else if ((now - lastRetryLog) > logIntervalNanoSec) { log.warn(getMessage(message), t); lastRetryLog = now; } else { if (log.isTraceEnabled()) { log.trace(getMessage(message, t)); } } }

Target:
public void logRetry(Logger log, String message, Throwable t) { long now = System.nanoTime(); if (hasNeverLogged) { if (log.isDebugEnabled()) { log.debug(getMessage(message, t)); } hasNeverLogged = false; lastRetryLog = now; } else if ((now - lastRetryLog) > logIntervalNanoSec) { log.warn(getMessage(message), t); lastRetryLog = now; } else { if (log.isTraceEnabled()) { log.trace(getMessage(message, t)); } } }
Source:
public static MemoryPool map(Mempool poolEntity) { MemoryPool poolModel = new MemoryPool(); if (poolEntity == null) return null; poolModel.setName(poolEntity.getName()); poolModel.setAllocCount(poolEntity.getAllocCount()); poolModel.setColdCount(poolEntity.getColdCount()); poolModel.setHotCount(poolEntity.getHotCount()); poolModel.setMaxAlloc(poolEntity.getMaxAlloc()); poolModel.setMaxStdAlloc(poolEntity.getMaxStdAlloc()); poolModel.setPaddedSize(poolEntity.getPadddedSize()); poolModel.setPoolMisses(poolEntity.getPoolMisses()); return poolModel; }

Target:
public static GlusterMemoryPool map(Mempool poolEntity) { GlusterMemoryPool poolModel = new GlusterMemoryPool(); if (poolEntity == null) return null; if (StringUtils.isNotEmpty(poolEntity.getName())) poolModel.setName(poolEntity.getName()); poolModel.setAllocCount(poolEntity.getAllocCount()); poolModel.setColdCount(poolEntity.getColdCount()); poolModel.setHotCount(poolEntity.getHotCount()); poolModel.setMaxAlloc(poolEntity.getMaxAlloc()); poolModel.setMaxStdAlloc(poolEntity.getMaxStdAlloc()); poolModel.setPaddedSize(poolEntity.getPadddedSize()); poolModel.setPoolMisses(poolEntity.getPoolMisses()); return poolModel; }
Source:
protected long getPreferredWeight(final ProductSummary summary) { Regions regions = ANSSRegionsFactory.getFactory().getRegions(); long preferredWeight = DEFAULT_PREFERRED_WEIGHT; String source = summary.getId().getSource(); String eventSource = summary.getEventSource(); BigDecimal latitude = summary.getEventLatitude(); BigDecimal longitude = summary.getEventLongitude(); Point location = null; if (latitude != null && longitude != null) { location = new Point(longitude.doubleValue(), latitude.doubleValue()); } if (location != null) { if (regions.isAuthor(source, location)) { preferredWeight += AUTHORITATIVE_WEIGHT; } if (eventSource != null && regions.isAuthor(eventSource, location)) { preferredWeight += AUTHORITATIVE_EVENT_WEIGHT; } } if (eventSource != null && eventSource.equalsIgnoreCase(source)) { preferredWeight += SAME_SOURCE_WEIGHT; } return preferredWeight; }

Target:
protected long getPreferredWeight(final ProductSummary summary) throws Exception { Regions regions = ANSSRegionsFactory.getFactory().getRegions(); if (regions == null) { throw new ContinuableListenerException( "Unable to load ANSS Authoritative Regions"); } long preferredWeight = DEFAULT_PREFERRED_WEIGHT; String source = summary.getId().getSource(); String eventSource = summary.getEventSource(); BigDecimal latitude = summary.getEventLatitude(); BigDecimal longitude = summary.getEventLongitude(); Point location = null; if (latitude != null && longitude != null) { location = new Point(longitude.doubleValue(), latitude.doubleValue()); } if (location != null) { if (regions.isAuthor(source, location)) { preferredWeight += AUTHORITATIVE_WEIGHT; } if (eventSource != null && regions.isAuthor(eventSource, location)) { preferredWeight += AUTHORITATIVE_EVENT_WEIGHT; } } if (eventSource != null && eventSource.equalsIgnoreCase(source)) { preferredWeight += SAME_SOURCE_WEIGHT; } return preferredWeight; }
Source:
public Component(Package pkg, String component){ mPackage = pkg; mComponent = component; }

Target:
public Component(Package pkg, String component) { this.pkg = pkg; this.component = component; }
Source:
public List<UserCouponDto> getInvestUserCoupons(String loginName, long loanId) { if (loanDetailsMapper.getByLoanId(loanId).getNonUseCoupon()){ return null; } List<UserCouponModel> userCouponModels = userCouponMapper.findByLoginName(loginName, null); List<UserCouponDto> dtoList = Lists.transform(userCouponModels, new Function<UserCouponModel, UserCouponDto>() { @Override public UserCouponDto apply(UserCouponModel userCouponModel) { return new UserCouponDto(couponMapper.findById(userCouponModel.getCouponId()), userCouponModel, couponLockSeconds); } }); return Lists.newArrayList(Iterators.filter(dtoList.iterator(), new Predicate<UserCouponDto>() { @Override public boolean apply(UserCouponDto dto) { return dto.isUnused(); } })); }

Target:
public List<UserCouponDto> getInvestUserCoupons(String loginName, long loanId) { if (loanDetailsMapper.getByLoanId(loanId).getDisableCoupon()){ return new ArrayList<UserCouponDto>(); } List<UserCouponModel> userCouponModels = userCouponMapper.findByLoginName(loginName, null); List<UserCouponDto> dtoList = Lists.transform(userCouponModels, new Function<UserCouponModel, UserCouponDto>() { @Override public UserCouponDto apply(UserCouponModel userCouponModel) { return new UserCouponDto(couponMapper.findById(userCouponModel.getCouponId()), userCouponModel, couponLockSeconds); } }); return Lists.newArrayList(Iterators.filter(dtoList.iterator(), new Predicate<UserCouponDto>() { @Override public boolean apply(UserCouponDto dto) { return dto.isUnused(); } })); }
Source:
public MethodSource<JavaInterfaceSource> setConstructor(boolean constructor) { throw new UnsupportedOperationException(); }

Target:
public MethodSource<JavaInterfaceSource> setConstructor(boolean constructor) { throw new UnsupportedOperationException("An interface couldn't have a constructor"); }
Source:
ClientSession getClientSession() throws Exception { if (this.session == null || this.session.isClosed()) { log.debug("Creating new ActiveMQ session for async job messages..."); ClientSessionFactory csf = this.getClientSessionFactory(); this.session = csf.createSession(); log.debug("Created new ActiveMQ session: {}", this.session); } return this.session; }

Target:
protected ClientSession getClientSession() throws Exception { if (this.session == null || this.session.isClosed()) { log.debug("Creating new ActiveMQ session for sending async job messages..."); this.session = this.sessionFactory.getEgressSession(); log.debug("Created new ActiveMQ session: {}", this.session); } return this.session; }
Source:
public void run() { try { APILocator.getDistributedJournalAPI().processJournalEntries(); } catch (Exception e) { Logger.error(this, "Error ocurred while trying to process journal entries.", e); } }

Target:
public void run() { try { APILocator.getDistributedJournalAPI().processJournalEntries(); } catch (Exception e) { Logger.error(this, "Error ocurred while trying to process journal entries.", e); throw new DotRuntimeException(e); } }
Source:
private List<SourceRecord> checkpointsForGroup(String group) throws InterruptedException { try { long timestamp = System.currentTimeMillis(); List<Checkpoint> checkpoints = listConsumerGroupOffsets(group).entrySet().stream() .filter(x -> shouldCheckpointTopic(x.getKey().topic())) .map(x -> checkpoint(group, x.getKey(), x.getValue())) .filter(x -> x.downstreamOffset() > 0) .collect(Collectors.toList()); if (groupOffsetSyncEnabled) { DescribeConsumerGroupsResult describedGroups = targetAdminClient.describeConsumerGroups( Lists.newArrayList(group)); for (Map.Entry<String, KafkaFuture<ConsumerGroupDescription>> entry : describedGroups.describedGroups().entrySet()) { ConsumerGroupDescription consumerGroupDescription = entry.getValue().get(); if (consumerGroupDescription.state().equals(ConsumerGroupState.EMPTY)) { alterGroupOffset(group, checkpoints); } } } return checkpoints.stream().map(x -> checkpointRecord(x, timestamp)).collect(Collectors.toList()); } catch (ExecutionException e) { log.error("Error querying offsets for consumer group on cluster {}.", group, sourceClusterAlias, e); return Collections.emptyList(); } }

Target:
private List<Checkpoint> checkpointsForGroup(String group) throws ExecutionException, InterruptedException { return listConsumerGroupOffsets(group).entrySet().stream() .filter(x -> shouldCheckpointTopic(x.getKey().topic())) .map(x -> checkpoint(group, x.getKey(), x.getValue())) .filter(x -> x.downstreamOffset() > 0) .collect(Collectors.toList()); }
Source:
public void postsTweetWithLanguages() throws Exception { final Repo repo = this.repo(); final List<Language> langs = Lists.newArrayList( this.lang("Java"), this.lang("Python") ); Mockito.when(repo.languages()).thenReturn(langs); final Twitter twitter = Mockito.mock(Twitter.class); final Agent agent = new Tweets(repo.github(), twitter); final Talk talk = this.talk(repo, this.issue(repo)); agent.execute(talk); Mockito.verify(twitter).post( Matchers.contains( String.format("#%s #%s", langs.get(0), langs.get(1)) ) ); }

Target:
public void postsTweetWithLanguages() throws Exception { final Repo repo = new MkGithub().randomRepo(); final Twitter twitter = Mockito.mock(Twitter.class); new Tweets(repo.github(), twitter).execute( TweetsTest.talk(repo, repo.issues().create("", "")) ); Mockito.verify(twitter).post( Matchers.contains( Joiner.on(' ').join( Iterables.transform( repo.languages(), new Function<Language, String>() { @Override public String apply(final Language lang) { return String.format("#%s", lang.name()); } } ) ) ) ); }
Source:
public boolean isScanMarkerRow(Result result) { if (result instanceof RowResult) { return ((RowResult) result).isMarkerRow(); } return result.isEmpty(); }

Target:
public boolean isScanMarkerRow(Result result) { Preconditions.checkState(result instanceof RowResult, "Should be an instance of RowResult"); return ((RowResult) result).isMarkerRow(); }
Source:
public void testMonitor() throws IOException, InterruptedException { ArrayList<Field> fields = new ArrayList<>(Arrays.asList( new Field("version", String.class), new Field("avg_latency", Double.class), new Field("max_latency", Long.class), new Field("min_latency", Long.class), new Field("packets_received", Long.class), new Field("packets_sent", Long.class), new Field("num_alive_connections", Integer.class), new Field("outstanding_requests", Long.class), new Field("server_state", String.class), new Field("znode_count", Integer.class), new Field("watch_count", Integer.class), new Field("ephemerals_count", Integer.class), new Field("approximate_data_size", Long.class), new Field("open_file_descriptor_count", Long.class), new Field("max_file_descriptor_count", Long.class), new Field("last_client_response_size", Integer.class), new Field("max_client_response_size", Integer.class), new Field("min_client_response_size", Integer.class), new Field("uptime", Long.class), new Field("global_sessions", Long.class), new Field("local_sessions", Long.class), new Field("connection_drop_probability", Double.class) )); Map<String, Object> metrics = new HashMap<>(); ServerMetrics .getMetrics() .getMetricsProvider() .dump( (metric, value)-> { metrics.put(metric, value); }); for (String metric : metrics.keySet()) { if (metric.startsWith("avg_")) { fields.add(new Field(metric, Double.class)); } else { fields.add(new Field(metric, Long.class)); } } Field fieldsArray[] = fields.toArray(new Field[0]); testCommand("monitor", fieldsArray); }

Target:
public void testMonitor() throws IOException, InterruptedException { ArrayList<Field> fields = new ArrayList<>(Arrays.asList( new Field("version", String.class), new Field("avg_latency", Double.class), new Field("max_latency", Long.class), new Field("min_latency", Long.class), new Field("packets_received", Long.class), new Field("packets_sent", Long.class), new Field("num_alive_connections", Integer.class), new Field("outstanding_requests", Long.class), new Field("server_state", String.class), new Field("znode_count", Integer.class), new Field("watch_count", Integer.class), new Field("ephemerals_count", Integer.class), new Field("approximate_data_size", Long.class), new Field("open_file_descriptor_count", Long.class), new Field("max_file_descriptor_count", Long.class), new Field("last_client_response_size", Integer.class), new Field("max_client_response_size", Integer.class), new Field("min_client_response_size", Integer.class), new Field("uptime", Long.class), new Field("global_sessions", Long.class), new Field("local_sessions", Long.class), new Field("connection_drop_probability", Double.class) )); Map<String, Object> metrics = MetricsUtils.currentServerMetrics(); for (String metric : metrics.keySet()) { if (metric.startsWith("avg_")) { fields.add(new Field(metric, Double.class)); } else { fields.add(new Field(metric, Long.class)); } } Field fieldsArray[] = fields.toArray(new Field[0]); testCommand("monitor", fieldsArray); }
Source:
public void approveSelection() { File selectedFile = getSelectedFile(); if (selectedFile.length() > selectedFile.getUsableSpace()) { JOptionPane.showMessageDialog(this, "Not enough disk space!"); return; } if (!java.nio.file.Files.isWritable(selectedFile.getParentFile().toPath())) { JOptionPane.showMessageDialog(this, MessageFormat.format(Constant.messages.getString("report.write.permission.dialog.message"), selectedFile.getAbsolutePath()), Constant.messages.getString("report.write.permission.dialog.title"), JOptionPane.ERROR_MESSAGE); return; } if (selectedFile.exists()) { int result = JOptionPane.showConfirmDialog(this, Constant.messages.getString("report.write.overwrite.dialog.message"), Constant.messages.getString("report.write.overwrite.dialog.title"), JOptionPane.YES_NO_OPTION); switch (result) { case JOptionPane.YES_OPTION: super.approveSelection(); return; case JOptionPane.NO_OPTION: case JOptionPane.CLOSED_OPTION: return; } } Model.getSingleton().getOptionsParam().setUserDirectory(getCurrentDirectory()); super.approveSelection(); }

Target:
public void approveSelection() { File selectedFile = getSelectedFile(); File checkFile = selectedFile; boolean fileExists = checkFile.exists(); if (!fileExists) { checkFile = checkFile.getParentFile(); } if (checkFile.getUsableSpace() < MINIMUM_SPACE_REQUIREMENT_MB) { int result = JOptionPane.showConfirmDialog(this, Constant.messages.getString("report.write.diskspace.warning.dialog.message"), Constant.messages.getString("report.write.diskspace.warning.dialog.title"), JOptionPane.YES_NO_OPTION); if (result != JOptionPane.YES_OPTION) { return; } } if (!Files.isWritable(selectedFile.getParentFile().toPath())) { warnNotWritable("report.write.permission.dir.dialog.message", selectedFile.getParentFile().getAbsolutePath()); return; } if (fileExists) { if (!Files.isWritable(selectedFile.toPath())) { warnNotWritable("report.write.permission.file.dialog.message", selectedFile.getAbsolutePath()); return; } int result = JOptionPane.showConfirmDialog(this, Constant.messages.getString("report.write.overwrite.dialog.message"), Constant.messages.getString("report.write.overwrite.dialog.title"), JOptionPane.YES_NO_OPTION); switch (result) { case JOptionPane.YES_OPTION: super.approveSelection(); return; case JOptionPane.NO_OPTION: case JOptionPane.CLOSED_OPTION: return; } } Model.getSingleton().getOptionsParam().setUserDirectory(getCurrentDirectory()); super.approveSelection(); }
Source:
public ItemStack getStackInSlot(int slot) { ItemStack[] stacks = this.stacks; validateSlotIndex(slot, stacks); return stacks[slot]; }

Target:
public ItemStack getStackInSlot(int slot) { validateSlotIndex(slot); return this.stacks[slot]; }
Source:
public void testRegistrySystemProperty() throws Exception { System.setProperty("registry.username","roland"); System.setProperty("registry.password", "secret"); System.setProperty("registry.email", "roland@jolokia.org"); try { AuthConfig config = factory.createAuthConfig(true, false, null, settings, null, null); verifyAuthConfig(config,"roland","secret","roland@jolokia.org"); } finally { System.clearProperty("registry.username"); System.clearProperty("registry.password"); System.clearProperty("registry.email"); } }

Target:
public void testRegistrySystemProperty() throws Exception { testSystemProperty("registry"); }
Source:
public void writeStuffToFile(Path path) throws IOException { try { writer = new FileWriter(new File(path.toString())); Random random = new Random(); for (int i = 0; i < 20; i++) { writer.append(random.nextBoolean() + "\n"); } } catch (IOException ex) { fail("writer failed to init"); } writer.close(); }

Target:
public void writeStuffToFile(Path path) throws IOException { try { writer = new FileWriter(path.toFile()); Random random = new Random(); for (int i = 0; i < 20; i++) { writer.append(random.nextBoolean() + "\n"); } } catch (IOException ex) { fail("writer failed to init"); } writer.close(); }
Source:
private static final Collection<Operation> filterOperations(final Collection<Operation> operations, final boolean ignoreVoidOperations, final boolean ignoreOperationsWithParameters) { if (!ignoreOperationsWithParameters && !ignoreOperationsWithParameters) { return Collections.unmodifiableCollection(operations); } final Collection<Operation> filteredOperation = new HashSet<>(); for (Operation current : operations) { final Collection<Parameter> returnParameters = new ArrayList<>(); final Collection<Parameter> othersParameters = new ArrayList<>(); for (final Parameter p : current.getOwnedParameters()) { if (p.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { returnParameters.add(p); } else { othersParameters.add(p); } } if (ignoreVoidOperations == !returnParameters.isEmpty()) { if (ignoreOperationsWithParameters == othersParameters.isEmpty()) { filteredOperation.add(current); } } } return filteredOperation; }

Target:
private static final Collection<Operation> filterOperations(final Collection<Operation> operations, final boolean ignoreVoidOperations, final boolean ignoreOperationsWithParameters) { if (!ignoreOperationsWithParameters && !ignoreVoidOperations) { return Collections.unmodifiableCollection(operations); } final Collection<Operation> filteredOperation = new HashSet<>(); for (Operation current : operations) { final Collection<Parameter> returnParameters = new ArrayList<>(); final Collection<Parameter> othersParameters = new ArrayList<>(); for (final Parameter p : current.getOwnedParameters()) { if (p.getDirection() == ParameterDirectionKind.RETURN_LITERAL) { returnParameters.add(p); } else { othersParameters.add(p); } } if ((ignoreVoidOperations && !returnParameters.isEmpty()) && (ignoreOperationsWithParameters && othersParameters.isEmpty())) { filteredOperation.add(current); } } return filteredOperation; }
Source:
public ChargeEntity updateChargeStatus(ChargeEntity chargeEntity, ChargeStatus chargeStatus) { chargeEntity.setStatus(chargeStatus); chargeEventDao.persistChargeEventOf(chargeEntity, Optional.empty()); logger.info("{} for charge [charge_external_id={}]", chargeStatus, chargeEntity.getExternalId()); return chargeEntity; }

Target:
private ChargeEntity updateChargeStatus(ChargeEntity chargeEntity, ChargeStatus chargeStatus) { chargeEntity.setStatus(chargeStatus); chargeEventDao.persistChargeEventOf(chargeEntity, Optional.empty()); return chargeEntity; }