auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void endAction(CommandBase<?> commandBase, List<Guid> childCmdIds, boolean succeeded) { if (shouldExecuteEndMethod(commandBase)) { VdcReturnValueBase returnVal = commandBase.endAction(); if (!commandBase.getReturnValue().getSucceeded() && repeatEndMethodsOnFail(returnVal)) { if (repeatEndMethodsOnFail(returnVal)) { throw new EngineException(EngineError.ENGINE, String.format("Command %1$s id: '%2$s' endAction() " + "didn't complete successfully", commandBase.getActionType(), commandBase.getCommandId())); } else { log.info("Command '{}' id: '{}' end method execution failed, as the command isn't marked for " + "endAction() retries silently ignoring", commandBase.getActionType(), commandBase.getCommandId()); } } if (commandBase.getParameters().getParentCommand() == VdcActionType.Unknown) { CommandCoordinatorUtil.removeAllCommandsInHierarchy(commandBase.getCommandId()); } ExecutionHandler.endJob(commandBase.getExecutionContext(), succeeded); } }

Target:
private void endAction(CommandBase<?> commandBase, List<Guid> childCmdIds, boolean succeeded) { if (shouldExecuteEndMethod(commandBase)) { VdcReturnValueBase returnVal = commandBase.endAction(); if (!returnVal.getSucceeded() && repeatEndMethodsOnFail(returnVal)) { if (repeatEndMethodsOnFail(returnVal)) { throw new EngineException(EngineError.ENGINE, String.format("Command %1$s id: '%2$s' endAction() " + "didn't complete successfully", commandBase.getActionType(), commandBase.getCommandId())); } else { log.warn("Command '{}' id: '{}' end method execution failed, as the command isn't marked for " + "endAction() retries silently ignoring", commandBase.getActionType(), commandBase.getCommandId()); } } if (commandBase.getParameters().getParentCommand() == VdcActionType.Unknown) { CommandCoordinatorUtil.removeAllCommandsInHierarchy(commandBase.getCommandId()); } ExecutionHandler.endJob(commandBase.getExecutionContext(), succeeded); } }
Source:
private void publishTupleData(int portId, Object obj) { try { if (wsClient != null && wsClient.isConnectionOpen()) { HashMap<String, Object> map = new HashMap<>(); map.put("portId", String.valueOf(portId)); map.put("windowId", currentWindowId); map.put("tupleCount", totalTupleCount); map.put("data", obj); wsClient.publish(recordingNameTopic, map); } } catch (Exception ex) { if (shouldLog()) { logger.warn("Error publishing tuple data {}", obj, ex); } } }

Target:
private void publishTupleData(int portId, Object obj) { try { if (wsClient != null && wsClient.isConnectionOpen()) { HashMap<String, Object> map = new HashMap<>(); map.put("portId", String.valueOf(portId)); map.put("windowId", currentWindowId); map.put("tupleCount", totalTupleCount); map.put("data", obj); wsClient.publish(recordingNameTopic, map); } } catch (Exception ex) { if (ex instanceof JsonProcessingException) { checkLogTuple(ex, "publish", obj); } else { logger.warn("Error publishing tuple", ex); } } }
Source:
private boolean internalTest(Object receiver, String property) { if (!(receiver instanceof IResource)) return false; IResource res = (IResource) receiver; if ("isContainer".equals(property)) { int type = res.getType(); return type == IResource.FOLDER || type == IResource.PROJECT; } RepositoryMapping mapping = RepositoryMapping.getMapping(res .getProject()); if (mapping != null) { Repository repository = mapping.getRepository(); if ("isStaged".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { return ResourceStateFactory.getInstance() .get(indexDiffData, res) .staged() != Staged.NOT_STAGED; } } else if ("isIgnored".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { return ResourceStateFactory.getInstance() .get(indexDiffData, res).isIgnored(); } } else if ("hasUnstagedChanges".equals(property)) { IndexDiffData indexDiffData = ResourceStateFactory.getInstance() .getIndexDiffDataOrNull(res); if (indexDiffData != null) { IResourceState state = ResourceStateFactory.getInstance() .get(indexDiffData, res); return !state.isTracked() || state.isDirty(); } } else { return testRepositoryState(repository, property); } } return false; }

Target:
private boolean internalTest(Object receiver, String property) { if (!(receiver instanceof IResource)) return false; IResource res = (IResource) receiver; if ("isContainer".equals(property)) { int type = res.getType(); return type == IResource.FOLDER || type == IResource.PROJECT; } RepositoryMapping mapping = RepositoryMapping.getMapping(res .getProject()); if (mapping != null) { Repository repository = mapping.getRepository(); if ("isStaged".equals(property)) { return ResourceStateFactory.getInstance().get(res) .staged() != Staged.NOT_STAGED; } else if ("isIgnored".equals(property)) { return ResourceStateFactory.getInstance().get(res).isIgnored(); } else if ("hasUnstagedChanges".equals(property)) { IResourceState state = ResourceStateFactory.getInstance() .get(res); return !state.isTracked() || state.isDirty(); } else { return testRepositoryState(repository, property); } } return false; }
Source:
public int delete(Uri uri, String selection, String[] selectionArgs) { if (!hasReadWritePermission()) { throwSecurityException("delete", uri); } Collection col = CollectionHelper.getInstance().getCol(mContext); if (col == null) { throw new IllegalStateException(COL_NULL_ERROR_MSG); } col.log(getLogMessage("delete", uri)); switch (sUriMatcher.match(uri)) { case NOTES_ID: col.remNotes(new long[]{Long.parseLong(uri.getPathSegments().get(1))}); return 1; case MODELS_ID_CARDS: JSONObject model = getModel(getModelIdFromUri(uri, col), col); if (model != null) { String emptyStr = uri.getQueryParameter(FlashCardsContract.Card.EMPTY_QUERY_PARAM); if (emptyStr != null) { boolean empty = Boolean.valueOf(emptyStr); if (empty) { List<Long> cids = col.genCards(col.getModels().nids(model)); col.remCards(Utils.arrayList2array(cids)); return cids.size(); } } } throw new UnsupportedOperationException("Only ?empty=true supported"); default: throw new UnsupportedOperationException(); } }

