auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void handleIQ(IQ packet, MUCRole role) throws ForbiddenException, ConflictException, NotAllowedException, CannotBeInvitedException { IQ reply = IQ.createResultIQ(packet); Element element = packet.getChildElement(); @SuppressWarnings("unchecked") List<Element> itemsList = element.elements("item"); if (!itemsList.isEmpty()) { handleItemsElement(role, itemsList, reply); <START> } else if (!itemsList.isEmpty() && !itemsList.toString().contains(packet.getFrom().toBareJID())) { <END> handleItemsElement(role, itemsList, reply); } else { reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.bad_request); } if (reply.getTo() != null) { router.route(reply); } }</code><technical_language>This invoked. condition is added evaluates true, condition in if statement added true. prevent else statement invoked</technical_language>

Target:
public void handleIQ(IQ packet, MUCRole role) throws ForbiddenException, ConflictException, NotAllowedException, CannotBeInvitedException { IQ reply = IQ.createResultIQ(packet); Element element = packet.getChildElement(); @SuppressWarnings("unchecked") List<Element> itemsList = element.elements("item"); if (!itemsList.isEmpty() && packet.getFrom() == null) { handleItemsElement(role, itemsList, reply); } else if (!itemsList.isEmpty() && !itemsList.toString().contains(packet.getFrom().toBareJID())) { handleItemsElement(role, itemsList, reply); } else { reply.setChildElement(packet.getChildElement().createCopy()); reply.setError(PacketError.Condition.bad_request); } if (reply.getTo() != null) { router.route(reply); } }
Source:
<code>private JComboBox getSymbolUOMComboBox(){ uoms = getUomProperties(); UomCombo puc = new UomCombo(((CategorizedPoint)getLegend()).getSymbolUom(), uoms, <START> I18N.tr(UNIT_OF_MEASURE + " - size :")); <END> puc.addActionListener( EventHandler.create(ActionListener.class, this, "updateSUComboBox", "source.selectedIndex")); return puc.getCombo(); }</code><technical_language>18N parser is able recognize static properties, set concatenation of string const a translation key</technical_language>

Target:
private JComboBox getSymbolUOMComboBox(){ uoms = getUomProperties(); UomCombo puc = new UomCombo(((CategorizedPoint)getLegend()).getSymbolUom(), uoms, I18N.tr("Symbol size unit")); puc.addActionListener( EventHandler.create(ActionListener.class, this, "updateSUComboBox", "source.selectedIndex")); return puc.getCombo(); }
Source:
<code>public void dispose() { if (connectionJob != null) { connectionJob.cancel(true); connectionJob = null; } scheduler.submit(() -> { if (device != null) { device.disconnect(); <START> device = null; <END> } }); super.dispose(); }</code><technical_language>Do care threading? device is set in thread calls initialize (in parent class), device is unset (set null) in a thread scheduler. So, volatile, some synchronization, ...</technical_language>

Target:
public void dispose() { if (connectionJob != null) { connectionJob.cancel(true); connectionJob = null; } scheduler.submit(() -> { try { deviceLock.lock(); if (device != null) { device.removeListener(this); device.disconnect(); device = null; } } finally { deviceLock.unlock(); } }); }
Source:
<code>public final void collision(final AbstractEntity collidee) { if (collidee instanceof Coin) { apCoin.play(); OBSERVABLE.notify(Category.PLAYER, <START> GameObserver.Player.COLLISION, Coin.class.getSimpleName()); <END> State.addScore(Coin.VALUE); State.addCoins(1); } if (collidee instanceof AbstractObstacle) { apDie.play(); OBSERVABLE.notify( Category.PLAYER, GameObserver.Player.COLLISION, AbstractObstacle.class.getSimpleName()); if (!isInvincible()) { die(); } } }</code><technical_language>I idea. created AudioPlayers in Player, while this is GUI handle. if a GameObserver checks Player is jumping/sliding/moving/etc, play sound Observer sends out update? This works, AudioPlayers play sound is a message Observable. <organization,review</technical_language>

Target:
public final void collision(final AbstractEntity collidee) { if (collidee instanceof Coin) { OBSERVABLE.notify(Category.PLAYER, GameObserver.Player.COLLISION, Coin.class.getSimpleName()); State.addScore(Coin.VALUE); State.addCoins(1); } if (collidee instanceof AbstractObstacle) { OBSERVABLE.notify( Category.PLAYER, GameObserver.Player.COLLISION, AbstractObstacle.class.getSimpleName()); if (!isInvincible()) { die(); } } }
Source:
<code>public RespondingGatewayPRPAIN201306UV02ResponseType respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 pdRequest, AssertionType assertion, NhinTargetCommunitiesType targetCommunities) { LOG.debug("Begin respondingGatewayPRPAIN201305UV02"); RespondingGatewayPRPAIN201306UV02ResponseType response = null; try { String url = getEndpointURL(); if (pdRequest == null) { LOG.error("PRPAIN201305UV02 was null"); } else if (assertion == null) { LOG.error("AssertionType was null"); } else if (targetCommunities == null) { LOG.error("NhinTargetCommunitiesType was null"); } else { RespondingGatewayPRPAIN201305UV02RequestType request = new RespondingGatewayPRPAIN201305UV02RequestType(); request.setPRPAIN201305UV02(pdRequest); request.setAssertion(assertion); request.setNhinTargetCommunities(targetCommunities); response = (RespondingGatewayPRPAIN201306UV02ResponseType) getClient(url, assertion).invokePort( EntityPatientDiscoveryPortType.class, "respondingGatewayPRPAIN201305UV02", request); } } catch (Exception ex) { <START> LOG.error("Error calling respondingGatewayPRPAIN201305UV02: " + ex.getMessage(), ex); <END> } LOG.debug("End respondingGatewayPRPAIN201305UV02"); return response; }</code><technical_language>missing log parameter</technical_language>

