auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private PieData getData() { PieDataSet dataSet = new PieDataSet(null, ""); List<String> labels = new ArrayList<>(); List<Integer> colors = new ArrayList<>(); for (Account account : mAccountsDbAdapter.getSimpleAccountList()) { if (account.getAccountType() == mAccountType && !account.isPlaceholderAccount() <START> && account.getCommodity() == mCommodity) { <END> double balance = mAccountsDbAdapter.getAccountsBalance(Collections.singletonList(account.getUID()), mReportPeriodStart, mReportPeriodEnd).asDouble(); if (balance > 0) { dataSet.addEntry(new Entry((float) balance, dataSet.getEntryCount())); int color; if (mUseAccountColor) { color = (account.getColor() != Account.DEFAULT_COLOR) ? account.getColor() : ReportsActivity.COLORS[(dataSet.getEntryCount() - 1) % ReportsActivity.COLORS.length]; } else { color = ReportsActivity.COLORS[(dataSet.getEntryCount() - 1) % ReportsActivity.COLORS.length]; } colors.add(color); labels.add(account.getName()); } } } dataSet.setColors(colors); dataSet.setSliceSpace(SPACE_BETWEEN_SLICES); return new PieData(labels, dataSet); }</code><technical_language>equals()</technical_language>

Target:
private PieData getData() { PieDataSet dataSet = new PieDataSet(null, ""); List<String> labels = new ArrayList<>(); List<Integer> colors = new ArrayList<>(); for (Account account : mAccountsDbAdapter.getSimpleAccountList()) { if (account.getAccountType() == mAccountType && !account.isPlaceholderAccount() && account.getCommodity().equals(mCommodity)) { double balance = mAccountsDbAdapter.getAccountsBalance(Collections.singletonList(account.getUID()), mReportPeriodStart, mReportPeriodEnd).asDouble(); if (balance > 0) { dataSet.addEntry(new Entry((float) balance, dataSet.getEntryCount())); int color; if (mUseAccountColor) { color = (account.getColor() != Account.DEFAULT_COLOR) ? account.getColor() : ReportsActivity.COLORS[(dataSet.getEntryCount() - 1) % ReportsActivity.COLORS.length]; } else { color = ReportsActivity.COLORS[(dataSet.getEntryCount() - 1) % ReportsActivity.COLORS.length]; } colors.add(color); labels.add(account.getName()); } } } dataSet.setColors(colors); dataSet.setSliceSpace(SPACE_BETWEEN_SLICES); return new PieData(labels, dataSet); }
Source:
<code>protected void handleElementContentChanged(IFileEditorInput fileEditorInput) { FileInfo info= (FileInfo) getElementInfo(fileEditorInput); if (info == null) return; IDocument document= createEmptyDocument(); IStatus status= null; try { try { <START> refreshFile(fileEditorInput.getFile(), getProgressMonitor()); <END> } catch (CoreException x) { handleCoreException(x, "FileDocumentProvider.handleElementContentChanged"); } cacheEncodingState(fileEditorInput); setDocumentContent(document, fileEditorInput, info.fEncoding); } catch (CoreException x) { status= x.getStatus(); } String newContent= document.get(); if ( !newContent.equals(info.fDocument.get())) { fireElementContentAboutToBeReplaced(fileEditorInput); removeUnchangedElementListeners(fileEditorInput, info); info.fDocument.removeDocumentListener(info); info.fDocument.set(newContent); info.fCanBeSaved= false; info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile()); info.fStatus= status; addUnchangedElementListeners(fileEditorInput, info); fireElementContentReplaced(fileEditorInput); } else { removeUnchangedElementListeners(fileEditorInput, info); info.fCanBeSaved= false; info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile()); info.fStatus= status; addUnchangedElementListeners(fileEditorInput, info); fireElementDirtyStateChanged(fileEditorInput, false); } }</code><technical_language>change is unnecessary</technical_language>

Target:
protected void handleElementContentChanged(IFileEditorInput fileEditorInput) { FileInfo info= (FileInfo) getElementInfo(fileEditorInput); if (info == null) return; IDocument document= createEmptyDocument(); IStatus status= null; try { try { refreshFile(fileEditorInput.getFile()); } catch (CoreException x) { handleCoreException(x, "FileDocumentProvider.handleElementContentChanged"); } cacheEncodingState(fileEditorInput); setDocumentContent(document, fileEditorInput, info.fEncoding); } catch (CoreException x) { status= x.getStatus(); } String newContent= document.get(); if ( !newContent.equals(info.fDocument.get())) { fireElementContentAboutToBeReplaced(fileEditorInput); removeUnchangedElementListeners(fileEditorInput, info); info.fDocument.removeDocumentListener(info); info.fDocument.set(newContent); info.fCanBeSaved= false; info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile()); info.fStatus= status; addUnchangedElementListeners(fileEditorInput, info); fireElementContentReplaced(fileEditorInput); } else { removeUnchangedElementListeners(fileEditorInput, info); info.fCanBeSaved= false; info.fModificationStamp= computeModificationStamp(fileEditorInput.getFile()); info.fStatus= status; addUnchangedElementListeners(fileEditorInput, info); fireElementDirtyStateChanged(fileEditorInput, false); } }
Source:
<code>public void run() { <START> client.events().inAnyNamespace().watch(this); <END> }</code><technical_language>want watch endpoints() events(). Endpoints give ready + ready hosts/ports metadata attached, need for this case. Events more data need</technical_language>