Target:
public int delete(Uri uri, String selection, String[] selectionArgs) { if (!hasReadWritePermission()) { throwSecurityException("delete", uri); } Collection col = CollectionHelper.getInstance().getCol(mContext); if (col == null) { throw new IllegalStateException(COL_NULL_ERROR_MSG); } col.log(getLogMessage("delete", uri)); switch (sUriMatcher.match(uri)) { case NOTES_ID: col.remNotes(new long[]{Long.parseLong(uri.getPathSegments().get(1))}); return 1; case MODELS_ID_EMPTY_CARDS: JSONObject model = col.getModels().get(getModelIdFromUri(uri, col)); if (model != null) { List<Long> cids = col.genCards(col.getModels().nids(model)); col.remCards(Utils.arrayList2array(cids)); return cids.size(); } throw new UnsupportedOperationException("Only ?empty=true supported"); default: throw new UnsupportedOperationException(); } }
Source:
public ExtraPlugin(Settings settings) { latencyListener = new SearchLatencyListener(settings); loadService = new LoadService(settings, latencyListener, OsProbe.getInstance()); }

Target:
public ExtraPlugin(Settings settings) { threadPoolSupplier = new MutableSupplier<>(); latencyListener = new SearchLatencyListener(settings, threadPoolSupplier); loadStats = new LoadService(latencyListener, new OsService(settings)); }
Source:
private boolean handleBackPressed() { if (mFullScreenDialogFragment != null && mFullScreenDialogFragment.isVisible()) { Fragment contentFragment = mFullScreenDialogFragment.getContent(); if (contentFragment != null && contentFragment instanceof HistoryDetailFullScreenDialogFragment) { AnalyticsTracker.track(Stat.REVISIONS_DETAIL_CANCELLED); } mFullScreenDialogFragment.dismiss(); return false; } Fragment fragment = getSupportFragmentManager().findFragmentByTag( ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG); if (fragment != null && fragment.isVisible()) { if (fragment instanceof ImageSettingsDialogFragment) { ImageSettingsDialogFragment imFragment = (ImageSettingsDialogFragment) fragment; imFragment.dismissFragment(); } return false; } if (mViewPager.getCurrentItem() > PAGE_CONTENT) { if (mViewPager.getCurrentItem() == PAGE_SETTINGS) { mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId()); } mViewPager.setCurrentItem(PAGE_CONTENT); invalidateOptionsMenu(); } else if (isPhotoPickerShowing()) { hidePhotoPicker(); } else { savePostAndOptionallyFinish(true); } return true; }

Target:
private boolean handleBackPressed() { if (mFullScreenDialogFragment != null && mFullScreenDialogFragment.isVisible()) { Fragment contentFragment = mFullScreenDialogFragment.getContent(); if (contentFragment instanceof HistoryDetailFullScreenDialogFragment) { AnalyticsTracker.track(Stat.REVISIONS_DETAIL_CANCELLED); } mFullScreenDialogFragment.dismiss(); return false; } Fragment fragment = getSupportFragmentManager().findFragmentByTag( ImageSettingsDialogFragment.IMAGE_SETTINGS_DIALOG_TAG); if (fragment != null && fragment.isVisible()) { if (fragment instanceof ImageSettingsDialogFragment) { ImageSettingsDialogFragment imFragment = (ImageSettingsDialogFragment) fragment; imFragment.dismissFragment(); } return false; } if (mViewPager.getCurrentItem() > PAGE_CONTENT) { if (mViewPager.getCurrentItem() == PAGE_SETTINGS) { mEditorFragment.setFeaturedImageId(mPost.getFeaturedImageId()); } mViewPager.setCurrentItem(PAGE_CONTENT); invalidateOptionsMenu(); } else if (isPhotoPickerShowing()) { hidePhotoPicker(); } else { savePostAndOptionallyFinish(true); } return true; }
Source:
public void onDestroyView() { super.onDestroyView(); ((AppCompatActivity) getActivity()) .getSupportActionBar().setTitle(R.string.category_user_bricks); }

Target:
public void onDestroyView() { super.onDestroyView(); AppCompatActivity appCompatActivity = (AppCompatActivity) getActivity(); if (appCompatActivity != null && appCompatActivity.getSupportActionBar() != null) { appCompatActivity.getSupportActionBar().setTitle(R.string.category_user_bricks); } }
Source:
@Override public String toString() { return "ACES filmic tone mapping"; }

Target:
@Override public String toString() { return "None"; }
Source:
public void testSetup() { try { zkClient = new ZkClient( new ZkConnection("127.0.0.1:" + zkServer.getPort(), SESSION_TIMEOUT_MS), CONNECTION_TIMEOUT_MS); } catch (Exception e) { Assert.fail("Client connection setup failed. Aborting tests.."); } try { zkClient.createPersistent(KEY_BUILDER.getProcessorsPath(), true); } catch (ZkNodeExistsException e) { } ZkJobCoordinatorMetrics metrics = new ZkJobCoordinatorMetrics(new NoOpMetricsRegistry()); zkUtils = new ZkUtils( KEY_BUILDER, zkClient, SESSION_TIMEOUT_MS, metrics); zkUtils.connect(); }

Target:
public void testSetup() { try { zkClient = new ZkClient( new ZkConnection("127.0.0.1:" + zkServer.getPort(), SESSION_TIMEOUT_MS), CONNECTION_TIMEOUT_MS); } catch (Exception e) { Assert.fail("Client connection setup failed. Aborting tests.."); } try { zkClient.createPersistent(KEY_BUILDER.getProcessorsPath(), true); } catch (ZkNodeExistsException e) { } zkUtils = new ZkUtils( KEY_BUILDER, zkClient, SESSION_TIMEOUT_MS, new ZkJobCoordinatorMetrics(new NoOpMetricsRegistry())); zkUtils.connect(); }
Source:
protected AbstractImmutableBooleanData(Key<Value<Boolean>> usedKey, boolean value, boolean defaultValue) { super(usedKey, value, defaultValue); this.immutableValue = Sponge.getRegistry().getValueFactory().createValue(usedKey, defaultValue, value).asImmutable(); }