Target:
public RespondingGatewayPRPAIN201306UV02ResponseType respondingGatewayPRPAIN201305UV02(PRPAIN201305UV02 pdRequest, AssertionType assertion, NhinTargetCommunitiesType targetCommunities) { LOG.debug("Begin respondingGatewayPRPAIN201305UV02"); RespondingGatewayPRPAIN201306UV02ResponseType response = null; try { String url = getEndpointURL(); if (pdRequest == null) { LOG.error("PRPAIN201305UV02 was null"); } else if (assertion == null) { LOG.error("AssertionType was null"); } else if (targetCommunities == null) { LOG.error("NhinTargetCommunitiesType was null"); } else { RespondingGatewayPRPAIN201305UV02RequestType request = new RespondingGatewayPRPAIN201305UV02RequestType(); request.setPRPAIN201305UV02(pdRequest); request.setAssertion(assertion); request.setNhinTargetCommunities(targetCommunities); response = (RespondingGatewayPRPAIN201306UV02ResponseType) getClient(url, assertion).invokePort( EntityPatientDiscoveryPortType.class, "respondingGatewayPRPAIN201305UV02", request); } } catch (Exception ex) { LOG.error("Error calling respondingGatewayPRPAIN201305UV02: " , ex.getMessage(), ex); } LOG.debug("End respondingGatewayPRPAIN201305UV02"); return response; }
Source:
<code>public MessageArtifactTranslator(InputStream templateStream, JinjavaFactory jinjavaFactory) { if (templateStream == null) { this.jinjaTemplate = ""; } else { try { <START> this.jinjaTemplate = IOUtils.toString(templateStream, Charset.defaultCharset()); <END> } catch (IOException ioe) { throw new RuntimeException(ioe); } } this.jinjavaFactory = jinjavaFactory; }</code><technical_language>I feel super comfortable defaultCharset(), explicitly declare Charsets.UTF_8 instead</technical_language>

Target:
public MessageArtifactTranslator(InputStream templateStream, JinjavaFactory jinjavaFactory) { if (templateStream == null) { this.jinjaTemplate = ""; } else { try { this.jinjaTemplate = IOUtils.toString(templateStream, Charset.forName("UTF-8")); } catch (IOException ioe) { throw new RuntimeException(ioe); } } this.jinjavaFactory = jinjavaFactory; }
Source:
<code>public static void listResources(URI parent, Consumer<Path> consumer) throws IOException { FileSystem fileSystem = null; try { <START> if (!parent.getScheme().equals("file")) { <END> try { fileSystem = FileSystems.newFileSystem(parent, Collections.emptyMap()); } catch (FileSystemAlreadyExistsException ignore) { } } Path root = Paths.get(parent); Files.list(root).forEach(consumer); } finally { if (fileSystem != null) { fileSystem.close(); } } }</code><technical_language>If is provided URI is relative this line throws NPE, argument left side instead</technical_language>

Target:
public static void listResources(URI parent, Consumer<Path> consumer) throws IOException { FileSystem fileSystem = null; try { if (!"file".equals(parent.getScheme())) { try { fileSystem = FileSystems.newFileSystem(parent, Collections.emptyMap()); } catch (FileSystemAlreadyExistsException ignore) { } } Path root = Paths.get(parent); Files.list(root).forEach(consumer); } finally { if (fileSystem != null) { fileSystem.close(); } } }
Source:
<code>public void verifyBackLinkFunctionality(int anchorIndex) { waitForElementVisibleByElement(chevrons.get(anchorIndex)); <START> if (chevrons.size() != 0) { <END> chevrons.get(anchorIndex).click(); waitForElementVisibleByElement(backChevron); backChevron.click(); PageObjectLogging.log("verifyBackLinkFunctionality", "Back button is working", true, driver); } }</code><technical_language>is this check necessary chevrons.get(index) is called prior this</technical_language>

Target:
public void verifyBackLinkFunctionality(int anchorIndex) { waitForElementVisibleByElement(chevrons.get(anchorIndex)); chevrons.get(anchorIndex).click(); waitForElementVisibleByElement(backChevron); backChevron.click(); PageObjectLogging.log("verifyBackLinkFunctionality", "Back button is working", true, driver); }
Source:
<code>protected void setUp() throws Exception { super.setUp(); changePlatformUIPreference(IWorkbenchPreferenceConstants.PROMPT_WHEN_SAVEABLE_STILL_OPEN, true); changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_RELOAD_ON_LAST_EDITOR_CLOSE.name(), true); changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_SAVE_WHEN_NO_EDITOR.name(), true); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, ZOOM_SEMANTIC_MODEL_FOLDER_PATH, ZOOM_SEMANTIC_MODEL_NAME); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PACKAGES_SEMANTIC_MODEL_FOLDER_PATH, PACKAGES_SEMANTIC_MODEL_NAME); String alternativeSessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "alternativeSession.aird"; genericSetUp(TEMPORARY_PROJECT_NAME + "/" + ZOOM_SEMANTIC_MODEL_NAME, MODELER_PATH, alternativeSessionResourcePath); alternateSession = session; alternateSemanticModel = alternateSession.getSemanticResources().iterator().next().getContents().get(0); initViewpoint(DESIGN_VIEWPOINT_NAME, alternateSession, alternateSemanticModel); TestsUtil.emptyEventsFromUIThread(); String sessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "session.aird"; genericSetUp(TEMPORARY_PROJECT_NAME + "/" + PACKAGES_SEMANTIC_MODEL_NAME, MODELER_PATH, sessionResourcePath); initViewpoint(DESIGN_VIEWPOINT_NAME); TestsUtil.emptyEventsFromUIThread(); Job.getJobManager().join(SaveSessionJob.FAMILY, new NullProgressMonitor()); <START> session.save(new NullProgressMonitor()); <END> mock = createMock(SessionManagerListener.class); makeThreadSafe(mock, true); SessionManager.INSTANCE.addSessionsListener(mock); }</code><technical_language>Is this necessary join above</technical_language>

