auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onActivityPaused(final Activity activity) { mPaused = true; if (check != null) { mHandler.removeCallbacks(check); } mCurrentActivity = null; mHandler.postDelayed(check = new Runnable(){ @Override public void run() { if (mIsForeground && mPaused) { mIsForeground = false; try { double sessionLength = System.currentTimeMillis() - sStartSessionTime; if (sessionLength >= mConfig.getMinimumSessionDuration() && sessionLength < mConfig.getSessionTimeoutDuration()) { NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH); nf.setMaximumFractionDigits(1); String sessionLengthString = nf.format((System.currentTimeMillis() - sStartSessionTime) / 1000); JSONObject sessionProperties = new JSONObject(); sessionProperties.put(AutomaticEvents.SESSION_LENGTH, sessionLengthString); if (mMpInstance.getPeople().isIdentified()) { mMpInstance.getPeople().increment(AutomaticEvents.TOTAL_SESSIONS, 1); mMpInstance.getPeople().increment(AutomaticEvents.TOTAL_SESSIONS_LENGTH, sessionLength / 1000); } mMpInstance.track(AutomaticEvents.SESSION, sessionProperties, true); } } catch (JSONException e) { e.printStackTrace(); } mMpInstance.onBackground(); } } }, CHECK_DELAY); }

Target:
public void onActivityPaused(final Activity activity) { mPaused = true; if (check != null) { mHandler.removeCallbacks(check); } mCurrentActivity = null; mHandler.postDelayed(check = new Runnable(){ @Override public void run() { if (mIsForeground && mPaused) { mIsForeground = false; try { double sessionLength = System.currentTimeMillis() - sStartSessionTime; if (sessionLength >= mConfig.getMinimumSessionDuration() && sessionLength < mConfig.getSessionTimeoutDuration()) { NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH); nf.setMaximumFractionDigits(1); String sessionLengthString = nf.format((System.currentTimeMillis() - sStartSessionTime) / 1000); JSONObject sessionProperties = new JSONObject(); sessionProperties.put(AutomaticEvents.SESSION_LENGTH, sessionLengthString); mMpInstance.getPeople().increment(AutomaticEvents.TOTAL_SESSIONS, 1); mMpInstance.getPeople().increment(AutomaticEvents.TOTAL_SESSIONS_LENGTH, sessionLength / 1000); mMpInstance.track(AutomaticEvents.SESSION, sessionProperties, true); } } catch (JSONException e) { e.printStackTrace(); } mMpInstance.onBackground(); } } }, CHECK_DELAY); }
Source:
public void return_null_if_file_doesnt_exist() { ComponentDto project = db.components().insertMainBranch(); ComponentDto mergeBranch = db.components().insertProjectBranch(project, b -> b.setKey("mergeBranch")); ComponentDto branch1 = db.components().insertProjectBranch(project, b -> b.setKey("branch1")); ComponentDto mergeBranchFile = ComponentTesting.newFileDto(mergeBranch, null, "file").setUuid("mergeFile"); ComponentDto file = ComponentTesting.newFileDto(branch1, null, "file").setUuid("file1"); db.components().insertComponents(mergeBranchFile, file); when(branch.getMergeBranchUuid()).thenReturn(Optional.of(mergeBranch.uuid())); assertThat(underTest.getUuid("doesnt exist")).isNull(); }

Target:
public void return_null_if_file_doesnt_exist() { when(branch.getMergeBranchUuid()).thenReturn(Optional.of(mergeBranch.uuid())); assertThat(underTest.getUuid("doesnt exist")).isNull(); }
Source:
public void testGetRuleListWith404() throws InterruptedException { server.enqueue(response404()); List<FirewallRule> list = firewallApi().list("datacenter-id", "server-id", "nic-id", new DepthOptions().depth(1)); assertTrue(list.isEmpty()); assertEquals(server.getRequestCount(), 1); assertSent(server, "GET", "/datacenters/datacenter-id/servers/server-id/nics/nic-id/firewallrules?depth=1"); }

Target:
public void testGetRuleListWith404() throws InterruptedException { server.enqueue(response404()); List<FirewallRule> list = firewallApi().list("datacenter-id", "server-id", "nic-id"); assertTrue(list.isEmpty()); assertEquals(server.getRequestCount(), 1); assertSent(server, "GET", "/datacenters/datacenter-id/servers/server-id/nics/nic-id/firewallrules"); }
Source:
public static String getGerritJarPluginName(File srcFile) throws IOException { JarFile jarFile = new JarFile(srcFile); try { return jarFile.getManifest().getMainAttributes() .getValue("Gerrit-PluginName"); } finally { jarFile.close(); } }

Target:
public static String getGerritJarPluginName(File srcFile) throws IOException { try (JarFile jarFile = new JarFile(srcFile)) { return jarFile.getManifest().getMainAttributes() .getValue("Gerrit-PluginName"); } }
Source:
private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = perf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterateStart = perf.createPerformanceMeter(distributionName + " Iterate sorted by start: " + fName); PerformanceMeter pMiterateEnd = perf.createPerformanceMeter(distributionName + " Iterate sorted by end: " + fName); PerformanceMeter pMiterateDuration = perf.createPerformanceMeter(distributionName + " Iterate sorted by length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, getSegmentStoreSize()); pMiterateStart.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); pMiterateStart.stop(); pMiterateEnd.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); pMiterateEnd.stop(); pMiterateDuration.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); pMiterateDuration.stop(); } pMinsertion.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); }

Target:
private void fullTest(int size, int[] fuzz, String distributionName) { PerformanceMeter pMinsertion = fPerf.createPerformanceMeter(distributionName + " Insertion: " + fName); PerformanceMeter pMiterateStart = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by start: " + fName); PerformanceMeter pMiterateEnd = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by end: " + fName); PerformanceMeter pMiterateDuration = fPerf.createPerformanceMeter(distributionName + " Iterate sorted by length: " + fName); for (int i = 0; i < DEFAULT_LOOP_COUNT; i++) { fSegStore.clear(); pMinsertion.start(); populate(size, fuzz, fSegStore, 0, getSegmentStoreSize()); pMinsertion.stop(); pMiterateStart.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_START_COMPARATOR); pMiterateStart.stop(); pMiterateEnd.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_END_COMPARATOR); pMiterateEnd.stop(); pMiterateDuration.start(); sortedIterate(fSegStore, SegmentComparators.INTERVAL_LENGTH_COMPARATOR); pMiterateDuration.stop(); } pMinsertion.commit(); pMiterateStart.commit(); pMiterateEnd.commit(); pMiterateDuration.commit(); }
Source:
public void connectionChanged(RemoteConnectionChangeEvent event) { IRemoteConnection connection = event.getConnection(); if (connection.getConnectionType().getId().equals(getTypeId())) { switch (event.getType()) { case RemoteConnectionChangeEvent.CONNECTION_ADDED: targetManager.addLaunchTarget(getTypeId(), connection.getName()); break; case RemoteConnectionChangeEvent.CONNECTION_REMOVED: ILaunchTarget target = targetManager.getLaunchTarget(getTypeId(), connection.getName()); if (target != null) { targetManager.removeLaunchTarget(target); } break; case RemoteConnectionChangeEvent.CONNECTION_RENAMED: if (connection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) connection; IRemoteConnection original = ((IRemoteConnectionWorkingCopy) connection).getOriginal(); target = targetManager.getLaunchTarget(getTypeId(), original.getName()); if (target != null ) { targetManager.removeLaunchTarget(target); targetManager.addLaunchTarget(getTypeId(), wc.getName()); } } break; } } }

