auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void prepareReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { final PrepareMessage prepare = (PrepareMessage) evt.getMessage(); String version = prepare.getVersion(); if (!"2.0".equals(version)) { sendVersionError(ctx); return; } List<String> scriptNames = prepare.getNames(); if (logger.isDebugEnabled()) { logger.debug("preparing script(s) " + scriptNames); } robot = new Robot(); whenAbortedOrFinished = whenAbortedOrFinished(ctx); ChannelFuture prepareFuture; try { final String aggregatedScript = aggregateScript(scriptNames, scriptLoader); if (scriptLoader != null) { Thread currentThread = currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(scriptLoader); prepareFuture = <START> robot.prepare(aggregatedScript.toString()); <END> } finally { currentThread.setContextClassLoader(contextClassLoader); } } else { prepareFuture = robot.prepare(aggregatedScript.toString()); } prepareFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { PreparedMessage prepared = new PreparedMessage(); prepared.setScript(aggregatedScript); prepared.getBarriers().addAll(robot.getBarriersByName().keySet()); Channels.write(ctx, Channels.future(null), prepared); } }); } catch (Exception e) { sendErrorMessage(ctx, e); return; } }</code><technical_language>assignment line (just code)</technical_language>

Target:
public void prepareReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { final PrepareMessage prepare = (PrepareMessage) evt.getMessage(); String version = prepare.getVersion(); if (!"2.0".equals(version)) { sendVersionError(ctx); return; } List<String> scriptNames = prepare.getNames(); if (logger.isDebugEnabled()) { logger.debug("preparing script(s) " + scriptNames); } robot = new Robot(); whenAbortedOrFinished = whenAbortedOrFinished(ctx); ChannelFuture prepareFuture; try { final String aggregatedScript = aggregateScript(scriptNames, scriptLoader); if (scriptLoader != null) { Thread currentThread = currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(scriptLoader); prepareFuture = robot.prepare(aggregatedScript); } finally { currentThread.setContextClassLoader(contextClassLoader); } } else { prepareFuture = robot.prepare(aggregatedScript); } prepareFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { PreparedMessage prepared = new PreparedMessage(); prepared.setScript(aggregatedScript); prepared.getBarriers().addAll(robot.getBarriersByName().keySet()); Channels.write(ctx, Channels.future(null), prepared); } }); } catch (Exception e) { sendErrorMessage(ctx, e); return; } }
Source:
<code>public static void report(Saveable obj, String version) { OldDataMonitor odm = get(Jenkins.getInstance()); try { SaveableReference ref = referTo(obj); while (true) { VersionRange vr = odm.data.get(ref); if (vr != null) { vr.add(version); break; <START> } else if (odm.data.putIfAbsent(ref, new VersionRange(version, null)) == null) { <END> break; } } } catch (IllegalArgumentException ex) { LOGGER.log(Level.WARNING, "Bad parameter given to OldDataMonitor", ex); } }</code><technical_language>Minor performance :ant: : non-null putIfAbsent() result leads VersionRange retrieval next iteration => effectively request times collision</technical_language>

Target:
public static void report(Saveable obj, String version) { OldDataMonitor odm = get(Jenkins.getInstance()); try { SaveableReference ref = referTo(obj); while (true) { VersionRange vr = odm.data.get(ref); if (vr != null && odm.data.replace(ref, vr, new VersionRange(vr, version, null))) { break; } else if (odm.data.putIfAbsent(ref, new VersionRange(null, version, null)) == null) { break; } } } catch (IllegalArgumentException ex) { LOGGER.log(Level.WARNING, "Bad parameter given to OldDataMonitor", ex); } }
Source:
<code>public Crypter(String keysetFileName) throws CrypterException { String keysetLocation = Paths.get(keysetDir, keysetFileName + KEYSET_FILE_EXTENSION).toString(); <START> synchronized (Crypter.class) { <END> File keysetFile = new File(keysetLocation); try { AeadConfig.register(); if (!keysetFile.exists()) { keysetHandle = initKeysetHandle(keysetFile); } else { keysetHandle = readKeysetHandle(keysetFile); } aead = AeadFactory.getPrimitive(keysetHandle); associatedData = getAssociatedData(keysetHandle); } catch (GeneralSecurityException | IOException e) { LOGGER.warn("Problem initializing keyset."); throw new CrypterException("Problem initializing keyset", e); } } }</code><technical_language>I recall a reason synchronize access before, shared data read/written another thread now. static fields final other thread touching keysetHandle, associatedData, aead fields this ctor completed processing</technical_language>

Target:
public Crypter(String keysetFileName) throws CrypterException { String keysetLocation = Paths.get(keysetDir, keysetFileName + KEYSET_FILE_EXTENSION).toString(); synchronized (Crypter.class) { File keysetFile = new File(keysetLocation); try { AeadConfig.register(); if (!keysetFile.exists()) { keysetHandle = initKeysetHandle(keysetFile); } else { keysetHandle = readKeysetHandle(keysetFile); } aead = AeadFactory.getPrimitive(keysetHandle); associatedData = getAssociatedData(); } catch (GeneralSecurityException | IOException e) { LOGGER.warn("Problem initializing keyset."); throw new CrypterException("Problem initializing keyset", e); } } }
Source:
<code>public InputStream writeObject(final VelocityResourceKey key) throws DotStateException, DotDataException, DotSecurityException { long language = new Long(key.language); ContentletVersionInfo info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, language); <START> if (isLiveVersionNotAvailable(key, info) && language != defaultLang && APILocator.getLanguageAPI().canDefaultContentToDefaultLanguage()) { <END> info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, defaultLang); } if (isLiveVersionNotAvailable(key, info)) { throw new ResourceNotFoundException("cannot find content for: " + key); } Contentlet contentlet = (key.mode.showLive) ? APILocator.getContentletAPI().find(info.getLiveInode(), APILocator.systemUser(), false) : APILocator.getContentletAPI().find(info.getWorkingInode(), APILocator.systemUser(), false); Logger.debug(this, "DotResourceLoader:\tWriting out contentlet inode = " + contentlet.getInode()); if (null == contentlet) { throw new ResourceNotFoundException("cannot find content for: " + key); } return buildVelocity(contentlet, key.mode, key.path); }</code><technical_language>move this condition a private method, this method name give more information is</technical_language>

