auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override protected <T> T parse(HttpEntity entity, Type type) throws ConversionException { try { InputStream in = entity.getContent(); try { ByteSink out = destination.newSink(); final int total = (int) entity.getContentLength(); int totalRead = 0; try { byte[] buffer = new byte[4096]; int read; while ((read = in.read(buffer)) > -1) { out.write(buffer, read); if (progressListener != null) { totalRead += read; int percent = totalRead * 100 / total; if (percent - progressUpdate.percent > PROGRESS_GRANULARITY) { progressUpdate.percent = percent; mainThread.execute(progressUpdate); } } } } finally { out.close(); } } finally { in.close(); } } catch (IOException e) { throw new ConversionException(e); } return null; }

Target:
@Override protected Object parse(HttpEntity entity, Type type) throws ConversionException { try { InputStream in = entity.getContent(); try { ByteSink out = destination.newSink(); final int total = (int) entity.getContentLength(); int totalRead = 0; try { byte[] buffer = new byte[4096]; int read; while ((read = in.read(buffer)) > -1) { out.write(buffer, read); if (progressListener != null) { totalRead += read; int percent = totalRead * 100 / total; if (percent - progressUpdate.percent > PROGRESS_GRANULARITY) { progressUpdate.percent = percent; mainThread.execute(progressUpdate); } } } } finally { out.close(); } } finally { in.close(); } } catch (IOException e) { throw new ConversionException(e); } return null; }
Source:
public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(POST).path("/v2/counters/{counterName}").handleWith(this::createCounter) .invocation().methods(DELETE).path("/v2/counters/{counterName}").handleWith(this::deleteCounter) .invocation().methods(GET).path("/v2/counters/{counterName}/config").handleWith(this::getConfig) .invocation().methods(GET).path("/v2/counters/{counterName}").handleWith(this::getCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("reset").handleWith(this::resetCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("increment").handleWith(this::incrementWeak) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrement").handleWith(this::decrementWeak) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("add").handleWith(this::addValueWeak) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("incrementAndGet").handleWith(this::incrementStrong) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrementAndGet").handleWith(this::decrementStrong) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("addAndGet").handleWith(this::addValueStrong) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSet").handleWith(this::compareSet) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSwap").handleWith(this::compareSwap) .create(); }

Target:
public Invocations getInvocations() { return new Invocations.Builder() .invocation().methods(POST).path("/v2/counters/{counterName}").handleWith(this::createCounter) .invocation().methods(DELETE).path("/v2/counters/{counterName}").handleWith(this::deleteCounter) .invocation().methods(GET).path("/v2/counters/{counterName}/config").handleWith(this::getConfig) .invocation().methods(GET).path("/v2/counters/{counterName}").handleWith(this::getCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("reset").handleWith(this::resetCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("increment").handleWith(this::incrementCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("decrement").handleWith(this::decrementCounter) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("add").handleWith(this::addValue) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSet").handleWith(this::compareSet) .invocation().methods(GET).path("/v2/counters/{counterName}").withAction("compareAndSwap").handleWith(this::compareSwap) .create(); }
Source:
private void getTopic(RowMap r){ String original_topic_per_table = this.context.getKafkaTopicPerTableFormat(); if(original_topic_per_table.contains("%{database}") || original_topic_per_table.contains("%{table}")) { String db_name = r.getDatabase(); String kafkaTopicWithFormat = original_topic_per_table.replaceAll("%\\{database\\}", db_name); String table_name = r.getTable(); this.topic = kafkaTopicWithFormat.replaceAll("%\\{table\\}", table_name); List<PartitionInfo> partitions_for_kafka; try { partitions_for_kafka = this.kafka.partitionsFor(this.topic); } catch(TimeoutException e) { LOGGER.error("This topic name does not exist: " + this.topic + ": " + e.getLocalizedMessage()); throw (e); } } }

Target:
private String getTopic(RowMap r){ String finalKafkaTopicWithFormat = ""; String original_topic_per_table = this.context.getKafkaTopicPerTableFormat(); if(original_topic_per_table.contains("%{database}") || original_topic_per_table.contains("%{table}")) { String db_name = r.getDatabase(); String kafkaTopicWithFormat = original_topic_per_table.replaceAll("%\\{database\\}", db_name); String table_name = r.getTable(); finalKafkaTopicWithFormat = kafkaTopicWithFormat.replaceAll("%\\{table\\}", table_name); } return finalKafkaTopicWithFormat; }
Source:
void create() { statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { throw new RuntimeException("Couldn't destroy Cache", e); } }

Target:
void create() { statusTransitioner.checkMaintenance(); try { store.create(); } catch (CacheAccessException e) { throw new RuntimeException("Couldn't create Cache", e); } }
Source:
public void createFolderWithSlash() throws IOException { final String folderName = "FolderNameWithSlash/"; try { final Ds3Object ds3Object = new Ds3Object(folderName, 0); final PutBulkJobSpectraS3Response jobResponse = client.putBulkJobSpectraS3(new PutBulkJobSpectraS3Request(BUCKET_NAME, ImmutableList.of(ds3Object))); client.putFolder(new PutFolderRequest(BUCKET_NAME, folderName, jobResponse.getMasterObjectList().getJobId())); } finally { deleteAllContents(client, BUCKET_NAME); } }

Target:
public void createFolderWithSlash() throws IOException { final String folderName = "FolderNameWithSlash/"; try { final PutFolderResponse response = HELPERS.createFolder(BUCKET_NAME, folderName); assertNotNull(response); } finally { deleteAllContents(client, BUCKET_NAME); } }
Source:
public List<LunModel> getLunsToRemove() { if (getIsGrouppedByTarget()) { List<LunModel> luns = Collections.emptyList(); List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns = sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); } return luns; } return ((List<LunModel>) getItems()).stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isRemoveLunSelected) .distinct() .collect(Collectors.toList()); }

Target:
public Set<String> getLunsToRemove() { if (getIsGrouppedByTarget()) { return ((List<SanTargetModel>) getItems()).stream() .map(SanTargetModel::getLuns) .flatMap(List::stream) .filter(LunModel::isRemoveLunSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); } return ((List<LunModel>) getItems()).stream() .filter(LunModel::isRemoveLunSelected) .map(LunModel::getLunId) .collect(Collectors.toSet()); }
Source:
protected void initUnregisteredDisksToDB(Guid storageDomainId) { Set<DiskImage> existingDisks = new HashSet<>(diskImageDao.getAllForStorageDomain(storageDomainId)); List<UnregisteredDisk> unregisteredDisksToSave = new LinkedList<>(); for (Object unregisteredDiskObj : unregisteredDisks) { UnregisteredDisk unregisteredDisk = (UnregisteredDisk) unregisteredDiskObj; if (existingDisks.contains(unregisteredDisk.getDiskImage())) { log.info("Disk with id '{}' already exists in the engine, therefore will not be " + "part of the unregistered disks.", unregisteredDisk.getDiskAlias(), unregisteredDisk.getDiskImage().getId()); continue; } unregisteredDisksToSave.add(unregisteredDisk); log.info("Adding unregistered disk of disk id '{}' and disk alias '{}'", unregisteredDisk.getDiskImage().getId(), unregisteredDisk.getDiskAlias()); } unregisteredDisksDao.saveAllInBatch(unregisteredDisksToSave); }

Target:
protected void initUnregisteredDisksToDB(Guid storageDomainId) { Set<DiskImage> existingDisks = new HashSet<>(diskImageDao.getAllForStorageDomain(storageDomainId)); for (Object unregisteredDiskObj : unregisteredDisks) { UnregisteredDisk unregisteredDisk = (UnregisteredDisk) unregisteredDiskObj; if (existingDisks.contains(unregisteredDisk.getDiskImage())) { log.info("Disk with id '{}' already exists in the engine, therefore will not be " + "part of the unregistered disks.", unregisteredDisk.getDiskAlias(), unregisteredDisk.getDiskImage().getId()); continue; } unregisteredDisksDao.removeUnregisteredDisk(unregisteredDisk.getId().getDiskId(), storageDomainId); unregisteredDisksDao.saveUnregisteredDisk(unregisteredDisk); log.info("Adding unregistered disk of disk id '{}' and disk alias '{}'", unregisteredDisk.getDiskImage().getId(), unregisteredDisk.getDiskAlias()); } }
Source:
public static Builder builder() { return new Builder(); }

Target:
public static Builder builder() { return new AutoValue_NetworkSettings_Details.Builder(); }
Source:
public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); protectedContexts = new ArrayList<>(); protectedContexts.add(JOLOKIA_CONTEXT); protectedContexts.add(INTRIGUE_CONTEXT); protectedContexts.add(WEBSOCKET_CONTEXT); String internalHostname = SystemBaseUrl.INTERNAL.getHost(); String internalHttpPort = SystemBaseUrl.INTERNAL.getHttpPort(); String internalHttpsPort = SystemBaseUrl.INTERNAL.getHttpsPort(); String externalHostname = SystemBaseUrl.EXTERNAL.getHost(); String externalHttpPort = SystemBaseUrl.EXTERNAL.getHttpPort(); String externalHttpsPort = SystemBaseUrl.EXTERNAL.getHttpsPort(); if (trustedAuthorities == null) { trustedAuthorities = new ArrayList<>(); } trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); }

