auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String getDescription() { return "Type " + typeName + " in " + inputLibLoc.getDescription(); }

Target:
public String getDescription() { return "type " + typeName + " in " + inputLibLoc.getDescription(); }
Source:
private boolean hasResources(String role, List<Protos.Resource> resourceList, Double cpus, Double mem, Long port) { Double actualCpu = 0.0d, actualMem = 0.0d; List<Long> expectedPorts = new ArrayList<>(); expectedPorts.add(port); List<Long> actualPorts = new ArrayList<>(); for (Protos.Resource resource : resourceList) { if (!resource.getRole().equals(role)) { continue; } ResourceType r = ResourceType.of(resource.getName()); switch (r) { case CPU: actualCpu += resource.getScalar().getValue(); break; case MEM: actualMem += resource.getScalar().getValue(); break; case PORTS: Protos.Value.Ranges ranges = resource.getRanges(); for (Protos.Value.Range range : ranges.getRangeList()) { for (long i = 0; i < (range.getEnd() - range.getBegin() + 1); i++) { actualPorts.add(range.getBegin() + i); } } } } boolean hasPorts = (expectedPorts.size() == actualPorts.size()) && expectedPorts.containsAll(actualPorts); return actualCpu.equals(cpus) && actualMem.equals(mem) && hasPorts; }

Target:
private boolean hasResources(String role, List<Protos.Resource> resourceList, Double cpus, Double mem, Long port) { Double actualCpu = 0.0d, actualMem = 0.0d; List<Long> expectedPorts = new ArrayList<>(); expectedPorts.add(port); List<Long> actualPorts = new ArrayList<>(); for (Protos.Resource resource : resourceList) { if (!resource.getRole().equals(role)) { continue; } ResourceType r = ResourceType.of(resource.getName()); switch (r) { case CPU: actualCpu += resource.getScalar().getValue(); break; case MEM: actualMem += resource.getScalar().getValue(); break; case PORTS: Protos.Value.Ranges ranges = resource.getRanges(); for (Protos.Value.Range range : ranges.getRangeList()) { long endValue = range.getEnd(); long beginValue = range.getBegin(); while (endValue >= beginValue) { actualPorts.add(beginValue); ++beginValue; } } } } boolean hasExpectedPorts = (expectedPorts.size() == actualPorts.size()) && expectedPorts.containsAll(actualPorts); return actualCpu.equals(cpus) && actualMem.equals(mem) && hasExpectedPorts; }
Source:
public void init() { final StatusTransitioner.Transition st = statusTransitioner.init(); if (serviceLocator.getService(CacheManagerProviderService.class) == null) { this.serviceLocator.addService(new DefaultCacheManagerProviderService(this)); } try { for (ServiceCreationConfiguration<? extends Service> serviceConfig : configuration.getServiceCreationConfigurations()) { Service service = serviceLocator.getOrCreateServiceFor(serviceConfig); if (service == null) { throw new IllegalArgumentException("Couldn't resolve Service " + serviceConfig.getServiceType().getName()); } } serviceLocator.loadDependenciesOf(ServiceDeps.class); try { serviceLocator.startAllServices(); } catch (Exception e) { throw st.failed(e); } statisticsManager.root(this); Deque<String> initiatedCaches = new ArrayDeque<String>(); try { for (Entry<String, CacheConfiguration<?, ?>> cacheConfigurationEntry : configuration.getCacheConfigurations() .entrySet()) { final String alias = cacheConfigurationEntry.getKey(); createCache(alias, cacheConfigurationEntry.getValue(), false); initiatedCaches.push(alias); } } catch (RuntimeException e) { while (!initiatedCaches.isEmpty()) { String toBeClosed = initiatedCaches.pop(); try { removeCache(toBeClosed, false); } catch (Exception exceptionClosingCache) { LOGGER.error("Cache '{}' could not be removed due to ", toBeClosed, exceptionClosingCache); } } serviceLocator.stopAllServices(); throw e; } } catch (Exception e) { throw st.failed(e); } st.succeeded(); }

Target:
public void init() { final StatusTransitioner.Transition st = statusTransitioner.init(); if (serviceLocator.getService(CacheManagerProviderService.class) == null) { this.serviceLocator.addService(new DefaultCacheManagerProviderService(this)); } try { for (ServiceCreationConfiguration<? extends Service> serviceConfig : configuration.getServiceCreationConfigurations()) { Service service = serviceLocator.getOrCreateServiceFor(serviceConfig); if (service == null) { throw new IllegalArgumentException("Couldn't resolve Service " + serviceConfig.getServiceType().getName()); } } serviceLocator.loadDependenciesOf(ServiceDeps.class); try { serviceLocator.startAllServices(); } catch (Exception e) { throw st.failed(e); } statisticsManager.root(this); Deque<String> initiatedCaches = new ArrayDeque<String>(); try { for (Entry<String, CacheConfiguration<?, ?>> cacheConfigurationEntry : configuration.getCacheConfigurations() .entrySet()) { final String alias = cacheConfigurationEntry.getKey(); createCache(alias, cacheConfigurationEntry.getValue(), false); initiatedCaches.push(alias); } } catch (RuntimeException e) { while (!initiatedCaches.isEmpty()) { String toBeClosed = initiatedCaches.pop(); try { removeCache(toBeClosed, false); } catch (Exception exceptionClosingCache) { LOGGER.error("Cache '{}' could not be removed due to ", toBeClosed, exceptionClosingCache); } } try { serviceLocator.stopAllServices(); } catch (Exception exceptionStoppingServices) { LOGGER.error("Stopping services failed due to ", exceptionStoppingServices); } throw e; } } catch (Exception e) { throw st.failed(e); } st.succeeded(); }
Source:
void update(long deltaNanos) { if (deltaNanos < 0) { log.warn("Possible kernel bug: system nano time moved backwards"); } else if (deltaNanos > maxSafeVmPauseNanos) { totalPauseNanos.addAndGet(deltaNanos); pauseTime.addNanos(deltaNanos); } else { currentValue.addAndGet(deltaNanos); } }

