auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Optional<FactoryDto> createFactoryFromDevfile( String devfileLocation, FileContentProvider fileContentProvider) throws BadRequestException, ServerException { if (devfileLocation == null) { return Optional.empty(); } final String devfileYamlContent = urlFetcher.fetchSafely(devfileLocation); if (isNullOrEmpty(devfileYamlContent)) { return Optional.empty(); } try { Devfile devfile = devfileManager.parse(devfileYamlContent); WorkspaceConfigImpl wsConfig = devfileManager.createWorkspaceConfig(devfile, fileContentProvider); return Optional.of( newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withWorkspace(DtoConverter.asDto(wsConfig))); } catch (DevfileException e) { throw new BadRequestException( "Error occurred during creation a workspace from workspace located at `" + devfileLocation + "`. Cause: " + e.getMessage()); } }

Target:
public Optional<FactoryDto> createFactoryFromDevfile( String devfileLocation, FileContentProvider fileContentProvider) throws BadRequestException, ServerException { if (devfileLocation == null) { return Optional.empty(); } final String devfileYamlContent = urlFetcher.fetchSafely(devfileLocation); if (isNullOrEmpty(devfileYamlContent)) { return Optional.empty(); } try { Devfile devfile = devfileManager.parse(devfileYamlContent); WorkspaceConfigImpl wsConfig = devfileManager.createWorkspaceConfig(devfile, fileContentProvider); return Optional.of( newDto(FactoryDto.class) .withV(CURRENT_VERSION) .withWorkspace(DtoConverter.asDto(wsConfig))); } catch (DevfileException e) { throw new BadRequestException( "Error occurred during creation a workspace from devfile located at `" + devfileLocation + "`. Cause: " + e.getMessage()); } }
Source:
private Map<ExecutionResultNode, List<ExecutionResultZipper>> zipperWithSameParent(List<ExecutionResultZipper> zippers) { return zippers.stream().collect(Collectors.groupingBy(ExecutionResultZipper::getParent)); }

Target:
private Map<ExecutionResultNode, List<ExecutionResultZipper>> zipperWithSameParent(List<ExecutionResultZipper> zippers) { return zippers.stream().collect(Collectors.groupingBy(ExecutionResultZipper::getParent, LinkedHashMap::new, mapping(Function.identity(), toList()))); }
Source:
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (bean instanceof Advised) { for (Advisor advisor : ((Advised) bean).getAdvisors()) { Advice advice = advisor.getAdvice(); if (advice instanceof MessageHandlerMetrics) { return bean; } } } if (IntegrationContextUtils.INTEGRATION_MESSAGE_HISTORY_CONFIGURER_BEAN_NAME.equals(beanName) && bean instanceof MessageHistoryConfigurer) { this.messageHistoryConfigurer = (MessageHistoryConfigurer) bean; return bean; } if (bean instanceof MessageHandlerMetrics) { if (this.handlerInAnonymousWrapper(bean) != null) { if (logger.isDebugEnabled()) { logger.debug("Skipping " + beanName + " because it wraps another handler"); } return bean; } MessageHandlerMetrics monitor = (MessageHandlerMetrics) extractTarget(bean); monitor.enableStats(true); handlers.add(monitor); } if (bean instanceof MessageSourceMetrics) { MessageSourceMetrics monitor = (MessageSourceMetrics) extractTarget(bean); monitor.enableCounts(true); sources.add(monitor); } if (bean instanceof MessageChannel && bean instanceof MessageChannelMetrics && bean instanceof NamedComponent) { MessageChannelMetrics monitor = (MessageChannelMetrics) extractTarget(bean); monitor.enableStats(true); channels.add(monitor); } if (bean instanceof MessageProducer && bean instanceof Lifecycle) { Lifecycle target = (Lifecycle) extractTarget(bean); if (!(target instanceof AbstractReplyProducingMessageHandler)) { this.inboundLifecycleMessageProducers.add(target); } } return bean; }

Target:
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { if (IntegrationContextUtils.INTEGRATION_MESSAGE_HISTORY_CONFIGURER_BEAN_NAME.equals(beanName) && bean instanceof MessageHistoryConfigurer) { this.messageHistoryConfigurer = (MessageHistoryConfigurer) bean; return bean; } if (bean instanceof MessageHandlerMetrics) { if (this.handlerInAnonymousWrapper(bean) != null) { if (logger.isDebugEnabled()) { logger.debug("Skipping " + beanName + " because it wraps another handler"); } return bean; } MessageHandlerMetrics monitor = (MessageHandlerMetrics) extractTarget(bean); handlers.add(monitor); } if (bean instanceof MessageSourceMetrics) { MessageSourceMetrics monitor = (MessageSourceMetrics) extractTarget(bean); sources.add(monitor); } if (bean instanceof MessageChannel && bean instanceof MessageChannelMetrics && bean instanceof NamedComponent) { MessageChannelMetrics monitor = (MessageChannelMetrics) extractTarget(bean); channels.add(monitor); } if (bean instanceof MessageProducer && bean instanceof Lifecycle) { Lifecycle target = (Lifecycle) extractTarget(bean); if (!(target instanceof AbstractReplyProducingMessageHandler)) { this.inboundLifecycleMessageProducers.add(target); } } return bean; }
Source:
public void Case() { <<<<<<< HEAD assertEquals(ImmutableList.of(1, 2, 2, 2, 2, 2), query().from(cat).orderBy(cat.id.asc()) .select(cat.name.when("Bob123").then(1).otherwise(2)).fetch()); }

Target:
public void Case() { assertEquals(ImmutableList.of(1, 2, 2, 2, 2, 2), query().from(cat).orderBy(cat.id.asc()) .select(cat.name.when("Bob123").then(1).otherwise(2)).fetch()); }
Source:
public Object getValue() throws CouldNotGenerateValueException { try { return fMethod.invokeExplosively(null); } catch (IllegalArgumentException e) { throw new RuntimeException( "unexpected: argument length is checked"); } catch (IllegalAccessException e) { throw new RuntimeException( "unexpected: getMethods returned an inaccessible method"); } catch (Throwable t) { DataPoint annotation = fMethod.getAnnotation(DataPoint.class); if (annotation != null) { for (Class<? extends Throwable> ignorable : annotation.ignoredExceptions()) { Assume.assumeThat(t, not(instanceOf(ignorable))); } } throw new CouldNotGenerateValueException(t); } }