Target:
protected void setUp() throws Exception { super.setUp(); changePlatformUIPreference(IWorkbenchPreferenceConstants.PROMPT_WHEN_SAVEABLE_STILL_OPEN, true); changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_RELOAD_ON_LAST_EDITOR_CLOSE.name(), true); changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_SAVE_WHEN_NO_EDITOR.name(), true); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, ZOOM_SEMANTIC_MODEL_FOLDER_PATH, ZOOM_SEMANTIC_MODEL_NAME); copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PACKAGES_SEMANTIC_MODEL_FOLDER_PATH, PACKAGES_SEMANTIC_MODEL_NAME); String alternativeSessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "alternativeSession.aird"; genericSetUp(TEMPORARY_PROJECT_NAME + "/" + ZOOM_SEMANTIC_MODEL_NAME, MODELER_PATH, alternativeSessionResourcePath); alternateSession = session; alternateSemanticModel = alternateSession.getSemanticResources().iterator().next().getContents().get(0); initViewpoint(DESIGN_VIEWPOINT_NAME, alternateSession, alternateSemanticModel); TestsUtil.emptyEventsFromUIThread(); String sessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "session.aird"; genericSetUp(TEMPORARY_PROJECT_NAME + "/" + PACKAGES_SEMANTIC_MODEL_NAME, MODELER_PATH, sessionResourcePath); initViewpoint(DESIGN_VIEWPOINT_NAME); TestsUtil.emptyEventsFromUIThread(); session.save(new NullProgressMonitor()); mock = createMock(SessionManagerListener.class); makeThreadSafe(mock, true); SessionManager.INSTANCE.addSessionsListener(mock); }
Source:
<code>public StoringMappingIdGenerator(IdMappingStore idMappingStore, IdGenerator delegate) { <START> this.idMappingStore = idMappingStore; <END> this.delegate = delegate; }</code><technical_language>checkNotNull</technical_language>

Target:
public StoringMappingIdGenerator(IdMappingStore idMappingStore, IdGenerator delegate) { this.idMappingStore = checkNotNull(idMappingStore); this.delegate = checkNotNull(delegate); }
Source:
<code>private List<String> validateFilterOption( String moduleName, String filterOption, String testGroup) { List<String> errors = new ArrayList<>(); Set<Filters> filterTypes = new HashSet<>(); Map<Filters, Set<TestInfo>> filterTestInfos = new HashMap<>(); for (TestInfo test : getTestInfos(moduleName, testGroup)) { for (TestOption options : test.getOptions()) { if (options.getName().equals(filterOption)) { Filters optionType = getOptionType(options.getValue()); filterTestInfos.computeIfAbsent(optionType, k -> new HashSet<>()).add(test); } } } filterTypes = filterTestInfos.keySet(); <START> if (!(filterTypes.isEmpty() || filterTypes.size() == 1)) { <END> errors.add( String.format( "Mixed filter types found. Test: %s , TestGroup: %s, Details:\n" + "%s", moduleName, testGroup, getDetailedErrors(filterOption, filterTestInfos))); } return errors; }</code><technical_language>if (filterTypes.size() > 1)</technical_language>

Target:
private List<String> validateFilterOption( String moduleName, String filterOption, String testGroup) { List<String> errors = new ArrayList<>(); Set<Filters> filterTypes = new HashSet<>(); Map<Filters, Set<TestInfo>> filterTestInfos = new HashMap<>(); for (TestInfo test : getTestInfos(moduleName, testGroup)) { for (TestOption options : test.getOptions()) { if (options.getName().equals(filterOption)) { Filters optionType = getOptionType(options.getValue()); filterTestInfos.computeIfAbsent(optionType, k -> new HashSet<>()).add(test); } } } filterTypes = filterTestInfos.keySet(); if (filterTypes.size() > 1) { errors.add( String.format( "Mixed filter types found. Test: %s , TestGroup: %s, Details:\n" + "%s", moduleName, testGroup, getDetailedErrors(filterOption, filterTestInfos))); } return errors; }
Source:
<code>public void openInNewContext(EObject eObject) { if (RootObject.class.cast(treeViewer.getInput()).getRoot() == eObject) { treeViewer.setSelection(new StructuredSelection(eObject), true); return; } final AdapterFactoryContentProvider contentProvider = AdapterFactoryContentProvider.class.cast(treeViewer .getContentProvider()); final Object[] children = contentProvider.getChildren(RootObject.class.cast(treeViewer.getInput()) .getRoot()); <START> if (containsData(contentProvider, children, eObject)) { <END> treeViewer.setSelection(new StructuredSelection(eObject), true); return; } if (delegate == null) { return; } delegate.openInNewContext(eObject); }</code><technical_language>Doesnt set selection reveal return a boolean, element revelead selected? If so, this expensive check avoided..</technical_language>

Target:
public void openInNewContext(EObject eObject) { treeViewer.setSelection(new StructuredSelection(new Integer(1)), true); final ISelection selection = treeViewer.getSelection(); if (!selection.isEmpty()) { return; } if (delegate == null) { return; } delegate.openInNewContext(eObject); }
Source:
<code>public void selectLanguage(String lang) { wait.forElementClickable(wikiLanguageDropdown); new Actions(driver).moveToElement(wikiLanguageDropdown).perform(); List<WebElement> langList = wikiLanguageList.findElements(By.cssSelector("li:not(.spacer)")); String langSelector = lang + ":"; for (WebElement selectedLanguage : langList) { String selectedLanguageText = selectedLanguage.getText(); if (selectedLanguageText.contains(langSelector)) { wait.forElementClickable(selectedLanguage); selectedLanguage.click(); PageObjectLogging .log("selectLanguage", "selected " + selectedLanguageText + " language", true, driver); break; <START> } <END> } }</code><technical_language>wrong it</technical_language>

Target:
public void selectLanguage(String lang) { jsActions.scrollToElement(wait.forElementClickable(wikiLanguageDropdown)); String langSelector = lang + ":"; WebElement langElementInDropdown = wikiLanguageList.stream() .filter(e -> e.getAttribute("innerHTML").trim().contains(langSelector)).findAny() .orElseThrow(() -> new WebDriverException(String.format("Couldn't find language [%s]", lang))); hover(wikiLanguageDropdown); langElementInDropdown.click(); PageObjectLogging .log("selectLanguage", "selected " + langElementInDropdown.getAttribute("innerHTML").trim() + " language", true, driver); }
Source:
<code>public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); Double retVal = NullHandling.replaceWithDefault() ? Double.NEGATIVE_INFINITY : null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); <START> if (nextVal != null && COMPARATOR.compare(nextVal.doubleValue(), retVal) > 0) { <END> retVal = nextVal.doubleValue(); } } return retVal; }</code><technical_language>This code performs unnecessary unboxing/boxing cycles. I suggest Comparator.comparingDouble(Number::doubleValue) COMPARATOR, special-case retVal == null</technical_language>

