auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static Map<String, String> buildAliasMap(DnsResponse response, DnsCnameCache cache, EventLoop loop) { final int answerCount = response.count(DnsSection.ANSWER); Map<String, String> cnames = null; for (int i = 0; i < answerCount; i ++) { final DnsRecord r = response.recordAt(DnsSection.ANSWER, i); final DnsRecordType type = r.type(); if (type != DnsRecordType.CNAME) { continue; } if (!(r instanceof DnsRawRecord)) { continue; } final ByteBuf recordContent = ((ByteBufHolder) r).content(); final String domainName = decodeDomainName(recordContent); if (domainName == null) { continue; } if (cnames == null) { cnames = new HashMap<String, String>(min(8, answerCount)); } String name = r.name().toLowerCase(Locale.US); String mapping = domainName.toLowerCase(Locale.US); String nameWithDot = hostnameWithDot(name); String mappingWithDot = hostnameWithDot(mapping); if (!nameWithDot.equalsIgnoreCase(mappingWithDot)) { <START> cache.cache(hostnameWithDot(name), hostnameWithDot(mapping), r.timeToLive(), loop); <END> cnames.put(name, mapping); } } return cnames != null? cnames : Collections.<String, String>emptyMap(); }</code><technical_language>nameWithDot mappingWithDot here</technical_language>

