auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void pollNotifications(@NonNull final Context context) { if (!User.isLoggedIn() || !lastDescriptionEditedWithin(R.integer.notification_poll_timeout_days)) { return; } NotificationClient.instance().getNotifications(new Notification.Callback() { @Override public void success(@NonNull List<Notification> notifications) { if (notifications.isEmpty()) { return; } NotificationClient.instance().markRead(notifications); for (final Notification n : notifications) { if (isFromWikidata(n)) { EntityClient.instance().getLabelForLang(n.title().full(), WikipediaApp.getInstance().getWikiSite().languageCode(), new Entity.LabelCallback() { @Override public void success(@NonNull String label) { n.title().setFull(label); showNotification(context, n); } @Override public void failure(Throwable t) { L.e(t); } }); } else { showNotification(context, n); } } } @Override public void failure(Throwable t) { L.e(t); } }, EntityClient.WIKIDATA_WIKI); }

Target:
private void pollNotifications(@NonNull final Context context) { NotificationClient.instance().getNotifications(new NotificationClient.Callback() { @Override public void success(@NonNull List<Notification> notifications) { if (notifications.isEmpty()) { return; } NotificationClient.instance().markRead(notifications); for (final Notification n : notifications) { if (n.isFromWikidata()) { EntityClient.instance().getLabelForLang(n.title().full(), WikipediaApp.getInstance().getWikiSite().languageCode(), new EntityClient.LabelCallback() { @Override public void success(@NonNull String label) { n.title().setFull(label); NotificationPresenter.showNotification(context, n); } @Override public void failure(Throwable t) { L.e(t); } }); } else { NotificationPresenter.showNotification(context, n); } } } @Override public void failure(Throwable t) { L.e(t); } }, EntityClient.WIKIDATA_WIKI); }
Source:
public void verifyVideoOoyalaEmbed() { WebElement container = videoEmbed.findElement(By.tagName("div")); String containerId = "ooyalaplayer-"; Assertion.assertStringContains(container.getAttribute("id"), containerId); WebElement object = container.findElement(By.tagName("object")); Assertion.assertTrue( object.isDisplayed() ); PageObjectLogging.log("verifyVideoOoyalaEmbed", "Ooyala video is embedded", true); }

Target:
public void verifyVideoOoyalaEmbed() { WebElement container = videoEmbed.findElement(By.tagName("div")); String containerId = "ooyalaplayer-"; Assertion.assertStringContains(container.getAttribute("id"), containerId); waitForElementVisibleByElement(container.findElement(By.tagName("object"))); PageObjectLogging.log("verifyVideoOoyalaEmbed", "Ooyala video is embedded", true); }
Source:
public void testTimeout() throws SystemException, RemoteException { log.info("Method stateless #testTimeout called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); try { TxTestUtil.waitForTimeout(tm); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new RemoteException("Interupted during waiting for transaction timeout", ie); } }

Target:
public void testTimeout() throws SystemException, RemoteException { log.trace("Method stateless #testTimeout called"); Transaction txn; txn = tm.getTransaction(); TxTestUtil.enlistTestXAResource(txn); TxTestUtil.enlistTestXAResource(txn); try { TxTestUtil.waitForTimeout(tm); } catch (InterruptedException ie) { Thread.currentThread().interrupt(); throw new RemoteException("Interupted during waiting for transaction timeout", ie); } }
Source:
public static void mkdir(final File d, boolean skipExisting) throws IOException { if (skipExisting && d.exists() && d.isDirectory()) return; if (!d.mkdir()) throw new IOException(MessageFormat.format( JGitText.get().mkDirFailed, d.getAbsolutePath())); }

Target:
public static void mkdir(final File d, boolean skipExisting) throws IOException { if (!d.mkdir()) { if (skipExisting && d.isDirectory()) return; throw new IOException(MessageFormat.format( JGitText.get().mkDirFailed, d.getAbsolutePath())); } }
Source:
public void run() { while (!terminate) { Job runningJob = null; try { runningJob = queue.take(); } catch (InterruptedException e) { LOGGER.warn("FIFOScheduler is interrupted", e); break; } runJobInScheduler(runningJob); } }

Target:
public void run() { while (!terminate) { Job runningJob = null; try { runningJob = queue.take(); } catch (InterruptedException e) { LOGGER.warn("{} is interrupted", getClass().getSimpleName(), e); break; } runJobInScheduler(runningJob); } }
Source:
public boolean hasNestedTargetReferences() { boolean found = false; Iterator<List<Mapping>> mapIterator = mappings.values().iterator(); while ( mapIterator.hasNext() && !found ) { Iterator<Mapping> listIterator = mapIterator.next().iterator(); while ( listIterator.hasNext() && !found ) { TargetReference targetReference = listIterator.next().getTargetReference(); found = targetReference.isValid() && targetReference.getPropertyEntries().size() > 1; } } return found; }

Target:
public boolean hasNestedTargetReferences() { for ( List<Mapping> mappingList : mappings.values() ) { for ( Mapping mapping : mappingList ) { TargetReference targetReference = mapping.getTargetReference(); if ( targetReference.isValid() && targetReference.getPropertyEntries().size() > 1 ) { return true; } } } return false; }
Source:
public final Attribute getAttribute(String name) { if (StringUtils.isEmpty(name)) { return null; } if (Metacard.ID.equals(name)) { return this.id; } return attributes .stream() .filter(attr -> !StringUtils.isEmpty(attr.getName())) .filter(attr -> name.equals(attr.getName())) .findFirst() .orElse(null); }

Target:
public final Attribute getAttribute(String name) { if (StringUtils.isEmpty(name)) { return null; } if (Metacard.ID.equals(name)) { return this.id; } return attributes .stream() .filter(Objects::nonNull) .filter(attr -> name.equals(attr.getName())) .findFirst() .orElse(null); }
Source:
public ChangeLogSet<? extends Entry> parseRun(Run build, SCM scm, File changelogFile) throws IOException, SAXException { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, SCM.class, File.class)) { return parseRun((AbstractBuild) build, scm, changelogFile); } else { throw new AbstractMethodError("You must override the newer overload of parse"); } }

