auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private static String findActiveNicName(VDS vds, Map<String, Map<String, Object>> bridges) { final String hostIp = NetworkUtils.getHostByIp(vds); final VdsNetworkInterface activeIface = resolveActiveNic(vds, hostIp); String hostActiveNic = (activeIface == null) ? null : activeIface.getName(); <START> final String activeBridge = findActiveBridge(hostIp, bridges); <END> if (activeBridge != null) { hostActiveNic = activeBridge; } return hostActiveNic; }</code><technical_language>reverse order of conditions importance ? { if (has bridge host id) { return bridge name; } activeNic = resolveActiveNic(); return ... }</technical_language>

Target:
private static String findActiveNicName(VDS vds, Map<String, Map<String, Object>> bridges) { final String hostIp = NetworkUtils.getHostByIp(vds); final String activeBridge = findActiveBridge(hostIp, bridges); if (activeBridge != null) { return activeBridge; } final VdsNetworkInterface activeIface = resolveActiveNic(vds, hostIp); String hostActiveNic = (activeIface == null) ? null : activeIface.getName(); return hostActiveNic; }
Source:
<code>protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (Guid.isNullOrEmpty(image.getStoragePoolId())) { image.setStoragePoolId(getStoragePoolId()); } if (Guid.isNullOrEmpty(getParameters().getSourceDomainId())) { <START> getParameters().setSourceDomainId(storageDomainDao.getMasterStorageDomainIdForPool(image.getStoragePoolId())); <END> } updateDiskSizeByQcowImageInfo(image); if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }</code><technical_language>is setting SD Master SD? if disk is Master SD some other random SD? I qemu-img fail import</technical_language>

Target:
protected void initImportClonedTemplateDisks() { for (DiskImage image : getImages()) { if (getParameters().isImportAsNewEntity()) { generateNewDiskId(image); updateManagedDeviceMap(image, getVmTemplate().getManagedDeviceMap()); } else { originalDiskIdMap.put(image.getId(), image.getId()); originalDiskImageIdMap.put(image.getId(), image.getImageId()); } } }
Source:
<code>public LibraryPage deleteNote(String noteText) { for (WebElement noteElement : notes) { Note note = new Note(noteElement.getText()); if (noteText.equals(note.getText())) { WebElement html = getHtmlElement(); WebElement deleteButton = noteElement.findElement(DELETE_NOTE_SELECTOR); deleteButton.click(); <START> waitExplicitly(500); <END> getDriver().findElement(By.id("ok")).click(); waitForPageRefresh(html); return new LibraryPage(getDriver()); } } throw new IllegalArgumentException("Note not found"); }</code><technical_language>wait for presence/visibility of "#ok" instead</technical_language>

Target:
public LibraryPage deleteNote(String noteText) { for (WebElement noteElement : notes) { Note note = new Note(noteElement.getText()); if (noteText.equals(note.getText())) { WebElement html = getHtmlElement(); WebElement deleteButton = noteElement.findElement(DELETE_NOTE_SELECTOR); deleteButton.click(); waitUntil(visibilityOf(getDriver().findElement(By.id("ok")))); getDriver().findElement(By.id("ok")).click(); waitForPageRefresh(html); return new LibraryPage(getDriver()); } } throw new IllegalArgumentException("Note not found"); }
Source:
<code>protected String extractRootPrefix(final String uri, final StringBuilder name) throws FileSystemException { <START> if (name.length() == 0 || name.charAt(0) == '/') { <END> throw new FileSystemException("vfs.provider.res/not-valid-resource-location.error", uri); } return "/"; }</code><technical_language>name.isEmpty() instead of name.length() == 0</technical_language>

Target:
protected String extractRootPrefix(final String uri, final StringBuilder name) throws FileSystemException { int index = 0; while (index < name.length() && name.charAt(index) == '/') { ++index; } if (index > 0) { name.delete(0, index); } if (name.length() == 0) { throw new FileSystemException("vfs.provider.res/not-valid-resource-location.error", uri); } return "/"; }
Source:
<code>private DocumentChangeListenerToken addDocumentChangeListener(Executor executor, DocumentChangeListener listener, String docID) { if (!docListenerTokens.containsKey(docID)) { <START> Set<DocumentChangeListenerToken> listeners = Collections.synchronizedSet(new HashSet<DocumentChangeListenerToken>()); <END> docListenerTokens.put(docID, listeners); registerC4DocObserver(docID); } DocumentChangeListenerToken token = new DocumentChangeListenerToken(executor, listener, docID); docListenerTokens.get(docID).add(token); return token; }</code><technical_language>need a synchronized set</technical_language>

Target:
private DocumentChangeListenerToken addDocumentChangeListener(Executor executor, DocumentChangeListener listener, String docID) { if (!docListenerTokens.containsKey(docID)) { Set<DocumentChangeListenerToken> listeners = new HashSet<>(); docListenerTokens.put(docID, listeners); registerC4DocObserver(docID); } DocumentChangeListenerToken token = new DocumentChangeListenerToken(executor, listener, docID); docListenerTokens.get(docID).add(token); return token; }
Source:
<code>public int getCount() { if (App.getInstance().isOrganizer()) { <START> return 4; <END> } else { return 3; } }</code><technical_language>While this, I get rid of this hard coded numbers. array store name of tabs, count size of array. do think? do :)</technical_language>

Target:
public int getCount() { return mPages.length; }
Source:
<code>public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); fFile = new File(path); try { <START> fFileInput = new RandomAccessFile(fFile, "r"); END> parseHeader(); } catch (IOException e) { } }</code><technical_language>Do want this RAF (no, Royal Air Force) read events? a separate, local (which pass parameter parseHeader), close opening "real" for events</technical_language>