Target:
private static Map<String, String> buildAliasMap(DnsResponse response, DnsCnameCache cache, EventLoop loop) { final int answerCount = response.count(DnsSection.ANSWER); Map<String, String> cnames = null; for (int i = 0; i < answerCount; i ++) { final DnsRecord r = response.recordAt(DnsSection.ANSWER, i); final DnsRecordType type = r.type(); if (type != DnsRecordType.CNAME) { continue; } if (!(r instanceof DnsRawRecord)) { continue; } final ByteBuf recordContent = ((ByteBufHolder) r).content(); final String domainName = decodeDomainName(recordContent); if (domainName == null) { continue; } if (cnames == null) { cnames = new HashMap<String, String>(min(8, answerCount)); } String name = r.name().toLowerCase(Locale.US); String mapping = domainName.toLowerCase(Locale.US); String nameWithDot = hostnameWithDot(name); String mappingWithDot = hostnameWithDot(mapping); if (!nameWithDot.equalsIgnoreCase(mappingWithDot)) { cache.cache(nameWithDot, mappingWithDot, r.timeToLive(), loop); cnames.put(name, mapping); } } return cnames != null? cnames : Collections.<String, String>emptyMap(); }
Source:
<code>public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 8); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0), 2, 10); <START> formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 4, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isLun(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.diskProfile(), diskProfileName, 5, 0) { @Override public boolean getIsAvailable() { return !getDetailModel().isLun(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 6, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isQuotaAvailable(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.wipeAfterDelete(), wipeAfterDelete, 7, 0) { <END> @Override public boolean getIsAvailable() { return getDetailModel().isImage(); } }, 2, 10); formBuilder.setRelativeColumnWidth(0, 12); }</code><technical_language>indexes adjusted, out 3rd element need shifted</technical_language>

Target:
public SubTabDiskGeneralView(DetailModelProvider<DiskListModel, DiskGeneralModel> modelProvider) { super(modelProvider); formPanel = new GeneralFormPanel(); initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); driver.initialize(this); generateIds(); formBuilder = new FormBuilder(formPanel, 1, 8); formBuilder.addFormItem(new FormItem(constants.aliasDisk(), alias, 0, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.descriptionDisk(), description, 1, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.idDisk(), diskId, 2, 0), 2, 10); formBuilder.addFormItem(new FormItem(constants.lunIdSanStorage(), lunId, 3, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isLun(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.diskProfile(), diskProfileName, 4, 0) { @Override public boolean getIsAvailable() { return !getDetailModel().isLun(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.quota(), quotaName, 5, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isQuotaAvailable(); } }, 2, 10); formBuilder.addFormItem(new FormItem(constants.wipeAfterDelete(), wipeAfterDelete, 6, 0) { @Override public boolean getIsAvailable() { return getDetailModel().isImage(); } }, 2, 10); formBuilder.setRelativeColumnWidth(0, 12); }
Source:
<code>public void map() { if (!mapped) { final ResolvedType resolved = resolver.resolve(getType()); final ResolvedTypeWithMembers type = memberResolver.resolve(resolved, null, null); for (final ResolvedType resolvedType : resolved.getTypeParameters()) { addParameter(resolvedType.getErasedType()); } <START> for (final ResolvedField field : type.getMemberFields()) { <END> addField(field); } for (final ResolvedMethod memberMethod : type.getMemberMethods()) { addMethod(memberMethod); } mapped = true; } }</code><technical_language>I adding fields methods is elegant handle added/removed problem. +1</technical_language>

Target:
public void map() { if (!mapped) { final ResolvedType resolved = resolver.resolve(getType()); final ResolvedTypeWithMembers type = memberResolver.resolve(resolved, new StdConfiguration(AnnotationInclusion.INCLUDE_AND_INHERIT_IF_INHERITED), null); for (final ResolvedType resolvedType : resolved.getTypeParameters()) { addParameter(resolvedType.getErasedType()); } for (final ResolvedField field : type.getMemberFields()) { addField(field); } for (final ResolvedMethod memberMethod : type.getMemberMethods()) { addMethod(memberMethod); } mapped = true; } }
Source:
<code>private static int computeElapsedTimeInSeconds(long startTime, long endTime) { <START> return (int) (endTime - startTime / 1000); <END> }</code><technical_language>adding extra pair of endTime - startTime nice for of memorized arithmetic operator precedence, :)</technical_language>

Target:
private static int computeElapsedTimeInSeconds(long startTime, long endTime) { return (int)((endTime - startTime) / 1000); }
Source:
<code>private void load(int nodeSize, File fluoPropsFile, File out1) throws Exception { int ret = ToolRunner.run(new Load(), <START> new String[] {"-D", "mapred.job.tracker=local", "-D", "fs.default.name=file:/ END> fluoPropsFile.getAbsolutePath(), out1.toURI().toString()}); Assert.assertEquals(0, ret); }</code><technical_language>Newer equivalent: fs.defaultFS</technical_language>

Target:
private void load(int nodeSize, File fluoPropsFile, File out1) throws Exception { int ret = ToolRunner.run(new Load(), new String[] {"-D", "mapred.job.tracker=local", "-D", "fs.defaultFS=file:/ fluoPropsFile.getAbsolutePath(), out1.toURI().toString()}); Assert.assertEquals(0, ret); }
Source:
<code>public void testGetPropertyStoreWithTestStringData() throws IOException { String actual = new JerseyUriRequestBuilder("clusters/{}/propertyStore/NonZnRecord").format(TEST_CLUSTER) .isBodyReturnExpected(true).get(this); JsonNode jsonNode = OBJECT_MAPPER.readTree(actual); <START> String payLoad = jsonNode.get("content").getValueAsText(); <END> Assert.assertEquals(TEST_CONTENT, payLoad); }</code><technical_language>Nit: "content" a constant</technical_language>

Target:
public void testGetPropertyStoreWithTestStringData() throws IOException { String actual = new JerseyUriRequestBuilder("clusters/{}/propertyStore/NonZnRecord").format(TEST_CLUSTER) .isBodyReturnExpected(true).get(this); JsonNode jsonNode = OBJECT_MAPPER.readTree(actual); String payLoad = jsonNode.get(CONTENT_KEY).getValueAsText(); Assert.assertEquals(TEST_CONTENT, payLoad); }
Source:
<code>void close(boolean sawErrors) throws IOException { if (memIters != null) { tablet.getTabletMemory().returnIterators(memIters); memIters = null; tablet.getDatafileManager().returnFilesForScan(fileReservationId); fileReservationId = -1; } synchronized (tablet) { if (tablet.removeScan(this) == 0) tablet.notifyAll(); } if (fileManager != null) { fileManager.releaseOpenFiles(sawErrors); fileManager = null; } try { if (statsIterator != null) { statsIterator.report(); statsIterator.close(); } if (iter != null) { iter.close(); } } catch (Exception e) { <START> throw new IOException(e); <END> } }</code><technical_language>do this</technical_language>

Target:
void close(boolean sawErrors) { if (memIters != null) { tablet.getTabletMemory().returnIterators(memIters); memIters = null; tablet.getDatafileManager().returnFilesForScan(fileReservationId); fileReservationId = -1; } synchronized (tablet) { if (tablet.removeScan(this) == 0) tablet.notifyAll(); } if (fileManager != null) { fileManager.releaseOpenFiles(sawErrors); fileManager = null; } if (statsIterator != null) { statsIterator.report(); } }
Source:
<code>public void run(String... args) throws Exception { <START> System.out.println("Running and exiting"); <END> }</code><technical_language>prefer a proper logger instead of System.x - a logback.xml in module</technical_language>

Target:
public void run(String... args) throws Exception { logger.info("Running conditional flow application..."); }
Source:
<code>public void sendNotification(String providerId, Object payload, Notification notification, TaskTracker tracker) throws Exception { try { List<TranslatedNotification> translatedNotifications = ( List<TranslatedNotification>) payload; for(TranslatedNotification translatedNotification : translatedNotifications) { switch (translatedNotification.getType()) { case "toast": WnsToast toast = new WnsToastBuilder().bindingTemplateToastText01(translatedNotification.getMessage().toString()).build(); service.pushToast(providerId, toast); break; case "badge": WnsBadge badge; if (translatedNotification.getMessage() instanceof Integer) { badge = new WnsBadgeBuilder().value((Integer) translatedNotification.getMessage()).build(); } else { badge = new WnsBadgeBuilder().value(translatedNotification.getMessage().toString()).build(); } service.pushBadge(providerId, badge); <START> break; <END> } } tracker.completed(); } catch (Exception e) { tracker.failed(0,e.toString()); LOG.error("Failed to send notification",e); } }</code><technical_language>here, do want throw/log exception for a type handle? helpful operationally if users problems send</technical_language>

Target:
public void sendNotification(String providerId, Object payload, Notification notification, TaskTracker tracker) throws Exception { try { List<TranslatedNotification> translatedNotifications = ( List<TranslatedNotification>) payload; for(TranslatedNotification translatedNotification : translatedNotifications) { switch (translatedNotification.getType()) { case "toast": WnsToast toast = new WnsToastBuilder().bindingTemplateToastText01(translatedNotification.getMessage().toString()).build(); service.pushToast(providerId, toast); break; case "badge": WnsBadge badge; if (translatedNotification.getMessage() instanceof Integer) { badge = new WnsBadgeBuilder().value((Integer) translatedNotification.getMessage()).build(); } else { badge = new WnsBadgeBuilder().value(translatedNotification.getMessage().toString()).build(); } service.pushBadge(providerId, badge); break; default : throw new IllegalArgumentException(translatedNotification.getType()+" does not match a valid notification type (toast,badge)."); } } tracker.completed(); } catch (Exception e) { tracker.failed(0,e.toString()); LOG.error("Failed to send notification",e); } }
Source:
<code>private void updateReportDataClonedCashAdvanceCountAndAmountTotals(ConcurRequestExtractBatchReportData reportData, ConcurRequestExtractRequestDetailFileLine detailFileLine) { int count = reportData.getClonedCashAdvanceRequests().getRecordCount(); count++; reportData.getClonedCashAdvanceRequests().setRecordCount(count); <START> KualiDecimal amount = reportData.getClonedCashAdvanceRequests().getDollarAmount(); <END> reportData.getClonedCashAdvanceRequests().setDollarAmount(amount.add(detailFileLine.getRequestAmount())); }</code><technical_language>I cleaner add a new method in ConcurBatchReportSummaryItem class adds input amount DollarAmount</technical_language>

Target:
private void updateReportDataClonedCashAdvanceCountAndAmountTotals(ConcurRequestExtractBatchReportData reportData, ConcurRequestExtractRequestDetailFileLine detailFileLine) { reportData.getClonedCashAdvanceRequests().incrementRecordCount(); reportData.getClonedCashAdvanceRequests().addDollarAmount(detailFileLine.getRequestAmount()); }
Source:
<code>private String getAttachment() throws NotConnectedException, UnknownJobException, PermissionException, IOException { JobId jobID = jobState.getId(); List<TaskState> tasks = jobState.getTasks(); String attachLogPath = null; try { JobResult result = dbManager.loadJobResult(jobID); while (result == null) { try { <START> Thread.sleep(1000); <END> } catch (InterruptedException e) { logger.info("Stack trace: ", e); } } String allRes = String.join(System.lineSeparator(), tasks.stream() .map(task -> "Task " + task.getId().toString() + " (" + task.getId().getReadableName() + ") :" + System.lineSeparator() + result.getAllResults() .get(task.getId() .getReadableName()) .getOutput() .getAllLogs()) .collect(Collectors.toList())); File file = File.createTempFile("job_logs", ".log"); try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) { writer.write(allRes); attachLogPath = file.getAbsolutePath(); } catch (IOException e) { jlogger.warn(jobState.getId(), "Failed to create attachment for email notification: " + e.getMessage()); logger.warn("Error creating attachment for email notification: " + e.getMessage(), e); } } catch (Exception e) { logger.warn("Error creating attachment for email notification: ", e); } return attachLogPath; }</code><technical_language>need do loadJobResult</technical_language>

Target:
private String getAttachment() throws NotConnectedException, UnknownJobException, PermissionException, IOException { JobId jobID = jobState.getId(); List<TaskState> tasks = jobState.getTasks(); String attachLogPath = null; try { JobResult result = dbManager.loadJobResult(jobID); String allRes = String.join(System.lineSeparator(), tasks.stream() .map(task -> "Task " + task.getId().toString() + " (" + task.getId().getReadableName() + ") :" + System.lineSeparator() + result.getAllResults() .get(task.getId() .getReadableName()) .getOutput() .getAllLogs()) .collect(Collectors.toList())); File file = File.createTempFile("job_logs", ".log"); try (BufferedWriter writer = new BufferedWriter(new FileWriter(file))) { writer.write(allRes); attachLogPath = file.getAbsolutePath(); } catch (IOException e) { jlogger.warn(jobState.getId(), "Failed to create attachment for email notification: " + e.getMessage()); logger.warn("Error creating attachment for email notification: " + e.getMessage(), e); } } catch (Exception e) { logger.warn("Error creating attachment for email notification: ", e); } return attachLogPath; }
Source:
<code>private void calculateNormals() { List<Vector3f> vertices = getBindPoseVertexPositions(); List<Vector3f> normals = Lists.newArrayListWithCapacity(vertices.size()); for (int i = 0; i < vertices.size(); ++i) { normals.add(new Vector3f()); } Vector3f v1 = new Vector3f(); Vector3f v2 = new Vector3f(); Vector3f norm = new Vector3f(); for (int i = 0; i < indices.size() / 3; ++i) { Vector3f baseVert = vertices.get(indices.get(i * 3)); v1.sub(vertices.get(indices.get(i * 3 + 1)), baseVert); v2.sub(vertices.get(indices.get(i * 3 + 2)), baseVert); v1.normalize(); v2.normalize(); norm.cross(v1, v2); normals.get(indices.get(i * 3)).add(norm); normals.get(indices.get(i * 3 + 1)).add(norm); normals.get(indices.get(i * 3 + 2)).add(norm); } <START> <END> normals.forEach(Vector3f::normalize); Quaternionf inverseRot = new Quaternionf(); for (int vertIndex = 0; vertIndex < vertices.size(); ++vertIndex) { Vector3f normal = normals.get(vertIndex); for (int weightIndex = 0; weightIndex < vertexWeightCounts.get(vertIndex); ++weightIndex) { BoneWeight weight = weights.get(weightIndex + vertexStartWeights.get(vertIndex)); bones.get(weight.getBoneIndex()).getObjectRotation().invert(inverseRot); inverseRot.transform(normal, norm); weight.setNormal(norm); } } }</code><technical_language>is a sub() error in line 163-164. (above) be: vertices.get(indices.get(i * 3 + 1)).sub(baseVert, v1); vertices.get(indices.get(i * 3 + 2)).sub(baseVert, v2);</technical_language>

Target:
private void calculateNormals() { List<Vector3f> vertices = getBindPoseVertexPositions(); List<Vector3f> normals = Lists.newArrayListWithCapacity(vertices.size()); for (int i = 0; i < vertices.size(); ++i) { normals.add(new Vector3f()); } Vector3f v1 = new Vector3f(); Vector3f v2 = new Vector3f(); Vector3f norm = new Vector3f(); for (int i = 0; i < indices.size() / 3; ++i) { Vector3f baseVert = vertices.get(indices.get(i * 3)); vertices.get(indices.get(i * 3 + 1)).sub(baseVert, v1); vertices.get(indices.get(i * 3 + 2)).sub(baseVert, v2); v1.normalize(); v2.normalize(); norm.cross(v1, v2); normals.get(indices.get(i * 3)).add(norm); normals.get(indices.get(i * 3 + 1)).add(norm); normals.get(indices.get(i * 3 + 2)).add(norm); } normals.forEach(Vector3f::normalize); Quaternionf inverseRot = new Quaternionf(); for (int vertIndex = 0; vertIndex < vertices.size(); ++vertIndex) { Vector3f normal = normals.get(vertIndex); for (int weightIndex = 0; weightIndex < vertexWeightCounts.get(vertIndex); ++weightIndex) { BoneWeight weight = weights.get(weightIndex + vertexStartWeights.get(vertIndex)); bones.get(weight.getBoneIndex()).getObjectRotation().invert(inverseRot); inverseRot.transform(normal, norm); weight.setNormal(norm); } } }
Source:
<code>protected static String getMavenXcodePluginArtifactId() throws IOException { <START> return getProjectProperty("artifactId"); <END> }</code><technical_language>Constants? provided Maven API? E.g. org.apache.maven.archetype.common.Constants</technical_language>

Target:
protected static String getMavenXcodePluginArtifactId() throws IOException { return getProjectProperty(ARTIFACT_ID); }
Source:
<code>public static String getDomainFromResolverConf(final String file) { final InputStream in; try { in = new FileInputStream(file); } catch (FileNotFoundException e) { return ""; } final InputStreamReader isr = new InputStreamReader(in); final BufferedReader br = new BufferedReader(isr); <START> try { <END> String line; while ((line = br.readLine()) != null) { if (line.startsWith("domain")) { final StringTokenizer st = new StringTokenizer(line); st.nextToken(); if (!st.hasMoreTokens()) { continue; } return st.nextToken(); } } br.close(); } catch (IOException e) { } finally { try { br.close(); } catch (IOException e) { } } return ""; }</code><technical_language>try-with-resources</technical_language>

Target:
public static String getDomainFromResolverConf(final String file) { try (final InputStream in = new FileInputStream(file)) { final InputStreamReader isr = new InputStreamReader(in); try (final BufferedReader br = new BufferedReader(isr)) { String line; while ((line = br.readLine()) != null) { if (line.startsWith("domain")) { final StringTokenizer st = new StringTokenizer(line); st.nextToken(); if (!st.hasMoreTokens()) { continue; } return st.nextToken(); } } } } catch (FileNotFoundException e) { log.warn("Resolver config file not found", e); } catch (IOException e) { log.warn("Error reading config file", e); } return ""; }
Source:
<code>public static Response buildResetPasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); userStoreManager.updateCredentialByAdmin(credentials.getUsername(), new String( decodedNewPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); <START> log.error(errorMsg, e); <END> responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Could not change the password."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }</code><technical_language>put errorMsg straightaway in log.error function. need for a separate variable definition</technical_language>

Target:
public static Response buildResetPasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); userStoreManager.updateCredentialByAdmin(credentials.getUsername(), new String( decodedNewPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { log.error(e.getMessage(), e); responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Could not change the password."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Could not change the password of the user: " + credentials.getUsername() + ". The Character Encoding is not supported."; log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }
Source:
<code>public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail != null && mRequestedEmail.equalsIgnoreCase(event.value)) { if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked error: " + event.error.type + " - " + event.error.message); showErrorDialog(getString(R.string.signup_email_error_generic)); } else { switch (event.type) { case EMAIL: ActivityUtils.hideKeyboard(getActivity()); if (mLoginListener != null) { if (event.isAvailable) { mLoginListener.showSignupMagicLink(event.value); } else { <START> mAnalyticsListener.trackAnalyticsSignIn(mAccountStore, mSiteStore, true); <END> mLoginListener.showSignupToLoginMessage(); mLoginListener.gotWpcomEmail(event.value); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); } } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event: " + event.error.type); break; } } } }</code><technical_language>this trackSignupEmailToLogin()</technical_language>

Target:
public void onAvailabilityChecked(OnAvailabilityChecked event) { if (mRequestedEmail != null && mRequestedEmail.equalsIgnoreCase(event.value)) { if (isInProgress()) { endProgress(); } if (event.isError()) { AppLog.e(T.API, "OnAvailabilityChecked error: " + event.error.type + " - " + event.error.message); showErrorDialog(getString(R.string.signup_email_error_generic)); } else { switch (event.type) { case EMAIL: ActivityUtils.hideKeyboard(getActivity()); if (mLoginListener != null) { if (event.isAvailable) { mLoginListener.showSignupMagicLink(event.value); } else { mAnalyticsListener.trackSignupEmailToLogin(); mLoginListener.showSignupToLoginMessage(); mLoginListener.gotWpcomEmail(event.value); mDispatcher.unregister(this); getActivity().getSupportFragmentManager().beginTransaction().remove(this).commit(); } } break; default: AppLog.e(T.API, "OnAvailabilityChecked unhandled event: " + event.error.type); break; } } } }
Source:
<code>public void testH2Text() throws Exception { int duration = 20 * 1000; final int keyCnt = 5000; final int logFreq = 50; final String txt = "Value"; <START> final int limit = 1000; <END> final GridCacheAdapter<Integer, H2TextValue> c = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME); IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() { @Override public Object call() throws Exception { for (int i = 0; i < keyCnt; i++) { c.getAndPut(i, new H2TextValue(txt)); if (i % logFreq == 0) X.println("Stored values: " + i); } return null; } }, 1); final CacheQuery<Map.Entry<Integer, H2TextValue>> qry = c.context().queries().createFullTextQuery( H2TextValue.class.getName(), txt, limit, false); qry.enableDedup(false); qry.includeBackups(false); qry.timeout(TEST_TIMEOUT); final AtomicBoolean stop = new AtomicBoolean(); IgniteInternalFuture<?> fut2 = multithreadedAsync(new Callable() { @Override public Object call() throws Exception { int cnt = 0; while (!stop.get()) { CacheQueryFuture<Map.Entry<Integer, H2TextValue>> qryFut = qry.execute(); int size = 0; while(qryFut.next() != null) size++; cnt++; if (cnt % logFreq == 0) { X.println("Result set: " + size); X.println("Executed queries: " + cnt); } } return null; } }, 1); Thread.sleep(duration); fut1.get(); stop.set(true); fut2.get(); }</code><technical_language>change behavior in test. arguments do it</technical_language>