Target:
public void init(FilterConfig filterConfig) throws ServletException { LOGGER.debug("Starting CSRF filter."); String internalHostname = SystemBaseUrl.INTERNAL.getHost(); String internalHttpPort = SystemBaseUrl.INTERNAL.getHttpPort(); String internalHttpsPort = SystemBaseUrl.INTERNAL.getHttpsPort(); String externalHostname = SystemBaseUrl.EXTERNAL.getHost(); String externalHttpPort = SystemBaseUrl.EXTERNAL.getHttpPort(); String externalHttpsPort = SystemBaseUrl.EXTERNAL.getHttpsPort(); trustedAuthorities.add(internalHostname + ":" + internalHttpPort); trustedAuthorities.add(internalHostname + ":" + internalHttpsPort); trustedAuthorities.add(externalHostname + ":" + externalHttpPort); trustedAuthorities.add(externalHostname + ":" + externalHttpsPort); BROWSER_PROTECTION_WHITELIST.add( Pattern.compile(WEBSOCKET_CONTEXT_REGEX), HttpMethod.GET.asString()); BROWSER_PROTECTION_WHITELIST.add(Pattern.compile(CATALOG_CONTEXT), HttpMethod.GET.asString()); USER_AGENT_WHITELIST.add(Pattern.compile(APACHE_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(APACHE_CLIENT_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(JAVA_USER_AGENT)); USER_AGENT_WHITELIST.add(Pattern.compile(JAVA_CLIENT_USER_AGENT)); }
Source:
protected IStateHistoryBackend getBackendForBuilding(long startTime) throws IOException { File historyTreeFile = File.createTempFile("HistoryTreeBackendTest", ".ht"); fHistoryTreeFiles.add(historyTreeFile); HistoryTreeBackend backend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION, startTime, fBlockSize, fMaxChildren); fBackendMap.put(backend, historyTreeFile); return backend; }

Target:
protected IStateHistoryBackend getBackendForBuilding(long startTime) throws IOException { File historyTreeFile = checkNotNull(File.createTempFile("HistoryTreeBackendTest", ".ht")); fHistoryTreeFiles.add(historyTreeFile); HistoryTreeBackend backend = new HistoryTreeBackend(SSID, historyTreeFile, PROVIDER_VERSION, startTime, fBlockSize, fMaxChildren); fBackendMap.put(backend, historyTreeFile); return backend; }
Source:
public void translateSingle_SUPREME_COURT_defective_court_chamber() { SolrDocument doc = new SolrDocument(); doc.addField("courtChamber", "11"); JudgmentSearchResult result = resultsTranslator.translateSingle(doc); Assert.assertTrue(result.getCourtChambers().equals(Lists.newArrayList())); }

Target:
public void translateSingle_SUPREME_COURT_defective_court_chamber() { SolrDocument doc = new SolrDocument(); doc.addField("courtChamber", "11"); JudgmentSearchResult result = resultsTranslator.translateSingle(doc); Assert.assertEquals(0, result.getCourtChambers().size()); }
Source:
private void loadAndPreflightPdf() throws NuxeoException { if (pdfDoc != null) { return; } pdfDoc = PDFUtils.load(pdfBlob, password); try { stripper = new PDFTextStripperByArea(); for (Object pageObject : pdfDoc.getDocumentCatalog().getAllPages()) { PDPage page = (PDPage) pageObject; List pageAnnotations = page.getAnnotations(); for (Object annotationObject : pageAnnotations) { PDAnnotation annot = (PDAnnotation) annotationObject; if (!(annot instanceof PDAnnotationLink)) { continue; } PDAnnotationLink link = (PDAnnotationLink) annot; PDRectangle rect = link.getRectangle(); float x = rect.getLowerLeftX(), y = rect.getUpperRightY(); float width = rect.getWidth(), height = rect.getHeight(); int rotation = page.findRotation(); if (rotation == 0) { PDRectangle pageSize = page.findMediaBox(); y = pageSize.getHeight() - y; } Rectangle2D.Float awtRect = new Rectangle2D.Float(x, y, width, height); stripper.addRegion("" + pageAnnotations.indexOf(annot), awtRect); } } } catch (IOException e) { throw new NuxeoException("Cannot prefilght and prepare regions", e); } }

Target:
private void loadAndPreflightPdf() throws NuxeoException { if (pdfDoc != null) { return; } pdfDoc = PDFUtils.load(pdfBlob, password); try { stripper = new PDFTextStripperByArea(); for (Object pageObject : pdfDoc.getDocumentCatalog().getAllPages()) { PDPage page = (PDPage) pageObject; List pageAnnotations = page.getAnnotations(); for (Object annotationObject : pageAnnotations) { PDAnnotation annot = (PDAnnotation) annotationObject; if (!(annot instanceof PDAnnotationLink)) { continue; } PDAnnotationLink link = (PDAnnotationLink) annot; PDRectangle rect = link.getRectangle(); float x = rect.getLowerLeftX(), y = rect.getUpperRightY(); float width = rect.getWidth(), height = rect.getHeight(); int rotation = page.findRotation(); if (rotation == 0) { PDRectangle pageSize = page.findMediaBox(); y = pageSize.getHeight() - y; } Rectangle2D.Float awtRect = new Rectangle2D.Float(x, y, width, height); stripper.addRegion(String.valueOf(pageAnnotations.indexOf(annot)), awtRect); } } } catch (IOException e) { throw new NuxeoException("Cannot preflight and prepare regions", e); } }
Source:
public static @Nullable String getExecutableName(KernelAnalysisModule module, Integer threadId) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Integer execNameNode; try { execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME); List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime()); ITmfStateValue execNameValue; for (ITmfStateInterval interval : execNameIntervals) { execNameValue = interval.getStateValue(); if(execNameValue.getType().equals(Type.STRING)) { return execNameValue.unboxStr(); } } } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return null; }