Target:
public void connectionChanged(RemoteConnectionChangeEvent event) { IRemoteConnection connection = event.getConnection(); if (connection.getConnectionType().getId().equals(getTypeId())) { switch (event.getType()) { case RemoteConnectionChangeEvent.CONNECTION_ADDED: targetManager.addLaunchTarget(getTypeId(), connection.getName()); break; case RemoteConnectionChangeEvent.CONNECTION_REMOVED: ILaunchTarget target = targetManager.getLaunchTarget(getTypeId(), connection.getName()); if (target != null) { targetManager.removeLaunchTarget(target); } break; case RemoteConnectionChangeEvent.CONNECTION_RENAMED: if (connection instanceof IRemoteConnectionWorkingCopy) { IRemoteConnectionWorkingCopy wc = (IRemoteConnectionWorkingCopy) connection; IRemoteConnection original = ((IRemoteConnectionWorkingCopy) connection).getOriginal(); target = targetManager.getLaunchTarget(getTypeId(), original.getName()); if (target != null ) { targetManager.removeLaunchTarget(target); } targetManager.addLaunchTarget(getTypeId(), wc.getName()); } break; } } }
Source:
private VM getVmForNonShareableDiskImage(DiskImage disk) { if (!disk.isShareable()) { List<VM> vms = getVmDAO().getVmsListForDisk(disk.getId()); if (vms != null && !vms.isEmpty()) { return vms.get(0); } } return null; }

Target:
private VM getVmForNonShareableDiskImage(DiskImage disk) { if (!disk.isShareable()) { List<VM> vms = getVmDAO().getVmsListForDisk(disk.getId()); if (!vms.isEmpty()) { return vms.get(0); } } return null; }
Source:
public DataSet<ExecRow> write() throws StandardException{ Configuration conf=new Configuration(HConfiguration.unwrapDelegate()); ByteDataOutput bdo=new ByteDataOutput(); Job job; String encoded; try{ bdo.writeObject(exportFunction); encoded=Base64.encodeBase64String(bdo.toByteArray()); conf.set("exportFunction",encoded); job=Job.getInstance(conf); }catch(IOException e){ throw new RuntimeException(e); } job.setOutputKeyClass(Void.class); job.setOutputValueClass(ExecRow.class); job.setOutputFormatClass(SparkDataSet.EOutputFormat.class); job.getConfiguration().set("mapred.output.dir",directory); SparkContext context = rdd.context(); List<Long> recordsWrittenByTasks = Lists.newArrayList(); context.addSparkListener(new SparkListener() { @Override public void onTaskEnd(SparkListenerTaskEnd taskEnd) { synchronized (this) { recordsWrittenByTasks.add(taskEnd.taskMetrics().outputMetrics().recordsWritten()); } } }); rdd.keyBy(new NullFunction<V>()) .setName(String.format("Export Directory: %s", directory)) .saveAsNewAPIHadoopDataset(job.getConfiguration()); long writtenRows=0; for (Long count:recordsWrittenByTasks) { writtenRows += count; } ValueRow valueRow=new ValueRow(2); valueRow.setColumn(1,new SQLLongint(writtenRows)); valueRow.setColumn(2,new SQLInteger(0)); return new SparkDataSet<>(SpliceSpark.getContext().parallelize(Collections.singletonList(valueRow), 1)); }

Target:
public DataSet<ExecRow> write() throws StandardException{ long start = System.currentTimeMillis(); Configuration conf=new Configuration(HConfiguration.unwrapDelegate()); ByteDataOutput bdo=new ByteDataOutput(); Job job; String encoded; try{ bdo.writeObject(exportFunction); encoded=Base64.encodeBase64String(bdo.toByteArray()); conf.set("exportFunction",encoded); job=Job.getInstance(conf); }catch(IOException e){ throw new RuntimeException(e); } job.setOutputKeyClass(Void.class); job.setOutputValueClass(ExecRow.class); job.setOutputFormatClass(SparkDataSet.EOutputFormat.class); job.getConfiguration().set("mapred.output.dir",directory); SparkContext context = rdd.context(); AtomicLong writtenRows = new AtomicLong(0); context.addSparkListener(new SparkListener() { @Override public void onTaskEnd(SparkListenerTaskEnd taskEnd) { writtenRows.getAndAdd(taskEnd.taskMetrics().outputMetrics().recordsWritten()); } }); rdd.keyBy(new NullFunction<V>()) .setName(String.format("Export Directory: %s", directory)) .saveAsNewAPIHadoopDataset(job.getConfiguration()); long end = System.currentTimeMillis(); ValueRow valueRow=new ValueRow(2); valueRow.setColumn(1,new SQLLongint(writtenRows.get())); valueRow.setColumn(2,new SQLLongint(end-start)); return new SparkDataSet<>(SpliceSpark.getContext().parallelize(Collections.singletonList(valueRow), 1)); }
Source:
public boolean onCreateOptionsMenu(Menu menu) { if (CommCareApplication.instance().isConsumerApp()) { return super.onPrepareOptionsMenu(menu); } super.onCreateOptionsMenu(menu); menu.add(0, FormEntryConstants.MENU_SAVE, 0, StringUtils.getStringRobust(this, R.string.save_all_answers)) .setIcon(android.R.drawable.ic_menu_save); menu.add(0, FormEntryConstants.MENU_HIERARCHY_VIEW, 0, StringUtils.getStringRobust(this, R.string.view_hierarchy)) .setIcon(R.drawable.ic_menu_goto); menu.add(0, FormEntryConstants.MENU_LANGUAGES, 0, StringUtils.getStringRobust(this, R.string.change_language)) .setIcon(R.drawable.ic_menu_start_conversation); menu.add(0, FormEntryConstants.MENU_PREFERENCES, 0, StringUtils.getStringRobust(this, R.string.form_entry_settings)) .setIcon(android.R.drawable.ic_menu_preferences); return true; }