Target:
public Object getValue() throws CouldNotGenerateValueException { try { return fMethod.invokeExplosively(null); } catch (IllegalArgumentException e) { throw new RuntimeException( "unexpected: argument length is checked"); } catch (IllegalAccessException e) { throw new RuntimeException( "unexpected: getMethods returned an inaccessible method"); } catch (Throwable throwable) { DataPoint annotation = fMethod.getAnnotation(DataPoint.class); Assume.assumeTrue(annotation == null || !isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)); throw new CouldNotGenerateValueException(throwable); } }
Source:
public void run() { super.run(); Bugsnag.addMetadata("persist", "keep", "foo"); Bugsnag.addMetadata("persist", "remove", "bar"); Bugsnag.addMetadata("remove", "foo", "bar"); activate(); Handler main = new Handler(Looper.getMainLooper()); main.postDelayed(new Runnable() { @Override public void run() { Bugsnag.clearMetadata("remove"); Bugsnag.clearMetadata("persist", "remove"); activate(); } }, 1500); }

Target:
public void run() { super.run(); Bugsnag.addMetadata("persist", "keep", "foo"); Bugsnag.addMetadata("persist", "remove", "bar"); Bugsnag.addMetadata("remove", "foo", "bar"); activate(); Handler main = new Handler(Looper.getMainLooper()); main.postDelayed(new Runnable() { @Override public void run() { Bugsnag.clearMetadata("remove"); Bugsnag.clearMetadata("persist", "remove"); activate(); } }, 150); }
Source:
public void init() throws ServiceInitializationException { File containersDirectory = playOnLinuxContext.makeContainersPath(); containersDirectoryObservable = new DirectoryWatcherFiles(executorService, containersDirectory); containersDirectoryObservable.setOnChange(this::update); }