Target:
public void testH2Text() throws Exception { int duration = 20 * 1000; final int keyCnt = 5000; final int logFreq = 50; final String txt = "Value"; final int limit = 0; final GridCacheAdapter<Integer, H2TextValue> c = ((IgniteKernal)grid(0)).internalCache(DEFAULT_CACHE_NAME); IgniteInternalFuture<?> fut1 = multithreadedAsync(new Callable() { @Override public Object call() throws Exception { for (int i = 0; i < keyCnt; i++) { c.getAndPut(i, new H2TextValue(txt)); if (i % logFreq == 0) X.println("Stored values: " + i); } return null; } }, 1); final CacheQuery<Map.Entry<Integer, H2TextValue>> qry = c.context().queries().createFullTextQuery( H2TextValue.class.getName(), txt, limit, false); qry.enableDedup(false); qry.includeBackups(false); qry.timeout(TEST_TIMEOUT); final AtomicBoolean stop = new AtomicBoolean(); IgniteInternalFuture<?> fut2 = multithreadedAsync(new Callable() { @Override public Object call() throws Exception { int cnt = 0; while (!stop.get()) { CacheQueryFuture<Map.Entry<Integer, H2TextValue>> qryFut = qry.execute(); int size = 0; while(qryFut.next() != null) size++; cnt++; if (cnt % logFreq == 0) { X.println("Result set: " + size); X.println("Executed queries: " + cnt); } } return null; } }, 1); Thread.sleep(duration); fut1.get(); stop.set(true); fut2.get(); }
Source:
<code>final public List<IDecoration> setDecorationsNode(List<IPapyrusDecoration> pDecorations, int margin, boolean isVolatile) { <START> decorations = new BasicEList<IDecoration>(); <END> for (IPapyrusDecoration pDecoration : pDecorations) { Image image = addDecorationNode(pDecoration, margin, isVolatile); if (image != null) { margin += image.getBounds().width; } } return decorations; }</code><technical_language>list is created instantiation, a simple clear() sufficient (Rather creating a new list time)</technical_language>