Target:
public void initTrace(IResource resource, String path, Class<? extends ITmfEvent> type) throws TmfTraceException { super.initTrace(resource, path, type); fFile = new File(path); try { fFileInput = new RandomAccessFile(fFile, "r"); parseHeader(fFileInput); } catch (IOException e) { } }
Source:
<code>public void onTextMessage(@PathParam("name") String name, String text, Session session) throws IOException { String msg = name + " : " + text; <START> LOGGER.info("Received Text : " + text + " from " + name + session.getId()); <END> sendMessageToAll(msg); }</code><technical_language>need remove space colon</technical_language>

Target:
public void onTextMessage(@PathParam("name") String name, String text, Session session) throws IOException { String msg = name + " : " + text; logger.info("Received Text : " + text + " from " + name + session.getId()); sendMessageToAll(msg); }
Source:
<code>public CVSTag[] refreshDefinedTags(ICVSFolder folder, boolean recurse, IProgressMonitor monitor) throws TeamException { monitor = Policy.monitorFor(monitor); monitor.beginTask(null, recurse ? 210 : 100); try { CVSTag[] tags = null; if (!folder.getFolderSyncInfo().isVirtualDirectory()) { tags = fetchTagsUsingAutoRefreshFiles(folder, Policy.subMonitorFor(monitor, 50)); } if (tags == null || tags.length == 0) { tags = fetchTagsUsingLog(folder, Policy.subMonitorFor(monitor, 50)); } if (tags != null && tags.length > 0) { String remotePath = getRemotePathFor(folder); addTags(remotePath, tags); return tags; } if (recurse) { Set<CVSTag> tagsSet = new HashSet<>(); folder.fetchChildren(Policy.subMonitorFor(monitor, 10)); ICVSResource[] children = folder .members(ICVSFolder.FOLDER_MEMBERS); for (ICVSResource <START> children1 : <END> children) { tagsSet.addAll(Arrays.asList(refreshDefinedTags((ICVSFolder) children1, recurse, Policy .subMonitorFor(monitor, 100 / children.length)))); } tags = tagsSet.toArray(new CVSTag[tagsSet.size()]); } return tags; } finally { monitor.done(); } }</code><technical_language>child</technical_language>

Target:
public CVSTag[] refreshDefinedTags(ICVSFolder folder, boolean recurse, IProgressMonitor monitor) throws TeamException { monitor = Policy.monitorFor(monitor); monitor.beginTask(null, recurse ? 210 : 100); try { CVSTag[] tags = null; if (!folder.getFolderSyncInfo().isVirtualDirectory()) { tags = fetchTagsUsingAutoRefreshFiles(folder, Policy.subMonitorFor(monitor, 50)); } if (tags == null || tags.length == 0) { tags = fetchTagsUsingLog(folder, Policy.subMonitorFor(monitor, 50)); } if (tags != null && tags.length > 0) { String remotePath = getRemotePathFor(folder); addTags(remotePath, tags); return tags; } if (recurse) { Set<CVSTag> tagsSet = new HashSet<>(); folder.fetchChildren(Policy.subMonitorFor(monitor, 10)); ICVSResource[] children = folder .members(ICVSFolder.FOLDER_MEMBERS); for (ICVSResource child : children) { tagsSet.addAll(Arrays.asList(refreshDefinedTags((ICVSFolder) child, recurse, Policy .subMonitorFor(monitor, 100 / children.length)))); } tags = tagsSet.toArray(new CVSTag[tagsSet.size()]); } return tags; } finally { monitor.done(); } }
Source:
<code>public static String jsonFromAnnotation(Annotation annotation) throws JSONException { JSONArray positions = new JSONArray(); for (int i = 0; i < annotation.positions.size(); i++) { Box box = annotation.positions.get(i); JSONObject topLeft = null; JSONObject bottomRight = null; if (box.topLeft != null) { topLeft = new JSONObject(); topLeft.put("x", box.topLeft.x); topLeft.put("y", box.topLeft.y); } if (box.bottomRight != null) { bottomRight = new JSONObject(); bottomRight.put("x", box.bottomRight.x); bottomRight.put("y", box.bottomRight.y); } JSONObject bbox = new JSONObject(); bbox.put("top_left", topLeft); bbox.put("bottom_right", bottomRight); bbox.put("page", box.page); positions.put(i, bbox); } JSONObject color = new JSONObject(); color.put("r", Color.red(annotation.color)); color.put("g", Color.green(annotation.color)); color.put("b", Color.blue(annotation.color)); <START> <END> JSONObject jAnnotation = new JSONObject(); jAnnotation.put("id", annotation.id); jAnnotation.put("type", annotation.type.name); jAnnotation.put("previous_id", annotation.previousId); jAnnotation.put("color", color); jAnnotation.put("text", annotation.text); jAnnotation.put("profile_id", annotation.profileId); jAnnotation.put("positions", positions); jAnnotation.put("created", annotation.created); jAnnotation.put("last_modified", annotation.lastModified); jAnnotation.put("privacy_level", annotation.privacyLevel.name); jAnnotation.put("filehash", annotation.fileHash); jAnnotation.put("document_id", annotation.documentId); return jAnnotation.toString(); }</code><technical_language>extract formatting of sub-objects of annotation methods? a method for formatting / parsing objects part of other objects, for readability for avoiding replication. In this case important, I Points / Color in Annotations, for example parsing Person in points of code. This fixed "first-name parsing bug" in Person for Author, bug in remained unfixed in Person for Editor</technical_language>