Target:
public static @Nullable String getExecutableName(KernelAnalysisModule module, Integer threadId) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return null; } Integer execNameNode; try { execNameNode = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString(), Attributes.EXEC_NAME); List<ITmfStateInterval> execNameIntervals = StateSystemUtils.queryHistoryRange(ss, execNameNode, ss.getStartTime(), ss.getCurrentEndTime()); ITmfStateValue execNameValue; String execName = null; for (ITmfStateInterval interval : execNameIntervals) { execNameValue = interval.getStateValue(); if (execNameValue.getType().equals(Type.STRING)) { execName = execNameValue.unboxStr(); } } return execName; } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return null; }
Source:
public void onReceive(Context context, Intent intent) { Timber.tag(TAG).d(intent.toString()); if (intent.getAction() == null || !RESPONSIBILITIES.contains(intent.getAction())) { Timber.tag(TAG).w("Got called outside our responsibilities: %s", intent.getAction()); return; } if (intent.getBooleanExtra("forwarded", false)) { Timber.tag(TAG).d("Dropping forwarded intent"); return; } if (intent.getAction().equals(REFERRER_SOURCE_GPLAY)) { String referrer = intent.getStringExtra(ARG_KEY_GPLAY_REFERRER); if (referrer != null) { new Thread(() -> { Matomo.getInstance(context.getApplicationContext()).getPreferences().edit().putString(PREF_KEY_INSTALL_REFERRER_EXTRAS, referrer).apply(); Timber.tag(TAG).d("Stored Google Play referrer extras: %s", referrer); }).start(); } } intent.setComponent(null); intent.setPackage(context.getPackageName()); intent.putExtra("forwarded", true); context.sendBroadcast(intent); }

