auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void actsOnInvalidHttpMethods() throws Exception { <START> this.acts("INVALIDHTTPMETHOD"); <END> }</code><technical_language>@aschworer this test</technical_language>

Target:
public void actsOnInvalidHttpMethods() throws Exception { new FtRemote(new TkFixed("InvalidHeaderTest")).exec( new FtRemote.Script() { @Override public void exec(final URI home) throws IOException { TkProxyTest.this.actResponse( home, "INVALIDHTTPMETHOD" ); } } ); }
Source:
<code>private void testRemoveDataSource() throws Exception { cli.sendLine("/subsystem=datasources/data-source=TestDS:remove{allow-resource-service-restart=true}"); <START> cli.sendLine("/:reload"); <END> cli.sendLine("cd /subsystem=datasources/data-source"); cli.sendLine("ls"); String ls = cli.readOutput(); assertFalse(ls.contains("java:jboss/datasources/TestDS")); String jndiClass = JndiServlet.lookup(url.toString(), "java:jboss/datasources/TestDS"); Assert.assertEquals(JndiServlet.NOT_FOUND, jndiClass); }</code><technical_language>This be: cli.sendLine("reload"); high level CLI reload command instead of level ":reload" op, CLI expect connection server close, handles cleanly, reconnects. level op (i.e. :xxx syntax) parses sends a DMR op expects a response</technical_language>

Target:
private void testRemoveDataSource() throws Exception { cli.sendLine("/subsystem=datasources/data-source=TestDS:remove{allow-resource-service-restart=true}"); cli.sendLine("reload"); cli.sendLine("cd /subsystem=datasources/data-source"); cli.sendLine("ls"); String ls = cli.readOutput(); assertFalse(ls.contains("java:jboss/datasources/TestDS")); String jndiClass = JndiServlet.lookup(url.toString(), "java:jboss/datasources/TestDS"); Assert.assertEquals(JndiServlet.NOT_FOUND, jndiClass); }
Source:
<code><START> private static Taxonomy buildTaxonomy(IBranchPath branchPath, ICDOCommitChangeSet commitChangeSet, LongCollection conceptIds, <END> SnomedStatementBrowser statementBrowser, final StatementCollectionMode mode) { final IsAStatementWithId[] statements = statementBrowser.getActiveStatements(branchPath, mode); final ISnomedTaxonomyBuilder inferredPreviousBuilder = new SnomedTaxonomyBuilder(conceptIds, statements); final ISnomedTaxonomyBuilder inferredNewBuilder = new SnomedTaxonomyBuilder(conceptIds, statements); inferredPreviousBuilder.build(); new SnomedTaxonomyUpdateRunnable(branchPath, commitChangeSet, inferredNewBuilder, mode.getCharacteristicType()).run(); final Pair<LongSet, LongSet> diff = inferredNewBuilder.difference(inferredPreviousBuilder); return new Taxonomy(inferredNewBuilder, inferredPreviousBuilder, diff); }</code><technical_language>field in SnomedCDOChangeProcessor set, a list of longs returned getAllConceptIds, behavior before</technical_language>

Target:
private static Taxonomy buildTaxonomy(IBranchPath branchPath, ICDOCommitChangeSet commitChangeSet, LongCollection conceptIds, SnomedStatementBrowser statementBrowser, final StatementCollectionMode mode) { final IsAStatementWithId[] statements = statementBrowser.getActiveStatements(branchPath, mode); final ISnomedTaxonomyBuilder oldTaxonomy = new SnomedTaxonomyBuilder(conceptIds, statements); final ISnomedTaxonomyBuilder newTaxonomy = new SnomedTaxonomyBuilder(conceptIds, statements); oldTaxonomy.build(); new SnomedTaxonomyUpdateRunnable(branchPath, commitChangeSet, newTaxonomy, mode.getCharacteristicType()).run(); final Pair<LongSet, LongSet> diff = newTaxonomy.difference(oldTaxonomy); return new Taxonomy(newTaxonomy, oldTaxonomy, diff); }
Source:
<code>public boolean onBackPressed() { if (tocHandler != null && tocHandler.isVisible()) { tocHandler.hide(); return true; } if (closeFindInPage()) { return true; } if (pageFragmentLoadState.popBackStack()) { return true; } if (tabsProvider.onBackPressed()) { return true; } if (tabList.size() > 1) { tabList.remove(tabList.size() - 1); <START> tabsProvider.notifyTabClosed(tabList.size() - 1); <END> } return false; }</code><technical_language>this tabList.size() previous line modifies tabList's size</technical_language>