Target:
public static String jsonFromAnnotation(Annotation annotation) throws JSONException { JSONArray positions = new JSONArray(); for (int i = 0; i < annotation.positions.size(); i++) { Box box = annotation.positions.get(i); positions.put(i, serializeBox(box)); } JSONObject jAnnotation = new JSONObject(); jAnnotation.put("id", annotation.id); jAnnotation.put("type", annotation.type.name); jAnnotation.put("previous_id", annotation.previousId); jAnnotation.put("color", serializeColor(annotation.color)); jAnnotation.put("text", annotation.text); jAnnotation.put("profile_id", annotation.profileId); jAnnotation.put("positions", positions); jAnnotation.put("created", annotation.created); jAnnotation.put("last_modified", annotation.lastModified); jAnnotation.put("privacy_level", annotation.privacyLevel.name); jAnnotation.put("filehash", annotation.fileHash); jAnnotation.put("document_id", annotation.documentId); return jAnnotation.toString(); }
Source:
<code><START> public static TLSClientParametersFactory getInstance() { <END> if (tlsCPFactory == null) { tlsCPFactory = new TLSClientParametersFactory(); } return tlsCPFactory; }</code><technical_language>Consider a Singleton pattern here. For example CONNECT codebase, X12EntityExceptionBuilder.java</technical_language>

Target:
public static TLSClientParametersFactory getInstance() { return tlsCPFactory; }
Source:
<code>public void onLoad() { super.onLoad(); keyHandler = Event.addNativePreviewHandler(event -> { NativeEvent nativeEvent = event.getNativeEvent(); if (breadCrumbs != null) { if (event.getTypeInt() == Event.ONKEYDOWN) { if (nativeEvent.getCharCode() == 's' || nativeEvent.getKeyCode() == KeyCodes.KEY_S) { if (nativeEvent.getCtrlKey() && nativeEvent.getAltKey()) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.toggleSearch(); event.cancel(); } } else if (!SimpleTabPanel.this.breadCrumbs.isSearchVisible() && nativeEvent.getKeyCode() == KeyCodes.KEY_DOWN) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.nextEntity(); event.cancel(); } else if (!SimpleTabPanel.this.breadCrumbs.isSearchVisible() && nativeEvent.getKeyCode() == KeyCodes.KEY_UP) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.previousEntity(); event.cancel(); } } } } ); if (breadCrumbs != null && breadCrumbsContainer.getWidgetCount() == 0) { <START> breadCrumbs.asWidget().getElement().getStyle().setHeight(83, Unit.PX); <END> breadCrumbsContainer.add(breadCrumbs); } if (actionPanel != null && mainActionPanel.getWidgetCount() == 0) { mainActionPanel.add(actionPanel); } }</code><technical_language>a css class</technical_language>

Target:
public void onLoad() { super.onLoad(); keyHandler = Event.addNativePreviewHandler(event -> { NativeEvent nativeEvent = event.getNativeEvent(); if (breadCrumbs != null) { if (event.getTypeInt() == Event.ONKEYDOWN) { if (nativeEvent.getCharCode() == 's' || nativeEvent.getKeyCode() == KeyCodes.KEY_S) { if (nativeEvent.getCtrlKey() && nativeEvent.getAltKey()) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.toggleSearch(); event.cancel(); } } else if (!SimpleTabPanel.this.breadCrumbs.isSearchVisible() && nativeEvent.getKeyCode() == KeyCodes.KEY_DOWN) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.nextEntity(); event.cancel(); } else if (!SimpleTabPanel.this.breadCrumbs.isSearchVisible() && nativeEvent.getKeyCode() == KeyCodes.KEY_UP) { nativeEvent.preventDefault(); nativeEvent.stopPropagation(); SimpleTabPanel.this.breadCrumbs.previousEntity(); event.cancel(); } } } } ); if (breadCrumbs != null && breadCrumbsContainer.getWidgetCount() == 0) { breadCrumbsContainer.add(breadCrumbs); } if (actionPanel != null && mainActionPanel.getWidgetCount() == 0) { mainActionPanel.add(actionPanel); } }
Source:
<code>public void handleCommand(ChannelUID channelUID, Command command) { if (command instanceof RefreshType) { logger.debug("Refreshing channel {}", channelUID); coapClient.asyncGet(this); return; } <START> logger.warn("The sensor is a read-only device and cannot handle commands."); <END> }</code><technical_language>reduce debug</technical_language>