Target:
void update(long deltaNanos) { if (deltaNanos < 0) { if (badSystemNanoTime.compareAndSet(false, true)) { log.warn("Possible kernel or JVM bug: system nano time moved backwards"); } } else if (deltaNanos > maxSafeVmPauseNanos) { totalPauseNanos.addAndGet(deltaNanos); pauseTime.addNanos(deltaNanos); } else { currentValue.addAndGet(deltaNanos); } }
Source:
public void handle(KeepAlive alive) throws Exception { if (server.getSentKeepAlives().getFirst().getMillis() + bungee.getConfig().getTimeout() < System.currentTimeMillis()) { throw new IllegalStateException("Did not recieve keepalive in time from " + con.getName()); } server.getSentKeepAlives().addLast( new ServerConnection.KeepAliveInfo( alive.getRandomId() ) ); }

Target:
public void handle(KeepAlive alive) throws Exception { server.setSentPingId( alive.getRandomId() ); con.setSentPingTime( System.currentTimeMillis() ); }
Source:
private CacheStoreHolder getHolder(int grpId) { return idxCacheStores.computeIfAbsent((grpId), (key) -> { CacheGroupDescriptor gDesc = cctx.cache().cacheGroupDescriptors().get(grpId); CacheStoreHolder holder0 = null; if (gDesc != null) { Integer cacheId = F.firstValue(gDesc.caches()); if (cacheId != null) { DynamicCacheDescriptor cacheDesc = cctx.cache().cacheDescriptor(cacheId); if (CU.isPersistentCache(cacheDesc.cacheConfiguration(), cctx.gridConfig().getDataStorageConfiguration())) { try { holder0 = initForCache(cacheDesc.groupDescriptor(), cacheDesc.cacheConfiguration()); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } } } return holder0; }); }

Target:
private CacheStoreHolder getHolder(int grpId) throws IgniteCheckedException { try { return idxCacheStores.computeIfAbsent(grpId, (key) -> { CacheGroupDescriptor gDesc = cctx.cache().cacheGroupDescriptors().get(grpId); CacheStoreHolder holder0 = null; if (gDesc != null) { if (CU.isPersistentCache(gDesc.config(), cctx.gridConfig().getDataStorageConfiguration())) { try { holder0 = initForCache(gDesc, gDesc.config()); } catch (IgniteCheckedException e) { throw new IgniteException(e); } } } return holder0; }); } catch (IgniteException ex) { if (X.hasCause(ex, IgniteCheckedException.class)) throw ex.getCause(IgniteCheckedException.class); else throw ex; } }
Source:
private void addSalienceByMetadata() { final int priorityColumnIndex = getResolvedHitMetadataColumnIndex(); if ( priorityColumnIndex >= 0 ) { final RowPriorityResolver rowPriorityResolver = getRowPriorityResolver( priorityColumnIndex ); final int indexOfSalienceColumn = makeSalienceColumn(); final RowPriorities priorities = rowPriorityResolver.getPriorityRelations(); for ( final RowNumber rowNumber : priorities.getRowNumbers() ) { dtable.getData() .get( rowNumber.getRowNumber() - 1 ) .get( indexOfSalienceColumn ) .setNumericValue( priorities.getSalience( rowNumber ) .getSalience() ); } } }

Target:
private void addSalienceByMetadata() { final int priorityColumnIndex = getResolvedHitMetadataColumnIndex(); if ( priorityColumnIndex >= 0 ) { final RowPriorityResolver rowPriorityResolver = getRowPriorityResolver( priorityColumnIndex ); final int indexOfSalienceColumn = makeSalienceColumn(); final RowPriorities priorities = rowPriorityResolver.getPriorityRelations(); for ( final RowNumber rowNumber : priorities.getRowNumbers() ) { dtable.getData() .get( rowNumber.getRowIndex() ) .get( indexOfSalienceColumn ) .setNumericValue( priorities.getSalience( rowNumber ) .getSalience() ); } } }
Source:
protected synchronized ResourceBundle getResourceBundle() { String resourceBase = localization != null ? localization : MetaTypeProviderImpl.getBundleLocalization(bundle); long bundleId = bundle.getBundleId(); String key = (locale != null) ? bundleId + ":" + locale + ":" + resourceBase : bundleId + ":" + resourceBase; resourceBundle = resourceBundleMap.get(key); if (resourceBundle == null) { resourceBundle = getResourceBundle(resourceBase, locale, bundle); if (resourceBundle != null) { resourceBundleMap.put(key, resourceBundle); } } return resourceBundle; }

Target:
protected synchronized ResourceBundle getResourceBundle() { String resourceBase = localization != null ? localization : MetaTypeProviderImpl.getBundleLocalization(bundle); long bundleId = bundle.getBundleId(); String key = (locale != null) ? bundleId + ":" + locale + ":" + resourceBase : bundleId + ":" + resourceBase; ResourceBundle resourceBundle = resourceBundleCache.get(key); if (resourceBundle == null) { resourceBundle = getResourceBundle(resourceBase, locale, bundle); if (resourceBundle != null) { resourceBundleCache.put(key, resourceBundle); } } return resourceBundle; }
Source:
public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats() { prepareForRefreshVmStatsCall(); mockGetVmStatsCommand(false); updater.fetchRunningVms(); List<VM> runningAndUnchanged = updater.checkVmsStatusChanged(); Assert.assertTrue("expecting the VM to be missing from the running VMs map", !updater.getRunningVms().containsKey(VM_1)); Assert.assertFalse(runningAndUnchanged.contains(VM_1)); }

Target:
public void verifyListOfRunningVmsIsSameWithFailureOnGetVmStats() { prepareForRefreshVmStatsCall(); mockGetVmStatsCommand(false); updater.fetchRunningVms(); List<VM> runningAndUnchanged = updater.checkVmsStatusChanged(); Assert.assertFalse(updater.getRunningVms().containsKey(VM_1)); Assert.assertTrue(runningAndUnchanged.contains(vm_1_db)); }
Source:
public ExportAndShareTask(Context context, long trackId) { super(context, trackId); File cacheDir = context.getCacheDir(); trackDir = new File(cacheDir, "trackDirectory"); int i = 0; while (trackDir.exists()) trackDir = new File(cacheDir, "trackDirectory" + i++); if (trackDir.mkdir()) Log.d(TAG, "Temporary file: " + trackDir.getAbsolutePath()); else { Log.e(TAG, "Could not create temporary directory"); throw new IllegalStateException("Could not create temporary directory"); } }

Target:
public ExportAndShareTask(Context context, long trackId) { super(context, trackId); cacheDir = context.getCacheDir(); String cacheSubDirName = "trackDirectory"; trackDir = new File(cacheDir, cacheSubDirName); int i = 0; while (trackDir.exists()) { trackDir = new File(cacheDir, cacheSubDirName + i++); } if (trackDir.mkdir()) { Log.d(TAG, "Temporary directory: " + trackDir.getAbsolutePath()); } else { Log.e(TAG, "Could not create temporary directory"); throw new IllegalStateException("Could not create temporary directory"); } }
Source:
public String getPluginId() { return "org.eclipse.core.tests.resources.saveparticipant3"; }

Target:
public String getPluginId() { return getBundle().getSymbolicName(); }
Source:
public void removeAll(Guid vmId) { List<VmNic> interfaces = getVmNicDao().getAllForVm(vmId); if (interfaces != null) { removeFromExternalNetworks(interfaces); final MacPoolManagerStrategy macPool = getMacPoolManager(vmId); for (VmNic iface : interfaces) { macPool.freeMac(iface.getMacAddress()); getVmNicDao().remove(iface.getId()); getVmNetworkStatisticsDao().remove(iface.getId()); } } }

Target:
public void removeAll(Guid vmId) { List<VmNic> interfaces = getVmNicDao().getAllForVm(vmId); if (interfaces != null) { removeFromExternalNetworks(interfaces); for (VmNic iface : interfaces) { macPool.freeMac(iface.getMacAddress()); getVmNicDao().remove(iface.getId()); getVmNetworkStatisticsDao().remove(iface.getId()); } } }
Source:
public VariantAbstractRPCQuery() { variantType = NameValuePair.TYPE_POST_DATA; }

Target:
public VariantAbstractRPCQuery() { this(NameValuePair.TYPE_POST_DATA); }
Source:
private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException { monitor.beginTask("Creating " + fileName, 2); final File newFile = new File(containerName, fileName); try { String envString = "#!/usr/bin/env stap"; ByteArrayInputStream envOut = new ByteArrayInputStream(envString.getBytes()); FileOutputStream FOS = new FileOutputStream(newFile); int character; if (newFile.exists()) { while((character = envOut.read())!=-1) { char ch = (char)character; FOS.write(ch); } } else { newFile.createNewFile(); while((character = envOut.read())!=-1) { char ch = (char)character; FOS.write(ch); } } FOS.close(); } catch (IOException e) { throwCoreException("Error: " + e); } monitor.worked(1); monitor.setTaskName("Opening file for editing..."); getShell().getDisplay().asyncExec(new Runnable() { public void run() { try { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getWorkbench() .showPerspective("org.eclipse.linuxtools.systemtap.ui.ide.IDEPerspective", PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IDE.openEditorOnFileStore(page, EFS.getLocalFileSystem().fromLocalFile(newFile)); } catch (WorkbenchException e1) { e1.printStackTrace(); } } }); monitor.worked(1); }

Target:
private void doFinish(String containerName, String fileName, IProgressMonitor monitor) throws CoreException { monitor.beginTask(Messages.getString("StapNewWizard.BeginTask") + fileName, 2); final File newFile = new File(containerName, fileName); try { String envString = "#!/usr/bin/env stap"; FileOutputStream FOS = new FileOutputStream(newFile); newFile.createNewFile(); FOS.write(envString.getBytes()); FOS.close(); } catch (IOException e) { throwCoreException("Error: " + e); } monitor.worked(1); monitor.setTaskName(Messages.getString("StapNewWizard.SetTask")); getShell().getDisplay().asyncExec(new Runnable() { public void run() { try { IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getWorkbench() .showPerspective(IDEPerspective.ID, PlatformUI.getWorkbench().getActiveWorkbenchWindow()); IDE.openEditorOnFileStore(page, EFS.getLocalFileSystem().fromLocalFile(newFile)); } catch (WorkbenchException e1) { e1.printStackTrace(); } } }); monitor.worked(1); }
Source:
public void start() { cacheName = ByteString.fromString(cache.getName()); this.transactional = configuration.transaction().transactionMode().isTransactional(); this.totalOrderProtocol = configuration.transaction().transactionProtocol().isTotalOrder(); this.distributedOrReplicated = configuration.clustering().cacheMode().isDistributed() || configuration.clustering().cacheMode().isReplicated(); }

Target:
public void start() { cacheName = ByteString.fromString(cache.getName()); this.transactional = configuration.transaction().transactionMode().isTransactional(); this.totalOrderProtocol = configuration.transaction().transactionProtocol().isTotalOrder(); }
Source:
@Override public void perform() { RelOptCost upperBound = group.upperBound; RelOptCost upperForInput = planner.upperBoundForInputs(mExpr, upperBound); if (upperForInput.isLe(planner.zeroCost)) { if (LOGGER.isDebugEnabled()) { LOGGER.debug( "Skip O_INPUT because of lower bound. UB4Inputs = {}, UB = {}", upperForInput, upperBound); } return; } RelSubset input = (RelSubset) mExpr.getInput(0); tasks.push(new DeriveTrait(mExpr, group)); tasks.push(new CheckInput(null, mExpr, input, 0, upperForInput)); tasks.push(new OptimizeGroup(input, upperForInput)); }

Target:
@Override public void perform() { RelOptCost upperBound = group.upperBound; RelOptCost upperForInput = planner.upperBoundForInputs(mExpr, upperBound); if (upperForInput.isLe(planner.zeroCost)) { LOGGER.debug( "Skip O_INPUT because of lower bound. UB4Inputs = {}, UB = {}", upperForInput, upperBound); return; } RelSubset input = (RelSubset) mExpr.getInput(0); tasks.push(new DeriveTrait(mExpr, group)); tasks.push(new CheckInput(null, mExpr, input, 0, upperForInput)); tasks.push(new OptimizeGroup(input, upperForInput)); }
Source:
public void testDeclarationSyntax() throws Exception { List<File> inputs = DeclarationGeneratorFileBasedTests.getTestInputFiles(); List<String> goldenFilePaths = new ArrayList<>(); for (File input : inputs) { goldenFilePaths.add(DeclarationGeneratorFileBasedTests.getGoldenFile(input).getPath()); } final List<String> tscCommand = Lists.newArrayList("/Users/martinprobst/.nvm/versions/node/v0.12.4/bin/node", "/Users/martinprobst/.homebrew/bin/tsc", "--noEmit"); tscCommand.addAll(goldenFilePaths); Process tsc = new ProcessBuilder().command(tscCommand).redirectErrorStream(true).start(); if (!tsc.waitFor(5, TimeUnit.SECONDS)) { tsc.destroyForcibly(); fail("tsc process timed out"); } else if (tsc.exitValue() != 0) { InputStreamReader isr = new InputStreamReader(tsc.getInputStream(), Charsets.UTF_8); String consoleOut = CharStreams.toString(isr); fail("tsc exited abnormally: " + tsc.exitValue() + " - " + consoleOut); } }

Target:
public void testDeclarationSyntax() throws Exception { List<File> inputs = DeclarationGeneratorTests.getTestInputFiles(); List<String> goldenFilePaths = new ArrayList<>(); for (File input : inputs) { goldenFilePaths.add(DeclarationGeneratorTests.getGoldenFile(input).getPath()); } final List<String> tscCommand = Lists.newArrayList(TSC.toString(), "--noEmit"); tscCommand.addAll(goldenFilePaths); runChecked(tscCommand); }
Source:
private void registerMetrics(Map<String, Metric> metrics) { Optional.of(metrics).ifPresent(m -> m.forEach((key, value) -> { try { _metricRegistry.register(key, value); } catch (IllegalArgumentException e) { LOG.info("Metric " + key + " has already been registered.", e); } })); }

Target:
private void registerMetrics(Map<String, Metric> metrics) { Optional.of(metrics).ifPresent(m -> m.forEach((key, value) -> { try { _metricRegistry.register(key, value); } catch (IllegalArgumentException e) { LOG.error("Metric " + key + " has already been registered.", e); } })); }
Source:
private static void performWarmup() { ExecutorService connectionStartupExecutor = Executors .newCachedThreadPool(GrpcUtil.getThreadFactory("BigtableSession-startup-%d", true)); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { enableTracing(null); } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { BigtableSessionSharedThreadPools.getInstance(); } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { createSslContext(); } catch (SSLException e) { } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_TABLE_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { } } }); } connectionStartupExecutor.shutdown(); }