Target:
public InputStream writeObject(final VelocityResourceKey key) throws DotStateException, DotDataException, DotSecurityException { long language = new Long(key.language); ContentletVersionInfo info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, language); if (isLiveVersionNotAvailable(key, info) && shouldCheckForVersionInfoInDefaultLanguage( language)) { info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, defaultLang); } if (isLiveVersionNotAvailable(key, info)) { throw new ResourceNotFoundException("cannot find content for: " + key); } Contentlet contentlet = (key.mode.showLive) ? APILocator.getContentletAPI().find(info.getLiveInode(), APILocator.systemUser(), false) : APILocator.getContentletAPI().find(info.getWorkingInode(), APILocator.systemUser(), false); Logger.debug(this, "DotResourceLoader:\tWriting out contentlet inode = " + contentlet.getInode()); if (null == contentlet) { throw new ResourceNotFoundException("cannot find content for: " + key); } return buildVelocity(contentlet, key.mode, key.path); }
Source:
<code>public Mutex getMutexForClientSession(final String sessionId) { Assert.requireNonBlank(sessionId, "sessionId"); <START> WeakReference<Mutex> mutexReference = sessionMutexMap.get(sessionId); <END> Assert.requireNonNull(mutexReference, "mutexReference"); return mutexReference.get(); }</code><technical_language>final</technical_language>

Target:
public Mutex getMutexForClientSession(final String sessionId) { Assert.requireNonBlank(sessionId, "sessionId"); final WeakReference<Mutex> mutexReference = sessionMutexMap.get(sessionId); Assert.requireNonNull(mutexReference, "mutexReference"); return mutexReference.get(); }
Source:
<code>public JudgmentWithCorrectionList<CommonCourtJudgment> processJudgment(SourceCcJudgment sourceCcJudgment) { JudgmentWithCorrectionList<CommonCourtJudgment> judgmentWithCorrectionList = sourceCcJudgmentConverter.convertJudgment(sourceCcJudgment); CommonCourtJudgment ccJudgment = judgmentWithCorrectionList.getJudgment(); CommonCourtJudgment oldJudgment = ccJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(ccJudgment.getSourceInfo().getSourceCode(), ccJudgment.getSourceInfo().getSourceJudgmentId()); if (oldJudgment != null) { judgmentOverwriter.overwriteJudgment(oldJudgment, ccJudgment, judgmentWithCorrectionList.getCorrectionList()); List<EnrichmentTag> judgmentEnrichmentTags = enrichmentTagRepository.findAllByJudgmentId(oldJudgment.getId()); <START> enrichmentTagRepository.delete(judgmentEnrichmentTags); <END> judgmentWithCorrectionList.setJudgment(oldJudgment); } return judgmentWithCorrectionList; }</code><technical_language>a special deleting repository method for this? For example: enrichmentTagRepository.deleteAllByJudgmentId(int judgmentId) similar JudgmentCorrectionRepository.delete..</technical_language>

Target:
public JudgmentWithCorrectionList<CommonCourtJudgment> processJudgment(SourceCcJudgment sourceCcJudgment) { JudgmentWithCorrectionList<CommonCourtJudgment> judgmentWithCorrectionList = sourceCcJudgmentConverter.convertJudgment(sourceCcJudgment); CommonCourtJudgment ccJudgment = judgmentWithCorrectionList.getJudgment(); CommonCourtJudgment oldJudgment = ccJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(ccJudgment.getSourceInfo().getSourceCode(), ccJudgment.getSourceInfo().getSourceJudgmentId()); if (oldJudgment != null) { judgmentOverwriter.overwriteJudgment(oldJudgment, ccJudgment, judgmentWithCorrectionList.getCorrectionList()); enrichmentTagRepository.deleteAllByJudgmentId(oldJudgment.getId()); judgmentWithCorrectionList.setJudgment(oldJudgment); } return judgmentWithCorrectionList; }
Source:
<code>public int hashCode() { <START> return key.hashCode() ^ value.hashCode(); <END> }</code><technical_language>I current state of art is do like: int hc = key.hashCode(); hc *= 31; hc += value.hashCode(); return hc; for attribute multi-valued, there? key's hashCode hashCode sufficient here</technical_language>

Target:
public int hashCode() { return key.hashCode(); }
Source:
<code>private boolean isInvalidHost(UriTemplate template) { <START> Map<String, Object> uriKeysWithEmptyValues = Arrays.asList(template.getVariables()).stream().collect(toMap(v -> v, v -> "empty")); <END> return URI.create(template.expand(uriKeysWithEmptyValues)).getHost() == null; }</code><technical_language>Function.identity() express function returns input arguments</technical_language>

Target:
private boolean isInvalidHost(UriTemplate template) { Map<String, Object> uriKeysWithEmptyValues = asList(template.getVariables()).stream().collect(toMap(identity(), v -> "empty")); return URI.create(template.expand(uriKeysWithEmptyValues)).getHost() == null; }
Source:
<code>public static boolean isLocal(String domain, Properties configuration, Set<String> localDomains) { if (configuration == null) { return false; } String command = configuration.getProperty( Configuration.CONFIGURATION_LOCAL_DOMAIN_CHECKER); if (command == null) { String serverDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_DOMAIN); String topicDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); String channelDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_CHANNELS_DOMAIN); return (domain.equals(serverDomain) || domain.equals(topicDomain) || domain.equals(channelDomain)); } if (command.equals(Boolean.TRUE.toString())) { return true; } if (localDomains == null) { try { localDomains = getLocalDomains(configuration); } catch (Exception e) { return false; } } <START> return localDomains.contains(domain); <END> }</code><technical_language>Assuming this is case sensitive, note entries lowercase lowercase domain</technical_language>