Target:
public void init() throws ServiceInitializationException { final File containersDirectory = playOnLinuxContext.makeContainersPath(); containersDirectoryObservable = new DirectoryWatcherFiles(executorService, containersDirectory); containersDirectoryObservable.setOnChange(this::update); }
Source:
public void closeConnection() { try { if (reader != null) reader.stopserver(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void closeConnection() { try { if (reader != null) reader.stopserver(); } catch (IOException e) { logger.error("Error at closeconnection", e); } }
Source:
public void onReceive(Context context, Intent intent) { MixpanelAPI.trackPushNotificationEventFromIntent( context, intent, "$push_notification_dismissed" ); }

Target:
public void onReceive(Context context, Intent intent) { String action = intent.getAction(); if (action != null && action.equals(MixpanelPushNotification.PUSH_DISMISS_ACTION)) { MixpanelAPI.trackPushNotificationEventFromIntent( context, intent, "$push_notification_dismissed" ); } }
Source:
public int getNumberOfChildProcesses(int processId) { try { return ServiceManager.getProcessService().getById(processId).getChildren().size(); } catch (DAOException e) { Helper.setErrorMessage(ERROR_LOADING_ONE, new Object[] {ObjectType.PROCESS.getTranslationSingular(), processId }, logger, e); return 0; } }

Target:
public int getNumberOfChildProcesses(int processId) { try { return ServiceManager.getProcessService().getNumberOfChildren(processId); } catch (DAOException e) { Helper.setErrorMessage(ERROR_LOADING_ONE, new Object[] {ObjectType.PROCESS.getTranslationSingular(), processId }, logger, e); return 0; } }
Source:
private void setupDispatcherChain(double startGain, double startBpm, double secondsToSkip) throws EncoderException, LineUnavailableException { inputStream = Streamer.stream(track.getPath(), attributes); tarsosStream = new JVMAudioInputStream(inputStream); audioPlayer = new AudioPlayer(format); wsola = new WaveformSimilarityBasedOverlapAdd(newParameters()); gainProcessor = new GainProcessor(startGain); dispatcher = new CustomAudioDispatcher(tarsosStream, wsola.getInputBufferSize(), wsola.getOverlap()); progressProcessor = new ProgressProcessor(); progressProcessor.setUp(track.getDuration(), this.secondsToSkip, pcc); final TrackProcessor thisProcessor = this; skipProcessor = new SkipAudioProcessor(secondsToSkip, true, new SkipAudioProcessorCallback() { @Override public void onFinished() { thisProcessor.setState(PlayerState.READY); } }); dispatcher.addAudioProcessor(this); dispatcher.addAudioProcessor(skipProcessor); wsola.setDispatcher(dispatcher); dispatcher.addAudioProcessor(wsola); dispatcher.addAudioProcessor(gainProcessor); dispatcher.addAudioProcessor(progressProcessor); dispatcher.addAudioProcessor(audioPlayer); thread = new Thread(dispatcher); thread.start(); }

Target:
private void setupDispatcherChain(double startGain, double startBpm, double secondsToSkip) throws EncoderException, LineUnavailableException { inputStream = Streamer.stream(track.getPath(), attributes); tarsosStream = new JVMAudioInputStream(inputStream); audioPlayer = new AudioPlayer(format); wsola = new WaveformSimilarityBasedOverlapAdd(newParameters()); gainProcessor = new GainProcessor(startGain); dispatcher = new CustomAudioDispatcher(tarsosStream, wsola.getInputBufferSize(), wsola.getOverlap()); progressProcessor = new ProgressProcessor(transitionTime, this.secondsToSkip, pcc); final TrackProcessor thisProcessor = this; skipProcessor = new SkipAudioProcessor(secondsToSkip, true, new SkipAudioProcessorCallback() { @Override public void onFinished() { thisProcessor.setState(PlayerState.READY); } }); dispatcher.addAudioProcessor(this); dispatcher.addAudioProcessor(skipProcessor); wsola.setDispatcher(dispatcher); dispatcher.addAudioProcessor(wsola); dispatcher.addAudioProcessor(gainProcessor); dispatcher.addAudioProcessor(progressProcessor); dispatcher.addAudioProcessor(audioPlayer); thread = new Thread(dispatcher); thread.start(); }
Source:
public void rightClickAir(GlowPlayer player, ItemStack holding) { if (player.getCurrentFishingHook() == null) { Location location = calculateSpawnLocation(player); FishHook fishHook = new GlowFishingHook(location, holding); fishHook.setShooter(player); player.setCurrentFishingHook((GlowFishingHook) fishHook); } else { player.getCurrentFishingHook().reelIn(); player.setCurrentFishingHook(null); } }

Target:
public void rightClickAir(GlowPlayer player, ItemStack holding) { if (player.getCurrentFishingHook() == null) { Location location = calculateSpawnLocation(player); FishHook fishHook = new GlowFishingHook(location, holding, player); fishHook.setShooter(player); player.setCurrentFishingHook((GlowFishingHook) fishHook); } else { player.getCurrentFishingHook().reelIn(); player.setCurrentFishingHook(null); } }
Source:
public CatalogKey getKey() { return api$key; }

Target:
public CatalogKey getKey() { return this.api$key; }
Source:
public void setUp() throws IOException { DfsRepositoryDescription desc = new DfsRepositoryDescription("test"); git = new TestRepository<>(new InMemoryRepository(desc)); repo = git.getRepository(); odb = repo.getObjectDatabase(); ticks = 0; mockSystemReader = new MockSystemReader() { @Override public long getCurrentTime() { return super.getCurrentTime() + ticks++; } }; SystemReader.setInstance(mockSystemReader); }

Target:
public void setUp() throws IOException { DfsRepositoryDescription desc = new DfsRepositoryDescription("test"); git = new TestRepository<>(new InMemoryRepository(desc)); repo = git.getRepository(); odb = repo.getObjectDatabase(); mockSystemReader = new MockSystemReader(); SystemReader.setInstance(mockSystemReader); }
Source:
public void executePatchRequest() throws Exception { final GhJson json = new GhJson( new FakeRequest().withBody("{\"body\":\"hi\"}") ); json.patch( Json.createObjectBuilder() .add("content", "hi you!") .build() ); MatcherAssert.assertThat( json.fetch().toString(), Matchers.containsString("hi") ); }

Target:
public void executePatchRequest() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple(HttpURLConnection.HTTP_OK, "{\"body\":\"hj\"}") ).start(); final GhJson json = new GhJson(new ApacheRequest(container.home())); json.patch( Json.createObjectBuilder() .add("content", "hi you!") .build() ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo("PATCH") ); container.stop(); }
Source:
public Map<String, Object> prepareGlusterDisk(VM vm, DiskImage diskImage, Map<String, Object> struct) { this.getNetworkDiskType(vm, diskImage).ifPresent((diskType) -> struct.put(VdsProperties.DiskType, diskType)); return struct; }

Target:
public Map<String, Object> prepareGlusterDisk(VM vm, DiskImage diskImage, Map<String, Object> struct) { getNetworkDiskType(vm, diskImage).ifPresent((diskType) -> struct.put(VdsProperties.DiskType, diskType)); return struct; }
Source:
public List<AdminEmailAttributes> getSentAdminEmails(){ List<AdminEmailAttributes> list = new LinkedList<AdminEmailAttributes>(); Query q = getPM().newQuery(AdminEmail.class); q.declareParameters("boolean isInTrashBinParam"); q.setFilter("isInTrashBin == isInTrashBinParam && sendDate != null"); @SuppressWarnings("unchecked") List<AdminEmail> adminEmailList = (List<AdminEmail>) q.execute(false); if (adminEmailList.isEmpty() || JDOHelper.isDeleted(adminEmailList.get(0))) { return list; } Iterator<AdminEmail> it = adminEmailList.iterator(); while(it.hasNext()){ AdminEmail adminEmail = it.next(); if (!JDOHelper.isDeleted(adminEmail)) { list.add(new AdminEmailAttributes(adminEmail)); } } return list; }

Target:
public List<AdminEmailAttributes> getSentAdminEmails(){ List<AdminEmailAttributes> list = new LinkedList<AdminEmailAttributes>(); Query q = getPM().newQuery(AdminEmail.class); q.declareParameters("boolean isInTrashBinParam"); q.setFilter("isInTrashBin == isInTrashBinParam && sendDate != null"); @SuppressWarnings("unchecked") List<AdminEmail> adminEmailList = (List<AdminEmail>) q.execute(false); if (adminEmailList.isEmpty()) { return list; } Iterator<AdminEmail> it = adminEmailList.iterator(); while(it.hasNext()){ AdminEmail adminEmail = it.next(); if (!JDOHelper.isDeleted(adminEmail)) { list.add(new AdminEmailAttributes(adminEmail)); } } return list; }
Source:
public static void assertThrows( String message, Class<? extends Exception> expected, Callable callable) { try { callable.call(); Assert.fail("No exception was thrown (" + message + "), expected: " + expected.getName()); } catch (Exception actual) { if (!actual.equals(expected)) { System.err.println("Caught an unexpected exception:"); actual.printStackTrace(System.err); } Assert.assertEquals(message, expected, actual.getClass()); } }

Target:
public static void assertThrows( String message, Class<? extends Exception> expected, Callable callable) { try { callable.call(); Assert.fail("No exception was thrown (" + message + "), expected: " + expected.getName()); } catch (Exception actual) { try { Assert.assertEquals(message, expected, actual.getClass()); } catch (AssertionError e) { e.addSuppressed(actual); throw e; } } }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_syncpayload, container, false); ButterKnife.bind(this, rootView); mSyncLoanRepaymentTransactionPresenter.attachView(this); LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity()); mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); rv_loan_repayment.setLayoutManager(mLayoutManager); rv_loan_repayment.setHasFixedSize(true); rv_loan_repayment.setAdapter(mSyncLoanRepaymentAdapter); swipeRefreshLayout.setColorSchemeResources(R.color.blue_light, R.color.green_light, R .color.orange_light, R.color.red_light); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { mSyncLoanRepaymentTransactionPresenter.loadDatabaseLoanRepaymentTransactions(); mSyncLoanRepaymentTransactionPresenter.loanPaymentTypeOption(); if (swipeRefreshLayout.isRefreshing()) swipeRefreshLayout.setRefreshing(false); } }); mSyncLoanRepaymentTransactionPresenter.loadDatabaseLoanRepaymentTransactions(); mSyncLoanRepaymentTransactionPresenter.loanPaymentTypeOption(); return rootView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { rootView = inflater.inflate(R.layout.fragment_syncpayload, container, false); ButterKnife.bind(this, rootView); mSyncLoanRepaymentTransactionPresenter.attachView(this); LinearLayoutManager mLayoutManager = new LinearLayoutManager(getActivity()); mLayoutManager.setOrientation(LinearLayoutManager.VERTICAL); rv_loan_repayment.setLayoutManager(mLayoutManager); rv_loan_repayment.setHasFixedSize(true); rv_loan_repayment.setAdapter(mSyncLoanRepaymentAdapter); swipeRefreshLayout.setColorSchemeColors(getActivity() .getResources().getIntArray(R.array.swipeRefreshColors)); swipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() { @Override public void onRefresh() { mSyncLoanRepaymentTransactionPresenter.loadDatabaseLoanRepaymentTransactions(); mSyncLoanRepaymentTransactionPresenter.loanPaymentTypeOption(); if (swipeRefreshLayout.isRefreshing()) swipeRefreshLayout.setRefreshing(false); } }); mSyncLoanRepaymentTransactionPresenter.loadDatabaseLoanRepaymentTransactions(); mSyncLoanRepaymentTransactionPresenter.loanPaymentTypeOption(); return rootView; }
Source:
private SelectionAdapter onExplanationClicked(final Control connectionsPane, final Control explanationPane) { return new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ConnectionWizard wizard = new ConnectionWizard(); wizard.setWindowTitle("New OpenShift Connection"); WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getModalDialogShellProvider() .getShell(), wizard); if (dialog.open() == Window.OK) { showConnectionsOrExplanations(connectionsPane, explanationPane); } } }; }