Target:
public void run() { LOG.info("Master URL: {}", client.getMasterUrl()); LOG.info("Namespaces: {}", client.namespaces().list().getItems().stream().map(x -> x.getMetadata().getName()).collect(Collectors.toList())); client.endpoints().inNamespace("paas-run-playground").watch(this); }
Source:
<code>public void onRevealLogFolder() { Path mapPath = preferencesService.getFafLogDirectory(); try { FileUtils.openFolder(mapPath); } catch (IOException e) { e.printStackTrace(); <START> } <END> }</code><technical_language>do e.printStackTrace(), [as Codacy reports](<LINK_0> platform service IOException anyway</technical_language>

Target:
public void onRevealLogFolder() { Path logPath = preferencesService.getFafLogDirectory(); this.platformService.reveal(logPath); }
Source:
<code>public Builder<PersistenceConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { this.remoteCacheName = CACHE.resolveModelAttribute(context, model).asString(); this.socketTimeout = SOCKET_TIMEOUT.resolveModelAttribute(context, model).asLong(); this.tcpNoDelay = TCP_NO_DELAY.resolveModelAttribute(context, model).asBoolean(); <START> List<ValueDependency<OutboundSocketBinding>> list = new ArrayList<>(); <END> for (String binding : StringListAttributeDefinition.unwrapValue(context, SOCKET_BINDINGS.resolveModelAttribute(context, model))) { InjectedValueDependency<OutboundSocketBinding> outboundSocketBindingInjectedValueDependency = new InjectedValueDependency<>(CommonUnaryRequirement.OUTBOUND_SOCKET_BINDING.getServiceName(context, binding), OutboundSocketBinding.class); list.add(outboundSocketBindingInjectedValueDependency); } this.bindings = list; return super.configure(context, model); }</code><technical_language>ArrayList constructed fixed capacity</technical_language>

Target:
public Builder<PersistenceConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { this.remoteCacheName = CACHE.resolveModelAttribute(context, model).asString(); this.socketTimeout = SOCKET_TIMEOUT.resolveModelAttribute(context, model).asLong(); this.tcpNoDelay = TCP_NO_DELAY.resolveModelAttribute(context, model).asBoolean(); final List<String> unwrappedList = StringListAttributeDefinition.unwrapValue(context, SOCKET_BINDINGS.resolveModelAttribute(context, model)); final List<ValueDependency<OutboundSocketBinding>> list = new ArrayList<>(unwrappedList.size()); for (String binding : unwrappedList) { list.add(new InjectedValueDependency<>(CommonUnaryRequirement.OUTBOUND_SOCKET_BINDING.getServiceName(context, binding), OutboundSocketBinding.class)); } this.bindings = list; return super.configure(context, model); }
Source:
<code>private static void checkFirstFailed(Object input) { ChannelOutboundHandlerAdapter noOpWrites = new ChannelOutboundHandlerAdapter() { @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { promise.tryFailure(new RuntimeException()); } }; EmbeddedChannel ch = new EmbeddedChannel(noOpWrites, new ChunkedWriteHandler()); <START> ChannelFuture r = ch.writeAndFlush(input).awaitUninterruptibly(); <END> ch.close(); assertTrue(r.cause() instanceof RuntimeException); }</code><technical_language>Call ReferenceCountUtil.release(msg) failing promise</technical_language>

Target:
private static void checkFirstFailed(Object input) { ChannelOutboundHandlerAdapter noOpWrites = new ChannelOutboundHandlerAdapter() { @Override public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) { ReferenceCountUtil.release(msg); promise.tryFailure(new RuntimeException()); } }; EmbeddedChannel ch = new EmbeddedChannel(noOpWrites, new ChunkedWriteHandler()); ChannelFuture r = ch.writeAndFlush(input); assertFalse(ch.finish()); assertTrue(r.cause() instanceof RuntimeException); }
Source:
<code>public static String getCheckpointTopic(String jobName, String jobId, Config config) { <START> String checkpointTopic = String.format("__samza_checkpoint_ver_%d_for_%s_%s", CHECKPOINT_LOG_VERSION_NUMBER, <END> jobName.replaceAll("_", "-"), jobId.replaceAll("_", "-")); return StreamManager.createUniqueNameForBatch(checkpointTopic, config); }</code><technical_language>minor: define: "__samza_checkpoint_ver_%d_for_%s_%s" static final</technical_language>

Target:
public static String getCheckpointTopic(String jobName, String jobId, Config config) { String checkpointTopic = String.format(CHECKPOINT_TOPIC_FORMAT, CHECKPOINT_LOG_VERSION_NUMBER, jobName.replaceAll("_", "-"), jobId.replaceAll("_", "-")); return StreamManager.createUniqueNameForBatch(checkpointTopic, config); }
Source:
<code>protected boolean createTopics(Collection<NewTopic> newTopics) { boolean createStatus = true; try { <START> CreateTopicsResult resultFuture = <END> adminClient.createTopics(newTopics); resultFuture.all().get(10000, TimeUnit.MILLISECONDS); } catch (Exception e) { createStatus = false; } return createStatus; }</code><technical_language>KafkaSystemAdmin exposes admin operations hiding AdminClient. it(KafkaAdmin.createStream, KafkaSystemAdmin.clearStream) AdminClient. Do get benefit AdminClient directly</technical_language>

Target:
protected boolean createTopics(Collection<NewTopic> newTopics) { boolean createStatus = true; try { CreateTopicsResult resultFuture = adminClient.createTopics(newTopics); resultFuture.all().get(ADMIN_OPERATION_WAIT_DURATION_MS, TimeUnit.MILLISECONDS); } catch (Exception e) { createStatus = false; } return createStatus; }
Source:
<code>public void testMultiplePerTargetAspectsWithOrderAnnotation() throws SecurityException, NoSuchMethodException { TestBean target = new TestBean(); int realAge = 65; target.setAge(realAge); List<Advisor> advisors = new LinkedList<>(); PerTargetAspectWithOrderAnnotation10 aspect1 = new PerTargetAspectWithOrderAnnotation10(); aspect1.count = 100; advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1"))); PerTargetAspectWithOrderAnnotation5 aspect2 = new PerTargetAspectWithOrderAnnotation5(); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2"))); <START> sort(advisors, new OrderComparator()); <END> TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class); assertThat(itb.getAge()).as("Around advice must NOT apply").isEqualTo(realAge); itb.getSpouse(); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(0); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(1); }</code><technical_language>If optimize, do step :) > sort(advisors, OrderComparator.INSTANCE);</technical_language>