Target:
public void handleCommand(ChannelUID channelUID, Command command) { if (command instanceof RefreshType) { logger.debug("Refreshing channel {}", channelUID); coapClient.asyncGet(this); return; } logger.debug("The sensor is a read-only device and cannot handle commands."); }
Source:
<code>public Comment post( @NotNull(message = "text should not be NULL") final String text ) throws IOException { this.storage.lock(); final int number; try { final String timestamp = new Github.Time().toString(); final String userrepo = this.repo.user() + "/" + this.repo.repo(); number = 1 + this.storage.xml() .nodes(" final String url = "<LINK_1>" + userrepo + "/issues/comments/" + number; this.storage.apply( new Directives().xpath(this.xpath()).add("comment") .add("number").set(Integer.toString(number)).up() <START> .add("url").set(url).up() <END> .add("body").set(text).up() .add("user") .add("login").set(this.self).up() .up() .add("created_at").set(timestamp).up() .add("updated_at").set(timestamp) ); } finally { this.storage.unlock(); } Logger.info( this, "comment #%d posted to issue #%d by %s: %[text]s", number, this.issue().number(), this.self, text ); return this.get(number); }</code><technical_language>avoid one-time variables. Please, inline url following: java .add("url") .set( String.format( "<LINK_0>", this.repo.user(), this.repo.repo(), number ) ) remove userrepo url variables</technical_language>

Target:
public Comment post( @NotNull(message = "text should not be NULL") final String text ) throws IOException { this.storage.lock(); final int number; try { final String timestamp = new Github.Time().toString(); number = 1 + this.storage.xml() .nodes(" this.storage.apply( new Directives().xpath(this.xpath()).add("comment") .add("number").set(Integer.toString(number)).up() .add("url") .set( String.format( "<LINK_0>", this.repo.user(), this.repo.repo(), number ) ) .up() .add("body").set(text).up() .add("user") .add("login").set(this.self).up() .up() .add("created_at").set(timestamp).up() .add("updated_at").set(timestamp) ); } finally { this.storage.unlock(); } Logger.info( this, "comment #%d posted to issue #%d by %s: %[text]s", number, this.issue().number(), this.self, text ); return this.get(number); }
Source:
<code>public static CachedTimelines createEmpty(){ <START> return new CachedTimelines(Collections.<Timeline>emptyList(), new String("")); <END> }</code><technical_language>need new String("");, "" is good enough</technical_language>

Target:
public static CachedTimelines createEmpty(){ return new CachedTimelines(Collections.<Timeline>emptyList(), ""); }
Source:
<code>private static void query(String token) { String s = skip(token); int c = s.indexOf(','); if (c >= 0) { Gerrit.display(token, new QueryScreen( s.substring(0, c), <START> Integer.parseInt(s.substring(c + 1)))); <END> } else { Gerrit.display(token, new QueryScreen(s, 0)); } }</code><technical_language>a lot of links ",n,z". This is fail those. I understand point breaking links specific sortkey tokens ,n,z is heavily bookmarked</technical_language>

Target:
private static void query(String token) { String s = skip(token); int c = s.indexOf(','); Screen screen; if (c >= 0) { String prefix = s.substring(0, c); if (!s.substring(c).equals(",n,z")) { screen = new QueryScreen(prefix, Integer.parseInt(s.substring(c + 1))); } else { screen = new QueryScreen(prefix, 0); } } else { screen = new QueryScreen(s, 0); } Gerrit.display(token, screen); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.action_append_playlist: appendAllToPlaylist(); return true; case R.id.action_system_audio: startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS)); return true; case R.id.action_switch_main: return switchTo(MainVideoPlayer.class); case R.id.action_set_timer: <START> try { updateTimer(this); } catch (Exception e) { e.printStackTrace(); Toast.makeText(getApplicationContext(), getString(R.string.error_setting_timer), Toast.LENGTH_SHORT).show(); } <END> return true; } return onPlayerOptionSelected(item) || super.onOptionsItemSelected(item); }</code><technical_language>able set timer due unknown exception is a critical error, is ok for crash app open bug report screen. this piece converted into: updateTimer(this);</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.action_append_playlist: appendAllToPlaylist(); return true; case R.id.action_system_audio: startActivity(new Intent(Settings.ACTION_SOUND_SETTINGS)); return true; case R.id.action_switch_main: return switchTo(MainVideoPlayer.class); case R.id.action_set_timer: updateTimer(this); return true; } return onPlayerOptionSelected(item) || super.onOptionsItemSelected(item); }
Source:
<code>public HttpUriRequest build() throws URISyntaxException { if (hasPathParameters()) { List<NameValuePair> paramList = createParamList(); String replacedPath = originalRelativePath; Iterator<NameValuePair> itor = paramList.iterator(); while (itor.hasNext()) { NameValuePair pair = itor.next(); String paramName = pair.getName(); if (replacedPath.contains("{" + paramName + "}")) { replacedPath = replacedPath.replaceAll( "\\{" + paramName + "\\}", pair.getValue()); <START> itor.remove(); <END> } } replacedRelativePath = replacedPath; nonPathParams = paramList; } return httpMethod.createFrom(this); }</code><technical_language>remove param pairs, list is again..</technical_language>

Target:
HttpUriRequest build() throws URISyntaxException { if (hasPathParameters()) { List<NameValuePair> paramList = createParamList(); String replacedPath = requestLine.getRelativePath(); Iterator<NameValuePair> itor = paramList.iterator(); while (itor.hasNext()) { NameValuePair pair = itor.next(); String paramName = pair.getName(); if (replacedPath.contains("{" + paramName + "}")) { replacedPath = replacedPath.replaceAll( "\\{" + paramName + "\\}", pair.getValue()); itor.remove(); } } replacedRelativePath = replacedPath; nonPathParams = paramList; } return requestLine.getHttpMethod().createFrom(this); }
Source:
<code>public void writeFloat(float v) { <START> final int bits = Float.floatToIntBits(v); <END> int newcount = ensureCapacity(4); final int s = pos; bytes[s] = (byte) (bits >> 24); bytes[s+1] = (byte) (bits >> 16); bytes[s+2] = (byte) (bits >> 8); bytes[s+3] = (byte) bits; pos = newcount; }</code><technical_language>writeInt(Float.floatToIntBits(v)) avoid code duplication</technical_language>

Target:
public void writeFloat(float v) { writeInt(Float.floatToIntBits(v)); }
Source:
<code>public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), writable.toString()); <START> if (hl7Recipient.getRecipientUsername() != null && hl7Recipient.getRecipientPassword() != null) { <END> iheTemplateService.sendTemplateToRecipientUrlWithBA(hl7Recipient, writable.toString()); } else { iheTemplateService.sendTemplateToRecipientUrl(hl7Recipient.getRecipientUrl(), writable.toString()); } }</code><technical_language>test this logic in unit test</technical_language>