Target:
final public List<IDecoration> setDecorationsNode(List<IPapyrusDecoration> pDecorations, int margin, boolean isVolatile) { decorations.clear(); for (IPapyrusDecoration pDecoration : pDecorations) { Image image = addDecorationNode(pDecoration, margin, isVolatile); if (image != null) { margin += image.getBounds().width; } } return decorations; }
Source:
<code>protected String adjustPayloadBeforeSavingResource(ResourceManager mgr, CommandContext context, File f, String payload) { <START> payload = adjustPayloadBeforeSavingResource(mgr, context, f, payload); <END> if (removeRolesAndPermissionsDuringDeployment) { if (resourceMapper == null) { API api = new API(context.getManageClient(), context.getAdminManager()); resourceMapper = new DefaultResourceMapper(api); } Role role = resourceMapper.readResource(payload, Role.class); role.clearPermissionsAndRoles(); return role.getJson(); } return payload; }</code><technical_language>I this needs payload = super.adjustPayload, a stackoverflow error</technical_language>

Target:
protected String adjustPayloadBeforeSavingResource(ResourceManager mgr, CommandContext context, File f, String payload) { payload = super.adjustPayloadBeforeSavingResource(mgr, context, f, payload); if (removeRolesAndPermissionsDuringDeployment) { if (resourceMapper == null) { API api = new API(context.getManageClient(), context.getAdminManager()); resourceMapper = new DefaultResourceMapper(api); } Role role = resourceMapper.readResource(payload, Role.class); role.clearPermissionsAndRoles(); return role.getJson(); } return payload; }
Source:
<code>private List<Workflow> createServicesAndVersionsFromDockstoreYml(Service12 service, String repository, String gitReference, GitHubSourceCodeRepo gitHubSourceCodeRepo, User user, final SourceFile dockstoreYml) { final List<Workflow> updatedServices = new ArrayList<>(); if (service != null) { <START> final Path gitRefPath = Path.of(gitReference); final List<String> filters = service.getFilter(); Boolean isFiltered = !filters.isEmpty(); for (String filter : filters) { final PathMatcher pathMatcher = FileSystems.getDefault().getPathMatcher("glob:**/" + filter); if (pathMatcher.matches(gitRefPath)) { isFiltered = false; break; } } <END> if (isFiltered) { return updatedServices; } final DescriptorLanguageSubclass subclass = service.getSubclass(); Workflow workflow = createOrGetWorkflow(Service.class, repository, user, "", subclass.getShortName(), gitHubSourceCodeRepo); workflow = addDockstoreYmlVersionToWorkflow(repository, gitReference, dockstoreYml, gitHubSourceCodeRepo, workflow); updatedServices.add(workflow); } return updatedServices; }</code><technical_language>similar other part, combine somehow</technical_language>