Target:
private SelectionAdapter onExplanationClicked(final Control connectionsPane, final Control explanationPane) { return new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { ConnectionWizard wizard = new ConnectionWizard(); WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getModalDialogShellProvider() .getShell(), wizard); if (dialog.open() == Window.OK) { showConnectionsOrExplanations(connectionsPane, explanationPane); } } }; }
Source:
private void qos(Network network, VdsNetworkInterface iface, NetworkQoS expectedQos, boolean hostNetworkQosSupported) { configRule.mockConfigValue(ConfigValues.HostNetworkQosSupported, version, hostNetworkQosSupported); SetupNetworksVdsCommandParameters parameters = new SetupNetworksVdsCommandParameters(Guid.newGuid(), Collections.singletonList(network), Collections.<String> emptyList(), Collections.<VdsNetworkInterface> emptyList(), Collections.<String> emptySet(), Collections.singletonList(iface)); createCommand(parameters).execute(); verifyMethodPassedToHost(); Map<String, Object> networkStruct = assertNeworkWasSent(network); NetworkQosMapper qosMapper = new NetworkQosMapper(networkStruct, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); NetworkQoS deserialize = qosMapper.deserialize(); assertTrue((expectedQos == null && deserialize == null) || expectedQos.equalValues(deserialize)); }

Target:
private void qos(Network network, VdsNetworkInterface iface, NetworkQoS expectedQos, boolean hostNetworkQosSupported) { configRule.mockConfigValue(ConfigValues.HostNetworkQosSupported, version, hostNetworkQosSupported); SetupNetworksVdsCommandParameters parameters = new SetupNetworksVdsCommandParameters(Guid.newGuid(), Collections.singletonList(network), Collections.<String> emptyList(), Collections.<VdsNetworkInterface> emptyList(), Collections.<String> emptySet(), Collections.singletonList(iface)); createCommand(parameters).execute(); verifyMethodPassedToHost(); Map<String, Object> networkStruct = assertNeworkWasSent(network); NetworkQosMapper qosMapper = new NetworkQosMapper(networkStruct, VdsProperties.HOST_QOS_INBOUND, VdsProperties.HOST_QOS_OUTBOUND); NetworkQoS deserialize = qosMapper.deserialize(); assertTrue((expectedQos == null && deserialize == null) || (expectedQos != null && expectedQos.equalValues(deserialize))); }
Source:
public void reload(boolean adminOnly,int timeout){ executeReload(adminOnly); waitForLiveServerToReload(timeout); }

Target:
public void reload(boolean adminOnly, int timeout) { reload(adminOnly, timeout, null); }
Source:
public void setFont (Font font) { checkWidget(); if (((state & FONT) == 0) && font == null) return; this.font = font; long fontDesc; if (font == null) { fontDesc = defaultFont ().handle; } else { if (font.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); fontDesc = font.handle; } if (font == null) { state &= ~FONT; } else { state |= FONT; } if (OS.GTK_VERSION < OS.VERSION(3, 22, 0)){ setFontDescription (fontDesc); } else { long context = OS.gtk_widget_get_style_context (handle); long family = OS.pango_font_description_get_family(fontDesc); String name; if (family == 0) { return; } else { int length = OS.strlen (family); byte buffer = new byte [length]; OS.memmove (buffer, family, length); name = new String (Converter.mbcsToWcs (null, buffer)); } String cssName = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle) : display.gtk_widget_get_name(handle); int height = OS.pango_font_description_get_size(fontDesc) / OS.PANGO_SCALE; String css = cssName + " {font: "+ name +" "+height+";}"; gtk_css_provider_load_from_css(context,css); } }