Target:
private static void performWarmup() { ExecutorService connectionStartupExecutor = Executors .newCachedThreadPool(GrpcUtil.getThreadFactory("BigtableSession-startup-%d", true)); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { BigtableSessionSharedThreadPools.getInstance(); } }); connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { createSslContext(); } catch (SSLException e) { } } }); for (final String host : Arrays.asList(BigtableOptions.BIGTABLE_DATA_HOST_DEFAULT, BigtableOptions.BIGTABLE_TABLE_ADMIN_HOST_DEFAULT)) { connectionStartupExecutor.execute(new Runnable() { @Override public void run() { try { InetAddress.getByName(host); } catch (UnknownHostException e) { } } }); } connectionStartupExecutor.shutdown(); }
Source:
public String showParameters(Request req, Response res) throws IOException { PipelineTemplateConfig templateConfig = fetchEntityFromConfig(req.params("template_name")); if (isGetOrHeadRequestFresh(req, templateConfig)) { return notModified(res); } else { setEtagHeader(templateConfig, res); return writerForTopLevelObject(req, res, writer -> ParametersRepresenter.toJSON(writer, templateConfig.name().toString(), templateConfig.referredParams())); } }

Target:
public String showParameters(Request req, Response res) throws IOException { PipelineTemplateConfig templateConfig = fetchEntityFromConfig(req.params("template_name")); ParamsConfig paramConfigs = templateConfig.referredParams(); String etagFromServer = entityHashingService.md5ForEntity(paramConfigs); if (fresh(req, etagFromServer)) { return notModified(res); } else { setEtagHeader(templateConfig, res); return writerForTopLevelObject(req, res, writer -> { ParametersRepresenter.toJSON(writer, templateConfig.name().toString(), paramConfigs); }); } }
Source:
private boolean requestDetailFileLineIsCashAdvance(ConcurRequestExtractRequestDetailFileLine detailFileLine) { if (StringUtils.isNotEmpty(detailFileLine.getRequestEntryExpenseType()) && detailFileLine.getRequestEntryExpenseType().equalsIgnoreCase(ConcurConstants.CASH_ADVANCE_INDICATOR)) { detailFileLine.getValidationResult().setCashAdvanceLine(true); } else { detailFileLine.getValidationResult().setCashAdvanceLine(false); detailFileLine.getValidationResult().addMessage(new String(getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.CONCUR_REQUEST_EXTRACT_NOT_CASH_ADVANCE_DATA_LINE))); } return detailFileLine.getValidationResult().isCashAdvanceLine(); }