Target:
public static boolean isLocal(String domain, Properties configuration, Set<String> localDomains) { if (configuration == null) { return false; } String command = configuration.getProperty( Configuration.CONFIGURATION_LOCAL_DOMAIN_CHECKER); if (command == null) { String serverDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_DOMAIN); String topicDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); String channelDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_CHANNELS_DOMAIN); return (domain.equals(serverDomain) || domain.equals(topicDomain) || domain.equals(channelDomain)); } if (command.equals(Boolean.TRUE.toString())) { return true; } if (localDomains == null) { try { localDomains = getLocalDomains(configuration); } catch (Exception e) { return false; } } return localDomains.contains(domain.toLowerCase()); }
Source:
<code>public RecordCursor getCursor(SqlExecutionContext executionContext) { <START> cursor.of(reader, columnName); <END> return cursor; }</code><technical_language>CairoEngine - this is place get reader</technical_language>

Target:
public RecordCursor getCursor(SqlExecutionContext executionContext) { TableReader reader = engine.getReader(executionContext.getCairoSecurityContext(), tableName, tableVersion); cursor.of(reader, columnIndex); return cursor; }
Source:
<code>public void onPermissionResult(boolean granted) { <START> Style style = mapboxMap.getStyle(); <END> if (granted && style != null) { displayDeviceLocation(style); } else { Toast.makeText(this, R.string.user_location_permission_not_granted, Toast.LENGTH_LONG).show(); finish(); } }</code><technical_language>above, async callback for getStyle()</technical_language>

Target:
public void onPermissionResult(boolean granted) { mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { if (granted) { displayDeviceLocation(style); } else { Toast.makeText(ElevationQueryActivity.this, R.string.user_location_permission_not_granted, Toast.LENGTH_LONG).show(); finish(); } } }); }
Source:
<code>public JsonElement serialize(Token src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); <START> object.addProperty(MEMBER_ACCESS_TOKEN, src.accessToken); <END> if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } return object; }</code><technical_language>in if clause</technical_language>

Target:
public JsonElement serialize(Token src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } else { object.addProperty(MEMBER_ACCESS_TOKEN, src.accessToken); } return object; }
Source:
<code><START> public BindingSetDecorator(final BindingSet set) { <END> this.set = set; }</code><technical_language>is nullness contract here? missing docs</technical_language>

Target:
public BindingSetDecorator(final BindingSet set) { this.set = checkNotNull(set); }
Source:
<code>public static void checkElement(ProblemsHolder holder, String type, GoNamedElement namedElement, int index) { if (index < 1) { return; } <START> if (!StringUtil.isCapitalized(namedElement.getName())) { <END> return; } String errorText = "Exported " + type + " '" + namedElement.getName() + "' should have its own declaration"; holder.registerProblem(namedElement, errorText, ProblemHighlightType.WEAK_WARNING); }</code><technical_language>namedElement.isPublic</technical_language>

Target:
public static void checkElement(ProblemsHolder holder, String type, GoNamedElement namedElement, int index) { if (index < 1 || !namedElement.isPublic()) { return; } String errorText = "Exported " + type + " '" + namedElement.getName() + "' should have its own declaration"; holder.registerProblem(namedElement, errorText, ProblemHighlightType.WEAK_WARNING, new MyLocalQuickFixBase(index)); }
Source:
<code>public MavenWorkspaceRepository() { super(); collect(); <START> list = Memoize.supplier(() -> list0()); <END> }</code><technical_language>I added a protected memoize method AbstractIndexingRepository memoized suppliers consistent. override that. default is SoftReference memoization allow GC get memory if needed</technical_language>

Target:
public MavenWorkspaceRepository() { super(); collect(); list = memoize(this::list0); }
Source:
<code>public SystemViewAdapter(String name, String desc, Class<R> rowCls, SystemViewRowAttributeWalker<R> walker, Supplier<Collection<D>> dataSupplier, Function<D, R> rowFunc) { <START> A.notNull(rowCls, "rowCls"); A.notNull(walker, "walker"); this.name = name; this.desc = desc; this.rowCls = rowCls; this.walker = walker; <END> this.data = null; this.dataSupplier = dataSupplier; this.rowFunc = rowFunc; }</code><technical_language>code duplication</technical_language>

Target:
public SystemViewAdapter(String name, String desc, Class<R> rowCls, SystemViewRowAttributeWalker<R> walker, Supplier<Collection<D>> dataSupplier, Function<D, R> rowFunc) { super(name, desc, rowCls, walker); A.notNull(dataSupplier, "dataSupplier"); A.notNull(rowCls, "rowCls"); this.dataSupplier = dataSupplier; this.rowFunc = rowFunc; }
Source:
<code>public JGroupsTopologyAwareAddress doReadObject(ObjectInput unmarshaller) throws IOException, ClassNotFoundException { try { ExtendedUUID jgroupsAddress = (ExtendedUUID) org.jgroups.util.Util.readAddress(unmarshaller); return (JGroupsTopologyAwareAddress) JGroupsAddressCache.fromJGroupsAddressUnchecked(jgroupsAddress); } catch (Exception e) { throw new IOException(e); } <START> } <END></code><technical_language>needed</technical_language>

Target:
public JGroupsTopologyAwareAddress doReadObject(ObjectInput unmarshaller) throws IOException, ClassNotFoundException { try { org.jgroups.Address jgroupsAddress = (org.jgroups.Address) org.jgroups.util.Util.readAddress(unmarshaller); return (JGroupsTopologyAwareAddress) JGroupsAddressCache.fromJGroupsAddress(jgroupsAddress); } catch (Exception e) { throw new IOException(e); } }
Source:
<code>public void actionPerformed(ActionEvent e) { File file = FileChooserService.getSelectedFile("pdf", "PDF files", DialogType.PDF, false); int reply = JOptionPane.NO_OPTION; if (file != null) { if (file.toString().endsWith(".pdf")) { file = new File(file.toString().substring(0, file.toString().length() - 4)); } File v_overwriting = new File(file.toString() + ".pdf"); while (v_overwriting.exists() && reply == JOptionPane.NO_OPTION) { reply = JOptionPane.showConfirmDialog(null, <START> "The selected file already exists. Do you want to overwrite it?", <END> "File already exists.", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.NO_OPTION) { file = FileChooserService.getSelectedFile("pdf", "PDF files", DialogType.PDF, false); if (file != null) { if (file.toString().endsWith(".pdf")) { file = new File(file.toString().substring(0, file.toString().length() - 4)); } v_overwriting = new File(file.toString() + ".pdf"); } else return; } } } if (file == null) return; String filename = file.getName(); LOGGER.log("Invoking pdflatex"); CommandLineExecutor.executeGeneratePDF(new CommandLineBuilder() .withPathToSource(ApplicationUtils.getTempSourceFile()) .withOutputDirectory(file.getParentFile().getAbsolutePath()) .withJobname(filename) .withWorkingFile(etc.getCurrentFile()) .withLatexPath(etc.getLatexPath()) .withLogger(new ApplicationLogger("pdflatex"))); }</code><technical_language>replace "selected file" full path file? This give user additional confirmation reminder of selected</technical_language>