Target:
public void setFont (Font font) { checkWidget(); if (((state & FONT) == 0) && font == null) return; this.font = font; long fontDesc; if (font == null) { fontDesc = defaultFont ().handle; } else { if (font.isDisposed ()) error(SWT.ERROR_INVALID_ARGUMENT); fontDesc = font.handle; } if (font == null) { state &= ~FONT; } else { state |= FONT; } if (OS.GTK_VERSION < OS.VERSION(3, 21, 0)){ setFontDescription (fontDesc); } else { long context = OS.gtk_widget_get_style_context (handle); long family = OS.pango_font_description_get_family(fontDesc); String name; if (family == 0) { return; } else { int length = OS.strlen (family); byte buffer = new byte [length]; OS.memmove (buffer, family, length); name = new String (Converter.mbcsToWcs (null, buffer)); } String cssName = OS.GTK_VERSION >= OS.VERSION(3, 20, 0) ? display.gtk_widget_class_get_css_name(handle) : display.gtk_widget_get_name(handle); int height = OS.pango_font_description_get_size(fontDesc) / OS.PANGO_SCALE; String css = cssName + " {font: " + name +" " + height + ";}"; gtk_css_provider_load_from_css(context, css); } }
Source:
public void dataIsInAUsableStateAfterBackup() throws Exception { Cluster cluster = startCluster( recordFormat ); createIndexes( cluster.getDbWithAnyRole( Role.LEADER ).database() ); AtomicBoolean continueFlagReference = new AtomicBoolean( false ); new Thread( () -> repeatedlyPopulateDatabase( clusterLeader( cluster ).database(), continueFlagReference ) ) .start(); oneOffShutdownTasks.add( () -> continueFlagReference.set( false ) ); String ip = TestHelpers.backupAddressCc( clusterLeader( cluster ).database() ); assertEquals( 0, runBackupToolFromOtherJvmToGetExitCode( "--from", ip, "--cc-report-dir=" + backupDir, "--backup-dir=" + backupDir, "--name=defaultport" ) ); }

Target:
public void dataIsInAUsableStateAfterBackup() throws Exception { Cluster cluster = startCluster( recordFormat ); ClusterHelper.createIndexes( cluster.getDbWithAnyRole( Role.LEADER ).database() ); AtomicBoolean populateDatabaseFlag = new AtomicBoolean( true ); new Thread( () -> repeatedlyPopulateDatabase( cluster, populateDatabaseFlag ) ) .start(); oneOffShutdownTasks.add( () -> populateDatabaseFlag.set( false ) ); String address = TestHelpers.backupAddressCc( clusterLeader( cluster ).database() ); assertEquals( 0, runBackupToolFromOtherJvmToGetExitCode( "--from", address, "--cc-report-dir=" + backupDir, "--backup-dir=" + backupDir, "--name=defaultport" ) ); }
Source:
private void writeDirectoryToZip(ZipOutputStream destiny, FileHandle source, String relPath) { try { FileHandle[] children = source.list(); for (int i = 0; i < children.length; i++) { FileHandle child = children[i]; String childName = child.name(); if (child.isDirectory()) { String childRelativePath = ""; if (relPath != null && !relPath.equals("")) { relPath = relPath.replaceAll("\\\\", "/"); childRelativePath = relPath.endsWith("/") ? relPath + childName : relPath + "/" + childName; } else { childRelativePath = childName; } writeDirectoryToZip(destiny, child, childRelativePath); } else { InputStream fis = child.read(); String entryName = ""; if (relPath != null && !relPath.equals("")) { relPath = relPath.replaceAll("\\\\", "/"); entryName = relPath.endsWith("/") ? relPath + childName : relPath + "/" + childName; } else { entryName = childName; } ZipEntry anEntry = new ZipEntry(entryName); try { destiny.putNextEntry(anEntry); byte[] readBuffer = new byte[1024]; int bytesIn = 0; while ((bytesIn = fis.read(readBuffer)) != -1) { destiny.write(readBuffer, 0, bytesIn); } } catch (ZipException zipException) { Gdx.app.error("EditorIO.writeDirectoryToZip", "Error exporting: writeDirectoryToZip", zipException); } fis.close(); destiny.closeEntry(); } } } catch (Exception e) { Gdx.app.error("EditorIO.writeDirectoryToZip", "Error exporting: writeDirectoryToZip", e); } }

Target:
private void writeDirectoryToZip(ZipOutputStream destiny, FileHandle source, String relPath) { try { FileHandle[] children = source.list(); for (int i = 0; i < children.length; i++) { FileHandle child = children[i]; String childName = child.name(); if (child.isDirectory()) { String childRelativePath = canonicalizeChild(relPath, childName); writeDirectoryToZip(destiny, child, childRelativePath); } else { InputStream fis = child.read(); String entryName = canonicalizeChild(relPath, childName); ZipEntry anEntry = new ZipEntry(entryName); try { destiny.putNextEntry(anEntry); byte[] readBuffer = new byte[1024]; int bytesIn = 0; while ((bytesIn = fis.read(readBuffer)) != -1) { destiny.write(readBuffer, 0, bytesIn); } } catch (ZipException zipException) { Gdx.app.error("EditorIO.writeDirectoryToZip", "Error exporting: writeDirectoryToZip", zipException); } fis.close(); destiny.closeEntry(); } } } catch (Exception e) { Gdx.app.error("EditorIO.writeDirectoryToZip", "Error exporting: writeDirectoryToZip", e); } }
Source:
public void testDigestUpdatedWhenReplayCreateTxnForExistNode() { try { System.setProperty(DigestCalculator.ZOOKEEPER_DIGEST_ENABLED, "true"); dt.processTxn(new TxnHeader(13, 1000, 1, 30, ZooDefs.OpCode.create), new CreateTxn("/foo", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, false, 1)); dt.processTxn(new TxnHeader(13, 1000, 1, 30, ZooDefs.OpCode.create), new CreateTxn("/foo", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, false, 2)); assertEquals(dt.getTreeDigest(), dt.getLastProcessedZxidDigest().digest); } finally { System.setProperty(DigestCalculator.ZOOKEEPER_DIGEST_ENABLED, "false"); } }