Target:
private boolean requestDetailFileLineIsCashAdvance(ConcurRequestExtractRequestDetailFileLine detailFileLine) { if (StringUtils.isNotEmpty(detailFileLine.getRequestEntryExpenseType()) && StringUtils.equalsIgnoreCase(detailFileLine.getRequestEntryExpenseType(), ConcurConstants.REQUEST_EXTRACT_CASH_ADVANCE_INDICATOR)) { detailFileLine.getValidationResult().setCashAdvanceLine(true); } else { detailFileLine.getValidationResult().setCashAdvanceLine(false); detailFileLine.getValidationResult().addMessage(getConfigurationService().getPropertyValueAsString(ConcurKeyConstants.CONCUR_REQUEST_EXTRACT_NOT_CASH_ADVANCE_DATA_LINE)); } return detailFileLine.getValidationResult().isCashAdvanceLine(); }
Source:
public ValidationResult validate(EnvironmentDto environmentDto, ParametersDto parametersDto, ValidationResultBuilder validationResultBuilder) { AwsParametersDto awsParametersDto = parametersDto.getAwsParametersDto(); if (Objects.isNull(awsParametersDto)) { return validationResultBuilder.build(); } if (StringUtils.isNotBlank(awsParametersDto.getS3GuardTableName())) { boolean tableAlreadyAttached = isTableAlreadyAttached(environmentDto, awsParametersDto); if (tableAlreadyAttached) { validationResultBuilder.error(String.format("S3Guard table '%s' is already attached to another active environment. " + "Please select another unattached table or specify a non-existing name to create it.", awsParametersDto.getS3GuardTableName())); } else { determineAwsParameters(environmentDto, parametersDto); } } if (awsParametersDto.getFreeIpaSpotPercentage() < PERCENTAGE_MIN || awsParametersDto.getFreeIpaSpotPercentage() > PERCENTAGE_MAX) { validationResultBuilder.error(String.format("FreeIpa spot percentage must be between %d and %d.", PERCENTAGE_MIN, PERCENTAGE_MAX)); } return validationResultBuilder.build(); }