Target:
public void onReceive(Context context, Intent intent) { Timber.tag(TAG).d(intent.toString()); if (intent.getAction() == null || !RESPONSIBILITIES.contains(intent.getAction())) { Timber.tag(TAG).w("Got called outside our responsibilities: %s", intent.getAction()); return; } if (intent.getBooleanExtra("forwarded", false)) { Timber.tag(TAG).d("Dropping forwarded intent"); return; } if (intent.getAction().equals(REFERRER_SOURCE_GPLAY)) { String referrer = intent.getStringExtra(ARG_KEY_GPLAY_REFERRER); if (referrer != null) { final PendingResult result = goAsync(); new Thread(() -> { Matomo.getInstance(context.getApplicationContext()).getPreferences().edit().putString(PREF_KEY_INSTALL_REFERRER_EXTRAS, referrer).apply(); Timber.tag(TAG).d("Stored Google Play referrer extras: %s", referrer); result.finish(); }).start(); } } intent.setComponent(null); intent.setPackage(context.getPackageName()); intent.putExtra("forwarded", true); context.sendBroadcast(intent); }
Source:
public synchronized void deregisterEvaluator(final String contextId) { final int memoryStoreId = getMemoryStoreId(contextId); final Set<Integer> remainingBlocks = storeIdToBlockIds.get(memoryStoreId); if (remainingBlocks == null) { throw new RuntimeException("The store " + memoryStoreId + " does not exist"); } else if (!remainingBlocks.isEmpty()) { throw new RuntimeException("This attempt tries to remove a non-empty store, resulting missing blocks."); } storeIdToBlockIds.remove(memoryStoreId); }

Target:
synchronized void deregisterEvaluator(final String contextId) { final int memoryStoreId = getMemoryStoreId(contextId); final Set<Integer> remainingBlocks = storeIdToBlockIds.get(memoryStoreId); if (remainingBlocks == null) { throw new RuntimeException("The store " + memoryStoreId + " does not exist"); } else if (!remainingBlocks.isEmpty()) { throw new RuntimeException("This attempt tries to remove a non-empty store, resulting missing blocks."); } storeIdToBlockIds.remove(memoryStoreId); }
Source:
public void doSaveProperties(long version) { if (version < lastCacheChanged.get()) { return; } if (file == null) { return; } try { File lockfile = new File(file.getAbsolutePath() + ".lock"); if (!lockfile.exists()) { lockfile.createNewFile(); } try (RandomAccessFile raf = new RandomAccessFile(lockfile, "rw"); FileChannel channel = raf.getChannel()) { FileLock lock = channel.tryLock(); if (lock == null) { throw new IOException("Can not lock the registry cache file " + file.getAbsolutePath() + ", ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties"); } try { if (!file.exists()) { file.createNewFile(); } try (FileOutputStream outputFile = new FileOutputStream(file)) { properties.store(outputFile, "Dubbo Registry Cache"); } } finally { lock.release(); } } } catch (Throwable e) { if (e instanceof IOException) { logger.warn("Failed to save registry cache file, cause: " + e.getMessage(), e); return; } if (version < lastCacheChanged.get()) { return; } else { registryCacheExecutor.execute(new SaveProperties(lastCacheChanged.incrementAndGet())); } logger.warn("Failed to save registry cache file, cause: " + e.getMessage(), e); } }

Target:
public void doSaveProperties(long version) { if (version < lastCacheChanged.get()) { return; } if (file == null) { return; } try { File lockfile = new File(file.getAbsolutePath() + ".lock"); if (!lockfile.exists()) { lockfile.createNewFile(); } try (RandomAccessFile raf = new RandomAccessFile(lockfile, "rw"); FileChannel channel = raf.getChannel()) { FileLock lock = channel.tryLock(); if (lock == null) { throw new IOException("Can not lock the registry cache file " + file.getAbsolutePath() + ", ignore and retry later, maybe multi java process use the file, please config: dubbo.registry.file=xxx.properties"); } try { if (!file.exists()) { file.createNewFile(); } try (FileOutputStream outputFile = new FileOutputStream(file)) { properties.store(outputFile, "Dubbo Registry Cache"); } } finally { lock.release(); } } } catch (Throwable e) { savePropertiesRetryTimes.incrementAndGet(); if (savePropertiesRetryTimes.get() >= MAX_RETRY_TIMES_SAVE_PROPERTIES) { logger.warn("Failed to save registry cache file after retrying " + MAX_RETRY_TIMES_SAVE_PROPERTIES + " times, cause: " + e.getMessage(), e); savePropertiesRetryTimes.set(0); return; } if (version < lastCacheChanged.get()) { savePropertiesRetryTimes.set(0); return; } else { registryCacheExecutor.execute(new SaveProperties(lastCacheChanged.incrementAndGet())); } logger.warn("Failed to save registry cache file, will retry, cause: " + e.getMessage(), e); } }
Source:
protected RouteBuilder createRouteBuilder() throws Exception { stubFor(get(urlEqualTo("/")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"Kie Server info\">\n" + " <kie-server-info>\n" + " <version>1.2.3</version>\n" + " </kie-server-info>\n" + "</response>"))); return new RouteBuilder() { @Override public void configure() { from("direct:start") .to("kie:" + mockServerBaseUri + "?username=admin&password=admin") .to("mock:result"); } }; }