Target:
public void testDigestUpdatedWhenReplayCreateTxnForExistNode() { try { ZooKeeperServer.setDigestEnabled(true); DataTree dt = new DataTree(); dt.processTxn(new TxnHeader(13, 1000, 1, 30, ZooDefs.OpCode.create), new CreateTxn("/foo", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, false, 1)); dt.processTxn(new TxnHeader(13, 1000, 1, 30, ZooDefs.OpCode.create), new CreateTxn("/foo", "".getBytes(), ZooDefs.Ids.OPEN_ACL_UNSAFE, false, 2)); assertEquals(dt.getTreeDigest(), dt.getLastProcessedZxidDigest().digest); } finally { ZooKeeperServer.setDigestEnabled(false); } }
Source:
public void markMessage(Message message, ChatMarkersState chatMarkersState, String messageId) throws NotConnectedException, InterruptedException, IllegalStateException { if (message == null) { throw new IllegalStateException("Message must not be null"); } if (message.getTo() == null) { throw new IllegalStateException("To attribute must not be null"); } if (message.getStanzaId() == null) { message.setStanzaId(); } if (chatMarkersState == ChatMarkersState.received) { message.addExtension(new ChatMarkersElements.ReceivedExtension(messageId)); } else if (chatMarkersState == ChatMarkersState.displayed) { message.addExtension(new ChatMarkersElements.DisplayedExtension(messageId)); } else if (chatMarkersState == ChatMarkersState.acknowledged) { message.addExtension(new ChatMarkersElements.AcknowledgedExtension(messageId)); } connection().sendStanza(message); }

Target:
public void markMessage(Message message, ChatMarkersState chatMarkersState, String messageId) throws NotConnectedException, InterruptedException, IllegalStateException { Objects.requireNonNull(message, "Message must not be null"); if (message.getTo() == null) { throw new IllegalStateException("To attribute must not be null"); } if (!message.hasStanzaIdSet()) { message.setStanzaId(); } switch (chatMarkersState) { case received: message.addExtension(new ChatMarkersElements.ReceivedExtension(messageId)); break; case displayed: message.addExtension(new ChatMarkersElements.DisplayedExtension(messageId)); break; case acknowledged: message.addExtension(new ChatMarkersElements.AcknowledgedExtension(messageId)); break; default: throw new IllegalStateException("markable is automatically set in outgoing messages."); } connection().sendStanza(message); }
Source:
public void testMcqWeightsFeature_shouldToggleStateCorrectly() { ______TS("MCQ: Weight cells are visible when weights are assigned"); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); assertTrue(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); assertFalse(browser.driver.findElement(By.id("mcqOtherOptionFlag-" + NEW_QUESTION_INDEX)).isSelected()); assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); ______TS("MCQ: Other weight Cell is visible when other option and weights both are enabled"); assertTrue(feedbackEditPage.isMcqAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); assertFalse(browser.driver.findElement(By.id("mcqOtherOptionFlag-" + NEW_QUESTION_INDEX)).isSelected()); feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); assertTrue(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); }

Target:
public void testMcqWeightsFeature_shouldToggleStateCorrectly() { ______TS("MCQ: Weight cells are visible when assigneWeights checkbox is clicked?"); feedbackEditPage.clickAddQuestionButton(); feedbackEditPage.selectNewQuestionTypeAndWaitForNewQuestionPanelReady("MCQ"); feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); assertTrue(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); assertFalse(feedbackEditPage.isMcqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); ______TS("MCQ: Other weight Cell is visible when other option and weights both are enabled"); assertTrue(feedbackEditPage.isMcqHasAssignWeightCheckboxChecked(NEW_QUESTION_INDEX)); assertFalse(feedbackEditPage.isMcqOtherOptionCheckboxChecked(NEW_QUESTION_INDEX)); feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); assertTrue(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); feedbackEditPage.clickAddMcqOtherOptionCheckboxForNewQuestion(); assertFalse(feedbackEditPage.getMcqOtherWeightBox(NEW_QUESTION_INDEX).isDisplayed()); feedbackEditPage.clickMcqAssignWeightCheckboxForNewQuestion(); assertFalse(feedbackEditPage.getMcqWeightsColumn(NEW_QUESTION_INDEX).isDisplayed()); feedbackEditPage.clickDiscardChangesLinkForNewQuestion(); feedbackEditPage.waitForConfirmationModalAndClickOk(); }
Source:
public void noteOpenConnection(ServerStats serverStats) { if (serverStats == null) { return; } try { serverStats.incrementActiveRequestsCount(); } catch (Error ex) { logger.error("Error noting stats for client {}", clientName, ex); } }

Target:
public void noteOpenConnection(ServerStats serverStats) { if (serverStats == null) { return; } try { serverStats.incrementActiveRequestsCount(); } catch (Exception ex) { logger.error("Error noting stats for client {}", clientName, ex); } }
Source:
public GHRef createBranch(String branchName) throws IOException { GHRef defaultBranch = ghRepo.getRef("heads/" + ghRepo.getDefaultBranch()); return ghRepo.createRef("refs/heads/" + branchName, defaultBranch.getObject().getSha()); }

Target:
public GHRef createBranch(String branchName) throws IOException { GHRef defaultBranch = getReferenceToDefaultBranch(); return ghRepo.createRef("refs/heads/" + branchName, defaultBranch.getObject().getSha()); }
Source:
protected Optional<UserImpl> doRemove(String id) { final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user != null) { eventService.publish(new BeforeUserRemovedEvent(user)); manager.remove(user); } return Optional.ofNullable(user); }