Target:
public ValidationResult validate(EnvironmentDto environmentDto, ParametersDto parametersDto, ValidationResultBuilder validationResultBuilder) { LOGGER.debug("ParametersDto: {}", parametersDto); AwsParametersDto awsParametersDto = parametersDto.getAwsParametersDto(); if (Objects.isNull(awsParametersDto)) { LOGGER.debug("No aws parameters defined."); return validationResultBuilder.build(); } if (StringUtils.isNotBlank(awsParametersDto.getS3GuardTableName())) { LOGGER.debug("S3Guard table name defined: {}", awsParametersDto.getS3GuardTableName()); boolean tableAlreadyAttached = isTableAlreadyAttached(environmentDto, awsParametersDto); if (tableAlreadyAttached) { validationResultBuilder.error(String.format("S3Guard table '%s' is already attached to another active environment. " + "Please select another unattached table or specify a non-existing name to create it.", awsParametersDto.getS3GuardTableName())); } else { determineAwsParameters(environmentDto, parametersDto); } } if (awsParametersDto.getFreeIpaSpotPercentage() < PERCENTAGE_MIN || awsParametersDto.getFreeIpaSpotPercentage() > PERCENTAGE_MAX) { validationResultBuilder.error(String.format("FreeIpa spot percentage must be between %d and %d.", PERCENTAGE_MIN, PERCENTAGE_MAX)); } return validationResultBuilder.build(); }
Source:
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RowType.PROGRESS) { return new RecyclerView.ViewHolder(LayoutInflater. from(parent.getContext()). inflate(R.layout.list_view_footer_progress, parent, false)) { }; } @LayoutRes int layout = R.layout.row_discussion_comments_comment; if (viewType == RowType.RESPONSE) { layout = R.layout.row_discussion_comments_response; } return new ResponseAndCommentViewHolder(LayoutInflater. from(parent.getContext()). inflate(layout, parent, false)); }

Target:
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { if (viewType == RowType.PROGRESS) { return new RecyclerView.ViewHolder(LayoutInflater. from(parent.getContext()). inflate(R.layout.list_view_footer_progress, parent, false)) { }; } @LayoutRes final int layout; if (viewType == RowType.RESPONSE) { layout = R.layout.row_discussion_comments_response; } else { layout = R.layout.row_discussion_comments_comment; } return new ResponseOrCommentViewHolder(LayoutInflater. from(parent.getContext()). inflate(layout, parent, false)); }
Source:
public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(EVENT_PROCESSOR_METRICS_NAME, message -> Tags.of(TagsUtil.PAYLOAD_TYPE_TAG, message.getPayloadType().getSimpleName(), TagsUtil.PROCESSOR_NAME_TAG, componentName)); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } logger.warn("Cannot provide MessageMonitor for component of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); }

Target:
public MessageMonitor<? extends Message<?>> registerComponent(Class<?> componentType, String componentName) { if (EventProcessor.class.isAssignableFrom(componentType)) { return registerEventProcessor(componentName); } if (CommandBus.class.isAssignableFrom(componentType)) { return registerCommandBus(componentName); } if (EventBus.class.isAssignableFrom(componentType)) { return registerEventBus(componentName); } if (QueryBus.class.isAssignableFrom(componentType)) { return registerQueryBus(componentName); } logger.warn("Cannot provide MessageMonitor for component of type [{}]. Returning No-Op instance.", componentName, componentType.getSimpleName()); return NoOpMessageMonitor.instance(); }
Source:
public void testWatcherDisconnectOnClose() throws Exception { ZooKeeper zk = null; try { final BlockingQueue<WatchedEvent> queue = new LinkedBlockingQueue<>(); MyWatcher connWatcher = new MyWatcher(); Watcher watcher = new Watcher() { @Override public void process(WatchedEvent event) { try { queue.put(event); } catch (InterruptedException e) { } } }; zk = createClient(connWatcher, hostPort); StatCallback scb = new StatCallback() { public void processResult(int rc, String path, Object ctx, Stat stat) { } }; zk.exists("/missing", watcher, scb, null); zk.close(); WatchedEvent event = queue.poll(10, TimeUnit.SECONDS); Assert.assertNotNull( "No watch event was received after closing the Zookeeper client. " + "A 'Closed' event should have occurred", event); Assert.assertEquals( "Closed events are not generated by the server, " + "and so should have a type of 'None'", Event.EventType.None, event.getType()); Assert.assertEquals( "A 'Closed' event was expected as the Zookeeper client was closed " + "without altering the node it was watching", Event.KeeperState.Closed, event.getState()); } finally { if (zk != null) { zk.close(); } } }

Target:
public void testWatcherDisconnectOnClose() throws IOException, InterruptedException, KeeperException { ZooKeeper zk = null; try { final BlockingQueue<WatchedEvent> queue = new LinkedBlockingQueue<>(); MyWatcher connWatcher = new MyWatcher(); Watcher watcher = new Watcher() { @Override public void process(WatchedEvent event) { try { queue.put(event); } catch (InterruptedException e) { } } }; zk = createClient(connWatcher, hostPort); StatCallback scb = new StatCallback() { public void processResult(int rc, String path, Object ctx, Stat stat) { } }; zk.exists("/missing", watcher, scb, null); zk.close(); WatchedEvent event = queue.poll(10, TimeUnit.SECONDS); assertNotNull("No watch event was received after closing the Zookeeper client. A 'Closed' event should have occurred", event); assertEquals("Closed events are not generated by the server, and so should have a type of 'None'", Event.EventType.None, event.getType()); assertEquals("A 'Closed' event was expected as the Zookeeper client was closed without altering the node it was watching", Event.KeeperState.Closed, event.getState()); } finally { if (zk != null) { zk.close(); } } }
Source:
public static boolean checkVlanUriOverlap(final String vlanRange1, final String vlanRange2) { final List<Integer> vlans1 = expandVlanUri(vlanRange1); final List<Integer> vlans2 = expandVlanUri(vlanRange2); if (vlans1 == null || vlans2 == null) { return true; } for (final Integer vlan1: vlans1) { if (vlans2.contains(vlan1)) { return true; } } return false; }

Target:
public static boolean checkVlanUriOverlap(final String vlanRange1, final String vlanRange2) { final List<Integer> vlans1 = expandVlanUri(vlanRange1); final List<Integer> vlans2 = expandVlanUri(vlanRange2); if (vlans1 == null || vlans2 == null) { return true; } return !Collections.disjoint(vlans1, vlans2); }
Source:
protected void onCreate(Bundle savedInstanceState) { Utilities.setActivityTheme(this, getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_entry); mAmountView = (EditText) findViewById(R.id.entry_amount); mBudgetView = (Spinner) findViewById(R.id.spinner_budget); mDateView = (DatePicker) findViewById(R.id.entry_date_picker); mNotesView = (EditText) findViewById(R.id.entry_notes); mAddButtonView = (Button) findViewById(R.id.add_entry_button); addItemsToBudgetSpinner(); getIntent().setAction("Already created"); Bundle bundle = getIntent().getExtras(); if (bundle.getBoolean("Add")) { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_add))); mAddButtonView.setText(getString(R.string.entry_activity_button_add)); } else { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_edit))); mAddButtonView.setText(getString(R.string.entry_activity_button_edit)); Budget b = Budget.getBudgetById(bundle.getLong("BudgetId")); Entry e = b.getEntryById(bundle.getLong("EntryId")); mAmountView.setText(e.getAmount()); LocalDate date = e.getDate(); mDateView.updateDate(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth()); mNotesView.setText(e.getNotes()); ArrayAdapter<String> editAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, new String[]{b.getName()}); mBudgetView.setAdapter(editAdapter); mBudgetView.setEnabled(false); } }