Target:
public Object compute(Map<String, Object> values) { Iterator<PostAggregator> fieldsIter = fields.iterator(); Double retVal = NullHandling.replaceWithDefault() ? Double.NEGATIVE_INFINITY : null; while (fieldsIter.hasNext()) { Number nextVal = ((Number) fieldsIter.next().compute(values)); if (nextVal != null && (retVal == null || COMPARATOR.compare(nextVal, retVal) > 0)) { if (nextVal instanceof Double) { retVal = (Double) nextVal; } else { retVal = nextVal.doubleValue(); } } } return retVal; }
Source:
<code>public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); try { connection.connect(); String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("Unable to establish SSH connection for %s@%s on port %d", config.user, config.host, config.port)); } <START> LOG.info(String.format("Connection established with the host %s", config.host)); <END> Session session = connection.openSession(); session.execCommand(config.cmd); InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr)); StringBuilder outBuilder = new StringBuilder(); StringBuilder errBuilder = new StringBuilder(); String line = outBuffer.readLine(); while (line != null) { outBuilder.append(line).append("\n"); line = outBuffer.readLine(); } line = errBuffer.readLine(); while (line != null) { errBuilder.append(line).append("\n"); line = errBuffer.readLine(); } LOG.info("Output: {}", outBuilder.toString()); LOG.info("Errors: {}", errBuilder.toString()); if (config.output != null) { context.getArguments().set(config.output, outBuilder.toString()); } session.close(); } finally { connection.close(); } }</code><technical_language>String.format logger. place holder instead. LOG.info("Connection established host {}", config.host);</technical_language>

Target:
public void run(final ActionContext context) throws Exception { Connection connection = new Connection(config.host); Session session = connection.openSession(); try { connection.connect(); String password = Strings.isNullOrEmpty(config.password) ? null : config.password; if (!connection.authenticateWithPublicKey(config.user, new File(config.privateKeyFile), password)) { throw new IOException(String.format("SSH authentication error when connecting to %s@%s on port %d", config.user, config.host, config.port)); } LOG.debug("Connection established with the host {}", config.host); session.execCommand(config.command); InputStream stdout = new StreamGobbler(session.getStdout()); BufferedReader outBuffer = new BufferedReader(new InputStreamReader(stdout, Charsets.UTF_8)); InputStream stderr = new StreamGobbler(session.getStderr()); BufferedReader errBuffer = new BufferedReader(new InputStreamReader(stderr, Charsets.UTF_8)); String out = CharStreams.toString(outBuffer); String err = CharStreams.toString(errBuffer); LOG.debug("Output: {}", out); LOG.error("Errors: {}", err); if (config.output != null) { context.getArguments().set(config.output, out); } } finally { connection.close(); } }
Source:
<code>public void run() { Thread.yield(); try { final String rawLastCheck = this.config.lastCheck(); final long lastCheck = Long.parseLong( rawLastCheck ); final Date now = new Date(); final long nowInMs = now.getTime(); final long intervalInMs = this.config.interval() * SEC_TO_HOUR * MS_TO_SEC; final long lastAfterInterval = lastCheck + intervalInMs; this.processInterval( nowInMs, lastAfterInterval ); AELog.info( "Stopping AE2 VersionChecker" ); } <START> catch( Exception e ) <END> { AELog.error( e ); } }</code><technical_language>Exception pretty sure,</technical_language>

Target:
public void run() { try { Thread.yield(); this.config.save(); final String rawLastCheck = this.config.lastCheck(); final long lastCheck = Long.parseLong( rawLastCheck ); final Date now = new Date(); final long nowInMs = now.getTime(); final long intervalInMs = this.config.interval() * SEC_TO_HOUR * MS_TO_SEC; final long lastAfterInterval = lastCheck + intervalInMs; this.processInterval( nowInMs, lastAfterInterval ); } catch( Exception exception ) { AELog.error( exception ); } AELog.info( "Stopping AE2 VersionChecker" ); }
Source:
<code>public List<Double> execute() throws SAXException, IOException, ParserConfigurationException, FeatureFinderMetaboException { List<Double> mzValuesResult = new ArrayList<Double>(); <START> if (!OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME.equals(null)) { <END> createTempFeatureXMLFile(); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(FEATURE_XML_FILE); doc.getDocumentElement().normalize(); NodeList featureMap = doc.getElementsByTagName("featureMap").item(0).getChildNodes(); NodeList featureList = null; for (int i = 0; i < featureMap.getLength(); i++) { Node node = featureMap.item(i); if (node.getNodeName().equals("featureList")) featureList = node.getChildNodes(); } for (int i = 0; i < featureList.getLength(); i++) { Node node = featureList.item(i); if (node.getNodeName().equals("feature")) { Element featureElement = (Element) node; mzValuesResult.add( Double.valueOf(featureElement.getElementsByTagName("position").item(1).getTextContent())); } } } else { throw new FeatureFinderMetaboException( "FeatureFinderMetabo library not found. Please install OpenMS and add FeatureFinderMetabo to Path."); } return mzValuesResult; }</code><technical_language>Instead of checking !OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME, check for OPENMS_FEATURE_FINDER_METABO_LIBRARY_NAME fail quickly. This avoid long nested _if_ clauses</technical_language>