Target:
protected Optional<UserImpl> doRemove(String id) throws ServerException { final EntityManager manager = managerProvider.get(); final UserImpl user = manager.find(UserImpl.class, id); if (user == null) { return Optional.empty(); } eventService.publish(new BeforeUserRemovedEvent(user)).propagateException(); manager.remove(user); manager.flush(); return Optional.of(user); }
Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); for (TACmiBindingProvider provider : providers) { int canNode = provider.getCanNode(itemName); String portType = provider.getPortType(itemName); int portNumber = provider.getPortNumber(itemName); logger.debug("Type: {}, portNumber: {}, command: {}", portType, portNumber, command.toString()); if (portType.equals("d") && portNumber == 1 && command instanceof OnOffType) { boolean state = OnOffType.ON.equals(command) ? true : false; try { DigitalMessage message = new DigitalMessage((byte) canNode, state); byte[] messageBytes = message.getRaw(); InetAddress IPAddress = InetAddress .getByName(this.cmiAddress); DatagramPacket packet = new DatagramPacket(messageBytes, messageBytes.length, IPAddress, TACmiBinding.cmiPort); clientSocket.send(packet); } catch (Exception e) { logger.debug("Error sending message: {}, {}", e.getClass() .getName(), e.getMessage()); } } else { logger.debug( "Not sending command: portType: {}, portNumber: {}, command: {}", portType, portNumber, command.toString()); } } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); for (TACmiBindingProvider provider : providers) { int canNode = provider.getCanNode(itemName); String portType = provider.getPortType(itemName); int portNumber = provider.getPortNumber(itemName); logger.trace("Type: {}, portNumber: {}, command: {}", portType, portNumber, command.toString()); byte[] messageBytes; if (portType.equals("d") && portNumber == 1 && command instanceof OnOffType) { boolean state = OnOffType.ON.equals(command) ? true : false; DigitalMessage message = new DigitalMessage((byte) canNode, state); messageBytes = message.getRaw(); } else if (portType.equals("a") && (portNumber-1) % 4 == 0 && command instanceof DecimalType) { TACmiMeasureType measureType = provider.getMeasureType(itemName); AnalogMessage message = new AnalogMessage((byte) canNode, 1, (DecimalType) command, measureType); messageBytes = message.getRaw(); } else { logger.info( "Not sending command: portType: {}, portNumber: {}, command: {}", portType, portNumber, command.toString()); return; } DatagramPacket packet = new DatagramPacket(messageBytes, messageBytes.length, cmiAddress, TACmiBinding.cmiPort); try { clientSocket.send(packet); } catch (IOException e) { logger.warn("Error sending message: {}, {}", e.getClass() .getName(), e.getMessage()); } } }
Source:
public List<ListSelectorItem> getItems(final int uiRowIndex, final int uiColumnIndex) { final List<ListSelectorItem> items = new ArrayList<>(); if (hasExpression.isClearSupported()) { items.add(ListSelectorTextItem.build(translationService.format(DMNEditorConstants.ExpressionEditor_Clear), true, () -> { cellEditorControls.hide(); clearExpressionType(); })); } return items; }

Target:
public List<ListSelectorItem> getItems(final int uiRowIndex, final int uiColumnIndex) { if (hasExpression.isClearSupported()) { return Collections.singletonList(ListSelectorTextItem .build(translationService.format(DMNEditorConstants.ExpressionEditor_Clear), true, () -> { cellEditorControls.hide(); clearExpressionType(); })); } return Collections.emptyList(); }
Source:
public boolean isVmPluggedDiskUsingScsiReservation() { if (getDbFacade().getVmDeviceDao() == null) { return false; } VM vm = vms.iterator().next(); List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { return true; } } return false; }

Target:
public ValidationResult isVmPluggedDiskUsingScsiReservation() { if (getDbFacade().getVmDeviceDao() == null) { return ValidationResult.VALID; } for (VM vm : vms) { List<VmDevice> devices = getDbFacade().getVmDeviceDao().getVmDeviceByVmIdAndType(vm.getId(), VmDeviceGeneralType.DISK); for (VmDevice device : devices) { if (device.getIsPlugged() && device.isUsingScsiReservation()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION); } } } return ValidationResult.VALID; }
Source:
public InputStreamConsumerThread(final InputStream in) { setDaemon(true); this.in = in; this.outStream = null; this.outWriter = null; this.outFile = null; }

Target:
public InputStreamConsumerThread(final InputStream in) { this(in, (Writer) null); }
Source:
public Response submitRefund(@Parameter(hidden = true) @ApiParam(value = "accountId", hidden = true) @Auth Account account, @ApiParam(value = "paymentId", required = true) @PathParam(PATH_PAYMENT_KEY) String paymentId, @Parameter(required = true, description = "requestPayload") @ApiParam(value = "requestPayload", required = true) CreatePaymentRefundRequest requestPayload) { logger.info("Create a refund for payment request - paymentId={}", paymentId); Integer refundAmountAvailable = requestPayload.getRefundAmountAvailable() .orElseGet(() -> { Charge charge = connectorService.getCharge(account, paymentId); return Long.valueOf(charge.getRefundSummary().getAmountAvailable()).intValue(); }); ImmutableMap<String, Object> payloadMap = ImmutableMap.of("amount", requestPayload.getAmount(), "refund_amount_available", refundAmountAvailable); String connectorPayload = new GsonBuilder().create().toJson( payloadMap); Response connectorResponse = client .target(getConnectorUrl(format(CONNECTOR_CHARGE_REFUNDS_RESOURCE, account.getAccountId(), paymentId))) .request() .post(json(connectorPayload)); if (connectorResponse.getStatus() == ACCEPTED.getStatusCode()) { RefundFromConnector refundFromConnector = connectorResponse.readEntity(RefundFromConnector.class); logger.debug("created refund returned - [ ]", refundFromConnector); RefundResponse refundResponse = RefundResponse.valueOf(refundFromConnector, paymentId, baseUrl); return Response.accepted(refundResponse).build(); } throw new CreateRefundException(connectorResponse); }