Target:
private List<Workflow> createServicesAndVersionsFromDockstoreYml(Service12 service, String repository, String gitReference, GitHubSourceCodeRepo gitHubSourceCodeRepo, User user, final SourceFile dockstoreYml) { final List<Workflow> updatedServices = new ArrayList<>(); if (service != null) { if (!DockstoreYamlHelper.filterGitReference(Path.of(gitReference), service.getFilters())) { return updatedServices; } final DescriptorLanguageSubclass subclass = service.getSubclass(); Workflow workflow = createOrGetWorkflow(Service.class, repository, user, "", subclass.getShortName(), gitHubSourceCodeRepo); workflow = addDockstoreYmlVersionToWorkflow(repository, gitReference, dockstoreYml, gitHubSourceCodeRepo, workflow); updatedServices.add(workflow); } return updatedServices; }
Source:
<code>public Long getMegaByteMillis(Configuration jobConf) { if (jobConf == null) { throw new ProcessingException("JobConf is null, cannot calculate megabytemillis"); } Long Xmx75 = getXmxValue(jobConf.get(Constants.JAVA_CHILD_OPTS_CONF_KEY)); if (Xmx75 == 0L) { LOG.error("Xmx value is 0? check why"); throw new ProcessingException("Xmx value is 0! " + jobConf.get(Constants.JAVA_CHILD_OPTS_CONF_KEY)); } Long XmxTotal = getXmxTotal(Xmx75); Long mapSlotMillis = jobHistoryListener.getMapSlotMillis(); Long reduceSlotMillis = jobHistoryListener.getReduceSlotMillis(); LOG.trace("For " + jobKey.toString() + " \n Xmx " + XmxTotal + " " + ": " + mapSlotMillis + " \n " + ": " + reduceSlotMillis + " \n "); <START> Long mbMillis = XmxTotal * mapSlotMillis + XmxTotal * reduceSlotMillis; <END> return mbMillis; }</code><technical_language>AM's memory mentioned Line 111</technical_language>