Target:
public void testMultiplePerTargetAspectsWithOrderAnnotation() throws SecurityException, NoSuchMethodException { TestBean target = new TestBean(); int realAge = 65; target.setAge(realAge); List<Advisor> advisors = new LinkedList<>(); PerTargetAspectWithOrderAnnotation10 aspect1 = new PerTargetAspectWithOrderAnnotation10(); aspect1.count = 100; advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1"))); PerTargetAspectWithOrderAnnotation5 aspect2 = new PerTargetAspectWithOrderAnnotation5(); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2"))); OrderComparator.sort(advisors); TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class); assertThat(itb.getAge()).as("Around advice must NOT apply").isEqualTo(realAge); itb.getSpouse(); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(0); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(1); }
Source:
<code>public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { Inflater inflater = new Inflater(true); inflater.setInput(input, inputOffset, inputLength); int uncompressedLength = 0; try { uncompressedLength = inflater.inflate(output, outputOffset, maxOutputLength); if (!inflater.finished()) { <START> throw new IllegalStateException("maxCompressedLength formula is incorrect, because deflate produced more data"); <END> } } catch (DataFormatException e) { throw new MalformedInputException(inputOffset, e.getMessage()); } finally { inflater.end(); } return uncompressedLength; }</code><technical_language>IllegalArgumentException</technical_language>

Target:
public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { Inflater inflater = new Inflater(true); inflater.setInput(input, inputOffset, inputLength); int uncompressedLength = 0; try { uncompressedLength = inflater.inflate(output, outputOffset, maxOutputLength); if (!inflater.finished()) { throw new IllegalArgumentException("maxOutputLength is incorrect, there is more data to be decompressed"); } } catch (DataFormatException e) { throw new MalformedInputException(inputOffset, e.getMessage()); } finally { inflater.end(); } return uncompressedLength; }
Source:
<code>private void initViewModel() { dashPayViewModel = new ViewModelProvider(this).get(DashPayViewModel.class); dashPayViewModel.isPlatformAvailableLiveData().observe(this, new Observer<Resource<Boolean>>() { @Override public void onChanged(Resource<Boolean> status) { if(status.getStatus() == Status.SUCCESS) isPlatformAvailable = status.getData(); else isPlatformAvailable = false; showHideJoinDashPayAction(); } }); AppDatabase.getAppDatabase().blockchainIdentityDataDao().load().observe(this, new Observer<BlockchainIdentityData>() { @Override public void onChanged(BlockchainIdentityData blockchainIdentityData) { if (blockchainIdentityData != null) { BlockchainIdentity.RegistrationStatus status = blockchainIdentityData.getRegistrationStatus(); <START> hasIdentity = (status == BlockchainIdentity.RegistrationStatus.REGISTERED); <END> showHideJoinDashPayAction(); } } }); }</code><technical_language>I I a check for status == null null, this problem is addressed elsewhere</technical_language>

Target:
private void initViewModel() { dashPayViewModel = new ViewModelProvider(this).get(DashPayViewModel.class); dashPayViewModel.isPlatformAvailableLiveData().observe(this, new Observer<Resource<Boolean>>() { @Override public void onChanged(Resource<Boolean> status) { if (status.getStatus() == Status.SUCCESS) isPlatformAvailable = status.getData(); else isPlatformAvailable = false; showHideJoinDashPayAction(); } }); AppDatabase.getAppDatabase().blockchainIdentityDataDao().loadBase().observe(this, new Observer<BlockchainIdentityBaseData>() { @Override public void onChanged(BlockchainIdentityBaseData blockchainIdentityData) { if (blockchainIdentityData != null) { hasIdentity = (blockchainIdentityData.getCreationState() == BlockchainIdentityData.CreationState.DONE); showHideJoinDashPayAction(); if (retryCreationIfInProgress && blockchainIdentityData.getCreationInProgress()) { retryCreationIfInProgress = false; startService(CreateIdentityService.createIntentForRetry(WalletActivity.this, false)); } } } }); }
Source:
<code>public static Slice canonicalizePhoneNumber( @SqlType(StandardTypes.VARCHAR) Slice phoneNumber, @SqlNullable @SqlType(StandardTypes.VARCHAR) Slice country, @SqlType(StandardTypes.VARCHAR) Slice format) { PhoneNumberFormat numberFormat; if (format == null) { numberFormat = PhoneNumberFormat.RFC3966; } else { String formatString = format.toStringUtf8(); try { numberFormat = PhoneNumberFormat.valueOf(formatString); } catch (IllegalArgumentException ex) { <START> throw new PrestoException(StandardErrorCode.INVALID_FUNCTION_ARGUMENT, "Invalid format provided: " + formatString + ". Allowed values: " + <END> Arrays.toString(PhoneNumberFormat.values())); } } PhoneNumber number; try { number = PHONE_NUMBER_UTIL.parse(phoneNumber.toStringUtf8(), country != null ? country.toStringUtf8() : null); } catch (NumberParseException ex) { throw new PrestoException(StandardErrorCode.INVALID_FUNCTION_ARGUMENT, "Unable to parse phone number: " + phoneNumber.toStringUtf8(), ex); } return Slices.utf8Slice(PHONE_NUMBER_UTIL.format(number, numberFormat)); }</code><technical_language>Static import INVALID_FUNCTION_ARGUMENT</technical_language>

Target:
public static Slice canonicalizePhoneNumber( @SqlType(StandardTypes.VARCHAR) Slice phoneNumber, @SqlNullable @SqlType(StandardTypes.VARCHAR) Slice country, @SqlType(StandardTypes.VARCHAR) Slice format) { PhoneNumberFormat numberFormat; if (format == null) { numberFormat = RFC3966; } else { String formatString = format.toStringUtf8().toUpperCase(); try { numberFormat = PhoneNumberFormat.valueOf(formatString); } catch (IllegalArgumentException ex) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid format provided: " + formatString + ". Allowed values: " + Arrays.toString(PhoneNumberFormat.values())); } } PhoneNumber number; try { number = PHONE_NUMBER_UTIL.parse(phoneNumber.toStringUtf8(), country != null ? country.toStringUtf8().toUpperCase() : null); } catch (NumberParseException ex) { throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Unable to parse phone number: " + phoneNumber.toStringUtf8(), ex); } return Slices.utf8Slice(PHONE_NUMBER_UTIL.format(number, numberFormat)); }
Source:
<code>void single( long reference, Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( reference ); } this.next = reference; this.highMark = NO_ID; <START> this.lastStoreReference = -2; <END> this.read = read; this.hasChanges = HasChanges.MAYBE; this.addedNodes = emptySet(); }</code><technical_language>2? I it, clearer</technical_language>