Target:
protected RouteBuilder createRouteBuilder() throws Exception { stubFor(get(urlEqualTo("/")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"Kie Server info\">\n" + " <kie-server-info>\n" + " <version>1.2.3</version>\n" + " </kie-server-info>\n" + "</response>"))); stubFor(get(urlEqualTo("/containers")) .withHeader("Accept", equalTo("application/xml")) .willReturn(aResponse() .withStatus(200) .withHeader("Content-Type", "application/xml") .withBody("<response type=\"SUCCESS\" msg=\"List of created containers\">\n" + " <kie-containers>\n" + " <kie-container container-id=\"kjar1\" status=\"FAILED\"/>\n" + " <kie-container container-id=\"kjar2\" status=\"STARTED\"/>" + " </kie-containers>" + "</response>"))); return new RouteBuilder() { @Override public void configure() { from("direct:start") .to("kie:" + getAuthenticadUrl("admin", "admin")) .to("mock:result"); } }; }
Source:
public void stateUpdated(Item item, State state) { State oldState = this.state; if (null != function) { setState(function.calculate(members)); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }

Target:
public void stateUpdated(Item item, State state) { State oldState = this.state; if (function != null) { setState(function.calculate(members)); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }
Source:
protected void tearDown() throws Exception { setWorkspaceAutoBuild(wasAutoBuildOn); logListener.clear(); Platform.removeLogListener(logListener); super.tearDown(); }

Target:
protected void tearDown() throws Exception { Job.getJobManager().cancel(BuildTestProject.class); IProject testProject = getTestProject(); if (testProject.exists()) { testProject.delete(true, null); } setWorkspaceAutoBuild(wasAutoBuildOn); logListener.clear(); Platform.removeLogListener(logListener); super.tearDown(); }
Source:
public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { if(subPattern.length() != (endExcl - startIncl)){ return false; } int i = 0; for (; i < subPattern.length(); i++) { char c1 = subPattern.charAt(i); char c2 = segment.charAt(i + startIncl); if(c1 != c2){ return false; } } return true; }

Target:
public boolean matches(String segment, int startIncl, int endExcl, boolean assumeDirectory) { String s = subPattern; if (s.length() != (endExcl - startIncl)) return false; for (int i = 0; i < s.length(); i++) { char c1 = s.charAt(i); char c2 = segment.charAt(i + startIncl); if (c1 != c2) return false; } return true; }
Source:
private void stopContainerScrub() { if (scrubber == null) { return; } if (scrubber.isHalted()) { scrubber.down(); } }

Target:
private void stopContainerScrub() { if (scrubber == null) { return; } scrubber.down(); }
Source:
public static EndpointRegistryInfo fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistryInfo registry = new EndpointRegistryInfo(); registry.setName(registryDTO.getName()); registry.setOwner(owner); if (registryDTO.getType() != null) { registry.setType(registryDTO.getType().toString()); } if (registryDTO.getMode() != null) { registry.setMode(registryDTO.getMode().toString()); } return registry; }

Target:
public static EndpointRegistryInfo fromDTOtoEndpointRegistry(RegistryDTO registryDTO, String owner) { EndpointRegistryInfo registry = new EndpointRegistryInfo(); registry.setName(registryDTO.getName()); registry.setOwner(owner); if (registryDTO.getType() != null) { registry.setType(registryDTO.getType().toString()); } else { registry.setType(RegistryDTO.TypeEnum.WSO2.toString()); } if (registryDTO.getMode() != null) { registry.setMode(registryDTO.getMode().toString()); } else { registry.setMode(RegistryDTO.ModeEnum.READONLY.toString()); } return registry; }
Source:
private UnaryTest createInUnaryTest() { return (c, o) -> { if (o == null) { return false; } Object val = value.evaluate( c ); if (val instanceof Range) { try { return ((Range) val).includes(o); } catch (Exception e) { c.notifyEvt(astEvent(Severity.ERROR, Msg.createMessage(Msg.EXPRESSION_IS_RANGE_BUT_VALUE_IS_NOT_COMPARABLE, o.toString(), val.toString()))); throw e; } } else if (val instanceof List) { return ((List) val).contains(o); } else { return false; } }; }

Target:
private UnaryTest createInUnaryTest() { return (c, o) -> { if (o == null) { return false; } Object val = value.evaluate( c ); if (val instanceof Range) { try { return ((Range) val).includes(o); } catch (Exception e) { c.notifyEvt(astEvent(Severity.ERROR, Msg.createMessage(Msg.EXPRESSION_IS_RANGE_BUT_VALUE_IS_NOT_COMPARABLE, o.toString(), val.toString()))); throw e; } } else if (val instanceof Collection) { return ((Collection) val).contains(o); } else { return false; } }; }
Source:
public void keyVaultWithVirtualMachineMSI() throws Exception { final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final MavenBasedProject app = new MavenBasedProject("../azure-spring-boot-test-application"); app.packageUp(); final File file = new File(app.artifact()); if (!file.exists()) { throw new FileNotFoundException("There's no app.jar file found."); } try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD); FileInputStream fis = new FileInputStream(file)) { LOGGER.info("Uploading jar file..."); sshShell.upload(fis, "app.jar", "", true, "4095"); } final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD)) { sshShell.runCommands(commands); } final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }

Target:
public void keyVaultWithVirtualMachineMSI() throws Exception { final VirtualMachine vm = AZURE.virtualMachines().getByResourceGroup(SPRING_RESOURCE_GROUP, VM_NAME); final String host = vm.getPrimaryPublicIPAddress().ipAddress(); final MavenBasedProject app = new MavenBasedProject("../azure-spring-boot-test-application"); app.packageUp(); final File file = new File(app.artifact()); if (!file.exists()) { throw new FileNotFoundException("There's no app.jar file found."); } final List<String> commands = new ArrayList<>(); commands.add(String.format("cd /home/%s", VM_USER_USERNAME)); commands.add(String.format("nohup java -jar -Xdebug " + "-Xrunjdwp:server=y,transport=dt_socket,address=4000,suspend=n " + "-Dazure.keyvault.uri=%s %s &" + " >/log.txt 2>&1", AZURE_KEYVAULT_URI, "app.jar")); try (SSHShell sshShell = SSHShell.open(host, 22, VM_USER_USERNAME, VM_USER_PASSWORD); FileInputStream fis = new FileInputStream(file)) { LOGGER.info("Uploading jar file..."); sshShell.upload(fis, "app.jar", "", true, "4095"); LOGGER.info("Running commands"); sshShell.runCommands(commands); } final ResponseEntity<String> response = curlWithRetry( String.format("http://%s:8080/get", host), 3, 60_000, String.class); assertEquals(HttpStatus.OK, response.getStatusCode()); assertEquals(KEY_VAULT_SECRET_VALUE, response.getBody()); LOGGER.info("key vault value is: {}", response.getBody()); LOGGER.info("--------------------->test virtual machine with MSI over"); }
Source:
public void testLongPathWithCloneOption() throws Exception { RandomStringGenerator generator = new RandomStringGenerator.Builder() .withinRange('a', 'z').build(); String fileName = generator.generate(200); File tempDir = Files.createTempDirectory(fileName).toFile(); if (isWindows()) { if (workspace.getGitFileDir().renameTo(tempDir)) { CloneCommand cmd = workspace.getGitClient().clone_().url(workspace.localMirror()).repositoryName("origin").longPath(true); cmd.execute(); } testGitClient.checkout().ref("origin/master").branch("master").execute(); check_remote_url(workspace, testGitClient, "origin"); assertBranchesExist(testGitClient.getBranches(), "master"); } }