Target:
public void actionPerformed(ActionEvent e) { File file = FileChooserService.getSelectedFile("pdf", "PDF files", DialogType.PDF, false); int reply = JOptionPane.NO_OPTION; if (file != null) { if (file.toString().endsWith(".pdf")) { file = new File(file.toString().substring(0, file.toString().length() - 4)); } File v_overwriting = new File(file.toString() + ".pdf"); while (v_overwriting.exists() && reply == JOptionPane.NO_OPTION) { reply = JOptionPane.showConfirmDialog(null, v_overwriting.toString() + " already exists. Do you want to overwrite it?", "File already exists.", JOptionPane.YES_NO_OPTION); if (reply == JOptionPane.NO_OPTION) { file = FileChooserService.getSelectedFile("pdf", "PDF files", DialogType.PDF, false); if (file != null) { if (file.toString().endsWith(".pdf")) { file = new File(file.toString().substring(0, file.toString().length() - 4)); } v_overwriting = new File(file.toString() + ".pdf"); } else return; } } } if (file == null) return; String filename = file.getName(); LOGGER.log("Invoking pdflatex"); CommandLineExecutor.executeGeneratePDF(new CommandLineBuilder() .withPathToSource(ApplicationUtils.getTempSourceFile()) .withOutputDirectory(file.getParentFile().getAbsolutePath()) .withJobname(filename) .withWorkingFile(etc.getCurrentFile()) .withLatexPath(etc.getLatexPath()) .withLogger(new ApplicationLogger("pdflatex"))); }
Source:
<code>public void saveFields() { String[] lines = fieldsText.get().split("\n"); int i = 0; for (; i < lines.length; i++) { String[] parts = lines[i].split(":"); if (parts.length != 2) { String field = Localization.lang("field"); String title = Localization.lang("Error"); String content = Localization.lang("Each line must be of the following form") + " '" + Localization.lang("Tabname") + ':' + field + "1;" + field + "2;...;" + field + "N'"; dialogService.showInformationDialogAndWait(title, content); return; } <START> String testString = BibtexKeyGenerator.cleanKey(parts[1], Globals.prefs.get(JabRefPreferences.DEFAULT_UNWANTED_BIBTEX_KEY_CHARACTERS)); <END> if (!testString.equals(parts[1]) || (parts[1].indexOf('&') >= 0)) { String title = Localization.lang("Error"); String content = Localization.lang("Field names are not allowed to contain white space or the following " + "characters") + "{ } ( ) , = \\ \" # % ~ '"; dialogService.showInformationDialogAndWait(title, content); return; } preferences.setCustomTabsNameAndFields(parts[0], parts[1], i); } preferences.purgeSeries(JabRefPreferences.CUSTOM_TAB_NAME, i); preferences.purgeSeries(JabRefPreferences.CUSTOM_TAB_FIELDS, i); preferences.updateEntryEditorTabList(); }</code><technical_language>I argument replaced preferences.getUnwantedCharacters()</technical_language>

Target:
public void saveFields() { Map<String, Set<Field>> customTabsMap = new LinkedHashMap<>(); String[] lines = fieldsText.get().split("\n"); for (String line : lines) { String[] parts = line.split(":"); if (parts.length != 2) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Each line must be of the following form: 'tab:field1;field2;...;fieldN'.")); return; } String testString = BibtexKeyGenerator.cleanKey(parts[1], preferences.getUnwantedCharacters()); if (!testString.equals(parts[1]) || (parts[1].indexOf('&') >= 0)) { dialogService.showInformationDialogAndWait( Localization.lang("Error"), Localization.lang("Field names are not allowed to contain white spaces or certain characters (%0).", "# { } ( ) ~ , ^ & - \" ' ` ʹ \\")); return; } customTabsMap.put(parts[0], FieldFactory.parseFieldList(parts[1])); } preferences.storeEntryEditorTabList(customTabsMap); }
Source:
<code>static boolean isCompanyPortalInstalled(final PackageManager pkgManager) { <START> return isPackageInstalled(pkgManager, "com.microsoft.windowsintune.companyportal"); <END> }</code><technical_language>com.microsoft.windowsintune.companyportal [](start = 47, length = 41) this in a config file</technical_language>

Target:
static boolean isCompanyPortalInstalled(final PackageManager pkgManager) { return isPackageInstalled(pkgManager, COMPANY_PORTAL_APP_PACKAGE_NAME); }
Source:
<code>public void testOpenSessionEditorByDoubleClick3() { designerProject.convertToModelingProject(); <START> SWTBotView modelExplorerView = bot.viewById(IModelExplorerView.ID); modelExplorerView.setFocus(); SWTBot packageExplorerViewBot = modelExplorerView.bot(); SWTBotTreeItem expandedNode = packageExplorerViewBot.tree().expandNode("DesignerTestProject", true); SWTBotTreeItem node = expandedNode.getNode("My.aird"); node.doubleClick(); bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor() != null; } @Override public String getFailureMessage() { return "Wrong Active editor is : " + PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor().getEditorSite().getId(); } }); assertEquals("The session editor has not opened.", "org.eclipse.sirius.ui.editor.session", <END> PlatformUI.getWorkbench().getWorkbenchWindows()[0].getActivePage().getActiveEditor().getEditorSite().getId()); }</code><technical_language>mutialize this code</technical_language>