Target:
protected AbstractImmutableBooleanData(Key<Value<Boolean>> usedKey, boolean value, boolean defaultValue) { super(usedKey, value, defaultValue); this.immutableValue = Sponge.getRegistry().getValueFactory().createValue(usedKey, value, defaultValue).asImmutable(); }
Source:
private boolean isConverged(GmmModel oldModel, GmmModel newModel) { A.ensure(oldModel.countOfComponents() == newModel.countOfComponents(), "oldModel.countOfComponents() == newModel.countOfComponents()"); boolean isConverged = true; for (int i = 0; i < oldModel.countOfComponents(); i++) { MultivariateGaussianDistribution d1 = oldModel.distributions().get(i); MultivariateGaussianDistribution d2 = newModel.distributions().get(i); isConverged = isConverged && Math.sqrt(d1.mean().getDistanceSquared(d2.mean())) < eps; } return isConverged; }

Target:
private boolean isConverged(GmmModel oldModel, GmmModel newModel) { A.ensure(oldModel.countOfComponents() == newModel.countOfComponents(), "oldModel.countOfComponents() == newModel.countOfComponents()"); for (int i = 0; i < oldModel.countOfComponents(); i++) { MultivariateGaussianDistribution d1 = oldModel.distributions().get(i); MultivariateGaussianDistribution d2 = newModel.distributions().get(i); if (Math.sqrt(d1.mean().getDistanceSquared(d2.mean())) >= eps) return false; } return true; }
Source:
public List<IIssue> getStories() { return mStories; }

Target:
public ArrayList<IIssue> getStories() { return mStories; }
Source:
protected Control createDialogArea(Composite p) { p.getShell().setText(Messages.TmfChartView_LockYAxis); Composite parent = (Composite) super.createDialogArea(p); GridLayout parentLayout = new GridLayout(3, false); parent.setLayout(parentLayout); Range range = fChartViewer.getSwtChart().getAxisSet().getYAxis(0).getRange(); fCheck = new Button(parent, SWT.CHECK); fCheck.setText(Messages.TmfChartView_LockButton); fCheck.setLayoutData(newGridData(3)); fCheck.setSelection(true); fCheck.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { fMinText.setEnabled(fCheck.getSelection()); fMaxText.setEnabled(fCheck.getSelection()); validateInputs(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); Label minLabel = new Label(parent, SWT.RADIO); minLabel.setText(Messages.TmfChartView_LowerYAxisRange); minLabel.setLayoutData(newGridData(1)); fMinText = new Text(parent, SWT.SINGLE | SWT.BORDER); fMinText.setLayoutData(newGridData(2)); fMinText.setText(String.valueOf(range.lower)); fMinText.addModifyListener(fModifyListener); Label maxLabel = new Label(parent, SWT.RADIO); maxLabel.setText(Messages.TmfChartView_UpperYAxisRange); maxLabel.setLayoutData(newGridData(1)); fMaxText = new Text(parent, SWT.SINGLE | SWT.BORDER); fMaxText.setLayoutData(newGridData(2)); fMaxText.setText(String.valueOf(range.upper)); fMaxText.addModifyListener(fModifyListener); return parent; }

Target:
protected Control createDialogArea(Composite p) { p.getShell().setText(Messages.TmfChartView_LockYAxis); Composite parent = (Composite) super.createDialogArea(p); GridLayout parentLayout = new GridLayout(2, false); parent.setLayout(parentLayout); Range range = fChartViewer.getSwtChart().getAxisSet().getYAxis(0).getRange(); fCheck = new Button(parent, SWT.CHECK); fCheck.setText(Messages.TmfChartView_LockButton); fCheck.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 2, 1)); fCheck.setSelection(true); fCheck.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { fMinText.setEnabled(fCheck.getSelection()); fMaxText.setEnabled(fCheck.getSelection()); validateInputs(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); Label minLabel = new Label(parent, SWT.RADIO); minLabel.setText(Messages.TmfChartView_LowerYAxisRange); minLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fMinText = new Text(parent, SWT.SINGLE | SWT.BORDER); fMinText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fMinText.setText(String.valueOf(range.lower)); fMinText.addModifyListener(fModifyListener); Label maxLabel = new Label(parent, SWT.RADIO); maxLabel.setText(Messages.TmfChartView_UpperYAxisRange); maxLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false)); fMaxText = new Text(parent, SWT.SINGLE | SWT.BORDER); fMaxText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); fMaxText.setText(String.valueOf(range.upper)); fMaxText.addModifyListener(fModifyListener); return parent; }
Source:
public static List<ManagedCacheMBean> getManagedCache(List<Pair<String,JMXConnector>> mbscArray, List<String> mc) throws MalformedObjectNameException, IOException { List<ManagedCacheMBean> managedCache =new ArrayList<>(); for (Pair<String,JMXConnector> mbsc: mbscArray) { for(int i = 0; i < mc.size(); i++) { managedCache.add(getNewMBeanProxy(mbsc.getSecond(), MANAGED_CACHE + mc.get(i), ManagedCacheMBean.class)); } } return managedCache; }

Target:
public static List<ManagedCacheMBean> getManagedCache(List<Pair<String,JMXConnector>> mbscArray, List<String> mc) throws MalformedObjectNameException, IOException { List<ManagedCacheMBean> managedCache =new ArrayList<>(); for (Pair<String,JMXConnector> mbsc: mbscArray) { for(String s : mc) { managedCache.add(getNewMBeanProxy(mbsc.getSecond(), MANAGED_CACHE + s, ManagedCacheMBean.class)); } } return managedCache; }
Source:
public void testHandlerMBeanRegistration() throws Exception { Set<ObjectName> names = server.queryNames(new ObjectName("test.MBeanRegistration:type=MessageHandler,*"), null); assertEquals(6, names.size()); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain,bean=endpoint"))); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain$child.t1,bean=handler"))); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain$child.t1,bean=handler"))); }

Target:
public void testHandlerMBeanRegistration() throws Exception { Set<ObjectName> names = server.queryNames(new ObjectName("test.MBeanRegistration:type=MessageHandler,*"), null); assertEquals(6, names.size()); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain,bean=endpoint"))); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain$child.t1,bean=handler"))); assertTrue(names.contains(new ObjectName("test.MBeanRegistration:type=MessageHandler,name=chain$child.f1,bean=handler"))); }
Source:
public void finish() throws IOException { checkInProduceState(); broadcastEvent(EndOfPartitionEvent.INSTANCE, false); flushCurrentSortBuffer(); synchronized (lock) { checkState(!isReleased()); resultFile = fileWriter.finish(); fileWriter = null; LOG.info("New partitioned file produced: {}.", resultFile); } super.finish(); }