Target:
protected void onCreate(Bundle savedInstanceState) { Utilities.setActivityTheme(this, getApplicationContext()); super.onCreate(savedInstanceState); setContentView(R.layout.activity_add_entry); mAmountView = (EditText) findViewById(R.id.entry_amount); mBudgetView = (Spinner) findViewById(R.id.spinner_budget); mDateView = (DatePicker) findViewById(R.id.entry_date_picker); mNotesView = (EditText) findViewById(R.id.entry_notes); mAddButtonView = (Button) findViewById(R.id.add_entry_button); addItemsToBudgetSpinner(); Bundle bundle = getIntent().getExtras(); addMode = bundle.getBoolean("Add", true); if (addMode) { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_add))); mAddButtonView.setText(getString(R.string.entry_activity_button_add)); } else { setTitle(MessageFormat.format(getTitle().toString(), getString(R.string.title_entry_edit))); mAddButtonView.setText(getString(R.string.entry_activity_button_edit)); Budget b = Budget.getBudgetById(bundle.getLong("BudgetId")); Entry e = b.getEntryById(bundle.getLong("EntryId")); mAmountView.setText(e.getAmount()); LocalDate date = e.getDate(); mDateView.updateDate(date.getYear(), date.getMonthOfYear(), date.getDayOfMonth()); mNotesView.setText(e.getNotes()); ArrayAdapter<String> editAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, new String[]{b.getName()}); mBudgetView.setAdapter(editAdapter); mBudgetView.setEnabled(false); } getIntent().setAction("Already created"); }
Source:
public void init() { MockitoAnnotations.initMocks(this); tasksSyncJob = Mockito.spy(GlusterTasksSyncJob.getInstance()); logUtil = Mockito.spy(GlusterAuditLogUtil.getInstance()); tasksSyncJob.setLogUtil(logUtil); doReturn(clusterDao).when(tasksSyncJob).getClusterDao(); doReturn(getClusters()).when(clusterDao).getAll(); doReturn(provider).when(tasksSyncJob).getProvider(); doReturn(stepDao).when(tasksSyncJob).getStepDao(); doReturn(volumeDao).when(tasksSyncJob).getVolumeDao(); doReturn(jobRepository).when(tasksSyncJob).getJobRepository(); doReturn(backend).when(tasksSyncJob).getBackend(); doNothing().when(tasksSyncJob).releaseLock(any(Guid.class)); doNothing().when(tasksSyncJob).endStepJob(any(Step.class)); doNothing().when(tasksSyncJob).logMessage(any(Guid.class), any(GlusterVolumeEntity.class), any(String.class), any(String.class), any(AuditLogType.class)); doNothing().when(logUtil).logAuditMessage(any(Guid.class), any(GlusterVolumeEntity.class), any(VDS.class), any(AuditLogType.class), any(Map.class)); }