Target:
public List<Double> execute() throws SAXException, IOException, ParserConfigurationException, MSDKException { List<Double> mzValuesResult = new ArrayList<Double>(); createTempFeatureXMLFile(); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(FEATURE_XML_FILE); doc.getDocumentElement().normalize(); NodeList featureMap = doc.getElementsByTagName("featureMap").item(0).getChildNodes(); NodeList featureList = null; for (int i = 0; i < featureMap.getLength(); i++) { Node node = featureMap.item(i); if (node.getNodeName().equals("featureList")) featureList = node.getChildNodes(); } for (int i = 0; i < featureList.getLength(); i++) { Node node = featureList.item(i); if (node.getNodeName().equals("feature")) { Element featureElement = (Element) node; mzValuesResult .add(Double.valueOf(featureElement.getElementsByTagName("position").item(1).getTextContent())); } } return mzValuesResult; }
Source:
<code><START> private Predicate<ItemDefinition> typeRefIsCustom(final QName typeRef) { return itemDef -> itemDef.getName().getValue().equals(typeRef.getLocalPart()); } <END></code><technical_language>please reimplement Objects.equals? throw NPE in case itemDef.GetName().getValue() typeRef.getLocalPart() null. java private Predicate<ItemDefinition> typeRefIsCustom(final QName typeRef) { return itemDef -> Objects.equals(itemDef.getName().getValue(), typeRef.getLocalPart()); }</technical_language>

Target:
private Predicate<ItemDefinition> typeRefIsCustom(final QName typeRef) { return itemDef -> Objects.equals(itemDef.getName().getValue(), typeRef.getLocalPart()); }
Source:
<code>public final List<A> minus(final Equal<A> eq, final List<A> xs) { return this.removeAll(compose(Monoid.disjunctionMonoid.sumLeft(), xs.mapM(Function.<A, A, Boolean>curry(eq.eq())))); <START> } <END></code><technical_language>Hmm, I suprised this is case. I Intellij 14.0.2. Yourself</technical_language>

Target:
public final List<A> minus(final Equal<A> eq, final List<A> xs) { return removeAll(compose(Monoid.disjunctionMonoid.sumLeft(), xs.mapM(curry(eq.eq())))); }
Source:
<code>public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT && (delta.getKind() == IResourceDelta.REMOVED || <START> delta .getKind() == IResourceChangeEvent.PRE_DELETE)) <END> { atLeastOneInterestingDelta = true; return false; } if (resource.getType() == IResource.FOLDER && delta.getKind() == IResourceDelta.ADDED) { atLeastOneInterestingDelta = true; return false; } if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }</code><technical_language>This set event. A PRE_DELETE event a delta, get here. remove this</technical_language>

Target:
public boolean visit(IResourceDelta delta) throws CoreException { if (atLeastOneInterestingDelta) { return false; } final IResource resource = delta.getResource(); if (resource.getType() == IResource.ROOT) { return true; } if (resource.getType() == IResource.PROJECT && (delta.getKind() == IResourceDelta.REMOVED)) { atLeastOneInterestingDelta = true; return false; } if (resource.getType() == IResource.FOLDER && delta.getKind() == IResourceDelta.ADDED) { atLeastOneInterestingDelta = true; return false; } if (GitResourceDeltaVisitor.isInteresting(delta)) { atLeastOneInterestingDelta = true; return false; } return true; }
Source:
<code>public void testAllocationDeallocationMemory() { fModule.schedule(); fModule.waitForCompletion(); ITmfStateSystem ss = fModule.getStateSystem(); assertNotNull(ss); assertEquals(1L, ss.getStartTime()); assertEquals(30L, ss.getCurrentEndTime()); long totalMemory = 0; threadEvent.put(1L, PAGE_SIZE); threadEvent.put(2L, -PAGE_SIZE); threadEvent.put(3L, -PAGE_SIZE); threadEvent.put(17L, PAGE_SIZE); threadEvent.put(22L, -PAGE_SIZE); threadEvent.put(28L, -PAGE_SIZE); threadEvent.put(29L, PAGE_SIZE); threadEvent.put(30L, PAGE_SIZE); for (Map.Entry<Long, Long> entry : threadEvent.entrySet()) { try { <START> ITmfStateInterval kernelState = ss.querySingleState(entry.getKey(), 0); <END> long value = kernelState.getStateValue().unboxLong(); totalMemory += entry.getValue(); assertEquals(totalMemory, value); } catch (StateSystemDisposedException | AttributeNotFoundException e) { fail(e.getMessage()); } } }</code><technical_language>I guess 0 is attribute quark? get quark calling getQuarkAbsolute(path). time test attribute paths</technical_language>

Target:
public void testAllocationDeallocationMemory() { fModule.schedule(); fModule.waitForCompletion(); ITmfStateSystem ss = fModule.getStateSystem(); assertNotNull(ss); assertEquals(1L, ss.getStartTime()); assertEquals(30L, ss.getCurrentEndTime()); long totalMemory = 0; threadEvent.put(1L, PAGE_SIZE); threadEvent.put(2L, -PAGE_SIZE); threadEvent.put(3L, -PAGE_SIZE); threadEvent.put(17L, PAGE_SIZE); threadEvent.put(22L, -PAGE_SIZE); threadEvent.put(28L, -PAGE_SIZE); threadEvent.put(29L, PAGE_SIZE); threadEvent.put(30L, PAGE_SIZE); for (Map.Entry<Long, Long> entry : threadEvent.entrySet()) { try { ITmfContext context = fTrace.seekEvent(entry.getKey()); ITmfEvent event = fTrace.getNext(context); if (event == null) { assertNull(event); }else{ Integer tidField = KernelTidAspect.INSTANCE.resolve(event); String tid; if (tidField == null) { assertNull(tidField); tid = "other"; } else { tid = tidField.toString(); } int tidQuark = ss.getQuarkAbsolute(tid); ITmfStateInterval kernelState = ss.querySingleState(entry.getKey(), tidQuark); long value = kernelState.getStateValue().unboxLong(); totalMemory += entry.getValue(); assertEquals(totalMemory, value); } } catch (StateSystemDisposedException | AttributeNotFoundException e) { fail(e.getMessage()); } } }
Source:
<code>public void testFirstIntervalIsConsidered() { List<ITmfStateInterval> list; <START> ITmfStateInterval interval; <END> int quark = 233, valueInt; try { list = ssq.queryFullState(interestingTimestamp2); interval = list.get(quark); assertEquals(1331668247516664825L, interval.getStartTime()); assertEquals(1331668248014135818L, interval.getEndTime()); valueInt = interval.getStateValue().unboxInt(); assertEquals(1, valueInt); } catch (TimeRangeException e) { fail(); } catch (StateSystemDisposedException e) { fail(); } catch (StateValueTypeException e) { fail(); } }</code><technical_language>define try block, of it, matter</technical_language>