Target:
void single( long reference, Read read ) { if ( getId() != NO_ID ) { reset(); } if ( pageCursor == null ) { pageCursor = read.nodePage( reference ); } this.next = reference; this.highMark = NO_ID; this.nextStoreReference = NO_ID; this.read = read; this.hasChanges = HasChanges.MAYBE; this.addedNodes = LongSets.immutable.empty(); }
Source:
<code>public void removeUnusedModels(Set<String> reposInUse) { Set<String> openRepos = models.toModels().stream().map(Model::getRepoId).collect(Collectors.toSet()); <START> openRepos.removeAll(reposInUse); <END> for (String unusedRepoId : openRepos) { removeRepoModel(unusedRepoId); } }</code><technical_language>This written a map, filter, forEach, set supports a fast contains operation</technical_language>

Target:
public void removeUnusedModels(Set<String> reposInUse) { models.toModels().stream().map(Model::getRepoId). filter(repoId -> !reposInUse.contains(repoId)). forEach(repoIdNotInUse -> models.removeRepoModelById(repoIdNotInUse)); }
Source:
<code>public Server findServerAvatica(String connectionId) { Server chosenServer = avaticaConnectionBalancer.balance(getAllServers(), connectionId); if (chosenServer == null) { log.makeAlert( "Catastrophic failure! No servers found at all! Failing request!" ).emit(); throw new ISE("No server found for Avatica request with connectionId[%s]", connectionId); } <START> log.info( <END> "Balancer class [%s] sending request with connectionId[%s] to server: %s", avaticaConnectionBalancer.getClass(), connectionId, chosenServer.getHost() ); return chosenServer; }</code><technical_language>log.debug, info</technical_language>

Target:
public Server findServerAvatica(String connectionId) { Server chosenServer = avaticaConnectionBalancer.pickServer(getAllServers(), connectionId); if (chosenServer == null) { log.makeAlert( "Catastrophic failure! No servers found at all! Failing request!" ).emit(); throw new ISE("No server found for Avatica request with connectionId[%s]", connectionId); } log.debug( "Balancer class [%s] sending request with connectionId[%s] to server: %s", avaticaConnectionBalancer.getClass(), connectionId, chosenServer.getHost() ); return chosenServer; }
Source:
<code>public String getLastOpenBoard() { <START> return lastOpenBoard.get(); <END> }</code><technical_language>point of Optional is express statically a absent, force consumers of check for this (unlike null, check anything). Calling get checking isPresent fail runtime (similar dereferencing a null pointer). instead propagate Optional out callers of this method</technical_language>

Target:
public Optional<String> getLastOpenBoard() { return lastOpenBoard; }
Source:
<code>public String getText() { <START> return StringUtil.escapeXml(myText); <END> }</code><technical_language>I do escaping point message is converted HTML. If rename this message getTextAsHtml</technical_language>

Target:
public String getText() { return myText; }
Source:
<code>public void testListGatewaysWithOneDispatcherThread() { <START> String command = "create gateway-sender --id=ln_Serial --remote-distributed-system-id=2 --dispatcher-threads=1"; <END> int lnPort = locatorSite1.getPort(); server1 = clusterStartupRule.startServerVM(3, lnPort); server2 = clusterStartupRule.startServerVM(4, lnPort); server3 = clusterStartupRule.startServerVM(5, lnPort); gfsh.executeAndAssertThat(command).statusIsSuccess(); gfsh.executeAndAssertThat("list gateways").statusIsSuccess() .hasTableSection("gatewaySenders") .hasRowSize(3).hasColumn("Status").contains("Running, not Connected"); gfsh.executeAndAssertThat("list gateways --senders-only").statusIsSuccess() .hasNoSection("gatewayReceivers") .hasTableSection("gatewaySenders") .hasRowSize(3).hasColumn("Status").contains("Running, not Connected"); }</code><technical_language>Instead of hard-coding gfsh command, CommandStringBuilder static strings in CliStrings here</technical_language>

Target:
public void testListGatewaysWithOneDispatcherThread() { String command = new CommandStringBuilder(CliStrings.CREATE_GATEWAYSENDER) .addOption(CliStrings.CREATE_GATEWAYSENDER__ID, "ln_Serial") .addOption(CliStrings.CREATE_GATEWAYSENDER__REMOTEDISTRIBUTEDSYSTEMID, "2") .addOption(CliStrings.CREATE_GATEWAYSENDER__DISPATCHERTHREADS, "1") .getCommandString(); int lnPort = locatorSite1.getPort(); server1 = clusterStartupRule.startServerVM(3, lnPort); server2 = clusterStartupRule.startServerVM(4, lnPort); server3 = clusterStartupRule.startServerVM(5, lnPort); gfsh.executeAndAssertThat(command).statusIsSuccess(); gfsh.executeAndAssertThat(CliStrings.LIST_GATEWAY).statusIsSuccess() .hasTableSection("gatewaySenders") .hasRowSize(3).hasColumn("Status").contains("Running, not Connected"); gfsh.executeAndAssertThat( CliStrings.LIST_GATEWAY + " --" + CliStrings.LIST_GATEWAY__SHOW_SENDERS_ONLY) .statusIsSuccess() .hasNoSection("gatewayReceivers") .hasTableSection("gatewaySenders") .hasRowSize(3).hasColumn("Status").contains("Running, not Connected"); }
Source:
<code>public void after() throws IOException { <START> EasyMock.verify(_mocks.toArray()); <END> folder.delete(); }</code><technical_language>Is calling verify() in method a good practice? if a test need verify mocks</technical_language>

Target:
public void after() throws IOException { folder.delete(); }
Source:
<code>private boolean shouldBeIncluded(IResource res, GitSynchronizeDataSet dataSet) { final IProject project = res.getProject(); if (project == null) return false; final GitSynchronizeData syncData = dataSet.getData(project); if (syncData == null) return false; final Set<? extends IResource> includedPaths = syncData .getIncludedPaths(); if (includedPaths == null) return true; <START> IPath path = res.getLocation(); <END> for (IResource resource : includedPaths) if (resource.getLocation().isPrefixOf(path)) return true; return false; }</code><technical_language>getLocation() return null, checked. included then</technical_language>