Target:
public Long getMegaByteMillis(Configuration jobConf) { if (jobHistoryListener == null ) { LOG.error("Cannot call getMegaByteMillis before parsing the history file!"); return Constants.NOTFOUND_VALUE; } Long mapSlotMillis = jobHistoryListener.getMapSlotMillis(); Long reduceSlotMillis = jobHistoryListener.getReduceSlotMillis(); if (mapSlotMillis == Constants.NOTFOUND_VALUE || reduceSlotMillis == Constants.NOTFOUND_VALUE) { throw new ProcessingException("Cannot calculate megabytemillis " + " since mapSlotMillis " + mapSlotMillis + " or reduceSlotMillis " + reduceSlotMillis + " not found!"); } if (jobConf == null) { throw new ProcessingException("JobConf is null, cannot calculate megabytemillis"); } Long xmx75 = getXmxValue(jobConf.get(Constants.JAVA_CHILD_OPTS_CONF_KEY)); if (xmx75 == 0L) { xmx75 = Constants.DEFAULT_XMX_SETTING; LOG.info("Xmx value is 0, now presuming default Xmx size " + Constants.DEFAULT_XMX_SETTING); } Long xmxTotal = getXmxTotal(xmx75); LOG.trace("\n Xmx " + xmxTotal + ": " + mapSlotMillis + " \n " + ": " + reduceSlotMillis + " \n "); Long mbMillis = xmxTotal * mapSlotMillis + xmxTotal * reduceSlotMillis; return mbMillis; }
Source:
<code>Pair<Long, SortedMap<String, Long>> getValidDataSizeBySegment(TimeRange timeRange) { <START> TreeMap<String, Long> map = new TreeMap<>(); <END> long lastBucketEndTime = processTimeRange(timeRange); if (lastBucketEndTime != -1) { synchronized (swapLock) { for (String segmentName : segmentMap.keySet()) { map.put(segmentName, extractValidDataSize(segmentMap, segmentBuckets, segmentName, lastBucketEndTime)); } } return new Pair<>(lastBucketEndTime / time.MsPerSec, map); } else { return new Pair<>(-1L, map); } }</code><technical_language>SortedMap</technical_language>

Target:
public Pair<Long, SortedMap<String, Long>> getValidDataSizeBySegment(TimeRange timeRange) { checkForInitialScan(); SortedMap<String, Long> map; Long lastBucketEndTime = processTimeRange(timeRange); if (lastBucketEndTime != -1) { synchronized (swapLock) { map = scanResults.getValidDataSizePerSegment(lastBucketEndTime); } return new Pair<>(lastBucketEndTime / Time.MsPerSec, map); } else { return outOfBoundValidDataSizeBySegmentRequest(timeRange); } }
Source:
<code>private void updateConfig(AliasedDiscoveryConfig config, Node node) { NamedNodeMap attributes = node.getAttributes(); for (int a = 0; a < attributes.getLength(); a++) { Node att = attributes.item(a); String value = getTextContent(att).trim(); if ("enabled".equals(lowerCaseInternal(att.getNodeName()))) { config.setEnabled(getBooleanValue(value)); } else if (att.getNodeName().equals("connection-timeout-seconds")) { config.setProperty("connection-timeout-seconds", value); } } LowercaseHandler lowerCaseHandler = new LowercaseHandler(); for (Node n : childElements(node)) { lowerCaseHandler.put(n.getLocalName(), "eureka".equals(n.getParentNode().getLocalName())); <START> String key = cleanNodeName(n); <END> String value = getTextContent(n).trim(); String normalKey = lowerCaseHandler.get(key); if(normalKey != null) { config.setProperty(normalKey, value); } else { config.setProperty(key, value); } } }</code><technical_language>simply pass tag this metrod caller do need for handler? String key = cleanNodeName(n, !tag.equals("eureka")); [...] public static String cleanNodeName(final Node node, final boolean shouldLowerCase) { [...] } This put a "local" boolean a hashmap lookup for a lines in cycle, handler map feel unnecessary here</technical_language>