Target:
public ChangeLogSet<? extends Entry> parseRun(Run build, SCM scm, File changelogFile) throws IOException, SAXException { if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, SCM.class, File.class)) { return parse((AbstractBuild) build, scm, changelogFile); } else { throw new AbstractMethodError("You must override the newer overload of parseRun"); } }
Source:
public void execute(final Talks talks) throws IOException { if (talks == null) { return; } int idx = this.index(talks); for (final Talk talk : talks.active()) { final XML xml = talk.read(); final List<XML> requestNodes = xml.nodes("/talk/request"); final int current = idx + 1; final String index = "index"; if (requestNodes.isEmpty()) { talk.modify(new Directives().xpath("/talk").addIf("request") .attr(index, Integer.toString(current)) .attr("id", this.generateRequestID()).add("type") .set(index).up().add("args") ); idx = current; } } }

Target:
public void execute(final Talks talks) throws IOException { int idx = this.index(talks); for (final Talk talk : talks.active()) { idx += 1; talk.modify( new Directives() .xpath("/talk/request") .attr("index", Integer.toString(idx)) ); } }
Source:
public static SelectorHandler getHandler(final String selectorStr) { for (final Entry<String, SelectorHandler> handler : selectorHandlers.entrySet()) if (selectorStr.startsWith(handler.getKey())) return handler.getValue(); return vanillaHandler; }

Target:
public static SelectorHandler getHandler(final String selectorStr) { if (!selectorStr.isEmpty()) { for (final Entry<String, SelectorHandler> handler : selectorHandlers.subMap(selectorStr, true, selectorStr.substring(0, 1), true).entrySet()) { if (selectorStr.startsWith(handler.getKey())) { return handler.getValue(); } } } return vanillaHandler; }
Source:
public OSProcessBuilder createForkedProcessBuilder(TaskContext context, File serializedContext, PrintStream outputSink, PrintStream errorSink, File workingDir) throws Exception { OSProcessBuilder processBuilder; String nativeScriptPath = context.getSchedulerHome(); ScriptResult forkEnvironmentScriptResult = null; if (context.isRunAsUser()) { shareWorkingDirWithRunAsMeUser(workingDir); processBuilder = ForkerUtils.getOSProcessBuilderFactory(nativeScriptPath).getBuilder( ForkerUtils.checkConfigAndGetUser(context.getDecrypter())); } else { processBuilder = ForkerUtils.getOSProcessBuilderFactory(nativeScriptPath).getBuilder(); } ForkEnvironment forkEnvironment = context.getInitializer().getForkEnvironment(); if (forkEnvironment != null) { if (forkEnvironment.getEnvScript() != null) { forkEnvironmentScriptResult = forkEnvironmentScriptExecutor .executeForkEnvironmentScript(context, outputSink, errorSink); } try { processBuilder.environment().putAll( taskContextVariableExtractor .extractVariablesThirdPartyCredentialsAndSystemEnvironmentVariables(context)); } catch (IllegalArgumentException processEnvironmentReadOnly) { throw new IllegalStateException( "Cannot use runAsMe mode and set system environment properties", processEnvironmentReadOnly); } } processBuilder .command() .addAll(forkedJvmTaskExecutionCommandCreator .createForkedJvmTaskExecutionCommand(context, forkEnvironmentScriptResult, serializedContext.getAbsolutePath() )); processBuilder = processBuilder.directory(workingDir); return processBuilder; }

Target:
public OSProcessBuilder createForkedProcessBuilder(TaskContext context, File serializedContext, PrintStream outputSink, PrintStream errorSink, File workingDir) throws Exception { String nativeScriptPath = context.getSchedulerHome(); OSProcessBuilder processBuilder = getOsProcessBuilder(context, workingDir, nativeScriptPath); ScriptResult forkEnvironmentScriptResult = executeForkEnvironmentScriptAndExtractVariables(context, outputSink, errorSink, processBuilder); processBuilder .command() .addAll(forkedJvmTaskExecutionCommandCreator .createForkedJvmTaskExecutionCommand(context, forkEnvironmentScriptResult, serializedContext.getAbsolutePath() )); processBuilder = processBuilder.directory(workingDir); return processBuilder; }
Source:
void assertWithHamcrestMatcher() { assertThat(2 + 1, is(equalTo(calculator.subtract(4, 1)))); }

Target:
void assertWithHamcrestMatcher() { assertThat(3, is(equalTo(calculator.subtract(4, 1)))); }
Source:
public String getBucketRebuildMemoryHint() throws OperationNotSupportedException { if (this.service.versionCompare("5.0") < 0) { throw new OperationNotSupportedException("bucketRebuildMemoryHint unavailable before Splunk 5.0"); } else { return getString("bucketRebuildMemoryHint"); } }

Target:
public String getBucketRebuildMemoryHint() { return getString("bucketRebuildMemoryHint"); }
Source:
private void createDirectories() { if (jsonFile.getParentFile() != null) { File directory = new File(jsonFile.getParent()); if ((!directory.exists() || !directory.isDirectory()) && !directory.mkdirs()) { logger.warn("Could not create config file directory"); } } }

Target:
private void createDirectories() throws IOException { if (jsonFile.getParentFile() != null) { File directory = new File(jsonFile.getParent()); if ((!directory.exists() || !directory.isDirectory()) && !directory.mkdirs()) { throw new IOException("Could not create config file directory"); } } }
Source:
public void application_is_listed_with_details() throws Throwable { webDriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS); Date presentDate = currentDateMinus(5); WebElement table = webDriver.findElement(By.id(APPLICATIONS_TABLE)); List<WebElement> lastRowInTheTable = getValuesFromTheLastRowFromTheTable(table); String positionName = lastRowInTheTable.get(COLUMN_ZEROTH).getText(); Date addedDate = SIMPLE_DATE_FORMAT.parse(lastRowInTheTable.get(COLUMN_FIRST).getText()); Date lastModifiedDate = SIMPLE_DATE_FORMAT.parse(lastRowInTheTable.get(COLUMN_SECOND).getText()); String stateName = lastRowInTheTable.get(COLUMN_THIRD).getText(); assertThat(positionName, equalTo(DEVELOPER_IN_HUN)); assertThat(addedDate, lessThanOrEqualTo(presentDate)); assertThat(lastModifiedDate, lessThanOrEqualTo(presentDate)); assertThat(stateName, equalTo(NEW_APPLY_IN_HUN)); }