Target:
public void handleAction(Map<String, Object> parameters) throws IOException, ClassNotFoundException, ParserConfigurationException, SAXException { String templateName = (String) parameters.get(Constants.TEMPLATE_NAME_PARAM); String recipientName = (String) parameters.get(Constants.RECIPIENT_NAME_PARAM); CdaTemplate cdaTemplate = iheTemplateDataService.findByName(templateName); if (cdaTemplate == null) { LOGGER.error("Cannot find template", templateName); throw new TemplateNotFoundException(templateName); } HL7Recipient hl7Recipient = hl7RecipientsService.getRecipientbyName(recipientName); if (hl7Recipient == null) { LOGGER.error("Cannot find recipient", recipientName); throw new RecipientNotFoundException(templateName); } Byte[] templateData = (Byte[]) iheTemplateDataService.getDetachedField(cdaTemplate, TEMPLATE_DATA_FIELD_NAME); StreamingTemplateEngine streamingTemplateEngine = new StreamingTemplateEngine(); Template template = streamingTemplateEngine.createTemplate(new String(ArrayUtils.toPrimitive(templateData))); Writable writable = template.make(parameters); LOGGER.info("Template with name {}:\n{}", cdaTemplate.getTemplateName(), writable.toString()); if (hl7Recipient.getRecipientUsername() != null && hl7Recipient.getRecipientPassword() != null) { iheTemplateService.sendTemplateToRecipientUrlWithBasicAuthentication(hl7Recipient, writable.toString()); } else { iheTemplateService.sendTemplateToRecipientUrl(hl7Recipient.getRecipientUrl(), writable.toString()); } }
Source:
<code>private static TypeData<?> getTypeData(final Method method) { if (isGetter(method.getName())) { return getTypeData(method.getGenericReturnType(), method.getReturnType()); } else { <START> if (method.getGenericParameterTypes().length != 1) { <END> throw new CodecConfigurationException(format("Invalid count of arguments for setter method: %s", method.getName())); } return getTypeData(method.getGenericParameterTypes()[0], method.getParameterTypes()[0]); } }</code><technical_language>A method starting "set" more parameter define a property, thrown exception</technical_language>

Target:
private static TypeData<?> getTypeData(final Method method) { if (isGetter(method)) { return getTypeData(method.getGenericReturnType(), method.getReturnType()); } else { return getTypeData(method.getGenericParameterTypes()[0], method.getParameterTypes()[0]); } }
Source:
<code>public MachineResolver build() { if (container == null || cheContainer == null || defaultSidecarMemoryLimitAttribute == null || defaultSidecarMemoryRequestAttribute == null || defaultSidecarCpuLimitAttribute == null || defaultSidecarCpuRequestAttribute == null || containerEndpoints == null || projectsRootPathEnvVar == null) { <START> throw new IllegalStateException(); <END> } return new MachineResolver( projectsRootPathEnvVar, container, cheContainer, defaultSidecarMemoryLimitAttribute, defaultSidecarMemoryRequestAttribute, defaultSidecarCpuLimitAttribute, defaultSidecarCpuRequestAttribute, containerEndpoints, component); }</code><technical_language>improve this giving some meaningful exception message</technical_language>

Target:
public MachineResolver build() { if (container == null || cheContainer == null || defaultSidecarMemoryLimitAttribute == null || defaultSidecarMemoryRequestAttribute == null || defaultSidecarCpuLimitAttribute == null || defaultSidecarCpuRequestAttribute == null || containerEndpoints == null || projectsRootPathEnvVar == null) { throw new IllegalStateException( "Unable to build MachineResolver because some fields are null"); } return new MachineResolver( projectsRootPathEnvVar, container, cheContainer, defaultSidecarMemoryLimitAttribute, defaultSidecarMemoryRequestAttribute, defaultSidecarCpuLimitAttribute, defaultSidecarCpuRequestAttribute, containerEndpoints, component); }
Source:
<code>public static void createWorkDefHeader(Composite comp, XFormToolkit toolkit, IAtsWorkItem workItem, int horizontalSpan) { Composite headerComp = new Composite(comp, SWT.NONE); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; headerComp.setLayoutData(gridData); <START> headerComp.setLayout(ALayout.getZeroMarginLayout(5, false)); <END> toolkit.adapt(headerComp); IAtsWorkDefinition workDef = workItem.getWorkDefinition(); Label label = FormsUtil.createLabelValue(toolkit, headerComp, "Work Definition: ", workDef.getName()); label.addListener(SWT.MouseDoubleClick, new Listener() { @Override public void handleEvent(Event event) { IWorkbenchPage page = AWorkbench.getActivePage(); try { page.showView("org.eclipse.ui.views.ContentOutline", null, IWorkbenchPage.VIEW_ACTIVATE); } catch (PartInitException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }); Label dragDropLabel = new Label(headerComp, SWT.NONE); dragDropLabel.setText("Drag/Drop Related Here: "); FormsUtil.setLabelFonts(dragDropLabel, FontManager.getDefaultLabelFont()); dragDropLabel.setLayoutData(new GridData()); toolkit.adapt(dragDropLabel, true, true); Label dragDropBox = new Label(headerComp, SWT.BORDER); new WfeDragAndDrop(dragDropBox, (AbstractWorkflowArtifact) workItem.getStoreObject(), WorkflowEditor.EDITOR_ID); dragDropBox.setText(" "); dragDropBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); toolkit.adapt(dragDropBox, true, true); dragDropBox.setBackground(getLightGreyColor()); }</code><technical_language>Variable</technical_language>

Target:
public static void createWorkDefHeader(Composite comp, XFormToolkit toolkit, IAtsWorkItem workItem, int horizontalSpan) { Composite headerComp = new Composite(comp, SWT.NONE); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalSpan = horizontalSpan; headerComp.setLayoutData(gridData); int numColumns = 5; headerComp.setLayout(ALayout.getZeroMarginLayout(numColumns, false)); toolkit.adapt(headerComp); IAtsWorkDefinition workDef = workItem.getWorkDefinition(); Label label = FormsUtil.createLabelValue(toolkit, headerComp, "Work Definition: ", workDef.getName()); label.addListener(SWT.MouseDoubleClick, new Listener() { @Override public void handleEvent(Event event) { IWorkbenchPage page = AWorkbench.getActivePage(); try { page.showView("org.eclipse.ui.views.ContentOutline", null, IWorkbenchPage.VIEW_ACTIVATE); } catch (PartInitException ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } } }); Label dragDropLabel = new Label(headerComp, SWT.NONE); dragDropLabel.setText("Drag/Drop Related Here: "); FormsUtil.setLabelFonts(dragDropLabel, FontManager.getDefaultLabelFont()); dragDropLabel.setLayoutData(new GridData()); toolkit.adapt(dragDropLabel, true, true); Label dragDropBox = new Label(headerComp, SWT.BORDER); new WfeDragAndDrop(dragDropBox, (AbstractWorkflowArtifact) workItem.getStoreObject(), WorkflowEditor.EDITOR_ID); dragDropBox.setText(" "); dragDropBox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); toolkit.adapt(dragDropBox, true, true); dragDropBox.setBackground(getLightGreyColor()); }
Source:
<code>public void remove(MapillaryAbstractImage image) { images.remove(image); if (getMultiSelectedImages().contains(image)) { setSelectedImage(null); } <START> image.getSequence().remove(image); <END> MapillaryLayer.invalidateInstance(); }</code><technical_language>(presumably) removing this null check is longer for image a sequence this point. fair, largely correct. However, this case (getSequence is final, overridden). getSequence final _or_ leave this null check. (I prefer latter)</technical_language>