Target:
public void finish() throws IOException { broadcastEvent(EndOfPartitionEvent.INSTANCE, false); flushCurrentSortBuffer(); synchronized (lock) { checkState(!isReleased(), "Result partition is already released."); resultFile = fileWriter.finish(); LOG.info("New partitioned file produced: {}.", resultFile); } super.finish(); }
Source:
private void unloadResources() { ResourceSet rs = transactionalEditingDomain.getResourceSet(); for (Resource resource : getAllSessionResources()) { resource.unload(); rs.getResources().remove(resource); } for (Resource res : Iterables.concat(super.getResources(), getSemanticResources(), super.getControlledResources())) { try { if (!isFromPackageRegistry(rs, res)) { res.unload(); } } catch (final IllegalStateException e) { SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, "Error while unloading an unaccessible resource")); } rs.getResources().remove(res); } super.getAnalyses().clear(); super.getResources().clear(); super.getControlledResources().clear(); }

Target:
private void unloadResources() { ResourceSet rs = transactionalEditingDomain.getResourceSet(); for (Resource resource : getAllSessionResources()) { resource.unload(); rs.getResources().remove(resource); } for (Resource res : Iterables.concat(super.getResources(), getSemanticResources(), super.getControlledResources())) { try { if (!isFromPackageRegistry(rs, res)) { res.unload(); } } catch (final IllegalStateException e) { SiriusPlugin.getDefault().getLog().log(new Status(IStatus.WARNING, SiriusPlugin.ID, "Error while unloading an unaccessible resource:\n" + e.getMessage())); } rs.getResources().remove(res); } super.getAnalyses().clear(); super.getResources().clear(); super.getControlledResources().clear(); }
Source:
private static boolean isNewFileHelper(final String localFileLastModifiedTime, final String serverFileLastModifiedTime, final boolean isPutCommand) { DateTimeFormatter fmt = DateTimeFormat.forPattern("EEE MMM dd H:m:s z Y"); final DateTime localFileDateTime = new DateTime(localFileLastModifiedTime); final DateTime serverFileDateTime = new DateTime(DateTime.parse(serverFileLastModifiedTime, fmt)); if (isPutCommand) { return DateTimeComparator.getInstance().compare(localFileDateTime, serverFileDateTime) > 0; } return DateTimeComparator.getInstance().compare(localFileDateTime, serverFileDateTime) < 0; }

Target:
private static boolean isNewFileHelper(final String localFileLastModifiedTime, final String serverFileLastModifiedTime, final boolean isPutCommand) { final DateTimeFormatter fmt = DateTimeFormat.forPattern("EEE MMM dd H:m:s z Y"); final DateTime localFileDateTime = new DateTime(localFileLastModifiedTime); final DateTime serverFileDateTime = new DateTime(DateTime.parse(serverFileLastModifiedTime, fmt)); if (isPutCommand) { return DateTimeComparator.getInstance().compare(localFileDateTime, serverFileDateTime) > 0; } return DateTimeComparator.getInstance().compare(localFileDateTime, serverFileDateTime) < 0; }
Source:
private static Header readHeader(final BinaryCodec binaryCodec) { final byte[] buffer = new byte[SBI_MAGIC.length]; binaryCodec.readBytes(buffer); if (!Arrays.equals(buffer, SBI_MAGIC)) { throw new RuntimeException("Invalid file header in SBI: " + new String(buffer) + " (" + Arrays.toString(buffer) + ")"); } long fileLength = binaryCodec.readLong(); byte[] md5 = new byte[16]; binaryCodec.readBytes(md5); byte[] uuid = new byte[16]; binaryCodec.readBytes(uuid); long totalNumberOfRecords = binaryCodec.readLong(); long granularity = binaryCodec.readLong(); return new Header(fileLength, md5, uuid, totalNumberOfRecords, granularity); }

Target:
private static Header readHeader(final BinaryCodec binaryCodec) { final byte[] buffer = new byte[SBI_MAGIC.length]; binaryCodec.readBytes(buffer); if (!Arrays.equals(buffer, SBI_MAGIC)) { throw new RuntimeException("Invalid file header in SBI: " + new String(buffer) + " (" + Arrays.toString(buffer) + ")"); } final long fileLength = binaryCodec.readLong(); final byte[] md5 = new byte[16]; binaryCodec.readBytes(md5); final byte[] uuid = new byte[16]; binaryCodec.readBytes(uuid); final long totalNumberOfRecords = binaryCodec.readLong(); final long granularity = binaryCodec.readLong(); return new Header(fileLength, md5, uuid, totalNumberOfRecords, granularity); }
Source:
private boolean supportsDeferredPrallocation() { return FeatureSupported.isDeferringFileVolumePreallocationSupported( getStoragePool().getCompatibilityVersion()) && getType() == VolumeType.Preallocated && getStorageDomain().getStorageType().isFileDomain(); }

Target:
private boolean supportsDeferredPrallocation() { return getStorageDomain().getStorageType().isFileDomain() && getType() == VolumeType.Preallocated && FeatureSupported.isDeferringFileVolumePreallocationSupported( getStoragePool().getCompatibilityVersion()); }
Source:
public void getDirectorySuffixWithSeparator_ReturnsDirectorySuffixWithSeparator() { String directorySuffix = "test"; Configuration configuration = new Configuration(outputDirectory, projectName); configuration.setDirectorySuffix(directorySuffix); Class<Configuration> configClass = Configuration.class; try { Field suffixSeparator = configClass.getDeclaredField("SUFFIX_SEPARATOR"); suffixSeparator.setAccessible(true); assertThat(configuration.getDirectorySuffixWithSeparator()).isEqualTo(suffixSeparator.get(null) + directorySuffix); } catch (NoSuchFieldException|IllegalAccessException ex) { fail("Unable to retrieve directory suffix separator"); } }