Target:
public void application_is_listed_with_details() throws Throwable { WebElement table = webDriver.findElement(By.id(APPLICATIONS_TABLE)); List<WebElement> lastRowInTheTable = getValuesFromTheLastRowFromTheTable(table); Date presentDate = currentDateMinus(15); String positionName = lastRowInTheTable.get(COLUMN_ZEROTH).getText(); Date addedDate = SIMPLE_DATE_FORMAT.parse(lastRowInTheTable.get(COLUMN_FIRST).getText()); Date lastModifiedDate = SIMPLE_DATE_FORMAT.parse(lastRowInTheTable.get(COLUMN_SECOND).getText()); String stateName = lastRowInTheTable.get(COLUMN_THIRD).getText(); assertThat(positionName, equalTo(DEVELOPER_IN_HUN)); assertThat(addedDate, greaterThan(presentDate)); assertThat(lastModifiedDate, greaterThan(presentDate)); assertThat(stateName, equalTo(NEW_APPLY_IN_HUN)); }
Source:
public static String machineName(ObjectMeta podMeta, Container container) { final Map<String, String> annotations = podMeta.getAnnotations(); final String machineName; final String containerName = container.getName(); if ((machineName = findMachineName(annotations, containerName)) != null) { return machineName; } final String originalPodName; final Map<String, String> labels = podMeta.getLabels(); if (labels != null && (originalPodName = labels.get(CHE_ORIGINAL_NAME_LABEL)) != null) { return originalPodName + '/' + containerName; } return podMeta.getName() + '/' + containerName; }

Target:
public static String machineName(ObjectMeta podMeta, Container container) { final Map<String, String> annotations = podMeta.getAnnotations(); final String machineName; final String containerName = container.getName(); if (containerName != null && containerName.length() > MAX_CONTAINER_NAME_LENGTH) { throw new IllegalArgumentException( format( "The container name exceeds the allowed limit of %s characters.", MAX_CONTAINER_NAME_LENGTH)); } if (annotations != null && (machineName = annotations.get(format(CONTAINER_DISPLAY_NAMES_FMT, containerName))) != null) { return machineName; } final String originalPodName; final Map<String, String> labels = podMeta.getLabels(); if (labels != null && (originalPodName = labels.get(CHE_ORIGINAL_NAME_LABEL)) != null) { return originalPodName + '/' + containerName; } return podMeta.getName() + '/' + containerName; }
Source:
public OcflSession Open(final String id) { return new OcflSession() { @Override public void put(final String path, final InputStream content) { System.out.println("PUT content with path " + path); client.createOrUpdateNonRDFResource(id + "/" + path, content, "foo/dontCare"); } @Override public void commit() { client.createVersionSnapshot(id, "foo"); } }; }

Target:
public OcflSession Open(final String id) { return new OcflSession() { @Override public void put(final String path, final InputStream content) { client.createOrUpdateNonRDFResource(id + "/" + path, content, "foo/dontCare"); } @Override public void commit() { client.createVersionSnapshot(id, "foo"); } }; }
Source:
protected void setupContent(ViewGroup rootView) { mEmailInput = (WPLoginInputRow) rootView.findViewById(R.id.login_email_row); autoFillFromBuildConfig("DEBUG_DOTCOM_LOGIN_EMAIL", mEmailInput.getEditText()); mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); LinearLayout googleLoginLayout = (LinearLayout) rootView.findViewById(R.id.login_google_layout); googleLoginLayout.setVisibility(BuildConfig.LOGIN_GOOGLE_ENABLED ? View.VISIBLE : View.GONE); LinearLayout googleLoginButton = (LinearLayout) rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_GOOGLE_TAPPED); WPActivityUtils.hideKeyboard(getActivity().getCurrentFocus()); if (NetworkUtils.checkConnection(getActivity())) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); mLoginGoogleFragment = addGoogleFragment(); } } }); }

Target:
protected void setupContent(ViewGroup rootView) { mEmailInput = (WPLoginInputRow) rootView.findViewById(R.id.login_email_row); autoFillFromBuildConfig("DEBUG_DOTCOM_LOGIN_EMAIL", mEmailInput.getEditText()); mEmailInput.addTextChangedListener(this); mEmailInput.setOnEditorCommitListener(this); LinearLayout googleLoginButton = (LinearLayout) rootView.findViewById(R.id.login_google_button); googleLoginButton.setOnClickListener(new OnClickListener() { @SuppressWarnings("PrivateMemberAccessBetweenOuterAndInnerClass") @Override public void onClick(View view) { AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_GOOGLE_TAPPED); WPActivityUtils.hideKeyboard(getActivity().getCurrentFocus()); if (NetworkUtils.checkConnection(getActivity())) { mOldSitesIDs = SiteUtils.getCurrentSiteIds(mSiteStore, false); isSocialLogin = true; addGoogleFragment(); } } }); }
Source:
public ContainerStats stats(final String containerId) throws DockerException, InterruptedException { WebTarget resource = resource().path("containers").path(containerId).path("stats") .queryParam("stream", "0"); try { return request(GET, ContainerStats.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new ContainerNotFoundException(containerId); default: throw e; } } }