Target:
public void testOpenSessionEditorByDoubleClick3() { designerProject.convertToModelingProject(); SWTBotView modelExplorerView = bot.viewById(IModelExplorerView.ID); modelExplorerView.setFocus(); SWTBot packageExplorerViewBot = modelExplorerView.bot(); assertSessionEditorOpened(packageExplorerViewBot); }
Source:
<code>protected void onItemsFetched(BoxResponse response) { if (!response.isSuccess()) { checkConnectivity(); return; } ArrayList<String> removeIds = new ArrayList<String>(1); removeIds.add(BoxSearchAdapter.LOAD_MORE_ID); mAdapter.remove(removeIds); if (response.getResult() instanceof BoxIteratorItems) { if (((BoxRequestsSearch.Search) response.getRequest()).getOffset() == 0) { BoxIteratorItems items = (BoxIteratorItems) response.getResult(); updateTo(items.getEntries()); mOffset = 0; <START> } else { <END> BoxIteratorItems items = (BoxIteratorItems) response.getResult(); updateItems(items.getEntries()); mOffset += items.size(); if (items.fullSize() != null && mOffset < items.fullSize()) { mOffset = calculateBestOffset(mOffset, mLimit); BoxRequestsSearch.Search incrementalSearchTask = mRequest .setOffset(mOffset) .setLimit(mLimit); ((BoxSearchAdapter) mAdapter).addLoadMoreItem(incrementalSearchTask); } } } mSwipeRefresh.setRefreshing(false); }</code><technical_language>want else if search returns 200 items out of 1000 want add a LoadMoreItem entry end. mOffset is supposed increase if adding addMoreItems entry set offset</technical_language>

Target:
protected void onItemsFetched(BoxResponse response) { if (!response.isSuccess()) { checkConnectivity(); return; } ArrayList<String> removeIds = new ArrayList<String>(1); removeIds.add(BoxSearchAdapter.LOAD_MORE_ID); mAdapter.remove(removeIds); if (response.getResult() instanceof BoxIteratorItems) { BoxIteratorItems items = (BoxIteratorItems) response.getResult(); if (((BoxRequestsSearch.Search) response.getRequest()).getOffset() == 0) { mOffset = 0; updateTo(items.getEntries()); } else { updateItems(items.getEntries()); } mOffset += items.size(); if (items.fullSize() != null && mOffset < items.fullSize()) { mOffset = calculateBestOffset(mOffset, mLimit); BoxRequestsSearch.Search incrementalSearchTask = mRequest .setOffset(mOffset) .setLimit(mLimit); ((BoxSearchAdapter) mAdapter).addLoadMoreItem(incrementalSearchTask); } } mSwipeRefresh.setRefreshing(false); }
Source:
<code>public SortedMap<Long, List<List<Integer>>> getPalindromeProductsWithFactors(int minFactor, int maxFactor) { <START> if(minFactor > maxFactor) throw new IllegalArgumentException("invalid input: min is " + minFactor + " and max is " + maxFactor); <END> SortedMap<Long, List<List<Integer>>> palindromeSortedList = new TreeMap<>(); long num; List<List<Integer>> factors; for (int i = maxFactor; i >= minFactor; i--) { for (int j = maxFactor; j >= i; j--) { num = i * j; if (isPalindrome(num)) { factors = palindromeSortedList.get(num); if (factors == null) { factors = new ArrayList<>(); } factors.add(Arrays.asList(i, j)); palindromeSortedList.put(num, factors); } } } if(palindromeSortedList.size() == 0) throw new NoSuchElementException("no palindrome with factors in the range " + minFactor + " to " + maxFactor); return Collections.unmodifiableSortedMap(palindromeSortedList); }</code><technical_language>This read more nicely if presented as: if (minFactor > maxFactor) { throw new IllegalArgumentException("invalid input: min is " + minFactor + " max is " + maxFactor); }</technical_language>

Target:
public SortedMap<Long, List<List<Integer>>> getPalindromeProductsWithFactors(int minFactor, int maxFactor) { if(minFactor > maxFactor) { throw new IllegalArgumentException("invalid input: min is " + minFactor + " and max is " + maxFactor); } SortedMap<Long, List<List<Integer>>> palindromeSortedList = new TreeMap<>(); long num; List<List<Integer>> factors; for (int i = maxFactor; i >= minFactor; i--) { for (int j = maxFactor; j >= i; j--) { num = i * j; if (isPalindrome(num)) { factors = palindromeSortedList.get(num); if (factors == null) { factors = new ArrayList<>(); } factors.add(Arrays.asList(i, j)); palindromeSortedList.put(num, factors); } } } if(palindromeSortedList.size() == 0) { throw new NoSuchElementException("no palindrome with factors in the range " + minFactor + " to " + maxFactor); } return Collections.unmodifiableSortedMap(palindromeSortedList); }
Source:
<code>protected void doGet(final CloudletTopic reqTopic, final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload) { final String[] resources = reqTopic.getResources(); logger.info(message.cloudGETReqReceived()); if (resources.length != 1 || !ASSET_TOPIC_RESOURCE.equals(resources[0])) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } this.findAssets(); JsonArray request; try { request = getRequestJsonArray(reqPayload); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } <START> if (request == null || request.size() == 0) { <END> getAssetMetadata(respPayload, this.assets.keySet().iterator()); return; } MetadataRequest parsedRequest; try { parsedRequest = new MetadataRequest(request); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } getAssetMetadata(respPayload, parsedRequest.getAssetNames().iterator()); }</code><technical_language>check if isEmpty()</technical_language>