Target:
public void testLongPathWithCloneOption() throws Exception { RandomStringGenerator generator = new RandomStringGenerator.Builder() .withinRange('a', 'z').build(); String fileName = generator.generate(133); String subDirName = generator.generate(80); File tempDir = Files.createTempDirectory(fileName).toFile(); File tempSubDir = new File(tempDir, subDirName); Path subDirectory = Paths.get(tempSubDir.getAbsolutePath()); Files.createDirectories(subDirectory); assertThat(tempSubDir.getAbsolutePath().length(), greaterThan(259)); WorkspaceWithRepo tempRepo = new WorkspaceWithRepo(tempSubDir, gitImplName, listener); if (Files.isDirectory(subDirectory)) { if (isWindows()) { CloneCommand cmd = tempRepo.getGitClient().clone_().url(tempRepo.localMirror()).repositoryName("origin").longPath(true); cmd.execute(); tempRepo.getGitClient().checkout().ref("origin/master").branch("master").execute(); check_remote_url(tempRepo, tempRepo.getGitClient(), "origin"); assertBranchesExist(tempRepo.getGitClient().getBranches(), "master"); } } }
Source:
public EventDTO clone() { EventDTO copy = super.clone(); copy.timestamp = timestamp != null ? new Date(timestamp.getTime()) : null; return copy; }

Target:
public EventDTO clone() { EventDTO copy = super.clone(); copy.timestamp = this.timestamp != null ? (Date) this.timestamp.clone() : null; return copy; }
Source:
public static KLabelConstant of(String label, Definition definition) { synchronized (cache) { return cache.computeIfAbsent(Pair.of(definition.signaturesOf(label), definition.kLabelAttributesOf(label)), p -> Collections.synchronizedMap(new PatriciaTrie<>())) .computeIfAbsent(label, l -> new KLabelConstant( l, cacheSize(), definition.signaturesOf(l), definition.allSorts(), definition.kLabelAttributesOf(l))); } }

Target:
public static KLabelConstant of(String label, Definition definition) { return cache.computeIfAbsent(Pair.of(definition.signaturesOf(label), definition.kLabelAttributesOf(label)), p -> new ConcurrentHashMap<>()) .computeIfAbsent(label, l -> new KLabelConstant( l, maxOrdinal.getAndIncrement(), definition.signaturesOf(l), definition.allSorts(), definition.kLabelAttributesOf(l))); }
Source:
public List<MrrtReportTemplate> getMrrtReportTemplateByTitle(String title) { return mrrtReportTemplateDAO.getMrrtReportTemplateByTitle(title); }

Target:
public List<MrrtReportTemplate> getMrrtReportTemplateByTitle(String title) { if (title == null) { throw new IllegalArgumentException("title cannot be null"); } return mrrtReportTemplateDAO.getMrrtReportTemplateByTitle(title); }
Source:
public void render(SawmillTileEntity te, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { if(!te.formed||te.isDummy()||!te.getWorldNonnull().isBlockLoaded(te.getPos())) return; final BlockRendererDispatcher blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher(); BlockPos blockPos = te.getPos(); BlockState state = te.getWorld().getBlockState(blockPos); if(state.getBlock()!=Multiblocks.sawmill) return; matrixStack.push(); matrixStack.translate(.5, 0, .5); bufferIn = TileRenderUtils.mirror(te, matrixStack, bufferIn); IVertexBuilder solidBuilder = bufferIn.getBuffer(RenderType.getSolid()); Direction facing = te.getFacing(); float dir = facing==Direction.SOUTH?180: facing==Direction.NORTH?0: facing==Direction.EAST?-90: 90; matrixStack.rotate(new Quaternion(0, dir, 0, true)); boolean sawblade = !te.sawblade.isEmpty(); if(sawblade) { matrixStack.push(); matrixStack.translate(1, .125, -.5); float spin = te.animation_bladeRotation; if(te.shouldRenderAsActive()) spin += 36f*partialTicks; matrixStack.rotate(new Quaternion(0, 0, spin, true)); ClientUtils.renderModelTESRFast( BLADE.get(Direction.NORTH).getQuads(state, null, te.getWorldNonnull().rand, EmptyModelData.INSTANCE), solidBuilder, matrixStack, combinedLightIn); matrixStack.pop(); } for(SawmillProcess process : te.sawmillProcessQueue) { float relative = process.getRelativeProcessStep(); ItemStack rendered = process.getCurrentStack(sawblade); renderItem(rendered, relative, matrixStack, bufferIn, combinedLightIn, combinedOverlayIn); } matrixStack.pop(); }

Target:
public void render(SawmillTileEntity te, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer bufferIn, int combinedLightIn, int combinedOverlayIn) { if(!te.formed||te.isDummy()||!te.getWorldNonnull().isBlockLoaded(te.getPos())) return; BlockPos blockPos = te.getPos(); BlockState state = te.getWorld().getBlockState(blockPos); if(state.getBlock()!=Multiblocks.sawmill) return; matrixStack.push(); matrixStack.translate(.5, 0, .5); bufferIn = TileRenderUtils.mirror(te, matrixStack, bufferIn); IVertexBuilder solidBuilder = bufferIn.getBuffer(RenderType.getSolid()); Direction facing = te.getFacing(); float dir = facing==Direction.SOUTH?180: facing==Direction.NORTH?0: facing==Direction.EAST?-90: 90; matrixStack.rotate(new Quaternion(0, dir, 0, true)); boolean sawblade = !te.sawblade.isEmpty(); if(sawblade) { matrixStack.push(); matrixStack.translate(1, .125, -.5); float spin = te.animation_bladeRotation; if(te.shouldRenderAsActive()) spin += 36f*partialTicks; matrixStack.rotate(new Quaternion(0, 0, spin, true)); ClientUtils.renderModelTESRFast( BLADE.get(Direction.NORTH).getQuads(state, null, te.getWorldNonnull().rand, EmptyModelData.INSTANCE), solidBuilder, matrixStack, combinedLightIn); matrixStack.pop(); } for(SawmillProcess process : te.sawmillProcessQueue) { float relative = process.getRelativeProcessStep(); ItemStack rendered = process.getCurrentStack(sawblade); renderItem(rendered, relative, matrixStack, bufferIn, combinedLightIn, combinedOverlayIn); } matrixStack.pop(); }
Source:
private boolean tableExists(String tableName) { Connection conn = null; PreparedStatement stmt = null; String query; ResultSet rs = null; try { conn = getConnection(); query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY); stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName)); rs = stmt.executeQuery(); return true; } catch (SQLException e) { if (log.isDebugEnabled()) { log.debug("Table '" + tableName + "' assumed to not exist since its existence check resulted " + "in exception " + e.getMessage()); } return false; } finally { closeConnection(conn, stmt, rs); } }