Target:
private void updateConfig(AliasedDiscoveryConfig config, Node node) { NamedNodeMap attributes = node.getAttributes(); for (int a = 0; a < attributes.getLength(); a++) { Node att = attributes.item(a); String value = getTextContent(att).trim(); if ("enabled".equals(lowerCaseInternal(att.getNodeName()))) { config.setEnabled(getBooleanValue(value)); } else if (att.getNodeName().equals("connection-timeout-seconds")) { config.setProperty("connection-timeout-seconds", value); } } for (Node n : childElements(node)) { String key = cleanNodeName(n, !"eureka".equals(n.getParentNode().getLocalName())); String value = getTextContent(n).trim(); config.setProperty(key, value); } }
Source:
<code>public void withSaveFilesBeforeCommand(final Command command, final Command cancelCommand, String commandSource) { if (userPrefs_.saveFilesBeforeBuild().getValue()) { saveUnsavedDocuments(command); } else { String alwaysSaveOption = !userPrefs_.saveFilesBeforeBuild().getValue() ? "Always save files before build" : null; ArrayList<UnsavedChangesTarget> unsavedSourceDocs = getUnsavedChanges(TYPE_FILE_BACKED); if (unsavedSourceDocs.size() > 0) { new UnsavedChangesDialog( commandSource, alwaysSaveOption, unsavedSourceDocs, new OperationWithInput<UnsavedChangesDialog.Result>() { public void execute(UnsavedChangesDialog.Result result) { if (result.getAlwaysSave()) { userPrefs_.saveFilesBeforeBuild().setGlobalValue(true); userPrefs_.writeUserPrefs(); } handleUnsavedChangesBeforeExit( result.getSaveTargets(), command); } }, cancelCommand <START> ).showModal(); <END> } else { command.execute(); } } }</code><technical_language>lambda: new UnsavedChangesDialog( commandSource, alwaysSaveOption, unsavedSourceDocs, dialogResult -> { if (dialogResult.getAlwaysSave()) { userPrefs_.saveFilesBeforeBuild().setGlobalValue(true); userPrefs_.writeUserPrefs(); } handleUnsavedChangesBeforeExit( dialogResult.getSaveTargets(), command); }, cancelCommand ).showModal();</technical_language>

Target:
public void withSaveFilesBeforeCommand(final Command command, final Command cancelCommand, String commandSource) { if (userPrefs_.saveFilesBeforeBuild().getValue()) { saveUnsavedDocuments(command); } else { String alwaysSaveOption = !userPrefs_.saveFilesBeforeBuild().getValue() ? "Always save files before build" : null; ArrayList<UnsavedChangesTarget> unsavedSourceDocs = getUnsavedChanges(TYPE_FILE_BACKED); if (unsavedSourceDocs.size() > 0) { new UnsavedChangesDialog( commandSource, alwaysSaveOption, unsavedSourceDocs, dialogResult -> { if (dialogResult.getAlwaysSave()) { userPrefs_.saveFilesBeforeBuild().setGlobalValue(true); userPrefs_.writeUserPrefs(); } handleUnsavedChangesBeforeExit( dialogResult.getSaveTargets(), command); }, cancelCommand ).showModal(); } else { command.execute(); } } }
Source:
<code>ResponseOutput(String responseId, String giver, String giverTeam, String relatedGiverEmail, String giverSection, String recipient, String recipientTeam, String recipientSection, FeedbackResponseDetails responseDetails, CommentOutput participantComment, List<CommentOutput> instructorComments) { this.responseId = responseId; this.giver = giver; this.relatedGiverEmail = relatedGiverEmail; this.giverTeam = giverTeam; this.giverSection = giverSection; this.recipient = recipient; this.recipientTeam = recipientTeam; this.recipientSection = recipientSection; this.responseDetails = responseDetails; <START> this.participantComment = null; <END> this.participantComment = participantComment; this.instructorComments = instructorComments; }</code><technical_language>This line here</technical_language>

Target:
ResponseOutput(String responseId, String giver, String giverTeam, String relatedGiverEmail, String giverSection, String recipient, String recipientTeam, String recipientSection, FeedbackResponseDetails responseDetails, CommentOutput participantComment, List<CommentOutput> instructorComments) { this.responseId = responseId; this.giver = giver; this.relatedGiverEmail = relatedGiverEmail; this.giverTeam = giverTeam; this.giverSection = giverSection; this.recipient = recipient; this.recipientTeam = recipientTeam; this.recipientSection = recipientSection; this.responseDetails = responseDetails; this.participantComment = participantComment; this.instructorComments = instructorComments; }
Source:
<code><START> public String publishRequest(String text) { <END> return text.trim(); }</code><technical_language>This a null pointer exception if text is null. calling "trim" here. Please remove trim() statement. "publish" methods alter data publishing</technical_language>

Target:
public String publishRequest(String text) { return text; }
Source:
<code>public final void run() { try (CloseableRestResponse response = artifactResolver.get(url)) { } catch (Exception e) { <START> LOGGER.error(e.getMessage(), e); <END> } }</code><technical_language>Cosmetic: loggers codebase lowercase. please change this? Thanks! :)</technical_language>

Target:
public final void run() { try (CloseableRestResponse response = artifactResolver.get(url)) { } catch (Exception e) { logger.error(e.getMessage(), e); } }
Source:
<code>private Map<String, SourceFile> processOtherImports(String repositoryId, String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface, String workingDirectoryForFile) { Map<String, SourceFile> imports = new HashMap<>(); <START> Pattern p = Pattern.compile("include.+?from.+?'.+?'", Pattern.DOTALL); <END> Matcher m = p.matcher(content); while (m.find()) { String path = getRelativeImportPathFromLine(m.group(), workingDirectoryForFile); String absoluteImportPath = convertRelativePathToAbsolutePath(workingDirectoryForFile, path); handleImport(repositoryId, version, imports, path, sourceCodeRepoInterface, absoluteImportPath); } Map<String, SourceFile> recursiveImports = new HashMap<>(); for (Map.Entry<String, SourceFile> importFile : imports.entrySet()) { final Map<String, SourceFile> sourceFiles = processOtherImports(repositoryId, importFile.getValue().getContent(), version, sourceCodeRepoInterface, importFile.getKey()); recursiveImports.putAll(sourceFiles); } recursiveImports.putAll(imports); return recursiveImports; }</code><technical_language>a static, Pattern.compile is expensive</technical_language>