Target:
public Response submitRefund(@Parameter(hidden = true) @ApiParam(value = "accountId", hidden = true) @Auth Account account, @ApiParam(value = "paymentId", required = true) @PathParam(PATH_PAYMENT_KEY) String paymentId, @Parameter(required = true, description = "requestPayload") @ApiParam(value = "requestPayload", required = true) CreatePaymentRefundRequest requestPayload) { logger.info("Create a refund for payment request - paymentId={}", paymentId); Integer refundAmountAvailable = requestPayload.getRefundAmountAvailable() .orElseGet(() -> Optional.ofNullable(connectorService.getCharge(account, paymentId)) .map(Charge::getRefundSummary) .map(RefundSummary::getAmountAvailable) .map(Long::intValue) .orElse(0)); ImmutableMap<String, Object> payloadMap = ImmutableMap.of("amount", requestPayload.getAmount(), "refund_amount_available", refundAmountAvailable); String connectorPayload = new GsonBuilder().create().toJson( payloadMap); Response connectorResponse = client .target(getConnectorUrl(format(CONNECTOR_CHARGE_REFUNDS_RESOURCE, account.getAccountId(), paymentId))) .request() .post(json(connectorPayload)); if (connectorResponse.getStatus() == ACCEPTED.getStatusCode()) { RefundFromConnector refundFromConnector = connectorResponse.readEntity(RefundFromConnector.class); logger.debug("created refund returned - [ ]", refundFromConnector); RefundResponse refundResponse = RefundResponse.valueOf(refundFromConnector, paymentId, baseUrl); return Response.accepted(refundResponse).build(); } throw new CreateRefundException(connectorResponse); }
Source:
public String getExternalAddress() { if (useContainerAddress) { return externalAddressProperty != null ? externalAddressProperty : !isNullOrEmpty(gatewayAddressContainer) ? gatewayAddressContainer : this.internalHost; } else { return externalAddressProperty != null ? externalAddressProperty : internalAddressProperty != null ? internalAddressProperty : this.internalHost; } }

Target:
public String getExternalAddress() { if (useContainerAddress) { return cheDockerIpExternal != null ? cheDockerIpExternal : !isNullOrEmpty(gatewayAddressContainer) ? gatewayAddressContainer : this.internalHost; } return cheDockerIpExternal != null ? cheDockerIpExternal : cheDockerIp != null ? cheDockerIp : this.internalHost; }
Source:
public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; List<CarMenuItem> actionItems = new ArrayList<>(); mOverflowMenuItems.clear(); mActionViews.forEach(this::removeView); mActionViews.clear(); if (mMenuItems != null) { for (CarMenuItem item : mMenuItems) { if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) { actionItems.add(item); } else { mOverflowMenuItems.add(item); } } } mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE); for (CarMenuItem item : actionItems) { View view = item.isCheckable() ? createCheckableAction(item) : createAction(item); MarginLayoutParams marginLayoutParams = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, mActionButtonHeight); view.setLayoutParams(marginLayoutParams); mActionViews.add(view); addView(view); } requestLayout(); }

Target:
public void setMenuItems(@Nullable List<CarMenuItem> items) { mMenuItems = items; mOverflowMenuItems.clear(); mActionViews.forEach(this::removeView); mActionViews.clear(); List<CarMenuItem> actionItems = new ArrayList<>(); if (mMenuItems != null) { for (CarMenuItem item : mMenuItems) { if (item.getDisplayBehavior() == CarMenuItem.DisplayBehavior.ALWAYS) { actionItems.add(item); } else { mOverflowMenuItems.add(item); } } } mOverflowButtonView.setVisibility(mOverflowMenuItems.isEmpty() ? GONE : VISIBLE); for (CarMenuItem item : actionItems) { View action = item.isCheckable() ? createCheckableAction(item) : createAction(item); MarginLayoutParams marginLayoutParams = new MarginLayoutParams(LayoutParams.WRAP_CONTENT, mActionButtonHeight); action.setLayoutParams(marginLayoutParams); mActionViews.add(action); addView(action); } requestLayout(); }
Source:
private String[] getIndexNames() { List<String> repositoryNames = getRepositoryNames(); String indices[] = new String[this.repositoryNames.size()]; int i = 0; for (String repo : repositoryNames) { indices[i++] = esa.getIndexNameForRepository(repo); } return indices; }

Target:
private String[] getIndexNames() { List<String> repositoryNames = getRepositoryNames(); String indices[] = new String[repositoryNames.size()]; int i = 0; for (String repo : repositoryNames) { indices[i++] = esa.getIndexNameForRepository(repo); } return indices; }
Source:
public static DiffRepository lookup(Class<?> clazz, DiffRepository baseRepository, Filter filter) { final Key key = new Key(clazz, baseRepository, filter); final String overwrite = System.getProperty("overwrite"); if (overwrite != null && overwrite.equalsIgnoreCase("true")) { try { URL refFile = findFile(clazz, ".xml"); final String refFilePath = Sources.of(refFile).file().getAbsolutePath(); final String logFilePath = refFilePath.replace(".xml", "_actual.xml"); final File logFile = new File(logFilePath); FileUtils.copyFile(logFile, new File(refFilePath.replace("out", "src"))); } catch (IOException e) { e.printStackTrace(); } } return REPOSITORY_CACHE.getUnchecked(key); }

Target:
public static DiffRepository lookup(Class<?> clazz, DiffRepository baseRepository, Filter filter) { final Key key = new Key(clazz, baseRepository, filter); if (CalciteSystemProperty.OVERWRITE_XML_TEST.value()) { try { final String logFilePath = key.toRepo().logFile.getAbsolutePath() .replace("build/resources/test", "out/test/resources"); final String refFilePath = logFilePath.replace("out", "src").replace("_actual.xml", ".xml"); final File logFile = new File(logFilePath); Files.copy(logFile, new File(refFilePath)); } catch (IOException e) { throw new RuntimeException(e); } } return REPOSITORY_CACHE.getUnchecked(key); }
Source:
public String selector() { return "ClusterUpgradeInitRequest"; }

Target:
public String selector() { return EventSelectorUtil.selector(ClusterUpgradeInitRequest.class); }
Source:
private Set<Tuple2<? extends Class<?>, ? extends Class<?>>> pairwiseDistinctSetClasses() { return generators.keySet() .flatMap(firstClass -> generators.keySet() .filter(filteredKey -> filteredKey != firstClass) .map(inner -> Tuple.of(firstClass, inner)) .collect(Collectors.toSet())); }

Target:
private java.util.Set<Tuple2<? extends Class<?>, ? extends Class<?>>> pairwiseDistinctSetClasses() { return generators.keySet().toList() .combinations(2) .map(seq -> Tuple.of(seq.get(0), seq.get(1))) .collect(Collectors.toSet()); }