Target:
public boolean onBackPressed() { if (tocHandler != null && tocHandler.isVisible()) { tocHandler.hide(); return true; } if (closeFindInPage()) { return true; } if (pageFragmentLoadState.popBackStack()) { return true; } if (tabsProvider.onBackPressed()) { return true; } if (tabList.size() > 1) { tabList.remove(tabList.size() - 1); tabsProvider.notifyTabClosed(tabList.size()); } return false; }
Source:
<code>private static void parseFile(String projectKey, Path projectDirPath, Map<String, ExpectedIssues> expectedIssuesByRule, Path file) { String ruleKey = file.toFile().getName().split("\\.")[0]; String fileKey = projectKey + ":" + projectDirPath.relativize(file).toString().replaceAll(Pattern.quote(File.separator), "/"); List<String> lines = getLines(file); for (int lineNumber = 1; lineNumber <= lines.size(); lineNumber++) { String currentLine = lines.get(lineNumber - 1); if (!NON_COMPLIANT_PATTERN.matcher(currentLine).find() || currentLine.trim().startsWith(" <START> continue; <END> } addLineWithIssue(expectedIssuesByRule, ruleKey, fileKey, lineNumber); } }</code><technical_language>Do need this continue? inverting condition of if put line 77 body</technical_language>

Target:
private static void parseFile(String projectKey, Path projectDirPath, Map<String, ExpectedIssues> expectedIssuesByRule, Path file) { String ruleKey = file.toFile().getName().split("\\.")[0]; String fileKey = projectKey + ":" + projectDirPath.relativize(file).toString().replaceAll(Pattern.quote(File.separator), "/"); List<String> lines = getLines(file); for (int lineNumber = 1; lineNumber <= lines.size(); lineNumber++) { String currentLine = lines.get(lineNumber - 1); if (NON_COMPLIANT_PATTERN.matcher(currentLine).find() && !currentLine.trim().startsWith(" addLineWithIssue(expectedIssuesByRule, ruleKey, fileKey, lineNumber); } } }
Source:
<code>public String getToolTipText(Object element) { TaskReview review = (TaskReview) element; StringBuilder sb = new StringBuilder(); <START> sb.append("Description: "); <END> sb.append(review.getSummary()); sb.append("\n"); sb.append("Verified: "); if (review.getVerifiedScore() >= 1) { sb.append("YES"); } else { sb.append("NO"); } sb.append("\n"); sb.append("Code Review: "); sb.append(review.getCodeReviewScore()); return sb.toString(); }</code><technical_language>strings need externalized</technical_language>

Target:
public String getToolTipText(Object element) { TaskReview review = (TaskReview) element; StringBuilder sb = new StringBuilder(); sb.append("Description: "); sb.append(review.getSummary()); sb.append(System.getProperty("line.separator")); sb.append("Verified: "); if (review.getVerifiedScore() >= 1) { sb.append("YES"); } else { sb.append("NO"); } sb.append(System.getProperty("line.separator")); sb.append("Code Review: "); sb.append(review.getCodeReviewScore()); return sb.toString(); }
Source:
<code>private void initialize(CatalogContext catalogContext, List<Integer> partitions, boolean isRejoin) { try { <START> if (!hasEnabledConnectors(catalogContext)) { <END> return; } exportLog.info("Creating connector " + m_loaderClass); ExportDataProcessor newProcessor = getNewProcessorWithProcessConfigSet(m_processorConfig); m_processor.set(newProcessor); ExportGeneration generation = initializePersistedGenerations(); generation.initializeGenerationFromCatalog(catalogContext, getConnectors(catalogContext), m_hostId, m_messenger, partitions); m_generation.set(generation); newProcessor.setExportGeneration(generation); newProcessor.readyForData(true); } catch (final ClassNotFoundException e) { exportLog.l7dlog( Level.ERROR, LogKeys.export_ExportManager_NoLoaderExtensions.name(), e); Throwables.propagate(e); } catch (final Exception e) { Throwables.propagate(e); } }</code><technical_language>Constructor of ExportManager checked connectors, check again</technical_language>

Target:
private void initialize(CatalogContext catalogContext, List<Integer> partitions, boolean isRejoin) { try { CatalogMap<Connector> connectors = getConnectors(catalogContext); if (!hasEnabledConnectors(connectors)) { return; } exportLog.info("Creating connector " + m_loaderClass); ExportDataProcessor newProcessor = getNewProcessorWithProcessConfigSet(m_processorConfig); m_processor.set(newProcessor); ExportGeneration generation = initializePersistedGenerations(); generation.initializeGenerationFromCatalog(catalogContext, connectors, m_hostId, m_messenger, partitions); m_generation.set(generation); newProcessor.setExportGeneration(generation); newProcessor.readyForData(true); } catch (final ClassNotFoundException e) { exportLog.l7dlog( Level.ERROR, LogKeys.export_ExportManager_NoLoaderExtensions.name(), e); Throwables.propagate(e); } catch (final Exception e) { Throwables.propagate(e); } }
Source:
<code>public synchronized List<ConnectorTableLayoutResult> getTableLayouts( ConnectorSession session, ConnectorTableHandle handle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { requireNonNull(handle, "handle is null"); checkArgument(handle instanceof MemoryTableHandle); MemoryTableHandle memoryTableHandle = (MemoryTableHandle) handle; MemoryTableLayoutHandle layoutHandle = new MemoryTableLayoutHandle( memoryTableHandle, <START> ImmutableMap.copyOf(hostsPerTable.get((memoryTableHandle).getTableId()))); <END> return ImmutableList.of(new ConnectorTableLayoutResult(getTableLayout(session, layoutHandle), constraint.getSummary())); }</code><technical_language>hostsPerTable.get null if beginCreateTable finishInsert didn't. is a race condition I</technical_language>

Target:
public synchronized List<ConnectorTableLayoutResult> getTableLayouts( ConnectorSession session, ConnectorTableHandle handle, Constraint<ColumnHandle> constraint, Optional<Set<ColumnHandle>> desiredColumns) { requireNonNull(handle, "handle is null"); checkArgument(handle instanceof MemoryTableHandle); MemoryTableHandle memoryTableHandle = (MemoryTableHandle) handle; checkState( tableDataFragments.containsKey(memoryTableHandle.getTableId()), "Inconsistent state for the table [%s.%s]", memoryTableHandle.getSchemaName(), memoryTableHandle.getTableName()); List<MemoryDataFragment> expectedFragments = ImmutableList.copyOf( tableDataFragments.get(memoryTableHandle.getTableId()).values()); MemoryTableLayoutHandle layoutHandle = new MemoryTableLayoutHandle(memoryTableHandle, expectedFragments); return ImmutableList.of(new ConnectorTableLayoutResult(getTableLayout(session, layoutHandle), constraint.getSummary())); }
Source:
<code>private void expandTreeNode(TreeNode parentNode) { parentNode.getTreeItem().setState(true); if (parentNode.getParentName() != null) { final TreeNode parent = treeNodesMap.get(parentNode.getProjectId()); <START> expandTreeNode(parent); <END> } }</code><technical_language>some conditions running StackOverflowError: java.lang.StackOverflowError: null com.google.gwt.user.client.ui.TreeItem.getChildCount(TreeItem.java:371) com.google.gwt.user.client.ui.TreeItem.setState(TreeItem.java:538) com.google.gwt.user.client.ui.TreeItem.setState(TreeItem.java:528) com.google.gerrit.client.admin.ProjectListScreen.expandTreeNode(ProjectListScreen.java:310) com.google.gerrit.client.admin.ProjectListScreen.expandTreeNode(ProjectListScreen.java:313) com.google.gerrit.client.admin.ProjectListScreen.expandTreeNode(ProjectListScreen.java:313) ... scenario in this error is I filter for projects parent 'parent2' while project structure: -- Projects -- -> parent1 -> parent2 -> (project1, project2, project3)</technical_language>

Target:
private void expandTreeNode(TreeNode parentNode) { parentNode.getTreeItem().setState(true); if (parentNode.getParentName() != null) { final TreeNode parent = treeNodesMap.get(parentNode.getParentId()); expandTreeNode(parent); } }
Source:
<code>public void testInstrumentCodeByLine() { args.add("--instrument_code=LINE"); test( "function foo(){ const answerToAll = 42; }", <START> "self.window||(self.window=self,self.window.top=self);var __jscov=window.top.__jscov||" <END> + "(window.top.__jscov={fileNames:[],instrumentedLines:[],executedLines:[]})," + "JSCompiler_lcov_data_input0=[];" + "__jscov.executedLines.push(JSCompiler_lcov_data_input0);" + "__jscov.instrumentedLines.push(\"01\");" + "__jscov.fileNames.push(\"input0\");" + "function foo(){JSCompiler_lcov_data_input0[0]=!0}"); }</code><technical_language>For newer unit tests lines helper function instead of string concatenation create long strings. replace this test case lines( "self.window||(self.window=self,self.window.top=self);var __jscov=window.top.__jscov||", "(window.top.__jscov={fileNames:[],instrumentedLines:[],executedLines:[]}),", [ etc. ] )</technical_language>

Target:
public void testInstrumentCodeByLine() { args.add("--instrument_code=LINE"); test( "function foo(){ const answerToAll = 42; }", lines( "self.window||(self.window=self,self.window.top=self);var __jscov=window.top.__jscov||", "(window.top.__jscov={fileNames:[],instrumentedLines:[],executedLines:[]}),", "JSCompiler_lcov_data_input0=[];", "__jscov.executedLines.push(JSCompiler_lcov_data_input0);", "__jscov.instrumentedLines.push(\"01\");", "__jscov.fileNames.push(\"input0\");", "function foo(){JSCompiler_lcov_data_input0[0]=!0}")); }
Source:
<code>public byte[] getValueArray() { <START> return CellUtils.getValue(this, this.valueArray); <END> }</code><technical_language>This this.valueArray. is reason for CellUtils here</technical_language>

Target:
public byte[] getValueArray() { return this.valueArray; }
Source:
<code>private boolean loadDataFromSession() { HttpSession session = getHttpSession(); Object data = session.getAttribute(SESSION_KEY); if (data == null) { return false; } else { ReportSessionData reportSessionData = null; try { reportSessionData = (ReportSessionData) data; <START> } catch (ClassCastException e) { <END> return false; } currentUser = reportSessionData.currentUser; dateFrom = reportSessionData.dateFrom; dateFromFormated = DateTimeConverterUtil.dateToString(dateFrom); dateTo = reportSessionData.dateTo; dateToFormated = DateTimeConverterUtil.dateToString(dateTo); return true; } }</code><technical_language>Please instanceof communicating exception swallowing it</technical_language>

Target:
private boolean loadDataFromSession() { HttpSession session = getHttpSession(); Object data = session.getAttribute(SESSION_KEY); if (!(data instanceof ReportSessionData)) { return false; } ReportSessionData reportSessionData = (ReportSessionData) data; currentUser = reportSessionData.currentUser; dateFrom = reportSessionData.dateFrom; dateFromFormated = DateTimeConverterUtil.dateToString(dateFrom); dateTo = reportSessionData.dateTo; dateToFormated = DateTimeConverterUtil.dateToString(dateTo); return true; }
Source:
<code>public IScheduler getSchedulerInstance(Config config, Config runtime) throws SchedulerException { String schedulerClass = Context.schedulerClass(config); IScheduler scheduler; try { scheduler = ReflectionUtils.newInstance(schedulerClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { <START> String errMsg = String.format("Failed to instantiate scheduler using class '%s'", <END> schedulerClass); throw new SchedulerException(errMsg); } scheduler.initialize(config, runtime); return scheduler; }</code><technical_language>need create String errMsg</technical_language>

Target:
public IScheduler getSchedulerInstance(Config config, Config runtime) throws SchedulerException { String schedulerClass = Context.schedulerClass(config); IScheduler scheduler; try { scheduler = ReflectionUtils.newInstance(schedulerClass); } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) { throw new SchedulerException(String.format("Failed to instantiate scheduler using class '%s'", schedulerClass)); } scheduler.initialize(config, runtime); return scheduler; }
Source:
<code>public Long[] getByteRange() { <START> return MantaUtils.parseSingleRange(getRange()); <END> }</code><technical_language>This is calling a deprecated method. Is intended behavior</technical_language>

Target:
public Long[] getByteRange() { final String rangeString = getRange(); Validate.notNull(rangeString, "Range value must not be null"); String[] rangeValuesStrings = StringUtils.split(rangeString, "bytes="); Validate.isTrue(rangeValuesStrings.length == 1, "Range header value doesn't begin with string: bytes="); final String byteRange = rangeValuesStrings[0]; Validate.isTrue(StringUtils.split(byteRange, ",").length == 1, "Multi-range requests are not supported"); String[] rangeParts = StringUtils.split(byteRange, "-"); Validate.isTrue(StringUtils.countMatches(byteRange, "-") < 2, "Cannot end or start with a negative number"); Long startPos = null; Long endPos = null; if (StringUtils.startsWith(byteRange, "-")) { endPos = Long.parseLong(byteRange); } else if (StringUtils.endsWith(byteRange, "-")) { startPos = Long.parseLong(byteRange.split("-")[0]); } else if (rangeParts.length == 2) { startPos = Long.parseUnsignedLong(rangeParts[0]); endPos = Long.parseUnsignedLong(rangeParts[1]); } else { throw new IllegalArgumentException("range must exist with - separator"); } return new Long[] {startPos, endPos}; }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); if (null == mDisplayState) { cleanUp(); } else { mInAppView = inflater.inflate(R.layout.com_mixpanel_android_activity_notification_mini, container, false); final TextView titleView = (TextView) mInAppView.findViewById(R.id.com_mixpanel_android_notification_title); final ImageView notifImage = (ImageView) mInAppView.findViewById(R.id.com_mixpanel_android_notification_image); InAppNotification inApp = mDisplayState.getInAppNotification(); titleView.setText(inApp.getTitle()); notifImage.setImageBitmap(inApp.getImage()); mHandler.postDelayed(mRemover, MINI_REMOVE_TIME); <START> if (inApp.getStyle().equals("light")) showLightStyle(); <END> } return mInAppView; }</code><technical_language>do this instead? if (inApp.getStyle().equals("light")) { showLightStyle(); } Also, super useful if ENUM instead of hardcoding string</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreateView(inflater, container, savedInstanceState); if (null == mDisplayState) { cleanUp(); } else { mInAppView = inflater.inflate(R.layout.com_mixpanel_android_activity_notification_mini, container, false); final TextView titleView = (TextView) mInAppView.findViewById(R.id.com_mixpanel_android_notification_title); final ImageView notifImage = (ImageView) mInAppView.findViewById(R.id.com_mixpanel_android_notification_image); InAppNotification inApp = mDisplayState.getInAppNotification(); titleView.setText(inApp.getTitle()); notifImage.setImageBitmap(inApp.getImage()); mHandler.postDelayed(mRemover, MINI_REMOVE_TIME); if (InAppNotification.Style.LIGHT.equalsName(inApp.getStyle())) { showLightStyle(); } } return mInAppView; }
Source:
<code>public void testMultipleClients() throws Exception { Subscriber client1 = createSubscriber(new String[] { "refs/heads/*:refs/remotes/origin/*", "refs/tags/*:refs/tags/*" }); Subscriber client2 = createSubscriber(new String[] { "refs/heads/master:refs/remotes/origin/master" }); <START> Thread.sleep(1000); <END> Repository r1 = client1.getRepository("testrepository").getRepository(); Repository r2 = client2.getRepository("testrepository").getRepository(); Ref ref = r1.getRef("refs/pubsub/origin/heads/master"); assertNotNull(ref); ObjectId master = triggerUpdate("refs/heads/master"); ObjectId branch1 = createRef( "refs/heads/master", "refs/heads/branch1"); branch1 = triggerUpdate("refs/heads/branch1"); master = triggerUpdate("refs/heads/master"); ObjectId tag1 = createRef("refs/heads/branch1", "refs/tags/tag1"); Thread.sleep(1000); ref = r1.getRef("refs/pubsub/origin/heads/master"); assertEquals(master, ref.getObjectId()); ref = r1.getRef("refs/pubsub/origin/heads/branch1"); assertEquals(branch1, ref.getObjectId()); ref = r1.getRef("refs/pubsub/origin/tags/tag1"); assertEquals(tag1, ref.getObjectId()); ref = r2.getRef("refs/pubsub/origin/heads/master"); assertEquals(master, ref.getObjectId()); ref = r2.getRef("refs/pubsub/origin/heads/branch1"); assertNull(ref); ref = r2.getRef("refs/pubsub/origin/tags/tag1"); assertNull(ref); }</code><technical_language>Thread.sleep</technical_language>

Target:
public void testMultipleClients() throws Exception { setUpPublisher(2); TestSubscriber client1 = createSubscriber(new String[] { "refs/heads/*:refs/remotes/origin/*", "refs/tags/*:refs/tags/*" }, 6); TestSubscriber client2 = createSubscriber(new String[] { "refs/heads/master:refs/remotes/origin/master" }, 3); connectLatch.await(); ObjectId master = triggerUpdate("refs/heads/master"); ObjectId branch1 = createBranch( "refs/heads/master", "refs/heads/branch1"); branch1 = triggerUpdate("refs/heads/branch1"); master = triggerUpdate("refs/heads/master"); ObjectId tag1 = createTag("refs/heads/branch1", "refs/tags/tag1"); client1.await(); client2.await(); Repository r1 = client1.getRepository("testrepository").getRepository(); Repository r2 = client2.getRepository("testrepository").getRepository(); Ref ref = r1.getRef("refs/pubsub/origin/heads/master"); assertEquals(master, ref.getObjectId()); ref = r1.getRef("refs/pubsub/origin/heads/branch1"); assertEquals(branch1, ref.getObjectId()); ref = r1.getRef("refs/pubsub/origin/tags/tag1"); assertEquals(tag1, ref.getObjectId()); ref = r2.getRef("refs/pubsub/origin/heads/master"); assertEquals(master, ref.getObjectId()); ref = r2.getRef("refs/pubsub/origin/heads/branch1"); assertNull(ref); ref = r2.getRef("refs/pubsub/origin/tags/tag1"); assertNull(ref); }
Source:
<code>private CoordinatorStats assign( final Set<ServerHolder> serverHolders, final DataSegment segment ) { final CoordinatorStats stats = new CoordinatorStats(); stats.addToGlobalStat(LoadRule.ASSIGNED_COUNT, 0); for (ServerHolder holder : serverHolders) { <START> if (segment.getSize() > holder.getAvailableSize()) { <END> log.makeAlert("Failed to broadcast segment for [%s]", segment.getDataSource()) .addData("segmentId", segment.getIdentifier()) .addData("segmentSize", segment.getSize()) .addData("hostName", holder.getServer().getHost()) .addData("availableSize", holder.getAvailableSize()) .emit(); } else { holder.getPeon().loadSegment( segment, null ); stats.addToGlobalStat(LoadRule.ASSIGNED_COUNT, 1); } } return stats; }</code><technical_language>I CostBalancerStrategy, this check if holder.isLoadingSegment(segment) skip if so</technical_language>

Target:
private CoordinatorStats assign( final Set<ServerHolder> serverHolders, final DataSegment segment ) { final CoordinatorStats stats = new CoordinatorStats(); stats.addToGlobalStat(LoadRule.ASSIGNED_COUNT, 0); for (ServerHolder holder : serverHolders) { if (segment.getSize() > holder.getAvailableSize()) { log.makeAlert("Failed to broadcast segment for [%s]", segment.getDataSource()) .addData("segmentId", segment.getIdentifier()) .addData("segmentSize", segment.getSize()) .addData("hostName", holder.getServer().getHost()) .addData("availableSize", holder.getAvailableSize()) .emit(); } else { if (!holder.isLoadingSegment(segment)) { holder.getPeon().loadSegment( segment, null ); stats.addToGlobalStat(LoadRule.ASSIGNED_COUNT, 1); } } } return stats; }
Source:
<code>public String getAssociatedArticleImageSrc() { waitForElementByElement(associatedArticleImage); String imageSrc = articleImageUrl.getAttribute("src"); <START> return imageSrc; <END> }</code><technical_language>return articleImageUrl.getAttribute("src"); in line imageSrc is else</technical_language>

Target:
public String getAssociatedArticleImageSrc() { waitForElementByElement(associatedArticleImage); return articleImageUrl.getAttribute("src"); }
Source:
<code>public Updater(){ Config con = Node.getInstance().getConfig(); updateInterval = (long) con.get("node_update_interval"); <START> PARALLELISM = (int) con.get("node_update_parallelism"); <END> running = true; strikeList = new ConcurrentHashMap<L3Address, Integer>(); }</code><technical_language>PARALLELISM a global constant classes use</technical_language>

Target:
public Updater(){ running = true; strikeList = new ConcurrentHashMap<L3Address, Integer>(); }
Source:
<code>public void testSymlinkWithEncodingDifference() throws Exception { try (Repository testRepo = FileRepositoryBuilder.create(testRepoDir)) { File workingTree = testRepo.getWorkTree(); File symLink = new File(new File(workingTree, TESTFOLDER), TESTLINK); Path linkTarget = Files.readSymbolicLink(symLink.toPath()); assertEquals("Unexpected link target", TESTTARGET, linkTarget.toString()); <START> byte[] raw = rawPath(linkTarget); assertNotNull("Cannot get raw path", raw); <END> assertArrayEquals("Expected an NFC link target", NFC, raw); assertTrue("Could not delete symlink", symLink.delete()); Files.createSymbolicLink(symLink.toPath(), Paths.get(TESTTARGET)); linkTarget = Files.readSymbolicLink(symLink.toPath()); assertEquals("Unexpected link target", TESTTARGET, linkTarget.toString()); raw = rawPath(linkTarget); assertNotNull("Cannot get raw path", raw); assertArrayEquals("Expected an NFD link target", NFD, raw); WorkingTreeIterator iterator = new FileTreeIterator(testRepo); IndexDiff diff = new IndexDiff(testRepo, Constants.HEAD, iterator); diff.setFilter(PathFilterGroup.createFromStrings( Collections.singleton(TESTFOLDER + '/' + TESTLINK))); diff.diff(); } }</code><technical_language>this continue work future versions of Java? Is some other read raw symlink --- e.g., invoking "readlink" do trick</technical_language>

Target:
public void testSymlinkWithEncodingDifference() throws Exception { try (Repository testRepo = FileRepositoryBuilder.create(testRepoDir)) { File workingTree = testRepo.getWorkTree(); File symLink = new File(new File(workingTree, TESTFOLDER), TESTLINK); Path linkTarget = Files.readSymbolicLink(symLink.toPath()); assertEquals("Unexpected link target", TESTTARGET, linkTarget.toString()); byte[] raw = rawPath(linkTarget); if (raw != null) { assertArrayEquals("Expected an NFC link target", NFC, raw); } assertTrue("Could not delete symlink", symLink.delete()); Files.createSymbolicLink(symLink.toPath(), Paths.get(TESTTARGET)); linkTarget = Files.readSymbolicLink(symLink.toPath()); assertEquals("Unexpected link target", TESTTARGET, linkTarget.toString()); raw = rawPath(linkTarget); if (raw != null) { assertArrayEquals("Expected an NFD link target", NFD, raw); } WorkingTreeIterator iterator = new FileTreeIterator(testRepo); IndexDiff diff = new IndexDiff(testRepo, Constants.HEAD, iterator); diff.setFilter(PathFilterGroup.createFromStrings( Collections.singleton(TESTFOLDER + '/' + TESTLINK))); diff.diff(); } }
Source:
<code><START> public void start(JobTicket ticket) { <END> if ( threadPool != null ) { logger.warn("startJob called more than once"); return; } if ( getBatchSize() <= 0 ) { withBatchSize(1); logger.warn("batchSize should be 1 or greater--setting batchSize to 1"); } jobTicket = ticket; getRowCount(); jobStartTime = Calendar.getInstance(); started.set(true); }</code><technical_language>important verify a plan provided</technical_language>

Target:
public synchronized void start(JobTicket ticket) { if(this.batchPlanImpl.getView() == null) throw new InternalError("Plan must be supplied before starting the job"); if ( threadPool != null ) { logger.warn("startJob called more than once"); return; } params.add("schema", batchPlanImpl.getSchema()); params.add("view", batchPlanImpl.getView()); if ( super.getBatchSize() <= 0 ) { withBatchSize(1); logger.warn("batchSize should be 1 or greater--setting batchSize to 1"); } this.threadPool = new BatchThreadPoolExecutor(super.getThreadCount()); getRowCount(); for(int i=0; i<super.getThreadCount(); i++) { RowBatchCallable rowBatchCallable = new RowBatchCallable(this); rowBatchCallable.call(); } jobTicket = ticket; jobStartTime = Calendar.getInstance(); started.set(true); }
Source:
<code>private UrlUtil() { <START> throw new UnsupportedOperationException("No instances allowed"); <END> }</code><technical_language>making this class final OK this exception</technical_language>

Target:
private UrlUtil() { }
Source:
<code>public void setUp() { queryBuilder = new MISTQueryBuilder(); windowSize = 5000; windowEmissionInterval = 1000; mappedStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF) .map(s -> new Tuple2<>(s, 1)); timeWindowedStream = <START> (WindowOperatorStream)mappedStream <END> .window(new TimeWindowInformation(windowSize, windowEmissionInterval)); firstInputStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF); secondInputStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF); joinBiPred = (string1, string2) -> string1.equals(string2); }</code><technical_language>type casting</technical_language>

Target:
public void setUp() { queryBuilder = new MISTQueryBuilder(); windowSize = 5000; windowEmissionInterval = 1000; mappedStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF) .map(s -> new Tuple2<>(s, 1)); timeWindowedStream = mappedStream .window(new TimeWindowInformation(windowSize, windowEmissionInterval)); firstInputStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF); secondInputStream = queryBuilder.socketTextStream(APITestParameters.LOCAL_TEXT_SOCKET_SOURCE_CONF); joinBiPred = (string1, string2) -> string1.equals(string2); }
Source:
<code>private TreeSet<Entry<String, Path>> jarsFirstSortedPluginsSet( Map<String, Path> activePlugins) { TreeSet<Entry<String, Path>> sortedPlugins = Sets.newTreeSet(new Comparator<Entry<String, Path>>() { @Override public int compare(Entry<String, Path> e1, Entry<String, Path> e2) { Path n1 = e1.getValue().getFileName(); Path n2 = e2.getValue().getFileName(); return ComparisonChain.start() <START> .compareTrueFirst(n1.toString().endsWith(".jar"), n2.toString().endsWith(".jar")) <END> .compare(n1, n2) .result(); } }); addAllEntries(activePlugins, sortedPlugins); return sortedPlugins; }</code><technical_language>Long line, factor out toString locals, add a private isJar(Path) method</technical_language>

Target:
private TreeSet<Entry<String, Path>> jarsFirstSortedPluginsSet( Map<String, Path> activePlugins) { TreeSet<Entry<String, Path>> sortedPlugins = Sets.newTreeSet(new Comparator<Entry<String, Path>>() { @Override public int compare(Entry<String, Path> e1, Entry<String, Path> e2) { Path n1 = e1.getValue().getFileName(); Path n2 = e2.getValue().getFileName(); return ComparisonChain.start() .compareTrueFirst(isJar(n1), isJar(n2)) .compare(n1, n2) .result(); } private boolean isJar(Path n1) { return n1.toString().endsWith(".jar"); } }); addAllEntries(activePlugins, sortedPlugins); return sortedPlugins; }
Source:
<code>public void setReleasePartialSequences(boolean releasePartialSequences) { <START> if (!this.releaseStrategySet) { <END> setReleaseStrategy(new SequenceSizeReleaseStrategy()); } this.releasePartialSequences = releasePartialSequences; }</code><technical_language>if (!this.releaseStrategySet && releasePartialSequences) { I reason override SimpleSequenceSizeReleaseStrategy if releasePartialSequences feature. is assertion in commit message: > Change aggregator a SimpleSequenceSizeReleaseStrategy default, > setReleasePartialSequences(true)</technical_language>

Target:
public void setReleasePartialSequences(boolean releasePartialSequences) { if (!this.releaseStrategySet && releasePartialSequences) { setReleaseStrategy(new SequenceSizeReleaseStrategy()); } this.releasePartialSequences = releasePartialSequences; }
Source:
<code>public CompletableFuture<List<TableDescriptor>> listTableDescriptors(List<TableName> tableNames) { Preconditions.checkNotNull(tableNames, "tableNames is null"); if (tableNames.isEmpty()) { return CompletableFuture.completedFuture(Collections.emptyList()); } return toCompletableFuture(bigtableTableAdminClient.listTablesAsync()) .thenApply( t -> tableNames.stream() .filter(in -> t.contains(in.getNameAsString())) <START> .map(tbName -> getDescriptor(tbName).join()) <END> .collect(Collectors.toList())); }</code><technical_language>is a race condition here: table deleted a list get operations catch error remove table list</technical_language>

Target:
public CompletableFuture<List<TableDescriptor>> listTableDescriptors(List<TableName> tableNames) { Preconditions.checkNotNull(tableNames, "tableNames is null"); if (tableNames.isEmpty()) { return CompletableFuture.completedFuture(Collections.emptyList()); } return toCompletableFuture(bigtableTableAdminClient.listTablesAsync()) .thenApply( t -> tableNames.stream() .filter(inputTableName -> t.contains(inputTableName.getNameAsString())) .map( tbName -> { try { return getDescriptor(tbName).join(); } catch (CompletionException ex) { if (ex.getCause() instanceof TableNotFoundException) { return null; } throw ex; } }) .filter(Objects::nonNull) .collect(Collectors.toList())); }
Source:
<code>public SlotRequest(String filename, long size, String contentType) { super(ELEMENT, NAMESPACE); this.filename = filename; <START> this.size = size; <END> this.contentType = contentType; setType(Type.get); }</code><technical_language>This sanitized, i.e. throw IllegalArgumentException negative zero</technical_language>

Target:
public SlotRequest(String filename, long size, String contentType) { super(ELEMENT, NAMESPACE); if (size <= 0) { throw new IllegalArgumentException("File fileSize must be greater than zero."); } this.filename = filename; this.size = size; this.contentType = contentType; setType(Type.get); }
Source:
<code>protected Collection<S3Object> initObjects() throws IOException { if (!uris.isEmpty()) { return uris.stream() .map( uri -> { final String s3Bucket = uri.getAuthority(); final S3Object s3Object = new S3Object(extractS3Key(uri)); s3Object.setBucketName(s3Bucket); return s3Object; } ) .collect(Collectors.toList()); } else { final List<S3Object> objects = new ArrayList<>(); for (URI uri : prefixes) { final String bucket = uri.getAuthority(); final String prefix = extractS3Key(uri); try { <START> final S3Object[] listed = s3Client.listObjects(bucket, prefix, null); <END> objects.addAll(Arrays.asList(listed)); } catch (S3ServiceException e) { throw new IOException(e); } } return objects; } }</code><technical_language>this support common prefixes (subdirectory paths), is this want support? docs listObjectsChunked instead, preferable in case a large number of items</technical_language>

Target:
protected Collection<S3Object> initObjects() throws IOException { if (!uris.isEmpty()) { return uris.stream() .map( uri -> { final String s3Bucket = uri.getAuthority(); final S3Object s3Object = new S3Object(extractS3Key(uri)); s3Object.setBucketName(s3Bucket); return s3Object; } ) .collect(Collectors.toList()); } else { final List<S3Object> objects = new ArrayList<>(); for (URI uri : prefixes) { final String bucket = uri.getAuthority(); final String prefix = extractS3Key(uri); try { String lastKey = null; StorageObjectsChunk objectsChunk; do { objectsChunk = s3Client.listObjectsChunked( bucket, prefix, null, MAX_LISTING_LENGTH, lastKey ); Arrays.stream(objectsChunk.getObjects()).forEach(storageObject -> objects.add((S3Object) storageObject)); lastKey = objectsChunk.getPriorLastKey(); } while (!objectsChunk.isListingComplete()); } catch (ServiceException e) { throw new IOException(e); } } return objects; } }
Source:
<code>static void assertCRAM(File outputFile) { try (InputStream in = new FileInputStream(outputFile)) { Assert.assertEquals(0x43, in.read(), "File is not CRAM"); Assert.assertEquals(0x52, in.read(), "File is not CRAM"); Assert.assertEquals(0x41, in.read(), "File is not CRAM"); <START> Assert.assertEquals(0x4d, in.read(), "File is not CRAM"); <END> } catch (IOException e) { e.printStackTrace(); } }</code><technical_language>SamStreams.isCRAMFile here</technical_language>

Target:
static void assertCRAM(File outputFile) { try (InputStream in = new FileInputStream(outputFile)) { Assert.assertTrue(SamStreams.isCRAMFile(new BufferedInputStream(in)), "File is not a CRAM."); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public Resource makeFeatureInfoRequest(ConveyorTile tile, BoundingBox bbox, int height, int width, int x, int y) throws GeoWebCacheException { WMSLayer layer = (WMSLayer) tile.getLayer(); GridSubset gridSubset = tile.getGridSubset(); Map<String, String> wmsParams = layer.getWMSRequestTemplate(tile.getMimeType(), WMSLayer.RequestType.FEATUREINFO); wmsParams.put("INFO_FORMAT", tile.getMimeType().getFormat()); wmsParams.put("FORMAT", layer.getDefaultMimeType().getMimeType()); wmsParams.put("SRS", layer.backendSRSOverride(gridSubset.getSRS())); wmsParams.put("HEIGHT", String.valueOf(height)); wmsParams.put("WIDTH", String.valueOf(width)); wmsParams.put("BBOX", bbox.toString()); <START> Map<String, String> fullParameters = tile.getFilteringParameters(); <END> if (fullParameters.isEmpty()) { fullParameters = layer.getDefaultParameterFilters(); } wmsParams.putAll(fullParameters); wmsParams.put("X", String.valueOf(x)); wmsParams.put("Y", String.valueOf(y)); String featureCount; { Map<String, String> values = ServletUtils.selectedStringsFromMap( tile.servletReq.getParameterMap(), tile.servletReq.getCharacterEncoding(), "feature_count"); featureCount = values.get("feature_count"); } if(featureCount != null){ wmsParams.put("FEATURE_COUNT", featureCount); } MimeType mimeType = tile.getMimeType(); Resource target = new ByteArrayResource(2048); makeRequest(tile, layer, wmsParams, mimeType, target); return target; }</code><technical_language>correct local variable name</technical_language>

Target:
public Resource makeFeatureInfoRequest(ConveyorTile tile, BoundingBox bbox, int height, int width, int x, int y) throws GeoWebCacheException { WMSLayer layer = (WMSLayer) tile.getLayer(); GridSubset gridSubset = tile.getGridSubset(); Map<String, String> wmsParams = layer.getWMSRequestTemplate(tile.getMimeType(), WMSLayer.RequestType.FEATUREINFO); wmsParams.put("INFO_FORMAT", tile.getMimeType().getFormat()); wmsParams.put("FORMAT", layer.getDefaultMimeType().getMimeType()); wmsParams.put("SRS", layer.backendSRSOverride(gridSubset.getSRS())); wmsParams.put("HEIGHT", String.valueOf(height)); wmsParams.put("WIDTH", String.valueOf(width)); wmsParams.put("BBOX", bbox.toString()); Map<String, String> filteringParameters = tile.getFilteringParameters(); if (filteringParameters.isEmpty()) { filteringParameters = layer.getDefaultParameterFilters(); } wmsParams.putAll(filteringParameters); wmsParams.put("X", String.valueOf(x)); wmsParams.put("Y", String.valueOf(y)); String featureCount; { Map<String, String> values = ServletUtils.selectedStringsFromMap( tile.servletReq.getParameterMap(), tile.servletReq.getCharacterEncoding(), "feature_count"); featureCount = values.get("feature_count"); } if(featureCount != null){ wmsParams.put("FEATURE_COUNT", featureCount); } MimeType mimeType = tile.getMimeType(); Resource target = new ByteArrayResource(2048); makeRequest(tile, layer, wmsParams, mimeType, target); return target; }
Source:
<code>static boolean isECKeyWithFieldSize(Key key, int fieldSize) { <START> return ("ECDSA".equals(key.getAlgorithm()) || "EC".equals(key.getAlgorithm())) <END> && fieldSizeFromKey((ECKey) key) == fieldSize; }</code><technical_language>While changing it, extract "ECDSA" a constant, I do that</technical_language>

Target:
static boolean isECKeyWithFieldSize(Key key, int fieldSize) { return (KeyAlgorithm.ECDSA.equals(key.getAlgorithm()) || KeyAlgorithm.EC_KEYSTORE.equals(key.getAlgorithm())) && fieldSizeFromKey((ECKey) key) == fieldSize; }
Source:
<code>private synchronized static SslContext createSslContext() throws SSLException { if (sslBuilder == null) { sslBuilder = GrpcSslContexts.forClient().ciphers(null); if (OpenSsl.isAvailable()) { LOG.info("gRPC is using the OpenSSL provider (tcnactive jar - Open Ssl version: {})", OpenSsl.versionString()); } else { if (OpenSsl.isAlpnSupported()) { LOG.info("gRPC is using the JDK provider (alpn-boot jar)"); } else { <START> LOG.info("gRPC can't be configured"); <END> } } } return sslBuilder.build(); }</code><technical_language>..., OpenSsl Alpn supported</technical_language>

Target:
private synchronized static SslContext createSslContext() throws SSLException { if (sslBuilder == null) { sslBuilder = GrpcSslContexts.forClient().ciphers(null); if (OpenSsl.isAlpnSupported()) { LOG.info("gRPC is using the OpenSSL provider (tcnactive jar - Open Ssl version: %s)", OpenSsl.versionString()); } else { if (isJettyAlpnConfigured()) { LOG.info("gRPC is using the JDK provider (alpn-boot jar)"); } else { LOG.info("gRPC cannot be configured. Neither OpenSsl nor Alpn are available."); } } } return sslBuilder.build(); }
Source:
<code>public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); <START> if (uniqueKeys.isEmpty()) { <END> if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", uniqueKeys, lockOwner, time, unit); } final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size()); synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.markListAsFinal(); scheduleLockPromise(compositeLockPromise, time, unit); return compositeLockPromise; }</code><technical_language>another isEmpty() check above</technical_language>

Target:
public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", uniqueKeys, lockOwner, time, unit); } final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size()); synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.markListAsFinal(); return compositeLockPromise.scheduleLockTimeoutTask(scheduler, time, unit); }
Source:
<code>void handleChunk(Buffer data) { <START> this.bytesRead += data.length(); <END> if (paused) { if (pausedChunks == null) { pausedChunks = new ArrayDeque<>(); } pausedChunks.add(data); } else { request.dataReceived(); if (dataHandler != null) { dataHandler.handle(data); } } }</code><technical_language>This is imposing a performance penalty metrics is enabled</technical_language>

Target:
void handleChunk(Buffer data) { if (conn.metrics.isEnabled()) { this.bytesRead += data.length(); } if (paused) { if (pausedChunks == null) { pausedChunks = new ArrayDeque<>(); } pausedChunks.add(data); } else { request.dataReceived(); if (dataHandler != null) { dataHandler.handle(data); } } }
Source:
<code>private String buildDVExplanation(RecurringDisbursementVoucherDocument recurringDV) { String dvExplanation = CuFPConstants.RecurringDisbursementVoucherDocumentConstants.RECURRING_DV_EXPLANATION_TO_DV_NOTE_STARTER <START> + recurringDV.getDocumentNumber() + KFSConstants.DELIMITER + KFSConstants.BLANK_SPACE + recurringDV.getDocumentHeader().getExplanation(); <END> return truncateExplanationToMaxLength(dvExplanation); }</code><technical_language>Do worth while adding some logic include coma space if recurring DV explanation append? I a strong opinion this, I start appending a number of String together, I a StringBuilder is more efficient, slightly easier read</technical_language>

Target:
private String buildDVExplanation(RecurringDisbursementVoucherDocument recurringDV) { StringBuilder dvExplanation = new StringBuilder(); dvExplanation.append(CuFPConstants.RecurringDisbursementVoucherDocumentConstants.RECURRING_DV_EXPLANATION_TO_DV_NOTE_STARTER).append(recurringDV.getDocumentNumber()); String rcdvExplanation = recurringDV.getDocumentHeader().getExplanation(); if(StringUtils.isNotBlank(rcdvExplanation)) { dvExplanation.append(KFSConstants.DELIMITER).append(KFSConstants.BLANK_SPACE).append(rcdvExplanation); } return truncateExplanationToMaxLength(dvExplanation.toString()); }
Source:
<code>public void questionComplete(Bundle data) { if (data != null) { mValue = data.getString(ConstantUtil.CADDISFLY_RESPONSE); caddisflyTestResults = caddisflyJsonMapper.transform(mValue); String image = data.getString(ConstantUtil.CADDISFLY_IMAGE); Timber.d("caddisflyTestComplete - Response: %s . Image: %s", mValue, image); File src = !TextUtils.isEmpty(image) ? new File(image) : null; if (src != null && src.exists()) { presenter.onImageReady(src); } else { captureResponse(); } displayResponseView(); } else { <START> captureResponse(); <END> } }</code><technical_language>captureResponse() function called in branches of if statement</technical_language>

Target:
public void questionComplete(Bundle data) { if (data != null) { mValue = data.getString(ConstantUtil.CADDISFLY_RESPONSE); caddisflyTestResults = caddisflyJsonMapper.transform(mValue); String image = data.getString(ConstantUtil.CADDISFLY_IMAGE); Timber.d("caddisflyTestComplete - Response: %s . Image: %s", mValue, image); File src = !TextUtils.isEmpty(image) ? new File(image) : null; if (src != null && src.exists()) { presenter.onImageReady(src); } else { captureResponse(); } displayResponseView(); } }