Target:
private boolean shouldBeIncluded(IResource res, GitSynchronizeDataSet dataSet) { final IProject project = res.getProject(); if (project == null) return false; final GitSynchronizeData syncData = dataSet.getData(project); if (syncData == null) return false; final Set<? extends IResource> includedPaths = syncData .getIncludedPaths(); if (includedPaths == null) return true; IPath path = res.getLocation(); if (path != null) { for (IResource resource : includedPaths) { IPath inclResourceLocation = resource.getLocation(); if (inclResourceLocation != null && inclResourceLocation.isPrefixOf(path)) return true; } } return false; }
Source:
<code>private void setCowVirtualSizeAndQcowCompat(DiskImage diskImage, Image glanceImage) { byte[] imgContent = new byte[72]; ImageDownload downloadImage = getClient().images().download(glanceImage.getId()).execute(); try (InputStream inputStream = downloadImage.getInputStream()) { int bytesRead = inputStream.read(imgContent, 0, imgContent.length); if (bytesRead != imgContent.length) { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_DOWNLOAD_IMAGE, "Unable to read image header: " + bytesRead); } } catch (IOException e) { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_DOWNLOAD_IMAGE, "Unable to download image"); } ByteBuffer b = ByteBuffer.wrap(imgContent); int qcow2Signature = b.getInt(); int qcow2Version = b.getInt(); QcowCompat qcowCompat = QcowCompat.forQcowHeaderVersion(qcow2Version); if (qcow2Signature == QCOW2_SIGNATURE && (qcowCompat != null <START> || qcowCompat <END> != QcowCompat.Undefined)) { b.position(QCOW2_SIZE_OFFSET); diskImage.setSize(b.getLong()); diskImage.setQcowCompat(qcowCompat); } else { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNRECOGNIZED_IMAGE_FORMAT, "Unable to recognize QCOW2 format"); } }</code><technical_language>This &&. Otherwise, condition is true</technical_language>

Target:
private void setCowVirtualSizeAndQcowCompat(DiskImage diskImage, Image glanceImage) { byte[] imgContent = new byte[72]; ImageDownload downloadImage = getClient().images().download(glanceImage.getId()).execute(); try (InputStream inputStream = downloadImage.getInputStream()) { int bytesRead = inputStream.read(imgContent, 0, imgContent.length); if (bytesRead != imgContent.length) { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_DOWNLOAD_IMAGE, "Unable to read image header: " + bytesRead); } } catch (IOException e) { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_DOWNLOAD_IMAGE, "Unable to download image"); } ByteBuffer b = ByteBuffer.wrap(imgContent); int qcow2Signature = b.getInt(); int qcow2Version = b.getInt(); QcowCompat qcowCompat = QcowCompat.forQcowHeaderVersion(qcow2Version); if (qcow2Signature == QCOW2_SIGNATURE && qcowCompat != null && qcowCompat != QcowCompat.Undefined) { b.position(QCOW2_SIZE_OFFSET); diskImage.setSize(b.getLong()); diskImage.setQcowCompat(qcowCompat); } else { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNRECOGNIZED_IMAGE_FORMAT, "Unable to recognize QCOW2 format"); } }
Source:
<code>Mono<Response<DirectoryInfo>> createWithResponse(FileSmbProperties smbProperties, String filePermission, Map<String, String> metadata, Context context) { FileSmbProperties properties = smbProperties == null ? new FileSmbProperties() : smbProperties; FileExtensions.filePermissionAndKeyHelper(filePermission, properties.filePermissionKey()); <START> filePermission = properties.filePermission(filePermission, FileConstants.FILE_PERMISSION_INHERIT); <END> String filePermissionKey = properties.filePermissionKey(); String fileAttributes = properties.ntfsFileAttributes(FileConstants.FILE_ATTRIBUTES_NONE); String fileCreationTime = properties.fileCreationTime(FileConstants.FILE_TIME_NOW); String fileLastWriteTime = properties.fileLastWriteTime(FileConstants.FILE_TIME_NOW); return postProcessResponse(azureFileStorageClient.directorys().createWithRestResponseAsync(shareName, directoryPath, fileAttributes, fileCreationTime, fileLastWriteTime, null, metadata, filePermission, filePermissionKey, context)) .map(this::createWithRestResponse); }</code><technical_language>check permission key set? in filePermission(). accepting values setting for ntfs stuff instead of setting constants? (Sorry idk this feature. trust say)</technical_language>

Target:
Mono<Response<DirectoryInfo>> createWithResponse(FileSmbProperties smbProperties, String filePermission, Map<String, String> metadata, Context context) { FileSmbProperties properties = smbProperties == null ? new FileSmbProperties() : smbProperties; filePermissionAndKeyHelper(filePermission, properties.filePermissionKey()); filePermission = properties.filePermission(filePermission, FileConstants.FILE_PERMISSION_INHERIT); String filePermissionKey = properties.filePermissionKey(); String fileAttributes = properties.ntfsFileAttributes(FileConstants.FILE_ATTRIBUTES_NONE); String fileCreationTime = properties.fileCreationTime(FileConstants.FILE_TIME_NOW); String fileLastWriteTime = properties.fileLastWriteTime(FileConstants.FILE_TIME_NOW); return postProcessResponse(azureFileStorageClient.directorys().createWithRestResponseAsync(shareName, directoryPath, fileAttributes, fileCreationTime, fileLastWriteTime, null, metadata, filePermission, filePermissionKey, context)) .map(this::createWithRestResponse); }
Source:
<code>public SpecialAdminDashboardPageObject(WebDriver driver) { super(driver); <START> PageFactory.initElements(driver, this); <END> }</code><technical_language>is need execute initElements method, extending BasePageObject</technical_language>