Target:
public boolean onCreateOptionsMenu(Menu menu) { if (CommCareApplication.instance().isConsumerApp()) { return super.onCreateOptionsMenu(menu); } super.onCreateOptionsMenu(menu); menu.add(0, FormEntryConstants.MENU_SAVE, 0, StringUtils.getStringRobust(this, R.string.save_all_answers)) .setIcon(android.R.drawable.ic_menu_save); menu.add(0, FormEntryConstants.MENU_HIERARCHY_VIEW, 0, StringUtils.getStringRobust(this, R.string.view_hierarchy)) .setIcon(R.drawable.ic_menu_goto); menu.add(0, FormEntryConstants.MENU_LANGUAGES, 0, StringUtils.getStringRobust(this, R.string.change_language)) .setIcon(R.drawable.ic_menu_start_conversation); menu.add(0, FormEntryConstants.MENU_PREFERENCES, 0, StringUtils.getStringRobust(this, R.string.form_entry_settings)) .setIcon(android.R.drawable.ic_menu_preferences); return true; }
Source:
private CloseableHttpClient createClientBuilder(URI uri) { ArtifactoryHttpClient artifactoryHttpClient = new ArtifactoryHttpClient(); artifactoryHttpClient.hostFromUrl(uri.toString()); if (StringUtils.isEmpty(accessToken)) { artifactoryHttpClient.authentication(username, password); } if (this.proxy != null) { HttpBuilderBase.ProxyConfigBuilder proxyConfigBuilder = artifactoryHttpClient.proxy(this.proxy.getHost(), this.proxy.getPort()); if (this.proxy.getUser() != null) { proxyConfigBuilder.authentication(this.proxy.getUser(), this.proxy.getPassword()); } } artifactoryHttpClient.userAgent(userAgent); if (connectionTimeout != null) { artifactoryHttpClient.connectionTimeout(connectionTimeout); } if (socketTimeout != null) { artifactoryHttpClient.socketTimeout(socketTimeout); } if (sslContextBuilder != null) { artifactoryHttpClient.sslContextBuilder(sslContextBuilder); } else { artifactoryHttpClient.trustSelfSignCert(!ignoreSSLIssues); } if (requestInterceptorList != null) { for (HttpRequestInterceptor httpRequestInterceptor :requestInterceptorList) { artifactoryHttpClient.addInterceptorLast(httpRequestInterceptor); } } return artifactoryHttpClient.build(); }

Target:
private CloseableHttpClient createClientBuilder(URI uri) { ArtifactoryHttpClient artifactoryHttpClient = new ArtifactoryHttpClient(); artifactoryHttpClient.hostFromUrl(uri.toString()); if (StringUtils.isEmpty(accessToken)) { artifactoryHttpClient.authentication(username, password); } if (this.proxy != null) { HttpBuilderBase.ProxyConfigBuilder proxyConfigBuilder = artifactoryHttpClient.proxy(this.proxy.getHost(), this.proxy.getPort()); if (this.proxy.getUser() != null) { proxyConfigBuilder.authentication(this.proxy.getUser(), this.proxy.getPassword()); } } artifactoryHttpClient.userAgent(userAgent); if (connectionTimeout != null) { artifactoryHttpClient.connectionTimeout(connectionTimeout); } if (socketTimeout != null) { artifactoryHttpClient.socketTimeout(socketTimeout); } if (sslContextBuilder != null) { artifactoryHttpClient.sslContextBuilder(sslContextBuilder); } else { artifactoryHttpClient.trustSelfSignCert(!ignoreSSLIssues); } for (HttpRequestInterceptor httpRequestInterceptor : requestInterceptorList) { artifactoryHttpClient.addInterceptorLast(httpRequestInterceptor); } return artifactoryHttpClient.build(); }
Source:
protected KieServicesClient getClient(final String url) { KieServicesClientProvider clientProvider = clientProviders.stream().filter(provider -> provider.supports(url)).findFirst().orElseThrow(() -> new KieServerControllerNotFoundException("Kie Services Client Provider not found for url: " + url)); logger.debug("Using client provider {}", clientProvider); KieServicesClient client = clientProvider.get(url); logger.debug("Using client {}", clientProvider); if(client == null){ throw new KieServerControllerNotFoundException("Kie Services Client not found for url: " + url); } return client; }

Target:
protected KieServicesClient getClient(final String url) { KieServicesClientProvider clientProvider = clientProviders.stream().filter(provider -> provider.supports(url)).findFirst().orElseThrow(() -> new KieServerControllerIllegalArgumentException("Kie Services Client Provider not found for url: " + url)); logger.debug("Using client provider {}", clientProvider); KieServicesClient client = clientProvider.get(url); logger.debug("Using client {}", client); if(client == null){ throw new KieServerControllerIllegalArgumentException("Kie Services Client not found for url: " + url); } return client; }
Source:
protected static String getStackTraceString(Throwable t) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); t.printStackTrace(pw); pw.close(); return sw.toString(); }

Target:
protected static String getStackTraceString(Throwable t) throws IOException { try (StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw)) { t.printStackTrace(pw); return sw.toString(); } }
Source:
public int getColumnId(String name) { if (fieldsByQualifiedName.containsKey(name)) { return fieldsByQualifiedName.get(name); } String parts = name.split("\\."); if (parts.length == 2 || parts.length == 3) { if (fieldsByQualifiedName.containsKey(name)) { return fieldsByQualifiedName.get(name); } else { return -1; } } else { List<Integer> list = fieldsByName.get(name); if (list == null) { return -1; } else if (list.size() == 1) { return fieldsByName.get(name).get(0); } else if (list.size() == 0) { return -1; } else { throw throwAmbiguousFieldException(list); } } }