Target:
public void getDirectorySuffixWithSeparator_ReturnsDirectorySuffixWithSeparator() { String directorySuffix = "test"; Configuration configuration = new Configuration(outputDirectory, projectName); configuration.setDirectorySuffix(directorySuffix); assertThat(configuration.getDirectorySuffixWithSeparator()).isEqualTo("_" + directorySuffix); }
Source:
public void testDirectoryUIOverride() throws Exception { deployContrib("org.nuxeo.ecm.directory.web.tests", "OSGI-INF/test-directory-ui-override-contrib.xml"); applyInlineDeployments(); postSetUp(); List<String> dirs = service.getDirectoryNames(); assertNotNull(dirs); assertEquals(1, dirs.size()); assertEquals("country", dirs.get(0)); DirectoryUI continent = service.getDirectoryInfo("continent"); assertNull(continent); DirectoryUI country = service.getDirectoryInfo("country"); assertNotNull(country); assertEquals("country", country.getName()); assertEquals("country_vocabulary", country.getLayout()); assertEquals("parent", country.getSortField()); assertEquals("foo", country.getView()); List<DirectoryDeleteConstraint> constraints = country.getDeleteConstraints(); assertNotNull(constraints); assertEquals(0, constraints.size()); }

Target:
public void testDirectoryUIOverride() throws Exception { pushInlineDeployments("org.nuxeo.ecm.directory.web.tests:OSGI-INF/test-directory-ui-override-contrib.xml"); List<String> dirs = service.getDirectoryNames(); assertNotNull(dirs); assertEquals(1, dirs.size()); assertEquals("country", dirs.get(0)); DirectoryUI continent = service.getDirectoryInfo("continent"); assertNull(continent); DirectoryUI country = service.getDirectoryInfo("country"); assertNotNull(country); assertEquals("country", country.getName()); assertEquals("country_vocabulary", country.getLayout()); assertEquals("parent", country.getSortField()); assertEquals("foo", country.getView()); List<DirectoryDeleteConstraint> constraints = country.getDeleteConstraints(); assertNotNull(constraints); assertEquals(0, constraints.size()); }
Source:
private void setProxyChainEnabled(boolean isEnabled) { txtProxyChainName.setEnabled(isEnabled); spinnerProxyChainPort.setEnabled(isEnabled); getProxyExcludedDomainsPanel().setComponentEnabled(isEnabled); chkProxyChainAuth.setEnabled(isEnabled); chkShowPassword.setEnabled(isEnabled); setProxyChainAuthEnabled(isEnabled && chkProxyChainAuth.isSelected()); Color color = Color.WHITE; if (!isEnabled) { color = panelProxyChain.getBackground(); } txtProxyChainName.setBackground(color); spinnerProxyChainPort.setBackground(color); }

Target:
private void setProxyChainEnabled(boolean isEnabled) { txtProxyChainName.setEnabled(isEnabled); spinnerProxyChainPort.setEnabled(isEnabled); getProxyExcludedDomainsPanel().setComponentEnabled(isEnabled); chkProxyChainAuth.setEnabled(isEnabled); setProxyChainAuthEnabled(isEnabled && chkProxyChainAuth.isSelected()); Color color = Color.WHITE; if (!isEnabled) { color = panelProxyChain.getBackground(); } txtProxyChainName.setBackground(color); spinnerProxyChainPort.setBackground(color); }
Source:
public boolean advance() { if (!isRunning()) { return false; } URI nextUri = currentStatusInfo().getNextUri(); if (nextUri == null) { state.compareAndSet(State.RUNNING, State.FINISHED); return false; } Request request = prepareRequest(HttpUrl.get(nextUri)).build(); Exception cause = null; long start = System.nanoTime(); long attempts = 0; while (true) { Duration sinceStart = Duration.nanosSince(start); if (sinceStart.compareTo(requestTimeoutNanos) > 0) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException(format("Error fetching next (attempts: %s, duration: %s)", attempts, sinceStart), cause); } if (isClientAborted()) { return false; } if (attempts > 0) { try { MILLISECONDS.sleep(attempts * 100); } catch (InterruptedException e) { try { close(); } finally { Thread.currentThread().interrupt(); } state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException("StatementClient thread was interrupted"); } } attempts++; JsonResponse<QueryResults> response; try { response = JsonResponse.execute(QUERY_RESULTS_CODEC, httpClient, request); } catch (RuntimeException e) { cause = e; continue; } if ((response.getStatusCode() == HTTP_OK) && response.hasValue()) { processResponse(response.getHeaders(), response.getValue()); return true; } if (response.getStatusCode() != HTTP_UNAVAILABLE) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw requestFailedException("fetching next", request, response); } } }

Target:
public boolean advance() { if (!isRunning()) { return false; } URI nextUri = currentStatusInfo().getNextUri(); if (nextUri == null) { state.compareAndSet(State.RUNNING, State.FINISHED); return false; } Request request = prepareRequest(HttpUrl.get(nextUri)).build(); Exception cause = null; long start = System.nanoTime(); long attempts = 0; while (true) { if (isClientAborted()) { return false; } Duration sinceStart = Duration.nanosSince(start); if (attempts > 0 && sinceStart.compareTo(requestTimeoutNanos) > 0) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException(format("Error fetching next (attempts: %s, duration: %s)", attempts, sinceStart), cause); } if (attempts > 0) { try { MILLISECONDS.sleep(attempts * 100); } catch (InterruptedException e) { try { close(); } finally { Thread.currentThread().interrupt(); } state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw new RuntimeException("StatementClient thread was interrupted"); } } attempts++; JsonResponse<QueryResults> response; try { response = JsonResponse.execute(QUERY_RESULTS_CODEC, httpClient, request); } catch (RuntimeException e) { cause = e; continue; } if ((response.getStatusCode() == HTTP_OK) && response.hasValue()) { processResponse(response.getHeaders(), response.getValue()); return true; } if (response.getStatusCode() != HTTP_UNAVAILABLE) { state.compareAndSet(State.RUNNING, State.CLIENT_ERROR); throw requestFailedException("fetching next", request, response); } } }
Source:
public PageTitle titleForInternalLink(String internalLink) { return new PageTitle(internalLink.replaceFirst("/wiki/", "").replaceAll("_", " "), this); }