Target:
public ContainerStats stats(final String containerId) throws DockerException, InterruptedException { final WebTarget resource = resource().path("containers").path(containerId).path("stats") .queryParam("stream", "0"); try { return request(GET, ContainerStats.class, resource, resource.request(APPLICATION_JSON_TYPE)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new ContainerNotFoundException(containerId); default: throw e; } } }
Source:
public static @Nullable JSONObject getTempModel(@NonNull String tempModelFileName) { Timber.d("getTempModel() fetching tempModel %s", tempModelFileName); try (ByteArrayOutputStream target = new ByteArrayOutputStream()) { CompatHelper.getCompat().copyFile(tempModelFileName, target); return new JSONObject(target.toString()); } catch (IOException | JSONException e) { Timber.e(e, "Unable to read+parse tempModel from file %s", tempModelFileName); return null; } }

Target:
public static JSONObject getTempModel(@NonNull String tempModelFileName) throws IOException { Timber.d("getTempModel() fetching tempModel %s", tempModelFileName); try (ByteArrayOutputStream target = new ByteArrayOutputStream()) { CompatHelper.getCompat().copyFile(tempModelFileName, target); return new JSONObject(target.toString()); } catch (IOException e) { Timber.e(e, "Unable to read+parse tempModel from file %s", tempModelFileName); throw e; } }
Source:
public void testModifyTable_HBase2_Async() throws IOException { super.testModifyTable(new Function<HTableDescriptor, Void>() { @Nullable @Override public Void apply(@Nullable HTableDescriptor descriptor) { try { getAsyncAdmin().modifyTable(descriptor).get(20, TimeUnit.SECONDS); } catch (Exception e) { throw new RuntimeException(e); } return null; } }); }

Target:
public void testModifyTable_HBase2_Async() throws IOException { super.testModifyTable(new Function<HTableDescriptor, Void>() { @Nullable @Override public Void apply(@Nullable HTableDescriptor descriptor) { try { getAsyncAdmin().modifyTable(descriptor).get(1, TimeUnit.MINUTES); } catch (Exception e) { throw new RuntimeException(e); } return null; } }); }
Source:
protected int run(List<String> nonFlagArgs) throws Exception { final KijiTable table = getKiji().openTable(getURI().getTable()); try { final KijiTableWriter writer = table.openTableWriter(); try { for (KijiColumnName column : getURI().getColumns()) { try { final CellSchema cellSchema = table.getLayout().getCellSchema(column); if (cellSchema.getType() != SchemaType.COUNTER) { LOG.error("Can't increment non counter-type column: " + column); return 1; } final EntityId entityId = ToolUtils.createEntityIdFromUserInputs(mEntityId, table.getLayout()); writer.increment(entityId, column.getFamily(), column.getQualifier(), mValue); } catch (IOException ioe) { LOG.error("Error while incrementing column: " + column); return 1; } } } finally { writer.close(); } } finally { table.close(); } return 0; }

Target:
protected int run(List<String> nonFlagArgs) throws Exception { final Kiji kiji = Kiji.Factory.open(mCellURI); try { final KijiTable table = kiji.openTable(mCellURI.getTable()); try { final KijiTableWriter writer = table.openTableWriter(); try { for (KijiColumnName column : mCellURI.getColumns()) { try { final CellSchema cellSchema = table.getLayout().getCellSchema(column); if (cellSchema.getType() != SchemaType.COUNTER) { LOG.error("Can't increment non counter-type column '{}'", column); return FAILURE; } final EntityId entityId = ToolUtils.createEntityIdFromUserInputs(mEntityId, table.getLayout()); writer.increment(entityId, column.getFamily(), column.getQualifier(), mValue); } catch (IOException ioe) { LOG.error("Error while incrementing column '{}'", column); return FAILURE; } } return SUCCESS; } finally { writer.close(); } } finally { table.close(); } } finally { kiji.release(); } }
Source:
public Geometry extractGroupByResult(GroupByResultHolder groupByResultHolder, int groupKey) { return groupByResultHolder.getResult(groupKey); }

Target:
public Geometry extractGroupByResult(GroupByResultHolder groupByResultHolder, int groupKey) { Geometry geometry = groupByResultHolder.getResult(groupKey); return geometry == null ? GeometryUtils.EMPTY_POINT : geometry; }
Source:
public static NetworkClass getNetworkClass(Context context) { ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo mWifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (mWifi.isConnected()) { return NetworkClass.TYPE_WIFI; } TelephonyManager mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); int networkType = mTelephonyManager.getNetworkType(); switch (networkType) { case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_1xRTT: case TelephonyManager.NETWORK_TYPE_IDEN: return NetworkClass.TYPE_2G; case TelephonyManager.NETWORK_TYPE_UMTS: case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: case TelephonyManager.NETWORK_TYPE_EVDO_B: case TelephonyManager.NETWORK_TYPE_EHRPD: return NetworkClass.TYPE_3G; case TelephonyManager.NETWORK_TYPE_HSPAP: case TelephonyManager.NETWORK_TYPE_LTE: return NetworkClass.TYPE_4G; default: return NetworkClass.Unknown; } }

Target:
public static NetworkClass getNetworkClass(Context context) { ConnectivityManager connManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); if (connManager != null) { NetworkInfo wifi = connManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI); if (wifi != null && wifi.isConnected()) { return NetworkClass.TYPE_WIFI; } } TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); if (telephonyManager != null) { int networkType = telephonyManager.getNetworkType(); switch (networkType) { case TelephonyManager.NETWORK_TYPE_GPRS: case TelephonyManager.NETWORK_TYPE_EDGE: case TelephonyManager.NETWORK_TYPE_CDMA: case TelephonyManager.NETWORK_TYPE_1xRTT: case TelephonyManager.NETWORK_TYPE_IDEN: case TelephonyManager.NETWORK_TYPE_UMTS: return NetworkClass.TYPE_2G; case TelephonyManager.NETWORK_TYPE_EVDO_0: case TelephonyManager.NETWORK_TYPE_EVDO_A: case TelephonyManager.NETWORK_TYPE_HSDPA: case TelephonyManager.NETWORK_TYPE_HSUPA: case TelephonyManager.NETWORK_TYPE_HSPA: case TelephonyManager.NETWORK_TYPE_EVDO_B: case TelephonyManager.NETWORK_TYPE_EHRPD: return NetworkClass.TYPE_3G; case TelephonyManager.NETWORK_TYPE_HSPAP: case TelephonyManager.NETWORK_TYPE_LTE: return NetworkClass.TYPE_4G; default: return NetworkClass.Unknown; } } return NetworkClass.Unknown; }
Source:
public MethodBinding[] checkAndAddSyntheticRecordMethods(MethodBinding[] methodBindings, int count) { if (!this.isRecordDeclaration) return methodBindings; List<MethodBinding> tmp = checkAndAddSyntheticRecordComponentAccessors(methodBindings); tmp = checkAndAddSyntheticRecordOverrideMethods(methodBindings, tmp); for (int i = 0; i < count; ++i) tmp.add(methodBindings[i]); return tmp.toArray(new MethodBinding[0]); }