Target:
public int getColumnId(String name) { if (fieldsByQualifiedName.containsKey(name)) { return fieldsByQualifiedName.get(name); } List<Integer> list = fieldsByName.get(name); if (list == null) { return -1; } else if (list.size() == 1) { return fieldsByName.get(name).get(0); } else if (list.size() == 0) { return -1; } else { throw throwAmbiguousFieldException(list); } }
Source:
public void check(GHPullRequest ghpr) { setPullRequest(ghpr); if (helper.isProjectDisabled()) { logger.log(Level.FINE, "Project is disabled, ignoring pull request"); return; } try { getPullRequest(false); } catch (IOException e) { logger.log(Level.SEVERE, "Unable to get the latest copy of the PR from github", e); return; } updatePR(pr, pr.getUser()); checkSkipBuild(pr); tryBuild(); }

Target:
public void check(GHPullRequest ghpr) { setPullRequest(ghpr); if (helper.isProjectDisabled()) { logger.log(Level.FINE, "Project is disabled, ignoring pull request"); return; } try { getPullRequest(false); } catch (IOException e) { logger.log(Level.SEVERE, "Unable to get the latest copy of the PR from github", e); return; } updatePR(pr, pr.getUser()); tryBuild(); }
Source:
public static ArrayList<Guid> getGuidListFromStringArray(List<String> strings) { ArrayList<Guid> guidList = new ArrayList<Guid>(); if (CollectionUtils.isEmpty(strings)) { for (String guidString : strings) { guidList.add(Guid.createGuidFromString(guidString)); } } return guidList; }

Target:
public static ArrayList<Guid> getGuidListFromStringArray(List<String> strings) { ArrayList<Guid> guidList = new ArrayList<Guid>(); if (strings != null && !strings.isEmpty()) { for (String guidString : strings) { guidList.add(Guid.createGuidFromString(guidString)); } } return guidList; }
Source:
public PatchSet getBasePatchSet(RevisionEdit edit, RevCommit commit) throws IOException { checkState(commit.getParentCount() == 1); RevCommit parentCommit = commit.getParent(0); RevId parentRev = new RevId(ObjectId.toString(parentCommit.getId())); try { return Iterables.getOnlyElement(db.get().patchSets() .byRevision(parentRev).toList()); } catch (OrmException e) { throw new IOException(e); } }

Target:
public PatchSet getBasePatchSet(RevisionEdit edit, RevCommit commit) throws IOException { RevCommit parentCommit = commit.getParent(0); RevId parentRev = new RevId(ObjectId.toString(parentCommit.getId())); try { return Iterables.getOnlyElement(db.get().patchSets() .byRevision(parentRev).toList()); } catch (OrmException e) { throw new IOException(e); } }
Source:
private void resetValuesIfNeeded(IElement element, IElementParameter mainParam, Map<String, Object> currentLine) { List<Map<String, Object>> tableValues = (List<Map<String, Object>>) mainParam.getValue(); int rowNumber = tableValues.indexOf(currentLine); if (rowNumber != -1) { for (Object item : mainParam.getListItemsValue()) { if (item instanceof IElementParameter) { IElementParameter curParam = (IElementParameter) item; switch (curParam.getFieldType()) { case CLOSED_LIST: String[] itemsToDisplay = getItemsToDisplay(element, curParam, rowNumber); Object currentValue = currentLine.get(curParam.getName()); String currentDisplay = null; if (currentValue instanceof Integer) { if (((Integer) currentValue) < curParam.getListItemsDisplayName().length) { if ((Integer)currentValue >= 0) { currentDisplay = curParam.getListItemsDisplayName()[(Integer) currentValue]; } } } else if (currentValue instanceof String) { int index = ArrayUtils.indexOf(curParam.getListItemsValue(), currentValue); if (index != -1) { currentDisplay = curParam.getListItemsDisplayName()[index]; } } if (currentDisplay != null) { if (!ArrayUtils.contains(itemsToDisplay, currentDisplay)) { String newValue = ""; if (itemsToDisplay.length > 0) { int index = ArrayUtils.indexOf(curParam.getListItemsDisplayName(), itemsToDisplay[0]); newValue = (String) curParam.getListItemsValue()[index]; } currentLine.put(curParam.getName(), newValue); } }else if(itemsToDisplay.length >0){ currentLine.put(curParam.getName(), 0); } break; default: } } } } }

Target:
private void resetValuesIfNeeded(IElement element, IElementParameter mainParam, Map<String, Object> currentLine) { List<Map<String, Object>> tableValues = (List<Map<String, Object>>) mainParam.getValue(); int rowNumber = tableValues.indexOf(currentLine); if (rowNumber != -1) { for (Object item : mainParam.getListItemsValue()) { if (item instanceof IElementParameter) { IElementParameter curParam = (IElementParameter) item; switch (curParam.getFieldType()) { case CLOSED_LIST: String[] itemsToDisplay = getItemsToDisplay(element, curParam, rowNumber); Object currentValue = currentLine.get(curParam.getName()); String currentDisplay = null; if (currentValue instanceof Integer) { if (((Integer) currentValue) < curParam.getListItemsDisplayName().length && (Integer)currentValue >= 0) { currentDisplay = curParam.getListItemsDisplayName()[(Integer) currentValue]; } } else if (currentValue instanceof String) { int index = ArrayUtils.indexOf(curParam.getListItemsValue(), currentValue); if (index != -1) { currentDisplay = curParam.getListItemsDisplayName()[index]; } } if (currentDisplay != null) { if (!ArrayUtils.contains(itemsToDisplay, currentDisplay)) { String newValue = ""; if (itemsToDisplay.length > 0) { int index = ArrayUtils.indexOf(curParam.getListItemsDisplayName(), itemsToDisplay[0]); newValue = (String) curParam.getListItemsValue()[index]; } currentLine.put(curParam.getName(), newValue); } }else if(itemsToDisplay.length >0){ currentLine.put(curParam.getName(), 0); } break; default: } } } } }
Source:
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add(createChildParameter(DiagramPackage.Literals.BORDERED_STYLE__BORDER_COLOR, ViewpointFactory.eINSTANCE.createFromString(ViewpointPackage.Literals.RGB_VALUES, "209,209,209"))); }