Target:
public PageTitle titleForInternalLink(String internalLink) { return new PageTitle(internalLink.replaceFirst("/wiki/", ""), this); }
Source:
public T getTargetFileSystem() throws IOException { if (isSingleLink && targetFileSystem == null) { targetFileSystem = initFileSystemFunction.apply(targetDirLinkList[0]); if (targetFileSystem == null) { throw new IOException("Could not initialize " + "target File System for URI : " + targetDirLinkList[0]); } } return targetFileSystem; }

Target:
public T getTargetFileSystem() throws IOException { if (targetFileSystem != null) return targetFileSystem; if (targetDirLinkList.length == 1) { synchronized (this) { targetFileSystem = fileSystemInitFunc.apply(targetDirLinkList[0]); } } return targetFileSystem; }
Source:
public void writePacketData(RailcraftOutputStream data) throws IOException { super.writePacketData(data); tankManager.writePacketData(data); data.writeBoolean(boiler.isBurning()); }

Target:
public void writePacketData(RailcraftOutputStream data) throws IOException { super.writePacketData(data); data.writeBoolean(boiler.isBurning()); }
Source:
private void applyInterfaceRules() { final List<? extends TypeMirror> interfaces = typeElement.getInterfaces(); final Stream<? extends TypeMirror> subInterfaces = interfaces.stream() .map(i -> (DeclaredType) i) .map(i -> (TypeElement) i.asElement()) .flatMap(i -> i.getInterfaces().stream()); Stream.concat(interfaces.stream(), subInterfaces).distinct().forEach(i -> interfaceRules.stream() .filter(r -> r.accept((ReferenceType)i)) .findFirst()); }

Target:
private void applyInterfaceRules() { final List<? extends TypeMirror> interfaces = typeElement.getInterfaces(); final Stream<? extends TypeMirror> subInterfaces = interfaces.stream() .map(_interface -> (DeclaredType) _interface) .map(_interface -> (TypeElement) _interface.asElement()) .flatMap(_interface -> _interface.getInterfaces().stream()); Stream.concat(interfaces.stream(), subInterfaces).distinct().forEach(_interface -> interfaceRules.stream() .filter(rule -> rule.accept((ReferenceType)_interface)) .findFirst()); }
Source:
public static void setup() throws IOException { FileUtils.deleteDirectory(new File(ODO_CACHE_DIR)); UsageReportPreferences.setEnabled(false); UsageReportPreferences.setAskUser(false); }

Target:
public static void setup() throws IOException { FileUtils.deleteDirectory(new File(ODO_CACHE_DIR)); }
Source:
public void setChmod(int chmod) { Assert.isTrue(chmod <= 0777, "'chmod' must be between 0 and 0777 (octal)"); BitSet bits = BitSet.valueOf(new byte[] { (byte) chmod, (byte) (chmod >> 8) }); final Set<PosixFilePermission> permissions = new HashSet<>(); bits.stream().forEach(b -> { switch (b) { case 0: permissions.add(PosixFilePermission.OTHERS_EXECUTE); break; case 1: permissions.add(PosixFilePermission.OTHERS_WRITE); break; case 2: permissions.add(PosixFilePermission.OTHERS_READ); break; case 3: permissions.add(PosixFilePermission.GROUP_EXECUTE); break; case 4: permissions.add(PosixFilePermission.GROUP_WRITE); break; case 5: permissions.add(PosixFilePermission.GROUP_READ); break; case 6: permissions.add(PosixFilePermission.OWNER_EXECUTE); break; case 7: permissions.add(PosixFilePermission.OWNER_WRITE); break; case 8: permissions.add(PosixFilePermission.OWNER_READ); break; } }); this.permissions = permissions; }

Target:
public void setChmod(int chmod) { Assert.isTrue(chmod <= 0777, "'chmod' must be between 0 and 0777 (octal)"); if (!FileUtils.IS_POSIX) { this.logger.error("'chmod' setting ignored - the file system does not support Posix attributes"); return; } BitSet bits = BitSet.valueOf(new byte[] { (byte) chmod, (byte) (chmod >> 8) }); final Set<PosixFilePermission> permissions = new HashSet<>(); bits.stream().forEach(b -> { switch (b) { case 0: permissions.add(PosixFilePermission.OTHERS_EXECUTE); break; case 1: permissions.add(PosixFilePermission.OTHERS_WRITE); break; case 2: permissions.add(PosixFilePermission.OTHERS_READ); break; case 3: permissions.add(PosixFilePermission.GROUP_EXECUTE); break; case 4: permissions.add(PosixFilePermission.GROUP_WRITE); break; case 5: permissions.add(PosixFilePermission.GROUP_READ); break; case 6: permissions.add(PosixFilePermission.OWNER_EXECUTE); break; case 7: permissions.add(PosixFilePermission.OWNER_WRITE); break; case 8: permissions.add(PosixFilePermission.OWNER_READ); break; } }); this.permissions = permissions; }
Source:
public void afterApplicationName() { datastorePath.setValue(dsPath + "/" + applicationName.getValue()); }

Target:
public void afterApplicationName() { datastorePath.setValue(dsPath.resolve(applicationName.getValue()).toAbsolutePath().toString()); }
Source:
private void fillIn(List<HasMetadata> target, List<HasMetadata> objects) throws DevfileFormatException { Set<String> uniqueNames = new HashSet<>(); for (HasMetadata existingMeta : target) { uniqueNames.add(existingMeta.getKind() + '#' + existingMeta.getMetadata().getName()); } for (HasMetadata hasMeta : objects) { if (!uniqueNames.add(hasMeta.getKind() + '#' + hasMeta.getMetadata().getName())) { throw new DevfileFormatException( format( "Tools can not have objects with the same name and kind but there are multiple objects with kind '%s' and name '%s'", hasMeta.getKind(), hasMeta.getMetadata().getName())); } target.add(hasMeta); } }

Target:
private void fillIn(List<HasMetadata> target, List<HasMetadata> objects) throws DevfileFormatException { Set<Pair<String, String>> uniqueKindToName = new HashSet<>(); for (HasMetadata existingMeta : target) { uniqueKindToName.add( new Pair<>(existingMeta.getKind(), existingMeta.getMetadata().getName())); } for (HasMetadata hasMeta : objects) { if (!uniqueKindToName.add(new Pair<>(hasMeta.getKind(), hasMeta.getMetadata().getName()))) { throw new DevfileFormatException( format( "Tools can not have objects with the same name and kind but there are multiple objects with kind '%s' and name '%s'", hasMeta.getKind(), hasMeta.getMetadata().getName())); } target.add(hasMeta); } }
Source:
Set<StoreKey> getMissingStoreKeys() { return missingStoreMessages == null ? Collections.emptySet() : missingStoreMessages.stream().map(MessageInfo::getStoreKey).collect(Collectors.toSet()); }