Target:
public void testFirstIntervalIsConsidered() { try { List<ITmfStateInterval> list; ITmfStateInterval interval; int quark = interestingQuark, valueInt; list = ssq.queryFullState(interestingTimestamp2); interval = list.get(quark); assertEquals(1331668247516664825L, interval.getStartTime()); assertEquals(1331668248014135818L, interval.getEndTime()); valueInt = interval.getStateValue().unboxInt(); assertEquals(1, valueInt); } catch (TimeRangeException e) { fail(); } catch (StateSystemDisposedException e) { fail(); } catch (StateValueTypeException e) { fail(); } }
Source:
<code>protected final boolean performAllBuildSteps(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException { boolean r = true; for (BuildStep bs : buildSteps) { if ((bs instanceof Publisher && ((Publisher)bs).needsToRunAfterFinalized()) ^ phase) try { if (!perform(bs,listener)) { LOGGER.log(Level.FINE, "{0} : {1} failed", new Object[] {AbstractBuild.this, bs}); <START> setResult(Result.FAILURE); <END> r = false; } } catch (Exception e) { reportError(bs, e, listener, phase); r = false; } catch (LinkageError e) { reportError(bs, e, listener, phase); r = false; } } return r; }</code><technical_language>this need conditional phase, is in reportError</technical_language>

Target:
protected final boolean performAllBuildSteps(BuildListener listener, Iterable<? extends BuildStep> buildSteps, boolean phase) throws InterruptedException, IOException { boolean r = true; for (BuildStep bs : buildSteps) { if ((bs instanceof Publisher && ((Publisher)bs).needsToRunAfterFinalized()) ^ phase) try { if (!perform(bs,listener)) { LOGGER.log(Level.FINE, "{0} : {1} failed", new Object[] {AbstractBuild.this, bs}); r = false; if (phase) { setResult(Result.FAILURE); } } } catch (Exception e) { reportError(bs, e, listener, phase); r = false; } catch (LinkageError e) { reportError(bs, e, listener, phase); r = false; } } return r; }
Source:
<code>private static boolean canMatchPacket(final ITmfEvent event) { ITmfEventField content = event.getContent(); <START> return ((content.getFieldValue(Long.class, TcpEventStrings.SEQ) != null) || <END> (content.getFieldValue(Long.class, TcpEventStrings.ACKSEQ) != null) || (content.getFieldValue(Long.class, TcpEventStrings.FLAGS) != null)); }</code><technical_language>This is equivalent. || &&</technical_language>

Target:
private static boolean canMatchPacket(final ITmfEvent event) { ITmfEventField content = event.getContent(); return ((content.getFieldValue(Long.class, TcpEventStrings.SEQ) == null) || (content.getFieldValue(Long.class, TcpEventStrings.ACKSEQ) == null) || (content.getFieldValue(Long.class, TcpEventStrings.FLAGS) == null)); }
Source:
<code>private IWorkbenchPage getActiveWorkbenchPage() { IWorkbenchPage result = null; IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (workbenchWindow != null) { result = workbenchWindow.getActivePage(); } <START> if (result != null) { <END> } return result; }</code><technical_language>is missing here</technical_language>

Target:
private IWorkbenchPage getActiveWorkbenchPage() { IWorkbenchPage result = null; IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (workbenchWindow != null) { result = workbenchWindow.getActivePage(); } return result; }
Source:
<code>public WikiNotificationDisplayer(DocumentReference authorReference, TemplateManager templateManager, ScriptContextManager scriptContextManager, ComponentManager componentManager, BaseObject baseObject) throws NotificationException { this.objectReference = baseObject.getReference(); this.authorReference = authorReference; this.templateManager = templateManager; this.scriptContextManager = scriptContextManager; this.componentManager = componentManager; this.eventType = this.extractProperty(baseObject, WikiNotificationDisplayerDocumentInitializer.EVENT_TYPE); this.supportedEvents = Arrays.asList(this.eventType); try { <START> this.notificationTemplate = templateManager.createStringTemplate( <END> this.extractProperty(baseObject, WikiNotificationDisplayerDocumentInitializer.NOTIFICATION_TEMPLATE), this.getAuthorReference()); } catch (Exception e) { throw new NotificationException( String.format("Unable to render the template provided in the base object [%s]", baseObject), e); } }</code><technical_language>create if empty</technical_language>

Target:
public WikiNotificationDisplayer(DocumentReference authorReference, TemplateManager templateManager, ScriptContextManager scriptContextManager, ComponentManager componentManager, BaseObject baseObject) throws NotificationException { this.objectReference = baseObject.getReference(); this.authorReference = authorReference; this.templateManager = templateManager; this.scriptContextManager = scriptContextManager; this.componentManager = componentManager; this.eventType = this.extractProperty(baseObject, WikiNotificationDisplayerDocumentInitializer.EVENT_TYPE); this.supportedEvents = Arrays.asList(this.eventType); try { String xObjectTemplate = this.extractProperty(baseObject, WikiNotificationDisplayerDocumentInitializer.NOTIFICATION_TEMPLATE); if (!StringUtils.isBlank(xObjectTemplate)) { this.notificationTemplate = templateManager.createStringTemplate( xObjectTemplate, this.getAuthorReference()); } else { this.notificationTemplate = null; } } catch (Exception e) { throw new NotificationException( String.format("Unable to render the template provided in the base object [%s]", baseObject), e); } }
Source:
<code>public void workListStep(StateReturn stateReturn) { if (finishStateReturn(stateReturn)) { State state = stateReturn.key.stateCall.key.state; if (state instanceof ExitState) { for (StateCall stateCall : stateReturn.key.stateCall.key.ntCall.callers) { s.stateReturnWorkList.enqueue( s.getStateReturn( new StateReturn.Key(stateCall, stateReturn.key.stateEnd))); } } else if (state instanceof NextableState) { for (State nextState : ((NextableState) state).next) { <START> activateStateCall(s.getStateCall(new StateCall.Key( <END> stateReturn.key.stateCall.key.ntCall, stateReturn.key.stateEnd, nextState)), stateReturn.function); } } else { unknownStateType(); } } }</code><technical_language>this is type of ugly statement is hard read</technical_language>

Target:
private void workListStep(StateReturn stateReturn) { if (finishStateReturn(stateReturn)) { State state = stateReturn.key.stateCall.key.state; if (state instanceof ExitState) { for (StateCall stateCall : stateReturn.key.stateCall.key.ntCall.callers) { s.stateReturnWorkList.enqueue( s.stateReturns.get( new StateReturn.Key(stateCall, stateReturn.key.stateEnd))); } } else if (state instanceof NextableState) { for (State nextState : ((NextableState) state).next) { activateStateCall(s.stateCalls.get(new StateCall.Key( stateReturn.key.stateCall.key.ntCall, stateReturn.key.stateEnd, nextState)), stateReturn.function); } } else { throw unknownStateType(); } } }
Source:
<code>public void add(long value, double weight) { <START> checkArgument(count > 0, "count must be > 0"); <END> boolean needsCompression = false; if (alpha > 0.0) { long nowInSeconds = TimeUnit.NANOSECONDS.toSeconds(ticker.read()); if (nowInSeconds - landmarkInSeconds >= RESCALE_THRESHOLD_SECONDS) { rescale(nowInSeconds); needsCompression = true; } weight = weight(nowInSeconds) * count; } max = Math.max(max, value); min = Math.min(min, value); double previousCount = weightedCount; insert(longToBits(value), weight); int compressionFactor = calculateCompressionFactor(); if (needsCompression || ((long) previousCount) / compressionFactor != ((long) weightedCount) / compressionFactor) { compress(); } }</code><technical_language>a compilation failure. need rename this weight, also. Line 272 needs change from: java weight = weight(nowInSeconds) * count; java weight *= weight(nowInSeconds); [ERROR] /home/travis/build/airlift/airlift/stats/src/main/java/io/airlift/stats/QuantileDigest.java:[262,22] error: find symbol symbol: variable count location: class QuantileDigest [ERROR] /home/travis/build/airlift/airlift/stats/src/main/java/io/airlift/stats/QuantileDigest.java:[272,44] error: find symbol symbol: variable count location: class QuantileDigest</technical_language>

Target:
public void add(long value, double weight) { checkArgument(weight > 0, "weight must be > 0"); boolean needsCompression = false; if (alpha > 0.0) { long nowInSeconds = TimeUnit.NANOSECONDS.toSeconds(ticker.read()); if (nowInSeconds - landmarkInSeconds >= RESCALE_THRESHOLD_SECONDS) { rescale(nowInSeconds); needsCompression = true; } weight *= weight(nowInSeconds); } max = Math.max(max, value); min = Math.min(min, value); double previousCount = weightedCount; insert(longToBits(value), weight); int compressionFactor = calculateCompressionFactor(); if (needsCompression || ((long) previousCount) / compressionFactor != ((long) weightedCount) / compressionFactor) { compress(); } }
Source:
<code>public TupleExpressionOrcPredicate(TupleExpression<C> effectivePredicate, Map<C, ColumnReference<C>> columnReferences, boolean orcBloomFiltersEnabled) { this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); <START> this.columnReferences = columnReferences; <END> this.orcBloomFiltersEnabled = orcBloomFiltersEnabled; }</code><technical_language>requireNonNull</technical_language>