Target:
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { super.collectNewChildDescriptors(newChildDescriptors, object); newChildDescriptors.add(createChildParameter(DiagramPackage.Literals.BORDERED_STYLE__BORDER_COLOR, ViewpointFactory.eINSTANCE.createFromString(ViewpointPackage.Literals.RGB_VALUES, "0,0,0"))); }
Source:
public List<NameValuePair> extract(EpdqTemplateData templateData) { List<NameValuePair> nameValuePairs = super.extract(templateData); EpdqParameterBuilder parameterBuilder = newParameterBuilder(nameValuePairs) .add(BROWSER_COLOR_DEPTH, getBrowserColorDepth(templateData)) .add(BROWSER_LANGUAGE, getBrowserLanguage(templateData)) .add(BROWSER_SCREEN_HEIGHT, getBrowserScreenHeight(templateData)) .add(BROWSER_SCREEN_WIDTH, getBrowserScreenWidth(templateData)) .add(BROWSER_TIMEZONE_OFFSET_MINS, getBrowserTimezoneOffsetMins(templateData)) .add(BROWSER_ACCEPT_HEADER, getBrowserAcceptHeader(templateData)) .add(BROWSER_USER_AGENT, getBrowserUserAgent(templateData)) .add(BROWSER_JAVA_ENABLED, "false"); templateData.getAuthCardDetails().getAddress().map(address -> address.getCity()).ifPresent(city -> parameterBuilder.add(ADDRESS_CITY, city)); return parameterBuilder.build(); }

Target:
public List<NameValuePair> extract(EpdqTemplateData templateData) { List<NameValuePair> nameValuePairs = super.extract(templateData); EpdqParameterBuilder parameterBuilder = newParameterBuilder(nameValuePairs) .add(BROWSER_COLOR_DEPTH, getBrowserColorDepth(templateData)) .add(BROWSER_LANGUAGE, getBrowserLanguage(templateData)) .add(BROWSER_SCREEN_HEIGHT, getBrowserScreenHeight(templateData)) .add(BROWSER_SCREEN_WIDTH, getBrowserScreenWidth(templateData)) .add(BROWSER_TIMEZONE_OFFSET_MINS, getBrowserTimezoneOffsetMins(templateData)) .add(BROWSER_ACCEPT_HEADER, getBrowserAcceptHeader(templateData)) .add(BROWSER_USER_AGENT, getBrowserUserAgent(templateData)) .add(BROWSER_JAVA_ENABLED, "false"); templateData.getAuthCardDetails().getAddress().map(Address::getCity).ifPresent(city -> parameterBuilder.add(ECOM_BILLTO_POSTAL_CITY, city)); return parameterBuilder.build(); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == Constants.ACTIVITY_REQUEST_EDIT_SECTION && resultCode == EditHandler.RESULT_REFRESH_PAGE) { pageDataClient.backFromEditing(data); FeedbackUtil.showMessage(getActivity(), R.string.edit_saved_successfully); loadPage(model.getTitleOriginal(), model.getCurEntry(), PageLoadStrategy.Cache.FALLBACK, false); } else if (requestCode == Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT && resultCode == RESULT_OK) { if (articleHeaderView != null) { String newSubtitle = data.getStringExtra(Constants.INTENT_EXTRA_UPDATED_DESCRIPTION); articleHeaderView.setSubtitle(StringUtils.capitalize(newSubtitle)); } } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == Constants.ACTIVITY_REQUEST_EDIT_SECTION && resultCode == EditHandler.RESULT_REFRESH_PAGE) { pageDataClient.backFromEditing(data); FeedbackUtil.showMessage(getActivity(), R.string.edit_saved_successfully); loadPage(model.getTitleOriginal(), model.getCurEntry(), PageLoadStrategy.Cache.FALLBACK, false); } else if (requestCode == Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT && resultCode == RESULT_OK) { refreshPage(); } }
Source:
public int compare(Session session, PlanNodeCostEstimate left, PlanNodeCostEstimate right) { if (getQueryMaxMemory(session).toBytes() < Math.max(left.getMemoryCost().getValue(), right.getMemoryCost().getValue())) { return Double.compare(left.getMemoryCost().getValue(), right.getMemoryCost().getValue()); } Estimate leftCost = left.getCpuCost().map(value -> value * cpuWeight) .add(left.getMemoryCost().map(value -> value * memoryWeight)) .add(left.getNetworkCost().map(value -> value * networkWeight)); Estimate rightCost = right.getCpuCost().map(value -> value * cpuWeight) .add(right.getMemoryCost().map(value -> value * memoryWeight)) .add(right.getNetworkCost().map(value -> value * networkWeight)); if (leftCost.isValueUnknown() || rightCost.isValueUnknown()) { return 0; } return Double.compare(leftCost.getValue(), rightCost.getValue()); }

Target:
public int compare(Session session, PlanNodeCostEstimate left, PlanNodeCostEstimate right) { checkArgument(!left.isUnknown() && !right.isUnknown(), "cannot compare unknown costs"); double leftCost = left.getCpuCost() * cpuWeight + left.getMemoryCost() * memoryWeight + left.getNetworkCost() * networkWeight; double rightCost = right.getCpuCost() * cpuWeight + right.getMemoryCost() * memoryWeight + right.getNetworkCost() * networkWeight; return Double.compare(leftCost, rightCost); }
Source:
public ResponseType transformLoginResponse(ResponseType response, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) { AudienceRestrictionType aud = SAMLAudienceProtocolMapper.locateAudienceRestriction(response); if (aud != null) { Set<RoleModel> roles = clientSessionCtx.getRoles(); Set<String> audiences = new HashSet<>(); for (RoleModel role : roles) { logger.tracef("Managing role: %s", role.getName()); if (role.isClientRole()) { ClientModel app = (ClientModel) role.getContainer(); if (SamlProtocol.LOGIN_PROTOCOL.equals(app.getProtocol()) && !app.getClientId().equals(clientSessionCtx.getClientSession().getClient().getClientId())) { audiences.add(app.getClientId()); } } } logger.debugf("Calculated audiences to add: %s", audiences); for (String audience : audiences) { aud.addAudience(URI.create(audience)); } } return response; }