Target:
public SpecialAdminDashboardPageObject(WebDriver driver) { super(driver); }
Source:
<code>protected <T> T getEntity(Class<T> clz, SearchType searchType, String constraint) { try { VdcQueryReturnValue result = runQuery(VdcQueryType.Search, new SearchParameters(constraint, searchType)); if (!result.getSucceeded()) { throw new BackendFailureException(localize(result.getExceptionString()), <START> ErrorMessageHelper.getErrorStatus(result.getExceptionString())); <END> } T entity; if (List.class.isAssignableFrom(clz) && result.getReturnValue() instanceof List) { entity = clz.cast(result.getReturnValue()); } else { List<T> list = asCollection(clz, result.getReturnValue()); if (list == null || list.isEmpty()) { throw new EntityNotFoundException(constraint); } entity = clz.cast(list.get(0)); } return entity; } catch (Exception e) { return handleError(clz, e, false); } }</code><technical_language>suggest moving BackendFailureException generation in dedicated method, this internal logic in this method instead of expecting throwing well. backendFailure(result.getExceptionString()); backendFailure(message) { throw new BackendFailureException( localize(message), ErrorMessageHelper.getErrorStatus(message) ); }</technical_language>

Target:
protected <T> T getEntity(Class<T> clz, SearchType searchType, String constraint) { try { VdcQueryReturnValue result = runQuery(VdcQueryType.Search, new SearchParameters(constraint, searchType)); if (!result.getSucceeded()) { backendFailure(result.getExceptionString()); } T entity; if (List.class.isAssignableFrom(clz) && result.getReturnValue() instanceof List) { entity = clz.cast(result.getReturnValue()); } else { List<T> list = asCollection(clz, result.getReturnValue()); if (list == null || list.isEmpty()) { throw new EntityNotFoundException(constraint); } entity = clz.cast(list.get(0)); } return entity; } catch (Exception e) { return handleError(clz, e, false); } }
Source:
<code>public void testPoNHyperparameterInitialization() { LoggingUtils.setLoggingLevel(Log.LogLevel.INFO); final AllelicPanelOfNormals allelicPoN = new AllelicPanelOfNormals(new AllelicCountCollection(ALLELIC_PON_NORMAL_COUNTS_FILE)); final SimpleInterval firstSite = new SimpleInterval("1", 1, 1); <START> final SimpleInterval siteNotInPON = new SimpleInterval("2", 1, 1); END> final double alphaAtFirstSite = allelicPoN.getAlpha(firstSite); final double betaAtFirstSite = allelicPoN.getBeta(firstSite); Assert.assertEquals(alphaAtFirstSite, ALPHA_EXPECTED_AT_FIRST_SITE, DELTA); Assert.assertEquals(betaAtFirstSite, BETA_EXPECTED_AT_FIRST_SITE, DELTA); final double alphaNotInPON = allelicPoN.getAlpha(siteNotInPON); final double betaNotInPON = allelicPoN.getBeta(siteNotInPON); final double meanBias = allelicPoN.getGlobalMeanBias(); final double biasVariance = allelicPoN.getGlobalBiasVariance(); Assert.assertEquals(alphaNotInPON, MLE_ALPHA_EXPECTED, DELTA); Assert.assertEquals(betaNotInPON, MLE_BETA_EXPECTED, DELTA); Assert.assertEquals(meanBias, MLE_MEAN_BIAS_EXPECTED, DELTA); Assert.assertEquals(biasVariance, MLE_BIAS_VARIANCE_EXPECTED, DELTA); }</code><technical_language>siteNotInPON-> siteNotInPoN</technical_language>

Target:
public void testPoNHyperparameterInitialization() { LoggingUtils.setLoggingLevel(Log.LogLevel.INFO); final AllelicPanelOfNormals allelicPoN = new AllelicPanelOfNormals(new AllelicCountCollection(ALLELIC_PON_NORMAL_COUNTS_FILE)); final SimpleInterval firstSite = new SimpleInterval("1", 1, 1); final SimpleInterval siteNotInPoN = new SimpleInterval("2", 1, 1); final double alphaAtFirstSite = allelicPoN.getAlpha(firstSite); final double betaAtFirstSite = allelicPoN.getBeta(firstSite); Assert.assertEquals(alphaAtFirstSite, ALPHA_EXPECTED_AT_FIRST_SITE, DELTA); Assert.assertEquals(betaAtFirstSite, BETA_EXPECTED_AT_FIRST_SITE, DELTA); final double alphaNotInPoN = allelicPoN.getAlpha(siteNotInPoN); final double betaNotInPoN = allelicPoN.getBeta(siteNotInPoN); final double meanBias = allelicPoN.getGlobalMeanBias(); final double biasVariance = allelicPoN.getGlobalBiasVariance(); Assert.assertEquals(alphaNotInPoN, MLE_ALPHA_EXPECTED, DELTA); Assert.assertEquals(betaNotInPoN, MLE_BETA_EXPECTED, DELTA); Assert.assertEquals(meanBias, MLE_MEAN_BIAS_EXPECTED, DELTA); Assert.assertEquals(biasVariance, MLE_BIAS_VARIANCE_EXPECTED, DELTA); }
Source:
<code>public void onImportUserFromLDAP(LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate) { String userModelAttrName = getUserModelAttribute(); String attributeValue = getAttributeValue(); Property<Object> userModelProperty = userModelProperties.get(userModelAttrName.toLowerCase()); if (userModelProperty != null) { <START> checkDuplicateEmail(userModelAttrName, attributeValue, realm, ldapProvider.getSession(), user); <END> setPropertyOnUserModel(userModelProperty, user, attributeValue); } else { user.setAttribute(userModelAttrName, Arrays.asList(attributeValue)); } }</code><technical_language>sense check for duplicated email here? IMO I sense hardcoded username email for users? I delete this line completely delete methods "checkDuplicateEmail" "checkDuplicateUsername" . instead implement method HardcodedAttributeMapperFactory "validateConfiguration" throw error in case "username" "email" configured user model attribute</technical_language>

Target:
public void onImportUserFromLDAP(LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate) { String userModelAttrName = getUserModelAttribute(); String attributeValue = getAttributeValue(); Property<Object> userModelProperty = userModelProperties.get(userModelAttrName.toLowerCase()); if (userModelProperty != null) { setPropertyOnUserModel(userModelProperty, user, attributeValue); } else { user.setAttribute(userModelAttrName, Arrays.asList(attributeValue)); } }
Source:
<code>public String toString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); for (Range<Long> entry : m_map.asRanges()) { <START> sb.append("[").append(start(entry)).append("(").append(DRLogSegmentId.getSequenceNumberFromDRId(start(entry))).append("), ") <END> .append(end(entry)).append("(").append(DRLogSegmentId.getSequenceNumberFromDRId(end(entry))).append(")] "); } return sb.toString(); }</code><technical_language>print number twice</technical_language>