Target:
public MethodBinding[] checkAndAddSyntheticRecordMethods(MethodBinding[] methodBindings, int count) { if (!this.isRecordDeclaration) return methodBindings; List<MethodBinding> implicitMethods = checkAndAddSyntheticRecordComponentAccessors(methodBindings); implicitMethods = checkAndAddSyntheticRecordOverrideMethods(methodBindings, implicitMethods); for (int i = 0; i < count; ++i) implicitMethods.add(methodBindings[i]); return implicitMethods.toArray(new MethodBinding[0]); }
Source:
private Integer parseIdFromViewName(String viewName) { if (viewName.matches("flow_" + "^-?\\d+") || viewName.matches("catch_" + "^-?\\d+")) { String[] strings = viewName.split("_"); String id = strings[1]; if (isInteger(id)) { return new Integer(id); } else { log.info("The portion of the view name that represents the model output id was not an Integer and won't be included in the set: " + id); } } else { log.info("View name did not match catch_ or flow_ prefix and is not included in the set.: " + viewName); } return 0; }

Target:
private Integer parseIdFromViewName(String viewName) { if (viewName.matches("^(flow_|catch_)[-]?[0-9]{9}$")) { String[] strings = viewName.split("_"); String id = strings[1]; if (isInteger(id)) { log.info("The model output id: " + id + " has a view representation already:" + viewName + " No additional views will be created for it."); return new Integer(id); } else { log.info("The portion of the view name that represents the model output id was not an Integer and won't be included in the set to create views : " + id); } } else { log.info("View name did not match catch_ or flow_ prefix and is not included in the set.: " + viewName); } return 0; }
Source:
public int hashCode() { return value != null ? value.hashCode() : 0; }

Target:
public int hashCode() { return Objects.hashCode(value) + (caseSensitive ? (byte) 1 : 0); }
Source:
public static void main(String[] args) throws Exception { Gauge gauge = Gauge.build().name("labels").help("foo").labelNames("bar").register(); for (int i = 0; i < 10000; i++) { gauge.labels(UUID.randomUUID().toString()).set(Math.random()); } ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); Server server = new Server(1234); server.setHandler(context); server.start(); Thread.sleep(1000); byte[] bytes = new byte[8192]; URL url = new URL("http://localhost:1234/metrics"); long start = System.nanoTime(); for (int i = 0; i < 100; i++) { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); InputStream in = connection.getInputStream(); try { while (in.read(bytes) != -1) in.available(); } finally { in.close(); } connection.disconnect(); } System.out.println(String.format("%,3d ns", System.nanoTime() - start)); server.stop(); server.join(); }

Target:
public static void main(String[] args) throws Exception { Gauge gauge = Gauge.build().name("labels").help("foo").labelNames("bar").register(); for (int i = 0; i < 10000; i++) { gauge.labels(UUID.randomUUID().toString()).set(Math.random()); } ServletContextHandler context = new ServletContextHandler(); context.setContextPath("/"); context.addServlet(new ServletHolder(new MetricsServlet()), "/metrics"); Server server = new Server(0); server.setHandler(context); server.start(); Thread.sleep(1000); byte[] bytes = new byte[8192]; URL url = new URL("http", "localhost", server.getConnectors()[0].getLocalPort(), "/metrics"); long start = System.nanoTime(); for (int i = 0; i < 100; i++) { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); InputStream in = connection.getInputStream(); try { while (in.read(bytes) != -1) in.available(); } finally { in.close(); } connection.disconnect(); } System.out.println(String.format("%,3d ns", System.nanoTime() - start)); server.stop(); server.join(); }
Source:
private int getMethodPriority(IMethodInstance mi) { int result = 0; Method method = mi.getMethod().getMethod(); Priority a1 = method.getAnnotation(Priority.class); if (a1 != null) { result = a1.value(); } return result; }

Target:
private int getMethodPriority(IMethodInstance mi) { Method method = getMethod(mi); Priority a1 = method.getAnnotation(Priority.class); if (a1 != null) { return a1.value(); } return 0; }
Source:
protected void registerLaunch() { ILaunchConfigurationWorkingCopy lc; try { lc = getCLaunchConfigType().newInstance(null, "TestLaunch"); } catch(CoreException e) { throw assertFail(); } ISourceLocator sourceLocator = null; DsfLaunch dsfLaunch = new DsfLaunch(lc, "debug", sourceLocator); session.registerModelAdapter(ILaunch.class, dsfLaunch); }

Target:
protected void registerLaunch() { ILaunchConfigurationWorkingCopy lc; try { lc = getCLaunchConfigType().newInstance(null, "TestLaunch"); } catch(CoreException e) { fail(e.getMessage()); return; } ISourceLocator sourceLocator = null; DsfLaunch dsfLaunch = new DsfLaunch(lc, ILaunchManager.DEBUG_MODE, sourceLocator); fSession.registerModelAdapter(ILaunch.class, dsfLaunch); }
Source:
public void setProcessVariables(BaseProcessVariables processVariables) { String value = processVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType(), decl.getKpi()); if (Boolean.parseBoolean(decl.getKpi())) { CustomElement.customKPI.of(variable.getTypedIdentifier()).set(Boolean.parseBoolean(decl.getKpi())); } properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); }