Target:
private boolean tableExists(String tableName) { Connection conn = null; PreparedStatement stmt = null; String query = null; ResultSet rs = null; try { conn = getConnection(); query = queryManager.getQuery(conn, QueryManager.TABLE_CHECK_QUERY); stmt = conn.prepareStatement(query.replace(QueryManager.TABLE_NAME_PLACEHOLDER, tableName)); rs = stmt.executeQuery(); return true; } catch (SQLException e) { log.debug("Table '{}' assumed to not exist since its existence check query resulted " + "in exception {}.", tableName, query, e.getMessage()); return false; } finally { closeConnection(conn, stmt, rs); } }
Source:
public DBSSession(DBSRepository repository) { this.repository = repository; @SuppressWarnings("resource") DBSConnection connection = repository.getConnection(); transaction = new DBSTransactionState(repository, connection, this); FulltextConfiguration fulltextConfiguration = repository.getFulltextConfiguration(); fulltextSearchDisabled = fulltextConfiguration == null || fulltextConfiguration.fulltextSearchDisabled; changeTokenEnabled = repository.isChangeTokenEnabled(); saveTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "saves")); queryTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "queries")); LOG_MIN_DURATION_NS = Long.parseLong(Framework.getProperty(LOG_MIN_DURATION_KEY, "-1")) * 1000000; isLatestVersionDisabled = Framework.isBooleanPropertyTrue(DISABLED_ISLATESTVERSION_PROPERTY); }

Target:
public DBSSession(DBSRepository repository) { this.repository = repository; transaction = new DBSTransactionState(repository, this); FulltextConfiguration fulltextConfiguration = repository.getFulltextConfiguration(); fulltextSearchDisabled = fulltextConfiguration == null || fulltextConfiguration.fulltextSearchDisabled; changeTokenEnabled = repository.isChangeTokenEnabled(); saveTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "saves")); queryTimer = registry.timer(MetricRegistry.name("nuxeo", "repositories", repository.getName(), "queries")); LOG_MIN_DURATION_NS = Long.parseLong(Framework.getProperty(LOG_MIN_DURATION_KEY, "-1")) * 1000000; isLatestVersionDisabled = Framework.isBooleanPropertyTrue(DISABLED_ISLATESTVERSION_PROPERTY); }
Source:
private synchronized void initConnectStatusCheckCommand() { int reconnect = getReconnectParam(getUrl()); if (reconnect > 0 && (reconnectExecutorFuture == null || reconnectExecutorFuture.isCancelled())) { Runnable connectStatusCheckCommand = new Runnable() { @Override public void run() { try { if(isClosed()) { ScheduledFuture<?> future = reconnectExecutorFuture; if(future != null && !future.isCancelled()){ future.cancel(true); } return; } if (!isConnected()) { connect(); } else { lastConnectedTime = System.currentTimeMillis(); } } catch (Throwable t) { String errorMsg = "client reconnect to " + getUrl().getAddress() + " find error . url: " + getUrl(); if (System.currentTimeMillis() - lastConnectedTime > shutdown_timeout) { if (!reconnect_error_log_flag.get()) { reconnect_error_log_flag.set(true); logger.error(errorMsg, t); return; } } if (reconnect_count.getAndIncrement() % reconnect_warning_period == 0) { logger.warn(errorMsg, t); } } } }; reconnectExecutorFuture = reconnectExecutorService.scheduleWithFixedDelay(connectStatusCheckCommand, reconnect, reconnect, TimeUnit.MILLISECONDS); } }