Target:
public void init() { MockitoAnnotations.initMocks(this); tasksSyncJob = Mockito.spy(GlusterTasksSyncJob.getInstance()); logUtil = Mockito.spy(GlusterAuditLogUtil.getInstance()); doNothing().when(logUtil).logClusterMessage(any(Guid.class), any(AuditLogType.class)); doReturn(clusterDao).when(tasksSyncJob).getClusterDao(); doReturn(getClusters()).when(clusterDao).getAll(); doReturn(provider).when(tasksSyncJob).getProvider(); doReturn(stepDao).when(tasksSyncJob).getStepDao(); doReturn(volumeDao).when(tasksSyncJob).getVolumeDao(); doReturn(jobRepository).when(tasksSyncJob).getJobRepository(); doReturn(backend).when(tasksSyncJob).getBackend(); doNothing().when(tasksSyncJob).releaseLock(any(Guid.class)); doNothing().when(tasksSyncJob).endStepJob(any(Step.class)); doNothing().when(tasksSyncJob).eventMessageLogger(any(GlusterAsyncTask.class), any(JobExecutionStatus.class), any(VDSGroup.class)); }
Source:
public void end() { if (mStarted) { if (mOutcome == null) { mOutcome = Outcome.CANCEL; } Map<String, Object> properties = getCommonProperties(); properties.put(KEY_OUTCOME, mOutcome.toString().toLowerCase(Locale.ROOT)); AnalyticsTracker.track(Stat.EDITOR_SESSION_END, properties); } }

Target:
public void end() { if (mStarted) { if (mOutcome == null) { mOutcome = Outcome.CANCEL; } Map<String, Object> properties = getCommonProperties(); properties.put(KEY_OUTCOME, mOutcome.toString().toLowerCase(Locale.ROOT)); AnalyticsTracker.track(Stat.EDITOR_SESSION_END, properties); } else { AppLog.e(T.EDITOR, "A non-started editor session cannot be attempted to be ended"); } }
Source:
private GestureDetector.SimpleOnGestureListener createTapListener(final int position) { return new GestureDetector.SimpleOnGestureListener() { @Override public void onLongPress(MotionEvent e) { Log.d("plamenko", "onLongPress: " + position); } }; }

Target:
private GestureDetector.SimpleOnGestureListener createTapListener(final int position) { return new GestureDetector.SimpleOnGestureListener() { @Override public void onLongPress(MotionEvent e) { Log.d("MyPagerAdapter", "onLongPress: " + position); } }; }
Source:
public static <Arg1, Arg2 extends Arg1> boolean nullSafeEquals(Arg1 d1, Arg2 d2) { if (d1 == null) { return d2 == null; } else if (d2 == null) { return false; } return (d1 instanceof Timestamp || d2 instanceof Timestamp) ? compare((Date) d1, (Date) d2) == 0 : d1.equals(d2); }

Target:
public static <Arg1, Arg2 extends Arg1> boolean nullSafeEquals(Arg1 d1, Arg2 d2) { if (d1 == null) { return d2 == null; } else if (d2 == null) { return false; } return (d1 instanceof Date && d2 instanceof Date) ? compare((Date) d1, (Date) d2) == 0 : d1.equals(d2); }
Source:
public static <T, F> void setPrivateField( T obj, Class<T> objClass, Class<F> fieldClass, F fieldValue) { Field targetField = null; Field[] classFields = objClass.getDeclaredFields(); for (Field f : classFields) { if (f.getType().equals(fieldClass)) { if (targetField != null) { throw new IllegalStateException("Class " + objClass + " has multiple fields of type " + fieldClass); } targetField = f; } } if (targetField == null) { throw new IllegalStateException("Class " + objClass + " has no fields of type " + fieldClass); } targetField.setAccessible(true); try { targetField.set(obj, fieldValue); } catch (IllegalAccessException e) { Log.w(TAG, "Error setting field", e); } }

Target:
public static <T, F> void setPrivateField( T obj, Class<T> objClass, Class<F> fieldClass, F fieldValue) { Field targetField = null; Field[] classFields = objClass.getDeclaredFields(); for (Field field : classFields) { if (field.getType().equals(fieldClass)) { if (targetField != null) { throw new IllegalStateException("Class " + objClass + " has multiple fields of type " + fieldClass); } targetField = field; } } if (targetField == null) { throw new IllegalStateException("Class " + objClass + " has no fields of type " + fieldClass); } targetField.setAccessible(true); try { targetField.set(obj, fieldValue); } catch (IllegalAccessException e) { Log.w(TAG, "Error setting field", e); } }
Source:
private static void serializeMap(JsonObject root, String key, Map<String, ?> map) { final JsonObject jsonObject = new JsonObject(); for (Entry<String, ?> e : map.entrySet()) { jsonObject.add(e.getKey(), ((JsonSerializable) e.getValue()).toJson()); } root.add(key, jsonObject); }

Target:
private static void serializeMap(JsonObject root, String key, Map<String, ?> map) { final JsonObject jsonObject = new JsonObject(); for (Entry<String, ?> e : map.entrySet()) { addJsonIfSerializable(jsonObject, e.getKey(), e.getValue()); } root.add(key, jsonObject); }
Source:
public RepositoryFileAclDto getMetadataAcl( String domainId ) throws PentahoAccessControlException, FileNotFoundException { checkMetadataExists( domainId ); if ( aclMetadataHelper != null ) { final RepositoryFile domainRepositoryFile = aclMetadataHelper.getDomainRepositoryFile( domainId ); final RepositoryFileAcl acl = aclMetadataHelper.getAclHelper().getAclFor( domainRepositoryFile ); return acl == null ? null : repositoryFileAclAdapter.marshal( acl ); } return null; }

Target:
public RepositoryFileAclDto getMetadataAcl( String domainId ) throws PentahoAccessControlException, FileNotFoundException { checkMetadataExists( domainId ); if ( aclAwarePentahoMetadataDomainRepositoryImporter != null ) { final RepositoryFileAcl acl = aclAwarePentahoMetadataDomainRepositoryImporter.getAclFor( domainId ); return acl == null ? null : repositoryFileAclAdapter.marshal( acl ); } return null; }
Source:
public Optional<DMNIncludeModel> create(final Path path) { try { final String fileName = path.getFileName(); final String modelPackage = getPackage(path); final String pathURI = path.toURI(); final String namespace = getNamespace(path); return Optional.of(new DMNIncludeModel(fileName, modelPackage, pathURI, namespace)); } catch (final Exception e) { return Optional.empty(); } }