Target:
public void setProcessVariables(BaseProcessVariables processVariables) { String value = processVariables.getValue(); DeclarationList declarationList = DeclarationList.fromString(value); List<Property> properties = process.getProperties(); declarationList.getDeclarations().forEach(decl -> { VariableScope.Variable variable = variableScope.declare(this.process.getId(), decl.getIdentifier(), decl.getType(), decl.getKpi()); if (Boolean.parseBoolean(decl.getKpi())) { CustomElement.customKPI.of(variable.getTypedIdentifier()).set(true); } properties.add(variable.getTypedIdentifier()); this.itemDefinitions.add(variable.getTypeDeclaration()); }); }
Source:
public <T, SpecT> SpecT createSpec(CatalogItem<T, SpecT> item) { CatalogItemDo<T,SpecT> loadedItem = (CatalogItemDo<T, SpecT>) getCatalogItemDo(item.getId()); Class<SpecT> specType = loadedItem.getSpecType(); if (specType==null) return null; String yaml = loadedItem.getPlanYaml(); SpecT spec = null; if (yaml!=null) { DeploymentPlan plan = makePlanFromYaml(yaml); switch (item.getCatalogItemType()) { case ENTITY:return createEntitySpec(loadedItem, plan); case POLICY:return createPolicySpec(loadedItem, plan); default: throw new RuntimeException("Only entity & policy catalog items are supported."); } } try { if (loadedItem.getJavaType()!=null) { SpecT specT = (SpecT) Reflections.findMethod(specType, "create", Class.class).invoke(null, loadedItem.loadJavaClass(mgmt)); spec = specT; } } catch (Exception e) { Exceptions.propagateIfFatal(e); throw new IllegalStateException("Unsupported creation of spec type "+specType+"; it must have a public static create(Class) method", e); } if (spec==null) throw new IllegalStateException("Unknown how to create instance of "+this); return spec; }

Target:
public <T, SpecT> SpecT createSpec(CatalogItem<T, SpecT> item) { CatalogItemDo<T,SpecT> loadedItem = (CatalogItemDo<T, SpecT>) getCatalogItemDo(item.getId()); Class<SpecT> specType = loadedItem.getSpecType(); if (specType==null) return null; String yaml = loadedItem.getPlanYaml(); SpecT spec = null; if (yaml!=null) { DeploymentPlan plan = makePlanFromYaml(yaml); switch (item.getCatalogItemType()) { case ENTITY:return createEntitySpec(loadedItem, plan); case POLICY:return createPolicySpec(loadedItem, plan); default: throw new RuntimeException("Only entity & policy catalog items are supported. Unsupported catalog item type " + item.getCatalogItemType()); } } try { if (loadedItem.getJavaType()!=null) { SpecT specT = (SpecT) Reflections.findMethod(specType, "create", Class.class).invoke(null, loadedItem.loadJavaClass(mgmt)); spec = specT; } } catch (Exception e) { Exceptions.propagateIfFatal(e); throw new IllegalStateException("Unsupported creation of spec type "+specType+"; it must have a public static create(Class) method", e); } if (spec==null) throw new IllegalStateException("Unknown how to create instance of "+this); return spec; }
Source:
RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler, OAuth2Credentials credentials, RetryOptions retryOptions, Logger logger) { this.executor = Preconditions.checkNotNull(scheduler); this.credentials = Preconditions.checkNotNull(credentials); this.retryOptions = Preconditions.checkNotNull(retryOptions); this.logger = Preconditions.checkNotNull(logger); this.isAppEngine = System.getProperty("com.google.appengine.runtime.environment") != null; }

Target:
RefreshingOAuth2CredentialsInterceptor(ExecutorService scheduler, OAuth2Credentials credentials, RetryOptions retryOptions, Logger logger) { this.executor = Preconditions.checkNotNull(scheduler); this.credentials = Preconditions.checkNotNull(credentials); this.retryOptions = Preconditions.checkNotNull(retryOptions); this.logger = Preconditions.checkNotNull(logger); }
Source:
default List<BibEntry> performComplexSearch(ComplexSearchQuery complexSearchQuery) throws FetcherException { try (InputStream stream = getUrlDownload(getComplexQueryURL(complexSearchQuery)).asInputStream()) { List<BibEntry> fetchedEntries = getParser().parseEntries(stream); fetchedEntries.forEach(this::doPostCleanup); return fetchedEntries; } catch (URISyntaxException e) { throw new FetcherException("Search URI is malformed", e); } catch (IOException e) { try { throw new FetcherException("A network error occurred while fetching from " + getComplexQueryURL(complexSearchQuery), e); } catch (URISyntaxException | MalformedURLException uriSyntaxException) { throw new FetcherException("A network error occurred", e); } } catch (ParseException e) { try { throw new FetcherException("An internal parser error occurred while fetching from " + getComplexQueryURL(complexSearchQuery), e); } catch (URISyntaxException | MalformedURLException uriSyntaxException) { throw new FetcherException("An internal parser error occurred", e); } } }

Target:
default List<BibEntry> performComplexSearch(ComplexSearchQuery complexSearchQuery) throws FetcherException { URL urlForQuery; try { urlForQuery = getComplexQueryURL(complexSearchQuery); } catch (URISyntaxException | MalformedURLException | FetcherException e) { throw new FetcherException("Search URI crafted from complex search query is malformed", e); } return getBibEntries(urlForQuery); }
Source:
public static synchronized void shutdownAsynchronousLogging() { if (m_asynchLoggerPool != null) { try { m_asynchLoggerPool.submit(new Runnable() { @Override public void run() }).get(); } catch (Exception e) { Throwables.getRootCause(e).printStackTrace(); } m_asynchLoggerPool.shutdown(); m_asynchLoggerPool = null; } }