Target:
synchronized Set<StoreKey> getMissingStoreKeys() { return missingStoreMessages == null ? Collections.emptySet() : missingStoreMessages.stream().map(MessageInfo::getStoreKey).collect(Collectors.toSet()); }
Source:
public void testWithNonZeroFraction() throws SemanticException { if (intType) { testNullCase("100.1"); } }

Target:
public void testWithNonZeroFraction() throws Exception { if (intType) { testNullCase("100.1"); } }
Source:
public void start(Method method, Object[] data) { Configuration.clearCustomTestProperties(); Class<?> methodClass = method.getDeclaringClass(); if (methodClass.isAnnotationPresent(Execute.class)) { setTestProperty("wikiName", methodClass.getAnnotation(Execute.class).onWikia()); setTestProperty("disableFlash", methodClass.getAnnotation(Execute.class).disableFlash()); setTestProperty("browser", methodClass.getAnnotation(Execute.class).browser()); setTestProperty("browserSize", methodClass.getAnnotation(Execute.class).browserSize()); setTestProperty("onDevice", methodClass.getAnnotation(Execute.class).onDevice()); } if (method.isAnnotationPresent(Execute.class)) { setTestProperty("wikiName", method.getAnnotation(Execute.class).onWikia()); setTestProperty("disableFlash", method.getAnnotation(Execute.class).disableFlash()); setTestProperty("browser", method.getAnnotation(Execute.class).browser()); setTestProperty("browserSize", method.getAnnotation(Execute.class).browserSize()); setTestProperty("onDevice", method.getAnnotation(Execute.class).onDevice()); } prepareURLs(); if(isTestExcludedFromEnv(method)){ throw new SkipException( "Test can't be run on " + Configuration.getEnv() + " environment"); } runProxyServerIfNeeded(method); if (method.isAnnotationPresent(UserAgent.class)) { setBrowserUserAgent(method.getAnnotation(UserAgent.class).userAgent()); } if (method.isAnnotationPresent(UseUnstablePageLoadStrategy.class)) { NewDriverProvider.setUnstablePageLoadStrategy(true); } startBrowser(); setWindowSize(); if (method.isAnnotationPresent(Execute.class)) { if (method.getAnnotation(Execute.class).asUser() == User.ANONYMOUS) { loadFirstPage(); } } else { loadFirstPage(); } NewDriverProvider.setUnstablePageLoadStrategy(false); }

Target:
public void start(Method method, Object[] data) { Configuration.clearCustomTestProperties(); Class<?> declaringClass = method.getDeclaringClass(); String browser = Configuration.getBrowser(); setPropertiesFromAnnotationsOnDeclaringClass(declaringClass); setPropertiesFromAnnotationsOnMethod(method); String currentBrowser = Configuration.getBrowser(); if (!browser.equals(currentBrowser)) { PageObjectLogging .logWarning("Parameter override", "Browser parameter changed by annotation" + ", old value: " + browser + ", new value: " + currentBrowser); } prepareURLs(); if (isTestExcludedFromEnv(method)) { throw new SkipException( "Test can't be run on " + Configuration.getEnv() + " environment"); } runProxyServerIfNeeded(method); if (method.isAnnotationPresent(UserAgent.class)) { setBrowserUserAgent(method.getAnnotation(UserAgent.class).userAgent()); } if (method.isAnnotationPresent(UseUnstablePageLoadStrategy.class)) { NewDriverProvider.setUnstablePageLoadStrategy(true); } startBrowser(); setWindowSize(); if (!isNonAnonUserOnDeclaringClass(declaringClass) && !isNonAnonUserOnMethod(method)) { loadFirstPage(); } NewDriverProvider.setUnstablePageLoadStrategy(false); }
Source:
public boolean isValidAuthority(URL authorizationEndpoint) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath())) { if (UrlExtensions.isADFSAuthority(authorizationEndpoint)) { Logger.e(TAG, "Instance validation returned error", "", ADALError.DEVELOPER_AUTHORITY_CAN_NOT_BE_VALIDED, new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); return false; } return (sValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) || queryInstance(authorizationEndpoint); } return false; }

Target:
public boolean isValidAuthority(URL authorizationEndpoint) { if (authorizationEndpoint != null && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getHost()) && authorizationEndpoint.getProtocol().equals("https") && StringExtensions.IsNullOrBlank(authorizationEndpoint.getQuery()) && StringExtensions.IsNullOrBlank(authorizationEndpoint.getRef()) && !StringExtensions.IsNullOrBlank(authorizationEndpoint.getPath())) { if (UrlExtensions.isADFSAuthority(authorizationEndpoint)) { Logger.e(TAG, "Instance validation returned error", "", ADALError.DEVELOPER_AUTHORITY_CAN_NOT_BE_VALIDED, new AuthenticationException(ADALError.DISCOVERY_NOT_SUPPORTED)); } else if (sValidHosts.contains(authorizationEndpoint.getHost().toLowerCase(Locale.US))) { return true; } else { return queryInstance(authorizationEndpoint); } } return false; }
Source:
private void updateModuleDefinitions() { if (this.zkConnection.getClient() != null) { try { CuratorFramework client = this.zkConnection.getClient(); if (client.checkExists().forPath(Paths.STREAMS) != null) { Iterable<StreamDefinition> streamDefinitions = findAll(); for (StreamDefinition definition : streamDefinitions) { setModuleDefinitions(client, definition); } } } catch (Exception e) { logger.error("Exception migrating stream definitions. This migration is done when the existing " + "stream definitions that don't have module definitions set. " + e); } } }