Target:
protected void doGet(final CloudletTopic reqTopic, final KuraRequestPayload reqPayload, final KuraResponsePayload respPayload) { final String[] resources = reqTopic.getResources(); logger.info(message.cloudGETReqReceived()); if (resources.length != 1 || !ASSET_TOPIC_RESOURCE.equals(resources[0])) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } this.findAssets(); JsonArray request; try { request = parseRequest(reqPayload); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } if (request == null || request.isEmpty()) { getAssetMetadata(respPayload, this.assets.keySet().iterator()); return; } MetadataRequest parsedRequest; try { parsedRequest = new MetadataRequest(request); } catch (Exception e) { respPayload.setResponseCode(KuraResponsePayload.RESPONSE_CODE_BAD_REQUEST); return; } getAssetMetadata(respPayload, parsedRequest.getAssetNames().iterator()); }
Source:
<code>AwsS3Endpoints() { endpoints.put("ap-northeast-1", "s3-ap-northeast-1.amazonaws.com"); endpoints.put("ap-northeast-2", "s3-ap-northeast-2.amazonaws.com"); endpoints.put("ap-south-1", "s3-ap-south-1.amazonaws.com"); endpoints.put("ap-southeast-1", "s3-ap-southeast-1.amazonaws.com"); endpoints.put("ap-southeast-2", "s3-ap-southeast-2.amazonaws.com"); endpoints.put("eu-central-1", "s3-eu-central-1.amazonaws.com"); endpoints.put("eu-west-1", "s3-eu-west-1.amazonaws.com"); <START> endpoints.put("eu-west-1", "s3-eu-west-1.amazonaws.com"); <END> endpoints.put("sa-east-1", "s3-sa-east-1.amazonaws.com"); endpoints.put("us-west-1", "s3-us-west-1.amazonaws.com"); endpoints.put("us-west-2", "s3-us-west-2.amazonaws.com"); endpoints.put("us-east-1", "s3.amazonaws.com"); endpoints.put("us-east-2", "s3-us-east-2.amazonaws.com"); endpoints.put("ca-central-1", "s3.ca-central-1.amazonaws.com"); endpoints.put("cn-north-1", "s3.cn-north-1.amazonaws.com.cn"); }</code><technical_language>eu-west-2 eu-west-1</technical_language>

Target:
AwsS3Endpoints() { endpoints.put("ap-northeast-1", "s3-ap-northeast-1.amazonaws.com"); endpoints.put("ap-northeast-2", "s3-ap-northeast-2.amazonaws.com"); endpoints.put("ap-south-1", "s3-ap-south-1.amazonaws.com"); endpoints.put("ap-southeast-1", "s3-ap-southeast-1.amazonaws.com"); endpoints.put("ap-southeast-2", "s3-ap-southeast-2.amazonaws.com"); endpoints.put("eu-central-1", "s3-eu-central-1.amazonaws.com"); endpoints.put("eu-west-1", "s3-eu-west-1.amazonaws.com"); endpoints.put("eu-west-2", "s3-eu-west-2.amazonaws.com"); endpoints.put("sa-east-1", "s3-sa-east-1.amazonaws.com"); endpoints.put("us-west-1", "s3-us-west-1.amazonaws.com"); endpoints.put("us-west-2", "s3-us-west-2.amazonaws.com"); endpoints.put("us-east-1", "s3.amazonaws.com"); endpoints.put("us-east-2", "s3-us-east-2.amazonaws.com"); endpoints.put("ca-central-1", "s3.ca-central-1.amazonaws.com"); endpoints.put("cn-north-1", "s3.cn-north-1.amazonaws.com.cn"); }
Source:
<code>public Task<Void> delete(@NonNull Context context) { FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser(); if (currentUser == null) { return Tasks.forException(new FirebaseAuthInvalidUserException( String.valueOf(CommonStatusCodes.SIGN_IN_REQUIRED), "No currently signed in user.")); } Task<Void> deleteUserTask = currentUser.delete(); List<Credential> credentials = credentialsFromFirebaseUser(currentUser); CredentialsClient client; <START> if (context instanceof Activity) { <END> client = Credentials.getClient((Activity) context); } else { client = Credentials.getClient(context); } List<Task<?>> credentialTasks = new ArrayList<>(); for (Credential credential : credentials) { credentialTasks.add(client.delete(credential)); } final Task<Void> combinedCredentialTask = Tasks.whenAll(credentialTasks); return Tasks.whenAll(deleteUserTask, signOutIdps(context), combinedCredentialTask); }</code><technical_language>repeating this block, move out a static method like: java public static getCredentialsClient(@NonNull Context context) { if (context instanceof Activity) { return Credentials.getClient((Activity) context); } else { return Credentials.getClient(context); } }</technical_language>

Target:
public Task<Void> delete(@NonNull Context context) { final FirebaseUser currentUser = FirebaseAuth.getInstance().getCurrentUser(); if (currentUser == null) { return Tasks.forException(new FirebaseAuthInvalidUserException( String.valueOf(CommonStatusCodes.SIGN_IN_REQUIRED), "No currently signed in user.")); } final List<Credential> credentials = getCredentialsFromFirebaseUser(currentUser); final CredentialsClient client = GoogleApiUtils.getCredentialsClient(context); return signOutIdps(context).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(@NonNull Task<Void> task) { task.getResult(); return currentUser.delete(); } }).continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(@NonNull Task<Void> task) { task.getResult(); List<Task<?>> credentialTasks = new ArrayList<>(); for (Credential credential : credentials) { credentialTasks.add(client.delete(credential)); } return Tasks.whenAll(credentialTasks) .continueWithTask(new Continuation<Void, Task<Void>>() { @Override public Task<Void> then(@NonNull Task<Void> task) { Exception e = task.getException(); Throwable t = e == null ? null : e.getCause(); if (!(t instanceof ApiException) || ((ApiException) t).getStatusCode() != CommonStatusCodes.CANCELED) { task.getResult(); } return Tasks.forResult(null); } }); } }); }
Source:
<code>LuceneSearchResult<H> loadBlocking() { SearchProjectionTransformContext transformContext = extractContext.createProjectionTransformContext(); <START> LoadingResult<?> loadingResult = extractContext.getProjectionHitMapper().loadBlocking( null ); <END> int readIndex = 0; int writeIndex = 0; for ( ; readIndex < extractedData.size(); ++readIndex ) { transformContext.reset(); H transformed = transformUnsafe( rootProjection, loadingResult, extractedData.get( readIndex ), transformContext ); if ( transformContext.hasFailedLoad() ) { continue; } extractedData.set( writeIndex, transformed ); ++writeIndex; } if ( writeIndex < readIndex ) { extractedData.subList( writeIndex, readIndex ).clear(); } @SuppressWarnings("unchecked") List<H> loadedHits = Collections.unmodifiableList( (List<? extends H>) extractedData ); extractedData = null; return new LuceneSearchResultImpl<>( hitCount, loadedHits, extractedAggregations, took, timedOut ); }</code><technical_language>problem for multi-entity loading: if a timeout of 2ms, spent 1ms retrieving top docs Lucene, allowing loading 2ms, in end allow 3ms. address this, pass a timeout, pass a deadline (Instant long representing nanos, prefer). if want pass a timeout, subtract elapsed time</technical_language>