Target:
public static synchronized void shutdownAsynchronousLogging() { if (m_asynchLoggerPool != null) { try { m_asynchLoggerPool.submit(new Runnable() { @Override public void run() }).get(); } catch (Exception e) { Throwables.getRootCause(e).printStackTrace(); } m_asynchLoggerPool.shutdown(); try { m_asynchLoggerPool.awaitTermination(365, TimeUnit.DAYS); } catch (InterruptedException e) { throw new RuntimeException("Unable to shutdown VoltLogger", e); } m_asynchLoggerPool = null; } }
Source:
public static void removeMagicResponseContextFields(Map<String, Object> responseContext) { responseContext.remove(DirectDruidClient.QUERY_FAIL_TIME); responseContext.remove(DirectDruidClient.QUERY_TOTAL_BYTES_GATHERED); }

Target:
public static void removeMagicResponseContextFields(Map<String, Object> responseContext) { responseContext.remove(DirectDruidClient.QUERY_TOTAL_BYTES_GATHERED); }
Source:
public void stop() { setAttribute(Attributes.SERVICE_STATE, Lifecycle.STOPPING); try { Entities.invokeEffectorList(this, ImmutableList.of(getAttribute(CONFIG_SERVER_CLUSTER), getAttribute(ROUTER_CLUSTER), getAttribute(SHARD_CLUSTER)), Startable.STOP).get(); } catch (Exception e) { throw Exceptions.propagate(e); } setAttribute(Attributes.SERVICE_STATE, Lifecycle.STOPPED); setAttribute(SERVICE_UP, false); }

Target:
public void stop() { setAttribute(Attributes.SERVICE_STATE, Lifecycle.STOPPING); try { Entities.invokeEffectorList(this, ImmutableList.of(getAttribute(CONFIG_SERVER_CLUSTER), getAttribute(ROUTER_CLUSTER), getAttribute(SHARD_CLUSTER)), Startable.STOP).get(); } catch (Exception e) { setAttribute(Attributes.SERVICE_STATE, Lifecycle.ON_FIRE); throw Exceptions.propagate(e); } setAttribute(Attributes.SERVICE_STATE, Lifecycle.STOPPED); setAttribute(SERVICE_UP, false); }
Source:
protected String getResults(String sqlQuery) { String json = null; if(sqlQuery == null){ json = "{error:true,msg:'SQL was null'}"; }else{ try { Class.forName("org.apache.phoenix.jdbc.PhoenixDriver"); con = DriverManager.getConnection("jdbc:phoenix:"+PHOENIX_HOST+":"+PHOENIX_PORT); EntityFactory nutrientEntityFactory = new EntityFactory(con,sqlQuery); List<Map<String, Object>> nutrients = nutrientEntityFactory .findMultiple(new Object[] {}); ObjectMapper mapper = new ObjectMapper(); json = mapper.writeValueAsString(nutrients); } catch (Exception e) { json = "{error:true,msg:'Serrver Error:"+e.getMessage()+"'}"; } finally { if (con != null) { try { con.close(); } catch (SQLException e) { json = "{error:true,msg:'SQL Serrver Error:"+e.getMessage()+"'}"; } } } } return json; }

Target:
protected String getResults(String sqlQuery) { String json = null; if(sqlQuery == null){ json = "{error:true,msg:'SQL was null'}"; }else{ try { con = ConnectionFactory.getConnection(); EntityFactory nutrientEntityFactory = new EntityFactory(con,sqlQuery); List<Map<String, Object>> nutrients = nutrientEntityFactory .findMultiple(new Object[] {}); ObjectMapper mapper = new ObjectMapper(); json = mapper.writeValueAsString(nutrients); } catch (Exception e) { json = "{error:true,msg:'Serrver Error:"+e.getMessage()+"'}"; } finally { if (con != null) { try { con.close(); } catch (SQLException e) { json = "{error:true,msg:'SQL Serrver Error:"+e.getMessage()+"'}"; } } } } return json; }
Source:
private RevCommit parseCommit(RevCommit revCommit) { RevWalk rw = null; try { rw = new RevWalk(repository); return rw.parseCommit(revCommit); } catch (IOException e) { return revCommit; } finally { if (rw != null) { rw.close(); } } }

Target:
private RevCommit parseCommit(RevCommit revCommit) { try (RevWalk rw = new RevWalk(repository)) { return rw.parseCommit(revCommit); } catch (IOException exception) { LOG.error("Failed to parse commit. ", exception); return revCommit; } }
Source:
protected void computeInnerSurviving(int[]surviving, int base, int numSurviving) { innerSurvivingBase = elementOffset[base]; if (numSurviving == 0) { numInnerSurviving = 0; return; } int numInner = 0; for (int i = 0; i < numSurviving; i++) { int position = surviving[i] + base; numInner += elementOffset[position + 1] - elementOffset[position]; } if (innerSurviving == null || innerSurviving.length < numInner) { innerSurviving = new int[numInner]; } numInnerSurviving = numInner; int fill = 0; for (int i = 0; i < numSurviving; i++) { int position = surviving[i] + base; int startIndex = elementOffset[position]; int endIndex = elementOffset[position + 1]; for (int innerPosition = startIndex; innerPosition < endIndex; innerPosition++) { innerSurviving[fill++] = innerPosition - innerSurvivingBase; } } }

Target:
private void computeInnerSurviving(int[]surviving, int base, int numSurviving) { innerSurvivingBase = elementOffset[base]; if (numSurviving == 0) { numInnerSurviving = 0; return; } int numInner = 0; for (int i = 0; i < numSurviving; i++) { int position = surviving[i] + base; numInner += elementOffset[position + 1] - elementOffset[position]; } if (innerSurviving.length < numInner) { innerSurviving = newIntArrayForReuse(numInner); } numInnerSurviving = numInner; int fill = 0; for (int i = 0; i < numSurviving; i++) { int position = surviving[i] + base; int startIndex = elementOffset[position]; int endIndex = elementOffset[position + 1]; for (int innerPosition = startIndex; innerPosition < endIndex; innerPosition++) { innerSurviving[fill++] = innerPosition - innerSurvivingBase; } } }
Source:
public Row build(RegularAndStaticColumns columns) { int now = FBUtilities.nowInSeconds(); Row.Builder builder = BTreeRow.unsortedBuilder((int) TimeUnit.MILLISECONDS.toSeconds(now)); builder.newRow(clustering); columns.forEach(c -> { Object value = values.get(c); if (null != value) builder.addCell(BufferCell.live(c, now, decompose(c.type, value))); }); return builder.build(); }