Target:
public ResponseType transformLoginResponse(ResponseType response, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) { AudienceRestrictionType aud = SAMLAudienceProtocolMapper.locateAudienceRestriction(response); if (aud != null) { Set<RoleModel> roles = clientSessionCtx.getRoles(); Set<String> audiences = new HashSet<>(); for (RoleModel role : roles) { logger.tracef("Managing role: %s", role.getName()); if (role.isClientRole()) { ClientModel app = (ClientModel) role.getContainer(); if (SamlProtocol.LOGIN_PROTOCOL.equals(app.getProtocol()) && !app.getClientId().equals(clientSessionCtx.getClientSession().getClient().getClientId())) { audiences.add(app.getClientId()); } } } logger.debugf("Calculated audiences to add: %s", audiences); for (String audience : audiences) { try { aud.addAudience(URI.create(audience)); } catch (IllegalArgumentException e) { logger.warnf(e, "Invalid URI syntax for audience: %s", audience); } } } return response; }
Source:
public boolean isCellEditable(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) { boolean value = super.isCellEditable(columnElement, rowElement, tableManager); if (value) { final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null); if (objects.size() == 2) { final EObject object = (EObject) objects.get(0); if (matcher.matches(object)) { value = false; } } } return value; }

Target:
public boolean isCellEditable(final Object columnElement, final Object rowElement, final INattableModelManager tableManager) { boolean value = super.isCellEditable(columnElement, rowElement, tableManager); if (value) { final List<Object> objects = organizeAndResolvedObjects(columnElement, rowElement, null); if (2 == objects.size()) { final Object object = objects.get(0); if (object instanceof EObject) { value = !matcher.matches((EObject) object); } } } return value; }
Source:
private void fireNavalBombardment(final IDelegateBridge bridge) { final Collection<Unit> bombard = getBombardingUnits(); final Collection<Unit> attacked = CollectionUtils.getMatches( defendingUnits, Matches.unitIsNotInfrastructureAndNotCapturedOnEntering( attacker, battleSite, gameData)); if (!headless) { final Change change = ChangeFactory.markNoMovementChange(bombard); bridge.addChange(change); } final boolean canReturnFire = Properties.getNavalBombardCasualtiesReturnFire(gameData); if (!bombard.isEmpty() && !attacked.isEmpty()) { if (!headless) { bridge .getSoundChannelBroadcaster() .playSoundForAll(SoundPath.CLIP_BATTLE_BOMBARD, attacker); } final List<Unit> allEnemyUnitsAliveOrWaitingToDie = new ArrayList<>(defendingUnits); allEnemyUnitsAliveOrWaitingToDie.addAll(defendingWaitingToDie); final List<FiringGroup> firingGroups = Bombard.builder() .firingUnits(bombard) .attackableUnits(attacked) .defending(false) .build() .getFiringGroups(); fire( SELECT_NAVAL_BOMBARDMENT_CASUALTIES, firingGroups, allEnemyUnitsAliveOrWaitingToDie, bombard, false, canReturnFire ? ReturnFire.ALL : ReturnFire.NONE, "Bombard"); } }

Target:
private void fireNavalBombardment(final IDelegateBridge bridge) { final Collection<Unit> bombard = getBombardingUnits(); final Collection<Unit> attacked = CollectionUtils.getMatches( defendingUnits, Matches.unitIsNotInfrastructureAndNotCapturedOnEntering( attacker, battleSite, gameData)); if (!headless) { final Change change = ChangeFactory.markNoMovementChange(bombard); bridge.addChange(change); } final boolean canReturnFire = Properties.getNavalBombardCasualtiesReturnFire(gameData); if (!bombard.isEmpty() && !attacked.isEmpty()) { if (!headless) { bridge .getSoundChannelBroadcaster() .playSoundForAll(SoundPath.CLIP_BATTLE_BOMBARD, attacker); } final List<Unit> allEnemyUnitsAliveOrWaitingToDie = new ArrayList<>(defendingUnits); allEnemyUnitsAliveOrWaitingToDie.addAll(defendingWaitingToDie); final List<FiringGroup> firingGroups = BombardFiringGroup.builder() .firingUnits(bombard) .attackableUnits(attacked) .defending(false) .build() .getFiringGroups(); fire( SELECT_NAVAL_BOMBARDMENT_CASUALTIES, firingGroups, allEnemyUnitsAliveOrWaitingToDie, bombard, false, canReturnFire ? ReturnFire.ALL : ReturnFire.NONE, "Bombard"); } }
Source:
public DirectoryStream<Path> newDirectoryStream(final Path dir, final DirectoryStream.Filter<Path> filter) { checkNotNull("filter", filter); final Path[] content = getDirectoryContent(dir); return new SimpleFileSystemDirectoryStream(filter, content); }

Target:
public DirectoryStream<Path> newDirectoryStream(final Path dir, final DirectoryStream.Filter<Path> filter) throws NotDirectoryException, IOException, SecurityException { checkNotNull("filter", filter); final Path[] content = getDirectoryContent(dir); return new DirectoryStream<Path>() { boolean isClosed = false; @Override public void close() throws IOException { if (isClosed) { throw new IOException(STREAM_CLOSED); } isClosed = true; } @Override public Iterator<Path> iterator() { if (isClosed) { throw new IOException(STREAM_CLOSED); } return new Iterator<Path>() { public boolean atEof = false; private int i = -1; private Path nextEntry = null; @Override public boolean hasNext() { if (isClosed) { throw new IOException(STREAM_CLOSED); } if (nextEntry == null && !atEof) { nextEntry = readNextEntry(); } return nextEntry != null; } @Override public Path next() { final Path result; if (isClosed) { throw new IOException(STREAM_CLOSED); } if (nextEntry == null && !atEof) { result = readNextEntry(); } else { result = nextEntry; nextEntry = null; } if (result == null) { throw new NoSuchElementException(); } return result; } private Path readNextEntry() { if (atEof) { return null; } Path result = null; while (true) { i++; if (i >= content.length) { atEof = true; break; } final Path path = content[i]; if (filter.accept(path)) { result = path; break; } } return result; } @Override public void remove() { throw new UnsupportedOperationException(); } }; } }; }
Source:
protected <S extends Score<S>, H extends AbstractScoreHolder<S>> void impactScore(DroolsConstraint<?> constraint, Drools drools, H scoreHolder, int impact) { if (impact == 0) { return; } RuleContext kcontext = (RuleContext) drools; constraint.assertCorrectImpact(impact); scoreHolder.impactScore(kcontext, impact); }