Target:
public void remove(MapillaryAbstractImage image) { images.remove(image); if (getMultiSelectedImages().contains(image)) { setSelectedImage(null); } if (image.getSequence() != null) { image.getSequence().remove(image); } MapillaryLayer.invalidateInstance(); }
Source:
<code>private JsonObject getLatestReleaseElement() throws IOException { JsonElement doc = getPage(getApiUrl()); <START> for(int index = 0; index < doc.getAsJsonArray().size(); index++) { <END> JsonObject jsonObject = (JsonObject) doc.getAsJsonArray().get(index); if(jsonObject.get("zipball_url") != null) return jsonObject; } return null; }</code><technical_language>a for-each loop here? for (JsonElement jsonEle: doc.getAsJsonArray()){ // stuff }</technical_language>

Target:
private JsonObject getLatestReleaseElement() throws IOException { JsonElement doc = getPage(getApiUrl()); for(JsonElement jsonElement: doc.getAsJsonArray()) { JsonObject jsonObject = jsonElement.getAsJsonObject(); if(jsonObject.get("zipball_url") != null) return jsonObject; } return null; }
Source:
<code>public Observable<RealmResults<DynamicRealmObject>> from(DynamicRealm realm, final RealmResults<DynamicRealmObject> results) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<RealmResults<DynamicRealmObject>>() { @Override public void call(final Subscriber<? super RealmResults<DynamicRealmObject>> subscriber) { final DynamicRealm observableRealm = DynamicRealm.getInstance(realmConfig); resultsRefs.get().acquireReference(results); final RealmChangeListener<RealmResults<DynamicRealmObject>> listener = new RealmChangeListener<RealmResults<DynamicRealmObject>>() { @Override <START> public void onChange(RealmResults<DynamicRealmObject> object) { <END> if (!subscriber.isUnsubscribed()) { subscriber.onNext(results); } } }; results.addChangeListener(listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { results.removeChangeListener(listener); observableRealm.close(); resultsRefs.get().releaseReference(results); } })); subscriber.onNext(results); } }); }</code><technical_language>result object</technical_language>

Target:
public Observable<RealmResults<DynamicRealmObject>> from(DynamicRealm realm, final RealmResults<DynamicRealmObject> results) { final RealmConfiguration realmConfig = realm.getConfiguration(); return Observable.create(new Observable.OnSubscribe<RealmResults<DynamicRealmObject>>() { @Override public void call(final Subscriber<? super RealmResults<DynamicRealmObject>> subscriber) { final DynamicRealm observableRealm = DynamicRealm.getInstance(realmConfig); resultsRefs.get().acquireReference(results); final RealmChangeListener<RealmResults<DynamicRealmObject>> listener = new RealmChangeListener<RealmResults<DynamicRealmObject>>() { @Override public void onChange(RealmResults<DynamicRealmObject> result) { if (!subscriber.isUnsubscribed()) { subscriber.onNext(results); } } }; results.addChangeListener(listener); subscriber.add(Subscriptions.create(new Action0() { @Override public void call() { results.removeChangeListener(listener); observableRealm.close(); resultsRefs.get().releaseReference(results); } })); subscriber.onNext(results); } }); }
Source:
<code>public void useHostIDRequestAsCurrentHostNotBackendUser() throws DotDataException, DotSecurityException { final Host host = new SiteDataGen().nextPersisted(); final Host anotherHost = new SiteDataGen().nextPersisted(); final HttpServletRequest request = mock(HttpServletRequest.class); final HttpSession session = mock(HttpSession.class); setAllParametersAndAttributes(request, session, anotherHost); <START> when(request.getParameter("host_id")).thenReturn(host.getIdentifier()); <END> final User user = createUser(host); final HostWebAPIImpl hostWebAPI = new HostWebAPIImpl(); final Host currentHost = hostWebAPI.getCurrentHost(request, user); assertEquals(anotherHost.getIdentifier(), currentHost.getIdentifier()); verify(request).setAttribute(WebKeys.CURRENT_HOST, currentHost); verify(session, never()).setAttribute(anyString(), anyObject()); }</code><technical_language>constant HOST_ID_PARAMETER_NAME</technical_language>

Target:
public void useHostIDRequestAsCurrentHostNotBackendUser() throws DotDataException, DotSecurityException { final Host host = new SiteDataGen().nextPersisted(); final Host anotherHost = new SiteDataGen().nextPersisted(); final HttpServletRequest request = mock(HttpServletRequest.class); final HttpSession session = mock(HttpSession.class); setAllParametersAndAttributes(request, session, anotherHost); when(request.getParameter(HOST_ID_PARAMETER_NAME)).thenReturn(host.getIdentifier()); final User user = createUser(host); final HostWebAPIImpl hostWebAPI = new HostWebAPIImpl(); final Host currentHost = hostWebAPI.getCurrentHost(request, user); assertEquals(anotherHost.getIdentifier(), currentHost.getIdentifier()); verify(request).setAttribute(WebKeys.CURRENT_HOST, currentHost); verify(session, never()).setAttribute(anyString(), anyObject()); }
Source:
<code>private State getCommand(TellstickSensorEvent event, BigDecimal dValue, TellstickValueSelector selector) { State cmd = null; switch (event.getDataType()) { case TEMPERATURE: switch (selector) { case MOTION: cmd = OnOffType.ON; break; default: cmd = new DecimalType(dValue); } break; case HUMIDITY: switch (selector) { case BATTERY_LEVEL: cmd = new DecimalType(dValue); break; case HUMIDITY: default: <START> double val = Math.min(100, dValue.doubleValue()); <END> cmd = new PercentType((int) val); } break; case WINDAVERAGE: case WINDDIRECTION: case WINDGUST: case RAINRATE: case RAINTOTAL: cmd = new DecimalType(dValue); break; default: logger.warn("Event of type " + event.getDataType() + " does not have a mapping"); } return cmd; }</code><technical_language>stick BigDecimal "BigDecimal.HUNDRED.min(dValue)"</technical_language>