Target:
public TupleExpressionOrcPredicate(TupleExpression<C> effectivePredicate, Map<C, ColumnReference<C>> columnReferences, boolean orcBloomFiltersEnabled) { this.effectivePredicate = requireNonNull(effectivePredicate, "effectivePredicate is null"); this.columnReferences = requireNonNull(columnReferences, "columnReferences is null"); this.orcBloomFiltersEnabled = requireNonNull(orcBloomFiltersEnabled, "orcBloomFiltersEnabled is null"); }
Source:
<code>public void toFile(File file) throws Exception { PrintWriter out = new PrintWriter(file, "UTF-8"); try { out.write(graph()); } finally { <START> Closeables.close(out, false); <END> } }</code><technical_language>swallow exception for close</technical_language>

Target:
public void toFile(File file) throws Exception { PrintWriter out = new PrintWriter(file, "UTF-8"); try { out.write(graph()); } finally { Closeables.close(out, true); } }
Source:
<code>private boolean isSuspiciousGlobalFunction(FunctionCallTree tree) { ExpressionTree callee = tree.callee(); if (callee.is(Tree.Kind.NAMESPACE_NAME)) { NamespaceNameTree namespaceName = (NamespaceNameTree) callee; QualifiedName qualifiedName = getFullyQualifiedName(namespaceName); <START> return IO_FUNCTIONS.stream().anyMatch(matcher -> matcher.matches(qualifiedName, tree.arguments())); <END> } return false; }</code><technical_language>I extract tree.arguments() a dedicated variable, in order avoid call method for functions</technical_language>

Target:
private boolean isSuspiciousGlobalFunction(FunctionCallTree tree) { ExpressionTree callee = tree.callee(); if (callee.is(Tree.Kind.NAMESPACE_NAME)) { QualifiedName qualifiedName = getFullyQualifiedName((NamespaceNameTree) callee); SeparatedList<ExpressionTree> args = tree.arguments(); return IO_FUNCTIONS.stream().anyMatch(matcher -> matcher.matches(qualifiedName, args)); } return false; }
Source:
<code>protected void logThresholdExceededAlerts(List<GatewaySenderEventImpl> events) { if (getSender().getAlertThreshold() > 0) { Iterator it = events.iterator(); long currentTime = System.currentTimeMillis(); while (it.hasNext()) { try { Object o = it.next(); <START> if (o != null && o instanceof GatewaySenderEventImpl) { <END> GatewaySenderEventImpl ge = (GatewaySenderEventImpl) o; if (ge.getCreationTime() + getSender().getAlertThreshold() < currentTime) { logger.warn( "{} event for region={} key={} value={} was in the queue for milliseconds", new Object[] {ge.getOperation(), ge.getRegionPath(), ge.getKey(), ge.getValueAsString(true), currentTime - ge.getCreationTime()}); getSender().getStatistics().incEventsExceedingAlertThreshold(); } } } catch (Exception e) { logger.warn("Caught the following exception attempting to log threshold exceeded alert:", e); getSender().getStatistics().incEventsExceedingAlertThreshold(); } } } }</code><technical_language>This null check is redundant, implicitly included in instanceof check</technical_language>