Target:
public String toString() { if (m_map.isEmpty()) { return "Empty Map"; } StringBuilder sb = new StringBuilder(); sb.append("lastSpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastSpUniqueId)).append(" "); sb.append("lastMpUniqueId ").append(UniqueIdGenerator.toShortString(m_lastMpUniqueId)).append(" "); for (Range<Long> entry : m_map.asRanges()) { sb.append("[").append(DRLogSegmentId.getDebugStringFromDRId(start(entry))).append(", ") .append(DRLogSegmentId.getDebugStringFromDRId(end(entry))).append("] "); } return sb.toString(); }
Source:
<code>public InMemoryMessageIdProvider(final NetworkConfig config) { if (config == null) { throw new NullPointerException("Config must not be null"); } String textualMode = null; TrackerMode mode = TrackerMode.GROUPED; try { textualMode = config.getString(NetworkConfig.Keys.MID_TRACKER); mode = TrackerMode.valueOf(textualMode); } catch (Throwable t) { if (null == textualMode) { throw new IllegalArgumentException("Tracker mode unknown!"); } else { throw new IllegalArgumentException("Tracker mode '" + textualMode + "' not supported!"); } <START> } <END> this.mode = mode; this.exchangeLifetimeMillis = config.getLong(NetworkConfig.Keys.EXCHANGE_LIFETIME); this.midGroups = config.getInt(NetworkConfig.Keys.MID_TRACKER_GROUPS); if (config.getBoolean(NetworkConfig.Keys.USE_RANDOM_MID_START)) { random = new Random(System.currentTimeMillis()); } else { random = null; } trackers = new LeastRecentlyUsedCache<>(config.getInt(NetworkConfig.Keys.MAX_ACTIVE_PEERS, 150000), config.getLong(NetworkConfig.Keys.MAX_PEER_INACTIVITY_PERIOD, 10 * 60)); }</code><technical_language>do need catch exception here? simply check for nulls</technical_language>

Target:
public InMemoryMessageIdProvider(final NetworkConfig config) { if (config == null) { throw new NullPointerException("Config must not be null"); } String textualMode = null; TrackerMode mode = TrackerMode.GROUPED; try { textualMode = config.getString(NetworkConfig.Keys.MID_TRACKER); mode = TrackerMode.valueOf(textualMode); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Tracker mode '" + textualMode + "' not supported!"); } catch (NullPointerException e) { throw new IllegalArgumentException("Tracker mode not provided/configured!"); } this.config = config; this.mode = mode; if (config.getBoolean(NetworkConfig.Keys.USE_RANDOM_MID_START)) { random = new Random(System.currentTimeMillis()); } else { random = null; } trackers = new LeastRecentlyUsedCache<>(config.getInt(NetworkConfig.Keys.MAX_ACTIVE_PEERS, 150000), config.getLong(NetworkConfig.Keys.MAX_PEER_INACTIVITY_PERIOD, 10 * 60)); }
Source:
<code>public static PythonVersion fromString(String propertyValue) { String[] intervals = propertyValue.split(","); if (intervals.length > 2) { LOG.warn(String.format("Error while parsing value of parameter '%s' (%s). Only two intervals are supported (e.g. >= 3.6, < 3.8).", PYTHON_VERSION_KEY, propertyValue)); return PythonVersion.allVersions(); } PythonVersion pythonVersion = new PythonVersion(); for (String interval : intervals) { Matcher matcher = PATTERN.matcher(interval); if (!matcher.find()) { LOG.warn( String.format( <START> Locale.ROOT, "Error while parsing value of parameter '%s' (%s). Versions must be between %.1f and %.1f.", PYTHON_VERSION_KEY, propertyValue, MIN_VERSION, MAX_VERSION)); <END> return PythonVersion.allVersions(); } String operator = matcher.group(1); Double version = getVersion(matcher.group(2)); if (version != null) { pythonVersion.setMinAndMaxVersion(operator, version); } else { return PythonVersion.allVersions(); } } return pythonVersion; }</code><technical_language>This message is helpful, e.g. if I set "= 2.7", I get: WARN Error while parsing of parameter 'sonar.python.version' (= 2.7). Versions 2.7 3.8</technical_language>

Target:
public static PythonVersion fromString(String propertyValue) { String[] intervals = propertyValue.split(","); if (intervals.length > 2) { LOG.warn(String.format("Error while parsing value of parameter '%s' (%s). Only two intervals are supported (e.g. >= 3.6, < 3.8).", PYTHON_VERSION_KEY, propertyValue)); return PythonVersion.allVersions(); } PythonVersion pythonVersion = new PythonVersion(); pythonVersion.minVersion = MIN_VALUE; pythonVersion.maxVersion = MAX_VALUE; for (String interval : intervals) { Matcher matcher = PATTERN.matcher(interval); if (!matcher.find()) { LOG.warn(String.format(Locale.ROOT, parseErrorMessage(propertyValue.trim()), PYTHON_VERSION_KEY, propertyValue, MIN_VERSION, MAX_VERSION)); return PythonVersion.allVersions(); } String operator = matcher.group(1); pythonVersion.setMinAndMaxVersion(operator, Double.parseDouble(matcher.group(2))); } if (pythonVersion.minVersion != MIN_VALUE && (pythonVersion.minVersion < MIN_VERSION || pythonVersion.minVersion > MAX_VERSION)) { LOG.warn(String.format(Locale.ROOT, "Python version range '%s' is not supported. Versions must be between %.1f and %.1f.", propertyValue, MIN_VERSION, MAX_VERSION)); return PythonVersion.allVersions(); } if (pythonVersion.maxVersion != MAX_VALUE && (pythonVersion.maxVersion > MAX_VERSION || pythonVersion.maxVersion < MIN_VERSION)) { LOG.warn(String.format(Locale.ROOT, "Python version range '%s' is not supported. Versions must be between %.1f and %.1f.", propertyValue, MIN_VERSION, MAX_VERSION)); return PythonVersion.allVersions(); } if (pythonVersion.minVersion > pythonVersion.maxVersion) { return PythonVersion.allVersions(); } pythonVersion.minVersion = max(pythonVersion.minVersion, MIN_VERSION); pythonVersion.maxVersion = min(pythonVersion.maxVersion, MAX_VERSION); return pythonVersion; }
Source:
<code>public PhysicalOperation visitDistinctLimit(DistinctLimitNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); Optional<Integer> hashChannel = node.getHashSymbol().map(channelGetter(source)); List<Integer> distinctChannels = getChannelsForSymbols(node.getDistinctSymbols(), source.getLayout()); OperatorFactory operatorFactory = new DistinctLimitOperatorFactory( context.getNextOperatorId(), node.getId(), source.getTypes(), distinctChannels, node.getLimit(), hashChannel, joinCompiler); <START> return new PhysicalOperation(operatorFactory, makeLayout(node), source); <END> }</code><technical_language>this belong Prune DistinctLimitOperator output expected channels commit</technical_language>

Target:
public PhysicalOperation visitDistinctLimit(DistinctLimitNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); Optional<Integer> hashChannel = node.getHashSymbol().map(channelGetter(source)); List<Integer> distinctChannels = getChannelsForSymbols(node.getDistinctSymbols(), source.getLayout()); OperatorFactory operatorFactory = new DistinctLimitOperatorFactory( context.getNextOperatorId(), node.getId(), source.getTypes(), distinctChannels, node.getLimit(), hashChannel, joinCompiler); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
Source:
<code>public static FindDialog getDialog(Window parent, boolean modal) { if (getParentsList().containsKey(parent)) { FindDialog activeDialog = getParentsList().get(parent); <START> activeDialog.getTxtFind().requestFocusInWindow(); <END> return activeDialog; } return new FindDialog(parent, modal); }</code><technical_language>try requestFocus(), method before</technical_language>

Target:
public static FindDialog getDialog(Window parent, boolean modal) { FindDialog activeDialog = getParentsMap().get(parent); if (activeDialog != null) { activeDialog.getTxtFind().requestFocus(); return activeDialog; } FindDialog newDialog = new FindDialog(parent, modal); getParentsMap().put(parent, newDialog); newDialog.addWindowListener(new WindowAdapter() { @Override public void windowClosed(WindowEvent e) { getParentsMap().remove(parent); } }); return newDialog; }
Source:
<code>public int size() { int waitingSplits = 0; for (PriorityQueue<PrioritizedSplitRunner> level : levelWaitingSplits) { <START> waitingSplits += level.size(); <END> } return waitingSplits; }</code><technical_language><LINK_0> > Note this implementation is synchronized. Multiple threads access a PriorityQueue instance concurrently if of threads modifies queue. Instead, thread-safe PriorityBlockingQueue class</technical_language>

Target:
public int size() { lock.lock(); try { int total = 0; for (PriorityQueue<PrioritizedSplitRunner> level : levelWaitingSplits) { total += level.size(); } return total; } finally { lock.unlock(); } }
Source:
<code>private void assertOutput(String path) throws IOException { File expectedOutput = copyFromResource(path, expectedSources); File actual = new File(outputSources, path); assertTrue("file does not exist. files: " + Arrays.toString(outputSources.listFiles()), actual.exists()); try { <START> Truth.ASSERT.about(JAVA_SOURCE).that(expectedOutput) <END> .isEquivalentTo(actual); } catch (AssertionError e) { throw new ComparisonFailure("", Files.toString(expectedOutput, UTF_8), Files.toString(actual, UTF_8)); } catch (RuntimeException e) { throw new ComparisonFailure("", Files.toString(expectedOutput, UTF_8), Files.toString(actual, UTF_8)); } }</code><technical_language>This is crazy badass</technical_language>

Target:
private void assertOutput(String path) throws IOException { File expectedOutput = copyFromResource(path, expectedSources); File actual = new File(outputSources, path); assertTrue("file does not exist. files: " + Arrays.toString(outputSources.listFiles()), actual.exists()); try { ASSERT.about(JAVA_SOURCE).that(expectedOutput) .isEquivalentTo(actual); } catch (AssertionError e) { throw new ComparisonFailure("", Files.toString(expectedOutput, UTF_8), Files.toString(actual, UTF_8)); } catch (RuntimeException e) { throw new ComparisonFailure("", Files.toString(expectedOutput, UTF_8), Files.toString(actual, UTF_8)); } }
Source:
<code>private Records<?> getFollowupsMissedClinicVisitsReport(GridSettings settings) { try { settings = DtoLookupHelper.changeLookupAndOrderForFollowupsMissedClinicVisitsReport(settings); if(settings == null) { return new Records<Object>(null); } Order order = null; if (StringUtils.isNotBlank(settings.getSortColumn())) { order = new Order(settings.getSortColumn(), settings.getSortDirection()); } QueryParams queryParams = new QueryParams(settings.getPage(), settings.getRows(), order); return lookupService.getEntities(MissedVisitsReportDto.class, Visit.class, settings.getLookup(), settings.getFields(), queryParams); <START> } catch (IOException e) { <END> LOGGER.error(e.getMessage(), e); return new Records<Object>(null); } }</code><technical_language>catch EbodacLookupException</technical_language>

Target:
private Records<?> getFollowupsMissedClinicVisitsReport(GridSettings settings) { try { settings = DtoLookupHelper.changeLookupAndOrderForFollowupsMissedClinicVisitsReport(settings); if(settings == null) { return new Records<Object>(null); } Order order = null; if (StringUtils.isNotBlank(settings.getSortColumn())) { order = new Order(settings.getSortColumn(), settings.getSortDirection()); } QueryParams queryParams = new QueryParams(settings.getPage(), settings.getRows(), order); return lookupService.getEntities(MissedVisitsReportDto.class, Visit.class, settings.getLookup(), settings.getFields(), queryParams); } catch (IOException | EbodacLookupException e) { LOGGER.error(e.getMessage(), e); return new Records<Object>(null); } }