Target:
protected <S extends Score<S>, H extends AbstractScoreHolder<S>> void impactScore(DroolsConstraint<?> constraint, Drools drools, H scoreHolder, int impact) { RuleContext kcontext = (RuleContext) drools; constraint.assertCorrectImpact(impact); scoreHolder.impactScore(kcontext, impact); }
Source:
public SAMSequenceRecord getSAMSequenceRecord() { final String lengthString = this.getGenericFieldValue("length"); if (lengthString == null) return null; final SAMSequenceRecord record = new SAMSequenceRecord(this.getID(), Integer.parseInt(lengthString)); record.setAssembly(this.getGenericFieldValue("assembly")); record.setSequenceIndex(this.contigIndex); return record; }

Target:
public SAMSequenceRecord getSAMSequenceRecord() { final String lengthString = this.getGenericFieldValue("length"); final int length; if (lengthString == null) { length = SAMSequenceRecord.UNKNOWN_SEQUENCE_LENGTH; } else { length = Integer.parseInt(lengthString); } final SAMSequenceRecord record = new SAMSequenceRecord(this.getID(), length); record.setAssembly(this.getGenericFieldValue("assembly")); record.setSequenceIndex(this.contigIndex); return record; }
Source:
public void setMainTabSelectedItem(VmPool selectedItem) { driver.edit(getDetailModel()); monitorCount.setText(String.valueOf(getDetailModel().getMonitorCount())); isStateless.setText(Boolean.toString(getDetailModel().getIsStateless())); oS.setText(String.valueOf(getDetailModel().getOS())); formBuilder.update(getDetailModel()); }

Target:
public void setMainTabSelectedItem(VmPool selectedItem) { driver.edit(getDetailModel()); monitorCount.setText(String.valueOf(getDetailModel().getMonitorCount())); isStateless.setText(Boolean.toString(getDetailModel().getIsStateless())); oS.setText(AsyncDataProvider.getOsName(getDetailModel().getOS())); formBuilder.update(getDetailModel()); }
Source:
public void testNettyClientConnectRetry() throws Exception { NettyClient nettyClient = mock(NettyClient.class); PartitionRequestClientFactory factory = new PartitionRequestClientFactory(nettyClient, 1); ConnectionID serverAddress = createServerConnectionID(0); when(nettyClient.connect(serverAddress.getAddress())).thenThrow(new ChannelException()); try { factory.createPartitionRequestClient(serverAddress); } catch (ChannelException e) { } verify(nettyClient, times(2)).connect(serverAddress.getAddress()); }

Target:
public void testNettyClientConnectRetry() throws Exception { NettyTestUtil.NettyServerAndClient serverAndClient = createNettyServerAndClient(); UnstableNettyClient unstableNettyClient = new UnstableNettyClient(serverAndClient.client(), 2); PartitionRequestClientFactory factory = new PartitionRequestClientFactory(unstableNettyClient, 2); ConnectionID serverAddress = new ConnectionID(new InetSocketAddress(InetAddress.getLocalHost(), serverAndClient.server().getConfig().getServerPort()), 0); factory.createPartitionRequestClient(serverAddress); serverAndClient.client().shutdown(); serverAndClient.server().shutdown(); }
Source:
public <T extends ArtifactId> ArtifactReadable getArtifactOrSentinel(T artifact) { if (artifact == null) { return ArtifactReadable.SENTINEL; } ArtifactReadable result = ArtifactReadable.SENTINEL; try { if (artifact instanceof ArtifactReadable) { result = (ArtifactReadable) artifact; } else if (artifact instanceof IAtsObject) { IAtsObject atsObject = (IAtsObject) artifact; if (atsObject.getStoreObject() instanceof ArtifactReadable) { result = (ArtifactReadable) atsObject.getStoreObject(); } else { result = getArtifact(atsObject.getId()); } } else { result = getArtifactOrSentinel(artifact.getId()); } } catch (ArtifactDoesNotExist ex) { } return result; }

Target:
public <T extends ArtifactId> ArtifactReadable getArtifactOrSentinel(T artifact) { if (artifact == null) { return ArtifactReadable.SENTINEL; } ArtifactReadable result = ArtifactReadable.SENTINEL; try { if (artifact instanceof ArtifactReadable) { result = (ArtifactReadable) artifact; } else if (artifact instanceof IAtsObject) { IAtsObject atsObject = (IAtsObject) artifact; if (atsObject.getStoreObject() instanceof ArtifactReadable) { result = (ArtifactReadable) atsObject.getStoreObject(); } else { result = getArtifactOrSentinel(atsObject.getId()); } } else { result = getArtifactOrSentinel(artifact.getId()); } } catch (ArtifactDoesNotExist ex) { } return result; }
Source:
protected void executeCommand() { if (isGlusterEnabled() && upServer != null) { glusterHostRemove(); if (!getSucceeded() && VdcBllErrors.GlusterHostIsNotPartOfCluster != getReturnValue().getFault().getError()) { return; } } if (!clusterHasMultipleHosts()) { removeGlusterVolumesFromDb(); removeGlusterHooksFromDb(); } TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { RemoveVdsStatisticsFromDb(); RemoveVdsDynamicFromDb(); RemoveVdsStaticFromDb(); return null; } }); RemoveVdsFromCollection(); setSucceeded(true); }

Target:
protected void executeCommand() { if (isGlusterEnabled() && upServer != null) { glusterHostRemove(); if (!getSucceeded()) { return; } } if (!clusterHasMultipleHosts()) { removeGlusterVolumesFromDb(); removeGlusterHooksFromDb(); } TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { RemoveVdsStatisticsFromDb(); RemoveVdsDynamicFromDb(); RemoveVdsStaticFromDb(); return null; } }); RemoveVdsFromCollection(); setSucceeded(true); }
Source:
public IStatus validate(IProject project, String path) { if(fileExists(path)) { return Status.OK_STATUS; } return new Status(IStatus.ERROR, "GDB", "File not found : "+ path); }