Target:
LuceneSearchResult<H> loadBlocking() { SearchProjectionTransformContext transformContext = extractContext.createProjectionTransformContext(); LoadingResult<?> loadingResult = extractContext.getProjectionHitMapper().loadBlocking(); int readIndex = 0; int writeIndex = 0; for ( ; readIndex < extractedData.size(); ++readIndex ) { transformContext.reset(); H transformed = transformUnsafe( rootProjection, loadingResult, extractedData.get( readIndex ), transformContext ); if ( transformContext.hasFailedLoad() ) { continue; } extractedData.set( writeIndex, transformed ); ++writeIndex; } if ( writeIndex < readIndex ) { extractedData.subList( writeIndex, readIndex ).clear(); } @SuppressWarnings("unchecked") List<H> loadedHits = Collections.unmodifiableList( (List<? extends H>) extractedData ); extractedData = null; return new LuceneSearchResultImpl<>( hitCount, loadedHits, extractedAggregations, took, timedOut ); }
Source:
<code>protected void preTick() { this.lock.lock(); try { this.condition.await(this.minimumTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { } catch (IllegalMonitorStateException e) { Sponge.getLogger().error("The scheduler internal state machine suffered a catastrophic error. Check #spongedev"); <START> Sponge.getLogger().error(e.toString()); <END> } }</code><technical_language>give exception logger above, leave out this line. a error message of happened good</technical_language>

Target:
protected void preTick() { this.lock.lock(); try { this.condition.await(this.minimumTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException ignored) { } catch (IllegalMonitorStateException e) { Sponge.getLogger().error("The scheduler internal state machine suffered a catastrophic error", e); } }
Source:
<code>public void testPuts() { Mutation m = new Mutation(new Text("r1")); <START> m.at().family(nt("cf1")).qualifier(nt("cq1")).set(nv("v1")); <END> m.put(nt("cf2"), nt("cq2"), new ColumnVisibility("cv2"), nv("v2")); m.put(nt("cf3"), nt("cq3"), 3l, nv("v3")); m.put(nt("cf4"), nt("cq4"), new ColumnVisibility("cv4"), 4l, nv("v4")); m.putDelete(nt("cf5"), nt("cq5")); m.putDelete(nt("cf6"), nt("cq6"), new ColumnVisibility("cv6")); m.putDelete(nt("cf7"), nt("cq7"), 7l); m.putDelete(nt("cf8"), nt("cq8"), new ColumnVisibility("cv8"), 8l); assertEquals(8, m.size()); List<ColumnUpdate> updates = m.getUpdates(); assertEquals(8, m.size()); assertEquals(8, updates.size()); verifyColumnUpdate(updates.get(0), "cf1", "cq1", "", 0l, false, false, "v1"); verifyColumnUpdate(updates.get(1), "cf2", "cq2", "cv2", 0l, false, false, "v2"); verifyColumnUpdate(updates.get(2), "cf3", "cq3", "", 3l, true, false, "v3"); verifyColumnUpdate(updates.get(3), "cf4", "cq4", "cv4", 4l, true, false, "v4"); verifyColumnUpdate(updates.get(4), "cf5", "cq5", "", 0l, false, true, ""); verifyColumnUpdate(updates.get(5), "cf6", "cq6", "cv6", 0l, false, true, ""); verifyColumnUpdate(updates.get(6), "cf7", "cq7", "", 7l, true, true, ""); verifyColumnUpdate(updates.get(7), "cf8", "cq8", "cv8", 8l, true, true, ""); }</code><technical_language>thinking of adding conditionalSet() method</technical_language>

Target:
public void testPuts() { Mutation m = new Mutation(new Text("r1")); m.put(nt("cf1"), nt("cq1"), nv("v1")); m.put(nt("cf2"), nt("cq2"), new ColumnVisibility("cv2"), nv("v2")); m.put(nt("cf3"), nt("cq3"), 3l, nv("v3")); m.put(nt("cf4"), nt("cq4"), new ColumnVisibility("cv4"), 4l, nv("v4")); m.putDelete(nt("cf5"), nt("cq5")); m.putDelete(nt("cf6"), nt("cq6"), new ColumnVisibility("cv6")); m.putDelete(nt("cf7"), nt("cq7"), 7l); m.putDelete(nt("cf8"), nt("cq8"), new ColumnVisibility("cv8"), 8l); assertEquals(8, m.size()); List<ColumnUpdate> updates = m.getUpdates(); assertEquals(8, m.size()); assertEquals(8, updates.size()); verifyColumnUpdate(updates.get(0), "cf1", "cq1", "", 0l, false, false, "v1"); verifyColumnUpdate(updates.get(1), "cf2", "cq2", "cv2", 0l, false, false, "v2"); verifyColumnUpdate(updates.get(2), "cf3", "cq3", "", 3l, true, false, "v3"); verifyColumnUpdate(updates.get(3), "cf4", "cq4", "cv4", 4l, true, false, "v4"); verifyColumnUpdate(updates.get(4), "cf5", "cq5", "", 0l, false, true, ""); verifyColumnUpdate(updates.get(5), "cf6", "cq6", "cv6", 0l, false, true, ""); verifyColumnUpdate(updates.get(6), "cf7", "cq7", "", 7l, true, true, ""); verifyColumnUpdate(updates.get(7), "cf8", "cq8", "cv8", 8l, true, true, ""); }
Source:
<code>public Expr apply(final List<Expr> args) { <START> if (args.size() < 2 || args.size() > 3) { <END> throw new IAE("Function[%s] must have 2 arguments", name()); } final Expr arg = args.get(0); final Expr patternExpr = args.get(1); if (!patternExpr.isLiteral() || !(patternExpr.getLiteralValue() == null || patternExpr.getLiteralValue() instanceof String)) { throw new IAE("Function[%s] pattern must be a string literal", name()); } final Pattern pattern = Pattern.compile( StringUtils.nullToEmptyNonDruidDataString((String) patternExpr.getLiteralValue()) ); class RegexpLikeExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr { private RegexpLikeExpr(Expr arg) { super(FN_NAME, arg); } @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { final String s = arg.eval(bindings).asString(); final Matcher matcher = pattern.matcher(NullHandling.nullToEmptyIfNeeded(s)); return ExprEval.of(matcher.find(), ExprType.LONG); } @Override public Expr visit(Shuttle shuttle) { Expr newArg = arg.visit(shuttle); return shuttle.visit(new RegexpLikeExpr(newArg)); } @Override public String stringify() { return StringUtils.format("%s(%s, %s)", FN_NAME, arg.stringify(), patternExpr.stringify()); } } return new RegexpLikeExpr(arg); }</code><technical_language>is 3rd argument for? I 2 in this expr suggestion if (args.size() != 2) {</technical_language>

Target:
public Expr apply(final List<Expr> args) { if (args.size() != 2) { throw new IAE("Function[%s] must have 2 arguments", name()); } final Expr arg = args.get(0); final Expr patternExpr = args.get(1); if (!ExprUtils.isStringLiteral(patternExpr)) { throw new IAE("Function[%s] pattern must be a string literal", name()); } final Pattern pattern = Pattern.compile( StringUtils.nullToEmptyNonDruidDataString((String) patternExpr.getLiteralValue()) ); class RegexpLikeExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr { private RegexpLikeExpr(Expr arg) { super(FN_NAME, arg); } @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { final String s = NullHandling.nullToEmptyIfNeeded(arg.eval(bindings).asString()); if (s == null) { return ExprEval.of(false, ExprType.LONG); } else { final Matcher matcher = pattern.matcher(s); return ExprEval.of(matcher.find(), ExprType.LONG); } } @Override public Expr visit(Shuttle shuttle) { Expr newArg = arg.visit(shuttle); return shuttle.visit(new RegexpLikeExpr(newArg)); } @Override public String stringify() { return StringUtils.format("%s(%s, %s)", FN_NAME, arg.stringify(), patternExpr.stringify()); } } return new RegexpLikeExpr(arg); }
Source:
<code>public void testUpdateGlusterHook() { dao.updateGlusterHook(getGlusterHook()); GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID); assertNotNull(hook); <START> assertEquals(CHECKSUM, hook.getChecksum()); <END> }</code><technical_language>compare object instead of checksum</technical_language>

Target:
public void testUpdateGlusterHook() { GlusterHookEntity existingHook = getGlusterHook(); existingHook.setName(EXISTING_HOOK_NAME); dao.updateGlusterHook(getGlusterHook()); GlusterHookEntity hook = dao.getById(FixturesTool.HOOK_ID); assertNotNull(hook); assertEquals(existingHook, hook); }
Source:
<code>public void readData(long n) { long curDataPoints = read.addAndGet(n); <START> if (curDataPoints > 1_000_000) { <END> long total = quotaWatchers.stream().map(QuotaWatcher::getReadData).reduce(0L, Long::sum); log.info("Total: {}; watchers: {}; Data points: {}; added: {}", total, quotaWatchers.size(), curDataPoints, n); } throwIfViolated(); dataInMemoryReporter.reportDataHasBeenRead(n); }</code><technical_language>I this is temp code raw number in a const please</technical_language>

Target:
public void readData(long n) { long curDataPoints = read.addAndGet(n); if (curDataPoints > LOGLIMIT) { long total = quotaWatchers.stream().map(QuotaWatcher::getReadData) .reduce(0L, Long::sum); log.info("Data Points READ: Instance {}; This Query: {}; Delta: {}" + " (# Wathcers: {})", total, curDataPoints, n, quotaWatchers.size()); } throwIfViolated(); dataInMemoryReporter.reportDataHasBeenRead(n); }
Source:
<code>public List<String> unapply(@Nullable final String value) { String valueToLookup = NullHandling.nullToEmptyIfNeeded(value); if (valueToLookup == null) { <START> return Collections.EMPTY_LIST; <END> } return Lists.newArrayList(Maps.filterKeys(map, key -> map.get(key).equals(valueToLookup)).keySet()); }</code><technical_language>Collections.emptyList()</technical_language>

Target:
public List<String> unapply(@Nullable final String value) { String valueToLookup = NullHandling.nullToEmptyIfNeeded(value); if (valueToLookup == null) { return Collections.emptyList(); } return map.entrySet() .stream() .filter(entry -> entry.getValue().equals(valueToLookup)) .map(entry -> entry.getKey()) .collect(Collectors.toList()); }
Source:
<code>private SSLContext buildSslContext() { SSLContext sslContext = null; try { SSLContextBuilder sslBuilder = sslContextBuilder; if (trustSelfSignCert) { if (sslBuilder != null) { <START> throw new IllegalStateException("Cannot configure both SSLContextBuilder and TrustSelfSignCert"); <END> } sslBuilder = SSLContexts.custom().loadTrustMaterial(TrustSelfSignedMultiChainStrategy.INSTANCE); } if (sslBuilder != null) { sslContext = sslBuilder.build(); } } catch (Exception e) { e.printStackTrace(); } return sslContext != null ? sslContext : SSLContexts.createDefault(); }</code><technical_language>is reason for this validation</technical_language>

Target:
private SSLContext buildSslContext() { SSLContext sslContext = null; try { SSLContextBuilder sslBuilder = sslContextBuilder; if (trustSelfSignCert) { if (sslBuilder == null) { sslBuilder = SSLContexts.custom(); } sslBuilder.loadTrustMaterial(TrustSelfSignedMultiChainStrategy.INSTANCE); } if (sslBuilder != null) { sslContext = sslBuilder.build(); } } catch (Exception e) { e.printStackTrace(); } return sslContext != null ? sslContext : SSLContexts.createDefault(); }