Target:
public DMNIncludeModel create(final Path path) throws DMNIncludeModelCouldNotBeCreatedException { try { final String fileName = path.getFileName(); final String modelPackage = getPackage(path); final String pathURI = path.toURI(); final String namespace = getNamespace(path); return new DMNIncludeModel(fileName, modelPackage, pathURI, namespace); } catch (final Exception e) { throw new DMNIncludeModelCouldNotBeCreatedException(); } }
Source:
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); RandomTeleport randomTeleport = ess.getRandomTeleport(); UserRandomTeleportEvent event = new UserRandomTeleportEvent(user, randomTeleport.getCenter(), randomTeleport.getMinRange(), randomTeleport.getMaxRange()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { return; } Location center = event.getCenter(); double minRange = event.getMinRange(); double maxRange = event.getMaxRange(); getRandomLocation(randomTeleport, center, minRange, maxRange).thenAccept(location -> { CompletableFuture<Boolean> future = getNewExceptionFuture(user.getSource(), commandLabel); user.getAsyncTeleport().teleport(location, charge, PlayerTeleportEvent.TeleportCause.COMMAND, future); future.thenAccept(success -> { if (success) { user.sendMessage(tl("tprSuccess")); } }); }); }

Target:
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception { final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); RandomTeleport randomTeleport = ess.getRandomTeleport(); UserRandomTeleportEvent event = new UserRandomTeleportEvent(user, randomTeleport.getCenter(), randomTeleport.getMinRange(), randomTeleport.getMaxRange()); server.getPluginManager().callEvent(event); if (event.isCancelled()) { return; } randomTeleport.getRandomLocation(event.getCenter(), event.getMinRange(), event.getMaxRange()).thenAccept(location -> { CompletableFuture<Boolean> future = getNewExceptionFuture(user.getSource(), commandLabel); user.getAsyncTeleport().teleport(location, charge, PlayerTeleportEvent.TeleportCause.COMMAND, future); future.thenAccept(success -> { if (success) { user.sendMessage(tl("tprSuccess")); } }); }); }
Source:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Long processCpuTime = callLongGetter("getProcessCpuTime", osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", processCpuTime / NANOSECONDS_PER_SECOND)); } catch (Exception e) { LOGGER.log(Level.FINE,"Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds", "Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); try { Long openFdCount = callLongGetter("getOpenFileDescriptorCount", osBean); mfs.add(new GaugeMetricFamily( "process_open_fds", "Number of open file descriptors.", openFdCount)); Long maxFdCount = callLongGetter("getMaxFileDescriptorCount", osBean); mfs.add(new GaugeMetricFamily( "process_max_fds", "Maximum number of open file descriptors.", maxFdCount)); } catch (Exception e) { LOGGER.log(Level.FINE, "Could not access file descriptor metrics", e); } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }

Target:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Long processCpuTime = callLongGetter("getProcessCpuTime", osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", processCpuTime / NANOSECONDS_PER_SECOND)); } catch (Exception e) { LOGGER.log(Level.FINE,"Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds", "Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); try { Long openFdCount = callLongGetter("getOpenFileDescriptorCount", osBean); mfs.add(new GaugeMetricFamily( "process_open_fds", "Number of open file descriptors.", openFdCount)); Long maxFdCount = callLongGetter("getMaxFileDescriptorCount", osBean); mfs.add(new GaugeMetricFamily( "process_max_fds", "Maximum number of open file descriptors.", maxFdCount)); } catch (Exception e) { } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }
Source:
public TemplateStore getCodeTemplateStore() { if (fCodeTemplateStore == null) { Promise<TemplateStore> p = getTemplateStoreInitializer().getTemplateStore(); try { fCodeTemplateStore = p.getValue(); } catch (InvocationTargetException e) { log(e); } catch (InterruptedException e) { log(e); } } return fCodeTemplateStore; }

Target:
public TemplateStore getCodeTemplateStore() { if (fCodeTemplateStore == null) { Promise<TemplateStore> p= getTemplateStoreInitializer().getTemplateStore(); try { fCodeTemplateStore= p.getValue(); } catch (InvocationTargetException | InterruptedException e) { fCodeTemplateStore= getTemplateStoreInitializer().loadTemplateStore(); log(e); } } return fCodeTemplateStore; }
Source:
public FileHeader createFileHeader(DiffEntry ent) throws IOException, CorruptObjectException, MissingObjectException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); final EditList editList; writeDiffHeader(buf, ent); if (ent.getOldMode() == GITLINK || ent.getNewMode() == GITLINK) { writeGitLinkDiffText(buf, ent); editList = new EditList(); } else { byte[] aRaw = open(ent.getOldMode(), ent.getOldId()); byte[] bRaw = open(ent.getNewMode(), ent.getNewId()); if (RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) { buf.write(encodeASCII("Binary files differ\n")); editList = new EditList(); } else { RawText a = rawTextFactory.create(aRaw); RawText b = rawTextFactory.create(bRaw); editList = new MyersDiff(a, b).getEdits(); } } buf.flush(); return new FileHeader(buf.toByteArray(), editList); }

Target:
public FileHeader createFileHeader(DiffEntry ent) throws IOException, CorruptObjectException, MissingObjectException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); final EditList editList; final FileHeader.PatchType type; writeDiffHeader(buf, ent); if (ent.getOldMode() == GITLINK || ent.getNewMode() == GITLINK) { writeGitLinkDiffText(buf, ent); editList = new EditList(); type = PatchType.UNIFIED; } else { byte[] aRaw = open(ent.getOldMode(), ent.getOldId()); byte[] bRaw = open(ent.getNewMode(), ent.getNewId()); if (RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) { buf.write(encodeASCII("Binary files differ\n")); editList = new EditList(); type = PatchType.BINARY; } else { RawText a = rawTextFactory.create(aRaw); RawText b = rawTextFactory.create(bRaw); editList = new MyersDiff(a, b).getEdits(); type = PatchType.UNIFIED; } } return new FileHeader(buf.toByteArray(), editList, type); }
Source:
public String getRyukImage() { return (String) properties.getOrDefault("ryuk.container.image", "testcontainersofficial/ryuk:latest"); }

Target:
public String getRyukImage() { return (String) properties.getOrDefault("ryuk.container.image", "testcontainersofficial/ryuk:0.3.0"); }