Target:
public IStatus validate(IProject project, String path) { if (fileExists(path)) { return Status.OK_STATUS; } return new Status(IStatus.ERROR, Activator.PLUGIN_ID, Messages.GdbTrace_FileNotFound + ": " + path); }
Source:
public final void execute() throws MojoExecutionException, MojoFailureException { if ( shouldExecute() ) { getLog().info( "Connecting to Nexus..." ); createTransport( getNexusUrl() ); createNexusClient(); final StagingWorkflowV2Service stagingWorkflow = getStagingWorkflowService(); try { doExecute( stagingWorkflow ); } catch ( NexusErrorMessageException e ) { NexusErrorMessageException.dumpErrors( new PrintWriter( System.out, true ), e ); throw new MojoExecutionException( "Could not perform action: Nexus ErrorResponse received!", e ); } catch ( StagingRuleFailuresException e ) { StagingRuleFailuresException.dumpErrors( new PrintWriter( System.out, true ), e ); throw new MojoExecutionException( "Could not perform action: there are failing staging rules!", e ); } } }

Target:
public final void execute() throws MojoExecutionException, MojoFailureException { if ( shouldExecute() ) { getLog().info( "Connecting to Nexus..." ); createTransport( getNexusUrl() ); createNexusClient(); final StagingWorkflowV2Service stagingWorkflow = getStagingWorkflowService(); try { doExecute( stagingWorkflow ); } catch ( NexusErrorMessageException e ) { ErrorDumper.dumpErrors( getLog(), e ); throw new MojoExecutionException( "Could not perform action: Nexus ErrorResponse received!", e ); } catch ( StagingRuleFailuresException e ) { ErrorDumper.dumpErrors( getLog(), e ); throw new MojoExecutionException( "Could not perform action: there are failing staging rules!", e ); } } }
Source:
public boolean isValid(final CurrentUser user, final ApprovalType at, final FunctionState state) { for (final ProjectRight pr : state.getAllProjectRights(at)) { if (user.getEffectiveGroups().contains(pr.getAccountGroupId()) && (pr.getMinValue() < 0 || pr.getMaxValue() > 0)) { return true; } } return false; }

Target:
public boolean isValid(final CurrentUser user, final ApprovalType at, final FunctionState state) { if (state.getRefRights(at).isEmpty()) { return isProjectStateValid(user, at, state); } else { return isRefStateValid(user, at, state); } }
Source:
public void testManyUpdatesForSameLeaders() throws InterruptedException { ExecutorService executorService = PTExecutors.newFixedThreadPool(50); accumulator = new LeaderElectionDurationAccumulator(mockConsumer, 5_000); List<Integer> durationBuckets = IntStream.range(0, 100).map(x -> x * 100).boxed().collect(Collectors.toList()); Collections.shuffle(durationBuckets); durationBuckets.forEach(duration -> executorService.submit(() -> leaderElectionResultsWithPause(LEADER_1, LEADER_2, 50, duration))); executorService.shutdown(); executorService.awaitTermination(1, TimeUnit.MINUTES); verify(mockConsumer).accept(0L); verifyNoMoreInteractions(mockConsumer); }

Target:
public void testManyUpdatesForSameLeaders() throws InterruptedException { ExecutorService executorService = PTExecutors.newFixedThreadPool(50); int numBuckets = 100; int requestsPerBucket = 50; accumulator = new LeaderElectionDurationAccumulator(mockConsumer, numBuckets * requestsPerBucket); List<Integer> durationBuckets = IntStream.range(0, numBuckets) .map(x -> x * requestsPerBucket) .boxed() .collect(Collectors.toList()); Collections.shuffle(durationBuckets); durationBuckets.forEach(duration -> executorService.submit( () -> leaderElectionResultsWithPause(LEADER_1, LEADER_2, requestsPerBucket, duration))); executorService.shutdown(); executorService.awaitTermination(1, TimeUnit.MINUTES); verify(mockConsumer).accept(0L); verifyNoMoreInteractions(mockConsumer); }
Source:
Store open() throws StoreException { lock.lock(); try { switch (state) { default: throw new StoreStateException( context.getStrings().get("storage.store.closed")); case INITIAL: driver.open(); state = State.OPEN; break; case OPEN: } } catch (StoreException ex) { ex.setStore(this); throw ex; } finally { lock.unlock(); } return this; }

Target:
Store open() throws IllegalAddressException, StoreException { try { synchronized (lock) { switch (state) { default: throw new StoreStateException( StoreStateException.Reason.ALREADY_CLOSED); case OPEN: throw new StoreStateException( StoreStateException.Reason.ALREADY_OPEN); case INITIAL: URI driverAddress = driver.open(address); if (driverAddress != null) { address = driverAddress; } state = State.OPEN; } } } catch (StoreException ex) { ex.setStore(this); throw ex; } return this; }
Source:
public boolean positionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page page, int[] rightChannels) { if (groupByUsesEqualTo) { return positionEqualsRow(leftBlockIndex, leftPosition, rightPosition, page, rightChannels); } for (int i = 0; i < hashChannels.size(); i++) { int hashChannel = hashChannels.get(i); Type type = types.get(hashChannel); Block leftBlock = channels.get(hashChannel).get(leftBlockIndex); Block rightBlock = page.getBlock(rightChannels[i]); Signature signature = functionRegistry.resolveOperator(OperatorType.IS_DISTINCT_FROM, ImmutableList.of(type, type)); ScalarFunctionImplementation scalarFunctionImplementation = functionRegistry.getScalarFunctionImplementation(signature); MethodHandle methodHandle = scalarFunctionImplementation.getMethodHandle(); try { if (!(boolean) methodHandle.invokeExact(leftBlock, leftPosition, rightBlock, rightPosition)) { return false; } } catch (Throwable t) { throw internalError(t); } } return true; }

Target:
public boolean positionNotDistinctFromRow(int leftBlockIndex, int leftPosition, int rightPosition, Page page, int[] rightChannels) { if (groupByUsesEqualTo) { return positionEqualsRow(leftBlockIndex, leftPosition, rightPosition, page, rightChannels); } for (int i = 0; i < hashChannels.size(); i++) { int hashChannel = hashChannels.get(i); Block leftBlock = channels.get(hashChannel).get(leftBlockIndex); Block rightBlock = page.getBlock(rightChannels[i]); MethodHandle methodHandle = distinctFromMethodHandles.get(hashChannel); try { if (!(boolean) methodHandle.invokeExact(leftBlock, leftPosition, rightBlock, rightPosition)) { return false; } } catch (Throwable t) { throw internalError(t); } } return true; }