Target:
private void updateModuleDefinitions() { if (this.zkConnection.getClient() != null) { try { CuratorFramework client = this.zkConnection.getClient(); if (client.checkExists().forPath(Paths.STREAMS) != null) { for (StreamDefinition definition : findAll()) { setModuleDefinitions(client, definition); } } } catch (Exception e) { logger.error("Exception migrating stream definitions. This migration is done when the existing " + "stream definitions that don't have module definitions set." , e); } } }
Source:
public static SCMHeadCategory union(List<SCMHeadCategory> categories) { if (categories.size() == 1) { return categories.get(0); } boolean includesCatchAll = false; final List<SCMHeadCategory> _categories = new ArrayList<SCMHeadCategory>(categories); for (SCMHeadCategory c : _categories) { if (c.isUncategorized()) { includesCatchAll = true; break; } } if (includesCatchAll) { final Localizable displayName = toDisplayName(_categories); return new SCMHeadCategory(displayName) { @NonNull @Override protected Localizable defaultDisplayName() { return displayName; } @Override public boolean isMatch(@NonNull SCMHead instance) { return true; } }; } else { final Localizable displayName = toDisplayName(_categories); String name = toShortUrl(_categories); return new SCMHeadCategory(name, displayName) { @NonNull @Override protected Localizable defaultDisplayName() { return displayName; } @Override public boolean isMatch(@NonNull SCMHead instance) { for (SCMHeadCategory c : _categories) { if (c.isMatch(instance)) { return true; } } return false; } }; } }

Target:
public static SCMHeadCategory union(List<SCMHeadCategory> categories) { if (categories.isEmpty()) { throw new IllegalArgumentException("Cannot reduce an empty list"); } if (categories.size() == 1) { return categories.get(0); } boolean includesCatchAll = false; final List<SCMHeadCategory> _categories = new ArrayList<SCMHeadCategory>(categories); for (SCMHeadCategory c : _categories) { if (c.isUncategorized()) { includesCatchAll = true; break; } } if (includesCatchAll) { final Localizable displayName = toDisplayName(_categories); return new SCMHeadCategory(displayName) { @NonNull @Override protected Localizable defaultDisplayName() { return displayName; } @Override public boolean isMatch(@NonNull SCMHead instance) { return true; } }; } else { final Localizable displayName = toDisplayName(_categories); String name = toShortUrl(_categories); return new SCMHeadCategory(name, displayName) { @NonNull @Override protected Localizable defaultDisplayName() { return displayName; } @Override public boolean isMatch(@NonNull SCMHead instance) { for (SCMHeadCategory c : _categories) { if (c.isMatch(instance)) { return true; } } return false; } }; } }
Source:
private void notifyUsersDatasetPublishStatus(CommandContext ctxt, DvObject subject, UserNotification.Type type) { ctxt.roles().rolesAssignments(subject).stream() .filter( ra -> ra.getRole().permissions().contains(Permission.ViewUnpublishedDataset) || ra.getRole().permissions().contains(Permission.DownloadFile)) .flatMap( ra -> ctxt.roleAssignees().getExplicitUsers(ctxt.roleAssignees().getRoleAssignee(ra.getAssigneeIdentifier())).stream() ) .distinct() .forEach( au -> ctxt.notifications().sendNotification(au, getTimestamp(), type, getDataset().getLatestVersion().getId()) ); }

Target:
private void notifyUsersDatasetPublishStatus(CommandContext ctxt, DvObject subject, UserNotification.Type type) { ctxt.roles().rolesAssignments(subject).stream() .filter( ra -> ra.getRole().permissions().contains(Permission.ViewUnpublishedDataset) || ra.getRole().permissions().contains(Permission.DownloadFile)) .flatMap( ra -> ctxt.roleAssignees().getExplicitUsers(ctxt.roleAssignees().getRoleAssignee(ra.getAssigneeIdentifier())).stream() ) .distinct() .forEach( au -> ctxt.notifications().sendNotificationInNewTransaction(au, getTimestamp(), type, getDataset().getLatestVersion().getId()) ); }
Source:
public int hashCode() { int result = 1; result = 37 * result + getName().hashCode(); result = 37 * result + getValueType().hashCode(); result = 37 * result + (!this.isInfinite() ? Arrays.hashCode(Iterables.toArray(this, Object.class)) : 0); return result; }

Target:
public int hashCode() { if(this.isInfinite()) return System.identityHashCode(this); int result = 1; result = 37 * result + getName().hashCode(); result = 37 * result + getValueType().hashCode(); for(Object obj : this) { result = 37 * result + (obj != null ? obj.hashCode() : 0); } return result; }
Source:
Response forget(URI lraId, URI parentId) { return invokeParticipantMethod(forgetMethod, lraId, parentId, FORGET); }

Target:
synchronized Response forget(URI lraId, URI parentId) { return invokeParticipantMethod(forgetMethod, lraId, parentId, FORGET); }
Source:
public static float convertRawToCO2(final int co2Raw) { if (co2Raw <= 0) { return 0.0f; } if (co2Raw > MAX_CO2) { final Random random = new Random(); final int wnoise = (int) (random.nextGaussian() * Math.sqrt(CO2_VARIANCE)); return (float) MAX_CO2 + wnoise; } return (float) co2Raw; }

Target:
public static float convertRawToCO2(final int co2Raw) { if (co2Raw <= 0) { return 0.0f; } return (float) co2Raw; }
Source:
public RemoteCacheManagerAdmin administration() { OperationsFactory operationsFactory = new OperationsFactory(transportFactory, codec, asyncExecutorService, configuration); return new RemoteCacheManagerAdminImpl(operationsFactory, EnumSet.noneOf(CacheContainerAdmin.AdminFlag.class)); }

Target:
public RemoteCacheManagerAdmin administration() { OperationsFactory operationsFactory = new OperationsFactory(transportFactory, codec, asyncExecutorService, configuration); return new RemoteCacheManagerAdminImpl(operationsFactory, EnumSet.noneOf(CacheContainerAdmin.AdminFlag.class), name -> { synchronized (cacheName2RemoteCache) { cacheName2RemoteCache.remove(new RemoteCacheKey(name, true)); cacheName2RemoteCache.remove(new RemoteCacheKey(name, false)); } }); }
Source:
private void handleMultipleRepositoryCheckoutError( Map<Repository, CheckoutResult> results) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { @Override public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new MultiBranchOperationResultDialog(shell, results).open(); } }); }

Target:
private void handleMultipleRepositoryCheckoutError( Map<Repository, CheckoutResult> results) { PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); new MultiBranchOperationResultDialog(shell, results).open(); } ); }