Target:
private State getCommand(TellstickSensorEvent event, BigDecimal dValue, TellstickValueSelector selector) { State cmd = null; switch (event.getDataType()) { case TEMPERATURE: switch (selector) { case MOTION: cmd = OnOffType.ON; break; default: cmd = new DecimalType(dValue); } break; case HUMIDITY: switch (selector) { case BATTERY_LEVEL: cmd = new DecimalType(dValue); break; case HUMIDITY: default: cmd = new PercentType(HUNDRED.min(dValue)); } break; case WINDAVERAGE: case WINDDIRECTION: case WINDGUST: case RAINRATE: case RAINTOTAL: cmd = new DecimalType(dValue); break; default: logger.warn("Event of type " + event.getDataType() + " does not have a mapping"); } return cmd; }
Source:
<code>public int compare(GenericRow row1, GenericRow row2) { RowKind kind1 = row1.getRowKind(); RowKind kind2 = row2.getRowKind(); if (kind1 != kind2) { <START> return kind1.ordinal() - kind2.ordinal(); <END> } else { Object key1 = TypeGetterSetters.get(row1, sortKeyIdx, sortKeyType); Object key2 = TypeGetterSetters.get(row2, sortKeyIdx, sortKeyType); if (key1 instanceof Comparable) { return ((Comparable) key1).compareTo(key2); } else { throw new UnsupportedOperationException(); } } }</code><technical_language>byte</technical_language>

Target:
public int compare(GenericRow row1, GenericRow row2) { RowKind kind1 = row1.getRowKind(); RowKind kind2 = row2.getRowKind(); if (kind1 != kind2) { return kind1.toByteValue() - kind2.toByteValue(); } else { Object key1 = TypeGetterSetters.get(row1, sortKeyIdx, sortKeyType); Object key2 = TypeGetterSetters.get(row2, sortKeyIdx, sortKeyType); if (key1 instanceof Comparable) { return ((Comparable) key1).compareTo(key2); } else { throw new UnsupportedOperationException(); } } }
Source:
<code>private void testSegmentSplitsHelperWithFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = filter(planBuilder, tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch), getRowExpression("city = 'Boston'", sessionHolder)); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); <START> ImmutableList<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); <END> PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, true)); }</code><technical_language>List<PinotColumnHandle></technical_language>

Target:
private void testSegmentSplitsHelperWithFilter(PinotTableHandle table, int segmentsPerSplit, int expectedNumSplits) { PinotConfig pinotConfig = new PinotConfig().setForbidBrokerQueries(false); SessionHolder sessionHolder = new SessionHolder(pinotConfig); PlanBuilder planBuilder = createPlanBuilder(sessionHolder); PlanNode plan = filter(planBuilder, tableScan(planBuilder, table, regionId, city, fare, secondsSinceEpoch), getRowExpression("city = 'Boston'", sessionHolder)); PinotQueryGenerator.PinotQueryGeneratorResult pinotQueryGeneratorResult = new PinotQueryGenerator(pinotConfig, typeManager, functionMetadataManager, standardFunctionResolution).generate(plan, sessionHolder.getConnectorSession()).get(); List<PinotColumnHandle> expectedHandles = ImmutableList.copyOf(pinotQueryGeneratorResult.getContext().getAssignments().values()); PinotQueryGenerator.GeneratedPql generatedPql = pinotQueryGeneratorResult.getGeneratedPql(); PinotTableHandle pinotTableHandle = new PinotTableHandle(table.getConnectorId(), table.getSchemaName(), table.getTableName(), Optional.of(false), Optional.of(expectedHandles), Optional.of(generatedPql)); List<PinotSplit> splits = getSplitsHelper(pinotTableHandle, segmentsPerSplit, false); assertSplits(splits, expectedNumSplits, SEGMENT); splits.forEach(s -> assertSegmentSplitWellFormed(s, true)); }
Source:
<code>@Override public final boolean permitsFieldGet(Field field, Object receiver) { String key = Whitelist.canonicalFieldSig(field); Boolean b = permittedCache.get(key); if (b != null) { return b; } <START> boolean output = false; <END> for (FieldSignature s : fieldSignatures()) { if (s.matches(field)) { output = true; break; } } permittedCache.put(key, output); return output; }</code><technical_language>Incompatible. move a static method a "superclass"; javac lookup chain, JVM AFAIK. EnumeratingWhitelist right place for I think</technical_language>