Target:
public Row build(RegularAndStaticColumns columns) { long now = clock.now(); Row.Builder builder = BTreeRow.unsortedBuilder(); builder.newRow(clustering); columns.forEach(c -> { Object value = values.get(c); if (null != value) builder.addCell(BufferCell.live(c, now, decompose(c.type, value))); }); return builder.build(); }
Source:
private String createPostResponse(String samlResponse, String relayState, String acsUrl) { StringBuilder builder = new StringBuilder("<!DOCTYPE html>"); builder .append("<html>") .append("<head>") .append("<title>Form Submit</title>") .append("</head>") .append("<body Onload=\"document.forms[0].submit()\">") .append("<form id=\"postform\" method=\"POST\" action=\"") .append(acsUrl) .append("\">") .append("<input type=\"hidden\" name=\"SAMLResponse\" value=\"") .append(samlResponse) .append("\"/>"); if (relayState != null) { builder .append("<input type=\"hidden\" name=\"RelayState\" value=\"") .append(relayState) .append("\"/>"); } builder.append("</form></body></html>"); return builder.toString(); }

Target:
private String createPostResponse(String samlResponse, String relayState, String acsUrl) { String submitFormUpdated = postResponseForm .replace("{{" + Idp.ACS_URL + "}}", acsUrl) .replace("{{" + Idp.SAML_RESPONSE + "}}", samlResponse); if (relayState != null) { submitFormUpdated = submitFormUpdated.replace( "{{" + Idp.RELAY_STATE + "}}", "<input type=\"hidden\" name=\"RelayState\" value=\"" + relayState + "\"/>"); } else { submitFormUpdated = submitFormUpdated.replace("{{" + Idp.RELAY_STATE + "}}", ""); } return submitFormUpdated; }
Source:
public Sequence<T> run(QueryPlus<T> queryPlus, ResponseContext responseContext) { if (queryPlus.getQuery() != query) { throw new ISE("Unexpected query received"); } Sequence<T> result = baseRunner.run(queryPlus.withQuery(newQuery), responseContext); return result; }

Target:
public Sequence<T> run(QueryPlus<T> queryPlus, ResponseContext responseContext) { if (queryPlus.getQuery() != query) { throw new ISE("Unexpected query received"); } return baseRunner.run(queryPlus.withQuery(newQuery), responseContext); }
Source:
FileReftableStack.CompactionStats getCompactionStats() throws IOException { return reftableStack.getStats(); }

Target:
FileReftableStack.CompactionStats getCompactionStats() { return reftableStack.getStats(); }
Source:
public void testUniqueConstraintAndNOTUniqueIndex() { SessionFactoryConfig config = SessionFactoryConfig.entities( UniqueConstraintAndNotUniqueIndexEntity.class ).build(); insideCatchException( config, e -> { assertThat( e ) .isExactlyInstanceOf( HibernateException.class ) .hasMessage( "OGM001231: Unable to create index indexEmail on collection MyDoc" ); assertThat( e.getCause() ).isExactlyInstanceOf( MongoCommandException.class ); assertThat( e.getCause().getMessage() ).contains( "already exists with different options" ); } ); }

Target:
public void testUniqueConstraintAndNOTUniqueIndex() { config = SessionFactoryBuilder.entities( UniqueConstraintAndNotUniqueIndexEntity.class ); UniqueConstraintAndNotUniqueIndexEntity entity = new UniqueConstraintAndNotUniqueIndexEntity(); entity.name = "Fabio Massimo"; entity.email = "fabiomassimo@myemailprovider.eu"; entity.address = "11bis Rue Roquepine Paris"; this.entity = entity; try ( SessionFactory sessionFactory = config.build() ) { inTransaction( sessionFactory, session -> { session.persist( entity ); } ); inTransaction( sessionFactory, session -> { UniqueConstraintAndNotUniqueIndexEntity stored = session.load( UniqueConstraintAndNotUniqueIndexEntity.class, entity.name ); assertThat( entity.email ).isEqualTo( stored.getEmail() ); assertThat( entity.address ).isEqualTo( stored.getAddress() ); } ); } }
Source:
public PrimitiveProtocol protocol() { PrimitiveProtocol protocol = this.protocol; if (protocol == null) { PrimitiveProtocolConfig protocolConfig = config.getProtocolConfig(); if (protocolConfig == null) { Collection<PartitionGroup> partitionGroups = managementService.getPartitionService().getPartitionGroups(); if (partitionGroups.size() == 1) { protocol = partitionGroups.iterator().next().newProtocol(); } else { throw new ConfigurationException("Primitive protocol is ambiguous: " + partitionGroups.size() + " partition groups found"); } } else { protocol = PrimitiveProtocols.createProtocol(protocolConfig); } } return protocol; }

Target:
public PrimitiveProtocol protocol() { PrimitiveProtocol protocol = this.protocol; if (protocol == null) { PrimitiveProtocolConfig protocolConfig = config.getProtocolConfig(); if (protocolConfig == null) { Collection<PartitionGroup> partitionGroups = managementService.getPartitionService().getPartitionGroups(); if (partitionGroups.size() == 1) { protocol = partitionGroups.iterator().next().newProtocol(); } else { String groups = Joiner.on(", ").join(partitionGroups.stream() .map(group -> String.format("%s:%s", group.type().name(), group.name())) .collect(Collectors.toList())); throw new ConfigurationException(String.format("Primitive protocol is ambiguous: %d partition groups found (%s)", partitionGroups.size(), groups)); } } else { protocol = PrimitiveProtocols.createProtocol(protocolConfig); } } return protocol; }