Target:
private synchronized void initConnectStatusCheckCommand() { int reconnect = getReconnectParam(getUrl()); if (reconnect > 0 && (reconnectExecutorFuture == null || reconnectExecutorFuture.isCancelled())) { Runnable connectStatusCheckCommand = new Runnable() { @Override public void run() { try { if (cancelFutureIfOffline()) return; if (!isConnected()) { connect(); } else { lastConnectedTime = System.currentTimeMillis(); } } catch (Throwable t) { String errorMsg = "client reconnect to " + getUrl().getAddress() + " find error . url: " + getUrl(); if (System.currentTimeMillis() - lastConnectedTime > shutdown_timeout) { if (!reconnect_error_log_flag.get()) { reconnect_error_log_flag.set(true); logger.error(errorMsg, t); return; } } if (reconnect_count.getAndIncrement() % reconnect_warning_period == 0) { logger.warn(errorMsg, t); } } } private boolean cancelFutureIfOffline() { if(isClosed()) { ScheduledFuture<?> future = reconnectExecutorFuture; if(future != null && !future.isCancelled()){ future.cancel(true); } return true; } return false; } }; reconnectExecutorFuture = reconnectExecutorService.scheduleWithFixedDelay(connectStatusCheckCommand, reconnect, reconnect, TimeUnit.MILLISECONDS); } }
Source:
private String extractVmIpsFromGuestAgentInterfaces(List<VmGuestAgentInterface> nics) { if (nics == null || nics.isEmpty()) { return null; } List<String> ips = new ArrayList<String>(); for (VmGuestAgentInterface nic : nics) { if (nic.getIpv4Addresses() != null && !nic.getIpv4Addresses().isEmpty()) { ips.addAll(nic.getIpv4Addresses()); } } return ips.isEmpty() ? null : StringUtils.join(ips, " "); }

Target:
private String extractVmIpsFromGuestAgentInterfaces(List<VmGuestAgentInterface> nics) { if (nics == null || nics.isEmpty()) { return null; } List<String> ips = new ArrayList<String>(); for (VmGuestAgentInterface nic : nics) { if (nic.getIpv4Addresses() != null) { ips.addAll(nic.getIpv4Addresses()); } } return ips.isEmpty() ? null : StringUtils.join(ips, " "); }
Source:
protected void gtk_widget_set_align(long widget, int hAlign, int vAlign) { OS.gtk_widget_set_halign (widget, hAlign); OS.gtk_widget_set_valign (widget, vAlign); }

Target:
void gtk_widget_set_align(long widget, int hAlign, int vAlign) { OS.gtk_widget_set_halign (widget, hAlign); OS.gtk_widget_set_valign (widget, vAlign); }
Source:
public ResultIterator getPSIterator(String name, int fetchSize) throws DatabaseEngineException, ConnectionResetException { final PreparedStatementCapsule ps = stmts.get(name); if (ps == null) { throw new DatabaseEngineRuntimeException(String.format("PreparedStatement named '%s' does not exist", name)); } try { ps.ps.setFetchSize(fetchSize); } catch (final SQLException e) { throw new DatabaseEngineException("Error creating PS Iterator", e); } try { return createResultIterator(ps.ps); } catch (final DatabaseEngineException e2) { reconnectExceptionally("Connection is down"); throw new ConnectionResetException("Connection was lost and reset, you must reset the prepared statement parameters and re-execute the statement"); } }

Target:
public ResultIterator getPSIterator(String name, int fetchSize) throws DatabaseEngineException, ConnectionResetException { final PreparedStatementCapsule ps = stmts.get(name); if (ps == null) { throw new DatabaseEngineRuntimeException(String.format("PreparedStatement named '%s' does not exist", name)); } try { ps.ps.setFetchSize(fetchSize); } catch (final SQLException e) { throw new DatabaseEngineException("Error creating PS Iterator", e); } try { return createResultIterator(ps.ps); } catch (final DatabaseEngineException e2) { reconnectExceptionally("Connection is down"); throw new ConnectionResetException("Connection was lost and restablished. You need to reset the prepared statement parameters and re-execute the statement"); } }
Source:
private TransactionalDocumentAuthorizer createMockAuthorizer() { TransactionalDocumentAuthorizer documentAuthorizer = Mockito.mock(TransactionalDocumentAuthorizer.class); Mockito.when(documentAuthorizer.canEdit(Mockito.any(), Mockito.any())).then(this::determineEditCall); Mockito.when(documentAuthorizer.getEditModes(Mockito.any(), Mockito.any(),Mockito.any())).thenReturn(authorizationEditModes); return documentAuthorizer; }

Target:
private TransactionalDocumentAuthorizer createMockAuthorizer() { TransactionalDocumentAuthorizer documentAuthorizer = Mockito.mock(TransactionalDocumentAuthorizer.class); Mockito.when(documentAuthorizer.canEdit(Mockito.any(CuDisbursementVoucherDocument.class), Mockito.any())).then(this::determineEditCall); Mockito.when(documentAuthorizer.getEditModes(Mockito.any(CuDisbursementVoucherDocument.class), Mockito.any(),Mockito.any())).thenReturn(authorizationEditModes); return documentAuthorizer; }
Source:
protected void appendCriteria(Map<String, Object> parameters) { parameters.put(ScmMaterialConfig.URL, url.forCommandline()); parameters.put("branch", branch); parameters.put("shallowClone", shallowClone); }

Target:
protected void appendCriteria(Map<String, Object> parameters) { parameters.put(ScmMaterialConfig.URL, url.forCommandline()); parameters.put("branch", branch); }
Source:
public Term parseInModule(StringToken input, StringToken startSymbol, StringToken moduleName, TermContext termContext) { try { org.kframework.kil.Term kast = programLoader.parseInModule( input.stringValue(), new GeneratedSource(this.getClass()), Sort.of(startSymbol.stringValue()), moduleName.stringValue(), context); Term term = kilTransformer.transformAndEval(kast); term = term.evaluate(termContext); return term; } catch (ParseFailedException e) { String line = "" + e.getKException().getLocation().lineStart; String col = "" + e.getKException().getLocation().columnStart; return processIOException("noparse", StringToken.of(e.getMessage() + " Line: " + line + " Column: " + col), termContext); } }

Target:
public Term parseInModule(StringToken input, StringToken startSymbol, StringToken moduleName, TermContext termContext) { try { org.kframework.kil.Term kast = programLoader.parseInModule( input.stringValue(), Sources.generatedBy(this.getClass()), Sort.of(startSymbol.stringValue()), moduleName.stringValue(), context); Term term = kilTransformer.transformAndEval(kast); term = term.evaluate(termContext); return term; } catch (ParseFailedException e) { return processIOException("noparse", termContext); } }