Target:
private Map<String, SourceFile> processOtherImports(String repositoryId, String content, Version version, SourceCodeRepoInterface sourceCodeRepoInterface, String workingDirectoryForFile) { Map<String, SourceFile> imports = new HashMap<>(); Matcher m = IMPORT_PATTERN.matcher(content); while (m.find()) { String path = getRelativeImportPathFromLine(m.group(), workingDirectoryForFile); String absoluteImportPath = convertRelativePathToAbsolutePath(workingDirectoryForFile, path); handleImport(repositoryId, version, imports, path, sourceCodeRepoInterface, absoluteImportPath); } Map<String, SourceFile> recursiveImports = new HashMap<>(); for (Map.Entry<String, SourceFile> importFile : imports.entrySet()) { final Map<String, SourceFile> sourceFiles = processOtherImports(repositoryId, importFile.getValue().getContent(), version, sourceCodeRepoInterface, importFile.getKey()); recursiveImports.putAll(sourceFiles); } recursiveImports.putAll(imports); return recursiveImports; }
Source:
<code>protected final void unloadModuleLocal(Module module) throws SecurityException { <START> unloadModuleLocal(null, module); <END> }</code><technical_language>For sake of cleanness of contract maintainability, I vote for making new unloadModuleLocal() accept module name name module. proper unloadModuleLocal() lookup in moduleMap anyway</technical_language>

Target:
protected final void unloadModuleLocal(Module module) throws SecurityException { if (module == null) { throw new NullPointerException("Module parameter cannot be null"); } unloadModuleLocal(module.getName(), module); }
Source:
<code>public void testGetSetFileSecurityNoSACL() throws Exception { int infoType = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; int memSize = 64 * 1024; Memory memorySecurity = new Memory(memSize); IntByReference sizeNeeded = new IntByReference(0); File file = createTempFile(); String filePath = file.getAbsolutePath(); try { assertEquals("GetFileSecurity(" + filePath + ")", true, Advapi32.INSTANCE.GetFileSecurity( filePath, infoType, memorySecurity, memSize, sizeNeeded)); assertEquals("SetFileSecurity(" + filePath + ")", true, Advapi32.INSTANCE.SetFileSecurity( filePath, infoType, <START> memorySecurity.getPointer(0))); <END> } finally { file.delete(); } }</code><technical_language>This fails in test fix is easy: pass memorySecurity indirect it</technical_language>

Target:
public void testGetSetFileSecurityNoSACL() throws Exception { int infoType = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION; int memSize = 64 * 1024; Memory memorySecurity = new Memory(memSize); IntByReference sizeNeeded = new IntByReference(0); File file = createTempFile(); String filePath = file.getAbsolutePath(); try { assertEquals("GetFileSecurity(" + filePath + ")", true, Advapi32.INSTANCE.GetFileSecurity( filePath, infoType, memorySecurity, memSize, sizeNeeded)); assertEquals("SetFileSecurity(" + filePath + ")", true, Advapi32.INSTANCE.SetFileSecurity( filePath, infoType, memorySecurity)); } finally { file.delete(); } }
Source:
<code>InjectorConfig(InjectorRunner runner) { modules = Collections.unmodifiableList(new ArrayList<Module>(runner.getModules())); name = runner.getInjectorName(); <START> path = runner.getInjectorPath(); <END> parentName = runner.getParentName(); basePackage = runner.getBasePackage(); bundleFilter = runner.getBundleNameFilter(); }</code><technical_language>If path is null set "/apps/" + name</technical_language>

Target:
InjectorConfig(InjectorRunner runner) { modules = Collections.unmodifiableList(new ArrayList<Module>(runner.getModules())); name = runner.getInjectorName(); applicationPath = StringUtils.defaultIfEmpty(runner.getApplicationPath(), DEFAULT_INJECTOR_PATH + name); parentName = runner.getParentName(); basePackage = runner.getBasePackage(); bundleFilter = runner.getBundleNameFilter(); }
Source:
<code><START> protected Predicate<? super Entity> getEntityFilter() { <END> return getConfig(ENTITY_FILTER); }</code><technical_language>public instead, put in interface</technical_language>

Target:
public Predicate<? super Entity> getEntityFilter() { return getConfig(ENTITY_FILTER); }
Source:
<code>private void handleExpectioninMonitorLoop(Exception e) { if (mQuit == false) { if (e instanceof TimeoutException) { Log.e("DeviceMonitor", "Adb connection Error: timeout"); } else { Log.e("DeviceMonitor", "Adb connection Error:" + e.getMessage()); } mMonitoring = false; if (mMainAdbConnection != null) { try { mMainAdbConnection.close(); } catch (IOException ioe) { } mMainAdbConnection = null; <START> synchronized (AndroidDebugBridge.getLock()) { <END> synchronized (mDevices) { List<Device> listCopy = new ArrayList<Device>(mDevices.size()); listCopy.addAll(mDevices); for (Device device : listCopy) { removeDevice(device); mServer.deviceDisconnected(device); } } } } } }</code><technical_language>I source in front of me, I check do need acquire this lock</technical_language>

Target:
private void handleExpectioninMonitorLoop(Exception e) { if (mQuit == false) { if (e instanceof TimeoutException) { Log.e("DeviceMonitor", "Adb connection Error: timeout"); } else { Log.e("DeviceMonitor", "Adb connection Error:" + e.getMessage()); } mMonitoring = false; if (mMainAdbConnection != null) { try { mMainAdbConnection.close(); } catch (IOException ioe) { } mMainAdbConnection = null; synchronized (AndroidDebugBridge.getLock()) { synchronized (mDevices) { while (!mDevices.isEmpty()) { Device device = mDevices.remove(0); removeDevice(device); mServer.deviceDisconnected(device); } } } } } }
Source:
<code>public boolean isFinished() { boolean finished = (this.finished && probe == null && pageBuilder.isEmpty() && outputPage == null) || <START> isLookupSourceEmpty(); <END> if (finished) { close(); } return finished; }</code><technical_language>Instead of inspecting repeatedly lookup source is empty, leverage fact this information change, ever. So, instead of this change (and instead of introducing isLookupSourceEmpty method), inspect lookupSource once, in tryFetchLookupSourceProvider, set finishing flag LS is empty</technical_language>

Target:
public boolean isFinished() { boolean finished = this.finished && probe == null && pageBuilder.isEmpty() && outputPage == null; if (finished) { close(); } return finished; }