Target:
@Override public final boolean permitsFieldGet(Field field, Object receiver) { String key = canonicalFieldSig(field); Boolean b = permittedCache.get(key); if (b != null) { return b; } boolean output = false; for (FieldSignature s : fieldSignatures()) { if (s.matches(field)) { output = true; break; } } permittedCache.put(key, output); return output; }
Source:
<code>private void tryToAddVariant(final VariantContext vc, final ReferenceSequence refSeq, final VariantContext source) { if (!refSeq.getName().equals(vc.getContig())) { throw new IllegalStateException("The contig of the VariantContext, " + vc.getContig() + ", doesnt match the ReferenceSequence: " + refSeq.getName()); } boolean mismatchesReference = false; for (final Allele allele : vc.getAlleles()) { if (allele.isReference()) { final byte[] ref = refSeq.getBases(); final String refString = StringUtil.bytesToString(ref, vc.getStart() - 1, vc.getEnd() - vc.getStart() + 1); if (!refString.equalsIgnoreCase(allele.getBaseString())) { if (vc.isBiallelic() && vc.isSNP() && refString.equalsIgnoreCase(vc.getAlternateAllele(0).getBaseString())) { if (RECOVER_SWAPPED_REF_ALT){ totalRecoveredBySwapRefAlt++; addAndTrack(LiftoverUtils.swapRefAlt(vc, TAGS_TO_REVERSE, TAGS_TO_DROP), source); return; <START> } <END> else { totalNotRecoveredSwapRefAlt++; } } mismatchesReference = true; } break; } } if (mismatchesReference) { rejects.add(new VariantContextBuilder(source) .filter(FILTER_MISMATCHING_REF_ALLELE) .attribute(ATTEMPTED_LOCUS, String.format("%s:%d-%d", vc.getContig(), vc.getStart(), vc.getEnd())) .make()); failedAlleleCheck++; trackLiftedVariantContig(rejectsByContig, source.getContig()); } else { addAndTrack(vc, source); } }</code><technical_language>} else {</technical_language>

Target:
private void tryToAddVariant(final VariantContext vc, final ReferenceSequence refSeq, final VariantContext source) { if (!refSeq.getName().equals(vc.getContig())) { throw new IllegalStateException("The contig of the VariantContext, " + vc.getContig() + ", doesnt match the ReferenceSequence: " + refSeq.getName()); } boolean mismatchesReference = false; for (final Allele allele : vc.getAlleles()) { if (allele.isReference()) { final byte[] ref = refSeq.getBases(); final String refString = StringUtil.bytesToString(ref, vc.getStart() - 1, vc.getEnd() - vc.getStart() + 1); if (!refString.equalsIgnoreCase(allele.getBaseString())) { if (vc.isBiallelic() && vc.isSNP() && refString.equalsIgnoreCase(vc.getAlternateAllele(0).getBaseString())) { if (RECOVER_SWAPPED_REF_ALT) { totalTrackedAsSwapRefAlt++; addAndTrack(LiftoverUtils.swapRefAlt(vc, TAGS_TO_REVERSE, TAGS_TO_DROP), source); return; } else { totalTrackedAsSwapRefAlt++; } } mismatchesReference = true; } break; } } if (mismatchesReference) { rejects.add(new VariantContextBuilder(source) .filter(FILTER_MISMATCHING_REF_ALLELE) .attribute(ATTEMPTED_LOCUS, String.format("%s:%d-%d", vc.getContig(), vc.getStart(), vc.getEnd())) .make()); failedAlleleCheck++; trackLiftedVariantContig(rejectsByContig, source.getContig()); } else { addAndTrack(vc, source); } }
Source:
<code>private ListenableFuture<Void> initInternal(Context context, AppConfig appConfig) { <START> if (mInitialized.getAndSet(true)) { return Futures.immediateFuture(null); } <END> ListenableFuture<Void> future = CallbackToFutureAdapter.getFuture( completer -> { mCameraExecutor.execute(() -> { mContext = context.getApplicationContext(); mCameraFactory = appConfig.getCameraFactory(null); if (mCameraFactory == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing CameraFactory.")); } mSurfaceManager = appConfig.getDeviceSurfaceManager(null); if (mSurfaceManager == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing " + "CameraDeviceSurfaceManager.")); } mSurfaceManager.init(); mDefaultConfigFactory = appConfig.getUseCaseConfigRepository(null); if (mDefaultConfigFactory == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing " + "UseCaseConfigFactory.")); } if (mCameraExecutor instanceof CameraExecutor) { CameraExecutor executor = (CameraExecutor) mCameraExecutor; executor.init(mCameraFactory); } mCameraRepository.init(mCameraFactory); completer.set(null); }); return "CameraX initInternal"; }); return future; }</code><technical_language>If call initInternal() in succession, time return ImmediateFuture initialization in progress. need return in-progress future</technical_language>

Target:
private ListenableFuture<Void> initInternal(Context context, AppConfig appConfig) { if (mInitialized.getAndSet(true)) { return mInitInternalFuture; } mInitInternalFuture = CallbackToFutureAdapter.getFuture( completer -> { mCameraExecutor.execute(() -> { mContext = context.getApplicationContext(); mCameraFactory = appConfig.getCameraFactory(null); if (mCameraFactory == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing CameraFactory.")); return; } mSurfaceManager = appConfig.getDeviceSurfaceManager(null); if (mSurfaceManager == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing " + "CameraDeviceSurfaceManager.")); return; } mSurfaceManager.init(); mDefaultConfigFactory = appConfig.getUseCaseConfigRepository(null); if (mDefaultConfigFactory == null) { completer.setException(new IllegalStateException( "Invalid app configuration provided. Missing " + "UseCaseConfigFactory.")); return; } if (mCameraExecutor instanceof CameraExecutor) { CameraExecutor executor = (CameraExecutor) mCameraExecutor; executor.init(mCameraFactory); } mCameraRepository.init(mCameraFactory); completer.set(null); }); return "CameraX initInternal"; }); return mInitInternalFuture; }
Source:
<code>public Collection<String> getChangesByType(HelixConstants.ChangeType changeType) { assignPropertyMapByType(changeType); <START> return getChangedItems(); <END> }</code><technical_language>Is do calculation updateCahce()</technical_language>

Target:
public Collection<String> getChangesByType(HelixConstants.ChangeType changeType) { return _changedItems.computeIfAbsent(changeType, changedItems -> getChangedItems(determinePropertyMapByType(changeType, _oldSnapshot), determinePropertyMapByType(changeType, _newSnapshot))); }