Target:
protected void logThresholdExceededAlerts(List<GatewaySenderEventImpl> events) { if (getSender().getAlertThreshold() > 0) { long currentTime = System.currentTimeMillis(); for (GatewaySenderEventImpl event : events) { try { if (event.getCreationTime() + getSender().getAlertThreshold() < currentTime) { logger.warn( "{} event for region={} key={} value={} was in the queue for milliseconds", new Object[] {event.getOperation(), event.getRegionPath(), event.getKey(), event.getValueAsString(true), currentTime - event.getCreationTime()}); getSender().getStatistics().incEventsExceedingAlertThreshold(); } } catch (Exception e) { logger.warn("Caught the following exception attempting to log threshold exceeded alert:", e); getSender().getStatistics().incEventsExceedingAlertThreshold(); } } } }
Source:
<code><START> Option(String option) { <END> this.option = option; }</code><technical_language>Yes, missing constructor private</technical_language>

Target:
private Option(String option) { this.option = option; }
Source:
<code>EventHubProducer(EventHubAsyncProducer producer, Duration tryTimeout) { this.producer = Objects.requireNonNull(producer, "'producer' cannot be null."); <START> this.tryTimeout = Objects.requireNonNull(tryTimeout, "'getTryTimeout' cannot be null."); <END> }</code><technical_language>Find / replace mistake</technical_language>

Target:
EventHubProducer(EventHubAsyncProducer producer, Duration tryTimeout) { this.producer = Objects.requireNonNull(producer, "'producer' cannot be null."); this.tryTimeout = Objects.requireNonNull(tryTimeout, "'tryTimeout' cannot be null."); }
Source:
<code>private void subscribeTopicTagsChanged( @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { Object changedObj = event.getProperty(EventTags.ELEMENT); if (!(changedObj instanceof MToolBar) <START> || !(changedObj instanceof MToolBar)) <END> return; final MUIElement changedElement = (MUIElement) changedObj; if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, HIDDEN_BY_USER)) { changedElement.setVisible(false); } } else if (UIEvents.isREMOVE(event)) { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, HIDDEN_BY_USER)) { changedElement.setVisible(true); } } }</code><technical_language>OR-conditions in if-statement identical, "instanceof" check enough</technical_language>

Target:
private void subscribeTopicTagsChanged( @UIEventTopic(UIEvents.ApplicationElement.TOPIC_TAGS) Event event) { Object changedObj = event.getProperty(EventTags.ELEMENT); if (!(changedObj instanceof MToolBar)) return; final MUIElement changedElement = (MUIElement) changedObj; if (UIEvents.isADD(event)) { if (UIEvents.contains(event, UIEvents.EventTags.NEW_VALUE, HIDDEN_BY_USER)) { changedElement.setVisible(false); } } else if (UIEvents.isREMOVE(event)) { if (UIEvents.contains(event, UIEvents.EventTags.OLD_VALUE, HIDDEN_BY_USER)) { changedElement.setVisible(true); } } }
Source:
<code>public Set<String> reviewed() throws RestApiException { <START> String request = getRequestPath() + "/files?reviewed"; <END> JsonElement jsonElement = gerritRestClient.getRequest(request); return new HashSet<>(reviewInfoParser.parseFileInfos(jsonElement)); }</code><technical_language>Thank you! Yes, link is included in file leave out for consistency</technical_language>

Target:
public Set<String> reviewed() throws RestApiException { String request = getRequestPath() + "/files?reviewed"; JsonElement jsonElement = gerritRestClient.getRequest(request); return reviewInfoParser.parseFileInfos(jsonElement); }
Source:
<code>public String getMessage() { final String baseMessage = super.getMessage(); <START> StringBuilder errorInformationMessage = new StringBuilder().append(baseMessage); if (errorInformationList.size() > 0) { for (ErrorInformation errorInformation : errorInformationList) { errorInformationMessage.append(", " + "errorCode" + ": [" + errorInformation.getCode() + "], " + "message" + ": " + errorInformation.getMessage()); } } return errorInformationMessage.toString(); <END> }</code><technical_language>This done in constructor instead of time getMessage() is called</technical_language>

Target:
public String getMessage() { return this.errorInformationMessage; }
Source:
<code>public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) { <START> database.getDatabase().insertEntry(mergePanel.getMergeEntry()); <END> undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), mergePanel.getMergeEntry())); }</code><technical_language>entry needs removed, right</technical_language>

Target:
public void makeChange(BibDatabaseContext database, NamedCompound undoEdit) { database.getDatabase().removeEntry(oldEntry); database.getDatabase().insertEntry(mergePanel.getMergeEntry()); undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), oldEntry)); undoEdit.addEdit(new UndoableInsertEntry(database.getDatabase(), mergePanel.getMergeEntry())); }
Source:
<code>private void makePostRequest() { if (!hasTaskLaunched && !inErrorState) { RequestBody requestBody = ModernHttpRequester.getPostBody(params); <START> ModernHttpTask postTask = new ModernHttpTask(this, url.toString(), new HashMap(), requestBody, HTTPMethod.POST, null); <END> postTask.connect((CommCareTaskConnector)this); postTask.executeParallel(); hasTaskLaunched = true; } }</code><technical_language>Cool a good solution</technical_language>

Target:
private void makePostRequest() { try { if (!hasTaskLaunched && !inErrorState) { RequestBody requestBody = ModernHttpRequester.getPostBody(params); ModernHttpTask postTask = new ModernHttpTask(this, url.toString(), new HashMap(), getContentHeadersForXFormPost(requestBody), requestBody, HTTPMethod.POST, null); postTask.connect((CommCareTaskConnector)this); postTask.executeParallel(); hasTaskLaunched = true; } } catch (IOException e) { handleIOException(e); } }