auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean drawState(TimeGraphColorScheme colors, ITimeEvent event, Rectangle rect, GC gc, boolean selected, boolean timeSelected) { int colorIdx = fTimeGraphProvider.getStateTableIndex(event); if (colorIdx < 0 && colorIdx != ITimeGraphPresentationProvider.TRANSPARENT) { return false; } boolean visible = rect.width == 0 ? false : true; Color black = Display.getDefault().getSystemColor(SWT.COLOR_BLACK); gc.setForeground(black); if (visible) { if (colorIdx == ITimeGraphPresentationProvider.TRANSPARENT) { gc.drawLine(rect.x, rect.y, rect.x + rect.width - 1, rect.y); gc.drawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width - 1, rect.y + rect.height - 1); if (rect.width == 1) { gc.drawPoint(rect.x, rect.y - 2); } return false; } Color stateColor = null; if (colorIdx < fEventColorMap.length) { stateColor = fEventColorMap[colorIdx]; } else { stateColor = black; } boolean reallySelected = timeSelected && selected; gc.setBackground(stateColor); gc.fillRectangle(rect); if (reallySelected) { gc.drawRectangle(rect.x, rect.y - 1, rect.width -2, rect.height + 1); } } else { gc.drawPoint(rect.x, rect.y - 2); } fTimeGraphProvider.postDrawEvent(event, rect, gc); return visible; }

Target:
protected boolean drawState(TimeGraphColorScheme colors, ITimeEvent event, Rectangle rect, GC gc, boolean selected, boolean timeSelected) { int colorIdx = fTimeGraphProvider.getStateTableIndex(event); if (colorIdx < 0 && colorIdx != ITimeGraphPresentationProvider.TRANSPARENT) { return false; } boolean visible = rect.width == 0 ? false : true; Color black = Display.getDefault().getSystemColor(SWT.COLOR_BLACK); gc.setForeground(black); if (visible) { if (colorIdx == ITimeGraphPresentationProvider.TRANSPARENT) { gc.drawLine(rect.x, rect.y, rect.x + rect.width - 1, rect.y); gc.drawLine(rect.x, rect.y + rect.height - 1, rect.x + rect.width - 1, rect.y + rect.height - 1); if (rect.width == 1) { gc.drawPoint(rect.x, rect.y - 2); } return false; } Color stateColor = null; if (colorIdx < fEventColorMap.length) { stateColor = fEventColorMap[colorIdx]; } else { stateColor = black; } boolean reallySelected = timeSelected && selected; gc.setBackground(stateColor); gc.fillRectangle(rect); if (reallySelected) { gc.drawLine(rect.x, rect.y - 1, rect.x + rect.width - 1, rect.y - 1); gc.drawLine(rect.x, rect.y + rect.height, rect.x + rect.width - 1, rect.y + rect.height); } } else { gc.drawPoint(rect.x, rect.y - 2); } fTimeGraphProvider.postDrawEvent(event, rect, gc); return visible; }
Source:
private void loadConfig() { for (EventScript script : m_config.getEventScripts()) { Uei[] ueis = script.getUei(); if (ueis.length == 0) { m_eventScripts.add(script); } else { for (Uei uei : ueis) { String ueiName = uei.getName(); List<EventScript> list = m_eventScriptMap.get(ueiName); if (list == null) { list = new ArrayList<EventScript>(); list.add(script); m_eventScriptMap.put(ueiName, list); } else { list.add(script); } } } } }

Target:
private void loadConfig() { m_eventScripts.clear(); m_eventScriptMap.clear(); for (EventScript script : m_config.getEventScripts()) { Uei[] ueis = script.getUei(); if (ueis.length == 0) { m_eventScripts.add(script); } else { for (Uei uei : ueis) { String ueiName = uei.getName(); Set<EventScript> list = m_eventScriptMap.get(ueiName); if (list == null) { list = new CopyOnWriteArraySet<>(); list.add(script); m_eventScriptMap.put(ueiName, list); } else { list.add(script); } } } } }
Source:
public void should_not_execute_findbugs_if_no_active() throws Exception { BugInstance bugInstance = getBugInstance("THIS_RULE_DOES_NOT_EXIST", 107); Collection<ReportedBug> collection = Arrays.asList(new ReportedBug(bugInstance)); when(executor.execute(false, false)).thenReturn(collection); when(javaResourceLocator.classFilesToAnalyze()).thenReturn(Lists.newArrayList(new File("file"))); pico.addComponent(createRulesProfileWithActiveRules(false, false, false, false)); FindbugsSensor analyser = pico.getComponent(FindbugsSensor.class); analyser.execute(sensorContext); verify(executor, never()).execute(false, false); verify(sensorContext, never()).newIssue(); }

Target:
public void should_not_execute_findbugs_if_no_active() throws Exception { when(javaResourceLocator.classFilesToAnalyze()).thenReturn(Lists.newArrayList(new File("file"))); pico.addComponent(createRulesProfileWithActiveRules(false, false, false, false)); FindbugsSensor analyser = pico.getComponent(FindbugsSensor.class); analyser.execute(sensorContext); verify(executor, never()).execute(false, false); verify(sensorContext, never()).newIssue(); }
Source:
public Partition(HardwareLayout hardwareLayout, JSONObject jsonObject) throws JSONException { logger.trace("Partition " + jsonObject.toString()); this.id = jsonObject.getLong("id"); this.partitionState = PartitionState.valueOf(jsonObject.getString("partitionState")); this.replicaCapacityInBytes = jsonObject.getLong("replicaCapacityInBytes"); this.replicas = new ArrayList<Replica>(jsonObject.getJSONArray("replicas").length()); for (int i = 0; i < jsonObject.getJSONArray("replicas").length(); ++i) { this.replicas.add(i, new Replica(hardwareLayout, this, jsonObject.getJSONArray("replicas").getJSONObject(i))); } validate(); }

Target:
public Partition(HardwareLayout hardwareLayout, JSONObject jsonObject) throws JSONException { if (logger.isTraceEnabled()) logger.trace("Partition " + jsonObject.toString()); this.id = jsonObject.getLong("id"); this.partitionState = PartitionState.valueOf(jsonObject.getString("partitionState")); this.replicaCapacityInBytes = jsonObject.getLong("replicaCapacityInBytes"); this.replicas = new ArrayList<Replica>(jsonObject.getJSONArray("replicas").length()); for (int i = 0; i < jsonObject.getJSONArray("replicas").length(); ++i) { this.replicas.add(i, new Replica(hardwareLayout, this, jsonObject.getJSONArray("replicas").getJSONObject(i))); } validate(); }
Source:
private String translateWord(String word) { if (wordStartsWithVowelLike(word)) { return word + AY; } if(hasYAfterConsonantCluster(word)){ return word.substring(yLocation) + word.substring(0, yLocation) + AY; } if (wordStartsWithPrefixes(word, THR, SCH)) { return word.substring(3) + word.substring(0, 3) + AY; } if (wordStartsWithPrefixes(word, CH, QU, TH)) { return word.substring(2) + word.substring(0, 2) + AY; } if (wordStartsWithConsonantAndQu(word)) { return word.substring(3) + word.toCharArray()[0] + QUAY; } return word.substring(1) + word.toCharArray()[0] + AY; }

Target:
private String translateWord(String word) { if (wordStartsWithVowelLike(word)) { return word + AY; } if (getLocationOfYAfterConsonantCluster(word) != -1) { int yPos = getLocationOfYAfterConsonantCluster(word); return word.substring(yPos) + word.substring(0, yPos) + AY; } if (wordStartsWithPrefixes(word, THR, SCH)) { return word.substring(3) + word.substring(0, 3) + AY; } if (wordStartsWithPrefixes(word, CH, QU, TH)) { return word.substring(2) + word.substring(0, 2) + AY; } if (wordStartsWithConsonantAndQu(word)) { return word.substring(3) + word.toCharArray()[0] + QUAY; } return word.substring(1) + word.toCharArray()[0] + AY; }
Source:
public void testKillContainer() throws Exception { sut.pull(BUSYBOX_LATEST); final ContainerConfig containerConfig = ContainerConfig.builder() .image(BUSYBOX_LATEST) .cmd("sh", "-c", "while :; do sleep 1; done") .build(); final String containerName = randomName(); final ContainerCreation containerCreation = sut.createContainer(containerConfig, containerName); final String containerId = containerCreation.id(); sut.startContainer(containerId); { final ContainerInfo containerInfo = sut.inspectContainer(containerId); assertThat(containerInfo.state().running(), equalTo(true)); } sut.killContainer(containerId); { final ContainerInfo containerInfoLatest = sut.inspectContainer(containerId); assertFalse(containerInfoLatest.state().running()); } }

Target:
public void testKillContainer() throws Exception { sut.pull(BUSYBOX_LATEST); final ContainerConfig containerConfig = ContainerConfig.builder() .image(BUSYBOX_LATEST) .cmd("sh", "-c", "while :; do sleep 1; done") .build(); final String containerName = randomName(); final ContainerCreation containerCreation = sut.createContainer(containerConfig, containerName); final String containerId = containerCreation.id(); sut.startContainer(containerId); final ContainerInfo containerInfo = sut.inspectContainer(containerId); assertThat(containerInfo.state().running(), equalTo(true)); sut.killContainer(containerId); final ContainerInfo containerInfoLatest = sut.inspectContainer(containerId); assertFalse(containerInfoLatest.state().running()); }
Source:
public void testConcurrentUpload() throws IOException, InterruptedException, ExecutionException, TimeoutException { final int concurrency = 10; ExecutorService pool = Executors.newFixedThreadPool(concurrency); final CyclicBarrier barrier = new CyclicBarrier(concurrency); final DistributedFileSystem fs = miniCluster.getFileSystem(); final Path expectedJarPath = new Path(finalClasspath, dummyJarFile.getName()); List<Future<Boolean>> futures = new ArrayList<>(); for (int i = 0; i < concurrency; i++) { futures.add( pool.submit( new Callable() { @Override public Boolean call() throws Exception { int id = barrier.await(); Job job = Job.getInstance(conf, "test-job-" + id); Path intermediatePathForJob = new Path(intermediatePath, "job-" + id); barrier.await(); JobHelper.addJarToClassPath(dummyJarFile, finalClasspath, intermediatePathForJob, fs, job); Assert.assertTrue(fs.exists(expectedJarPath)); Assert.assertFalse(fs.exists(new Path(intermediatePathForJob, dummyJarFile.getName()))); Assert.assertEquals( expectedJarPath.toString(), job.getConfiguration().get(MRJobConfig.CLASSPATH_FILES) ); return true; } } ) ); } for (Future<Boolean> future : futures) { Assert.assertTrue(future.get(30, TimeUnit.SECONDS)); } pool.shutdownNow(); }

Target:
public void testConcurrentUpload() throws IOException, InterruptedException, ExecutionException, TimeoutException { final int concurrency = 10; ListeningExecutorService pool = MoreExecutors.listeningDecorator(Executors.newFixedThreadPool(concurrency)); final CyclicBarrier barrier = new CyclicBarrier(concurrency); final DistributedFileSystem fs = miniCluster.getFileSystem(); final Path expectedJarPath = new Path(finalClasspath, dummyJarFile.getName()); List<ListenableFuture<Boolean>> futures = new ArrayList<>(); for (int i = 0; i < concurrency; i++) { futures.add( pool.submit( new Callable() { @Override public Boolean call() throws Exception { int id = barrier.await(); Job job = Job.getInstance(conf, "test-job-" + id); Path intermediatePathForJob = new Path(intermediatePath, "job-" + id); JobHelper.addJarToClassPath(dummyJarFile, finalClasspath, intermediatePathForJob, fs, job); Assert.assertTrue(fs.exists(expectedJarPath)); Assert.assertFalse(fs.exists(new Path(intermediatePathForJob, dummyJarFile.getName()))); Assert.assertEquals( expectedJarPath.toString(), job.getConfiguration().get(MRJobConfig.CLASSPATH_FILES) ); return true; } } ) ); } Futures.allAsList(futures).get(30, TimeUnit.SECONDS); pool.shutdownNow(); }
Source:
protected void doRun() { AtomicInteger runningCallsCount = new AtomicInteger(); AtomicInteger queuedCallsCount = new AtomicInteger(); KubernetesClientProvider.clients.asMap().forEach((s, client) -> { KubernetesClient kClient = client.getClient(); if (kClient instanceof HttpClientAware) { OkHttpClient httpClient = ((HttpClientAware) kClient).getHttpClient(); Dispatcher dispatcher = httpClient.dispatcher(); runningCallsCount.addAndGet(dispatcher.runningCallsCount()); queuedCallsCount.addAndGet(dispatcher.queuedCallsCount()); } }); KubernetesClientProvider.runningCallsCount = runningCallsCount.get(); KubernetesClientProvider.queuedCallsCount = queuedCallsCount.get(); }

Target:
protected void doRun() { int runningCallsCount = 0; int queuedCallsCount = 0; for (Client client : KubernetesClientProvider.clients.asMap().values()) { KubernetesClient kClient = client.getClient(); if (kClient instanceof HttpClientAware) { OkHttpClient httpClient = ((HttpClientAware) kClient).getHttpClient(); Dispatcher dispatcher = httpClient.dispatcher(); runningCallsCount += dispatcher.runningCallsCount(); queuedCallsCount += dispatcher.queuedCallsCount(); } } KubernetesClientProvider.runningCallsCount = runningCallsCount; KubernetesClientProvider.queuedCallsCount = queuedCallsCount; }
Source:
private void visitIfStatement(IfStatementTree tree) { PhpCfgBlock successor = currentBlock; PhpCfgBlock elseBlock = currentBlock; buildSubFlow(tree.statements(), successor); PhpCfgBlock thenBlock = currentBlock; PhpCfgBranchingBlock branchingBlock = createBranchingBlock(tree, thenBlock, elseBlock); currentBlock = branchingBlock; }

Target:
private void visitIfStatement(IfStatementTree tree) { PhpCfgBlock successor = currentBlock; PhpCfgBlock elseBlock = currentBlock; buildSubFlow(tree.statements(), successor); PhpCfgBlock thenBlock = currentBlock; currentBlock = createBranchingBlock(tree, thenBlock, elseBlock); currentBlock.addElement(tree.condition().expression()); }
Source:
public APIResult submitAndSchedule( @PathParam("extension-name") String extensionName, @Context HttpServletRequest request, @DefaultValue("") @QueryParam("doAs") String doAsUser, @QueryParam("jobName") String jobName, @FormDataParam("entities") List<Entity> entities, @FormDataParam("config") InputStream config) { checkIfExtensionServiceIsEnabled(); try { ExtensionType extensionType = getExtensionType(extensionName); if (ExtensionType.TRUSTED.equals(extensionType)) { entities = generateEntities(extensionName, request); } List<String> entityNames = new ArrayList<>(); validateEntities(entities); for (Entity entity : entities) { submitInternal(entity, doAsUser); entityNames.add(entity.getName()); } ExtensionMetaStore metaStore = org.apache.falcon.extensions.store.ExtensionStore.get().getMetaStore(); metaStore.storeExtensionJob(jobName, extensionName, extensionType, entityNames, null); for (Entity entity : entities) { scheduleInternal(entity.getEntityType().name(), entity.getName(), null, null); } } catch (FalconException | IOException e) { LOG.error("Error when submitting extension job: ", e); throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted and scheduled successfully"); }

Target:
public APIResult submitAndSchedule( @PathParam("extension-name") String extensionName, @Context HttpServletRequest request, @DefaultValue("") @QueryParam("doAs") String doAsUser, @QueryParam("jobName") String jobName, @FormDataParam("entities") List<Entity> entities, @FormDataParam("config") InputStream config) { checkIfExtensionServiceIsEnabled(); try { entities = getEntityList(extensionName, entities, config); submitEntities(extensionName, doAsUser, jobName, entities, config); for (Entity entity : entities) { scheduleInternal(entity.getEntityType().name(), entity.getName(), null, null); } } catch (FalconException | IOException e) { LOG.error("Error when submitting extension job: ", e); throw FalconWebException.newAPIException(e, Response.Status.INTERNAL_SERVER_ERROR); } return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted and scheduled successfully"); }
Source:
private void handeLogin(ClickEvent<Button> buttonClickEvent) { clearMessage(); if (login.isEmpty() || password.isEmpty()) { setMessage("All fields are required."); } if (!"admin".equals(login.getValue()) && !"user" .equals(login.getValue())) { setMessage("Faulty username or password!"); return; } ((HttpServletRequest) VaadinRequest.getCurrent()).changeSessionId(); RouteRegistry sessionRegistry = SessionRouteRegistry .getSessionRegistry(VaadinSession.getCurrent()); if ("admin".equals(login.getValue())) { RouteUtil.setAnnotatedRoute(AdminView.class, sessionRegistry); } else if ("user".equals(login.getValue())) { RouteUtil.setAnnotatedRoute(UserView.class, sessionRegistry); } RouteUtil.setRoute("version", VersionView.class, sessionRegistry); sessionRegistry.setRoute("time", TimeView.class, Arrays.asList(LooseCenterLayout.class, MainLayout.class)); UI.getCurrent().getPage().reload(); }

Target:
private void handeLogin(ClickEvent<Button> buttonClickEvent) { clearMessage(); if (login.isEmpty() || password.isEmpty()) { setMessage("All fields are required."); } if (!"admin".equals(login.getValue()) && !"user" .equals(login.getValue())) { setMessage("Faulty username or password!"); return; } ((HttpServletRequest) VaadinRequest.getCurrent()).changeSessionId(); RouteConfiguration session = RouteConfiguration.forSessionScope(); if ("admin".equals(login.getValue())) { session.setAnnotatedRoute(AdminView.class); } else if ("user".equals(login.getValue())) { session.setAnnotatedRoute(UserView.class); } session.setParentAnnotatedRoute("version", VersionView.class); session.setRoute("time", TimeView.class, LooseCenterLayout.class, MainLayout.class); UI.getCurrent().getPage().reload(); }
Source:
private Expression assignmentExpression(AstNode astNode) { AstNode nameNode = astNode.getFirstChild(PythonGrammar.TEST); Name name = name(nameNode.getFirstDescendant(PythonGrammar.NAME)); AstNode walrusNode = nameNode.getNextSibling(); Token walrusToken = toPyToken(walrusNode.getToken()); Expression expression = expression(walrusNode.getNextSibling()); return new AssignmentExpressionImpl(name, walrusToken, expression); }

Target:
private Expression assignmentExpression(AstNode astNode) { AstNode nameNode = astNode.getFirstChild(PythonGrammar.TEST); Expression nameExpression = expression(nameNode); if (!nameExpression.is(Tree.Kind.NAME)) { int line = nameNode.getTokenLine(); throw new RecognitionException(line, "Parse error at line " + line + ": The left-hand side of an assignment expression must be a name."); } Name name = (Name) nameExpression; AstNode operatorNode = astNode.getFirstChild(PythonPunctuator.WALRUS_OPERATOR); Token operatorToken = toPyToken(operatorNode.getToken()); Expression expression = expression(astNode.getLastChild(PythonGrammar.TEST)); return new AssignmentExpressionImpl(name, operatorToken, expression); }
Source:
public Set<String> done(){ ParametrizedTypeJavaType.typeSubstitutionSolver = null; bytecodeCompleter.done(); return bytecodeCompleter.classesNotFound(); }

Target:
public void done(){ ParametrizedTypeJavaType.typeSubstitutionSolver = null; bytecodeCompleter.done(); }
Source:
public void deleteBucketAcl() throws IOException, SignatureException { PutBucketAclForUserSpectraS3Response putBucketAclForUserSpectraS3Response = null; try { putBucketAclForUserSpectraS3Response = client.putBucketAclForUserSpectraS3( new PutBucketAclForUserSpectraS3Request(BUCKET_NAME, BucketAclPermission.DELETE, spectraUUID)); final DeleteBucketAclSpectraS3Response deleteBucketAclSpectraS3Response = client .deleteBucketAclSpectraS3(new DeleteBucketAclSpectraS3Request( putBucketAclForUserSpectraS3Response.getBucketAclResult().getId().toString())); assertThat(deleteBucketAclSpectraS3Response.getStatusCode(), is(204)); } catch (final Exception e){ if (putBucketAclForUserSpectraS3Response != null) { client.deleteBucketAclSpectraS3(new DeleteBucketAclSpectraS3Request( putBucketAclForUserSpectraS3Response.getBucketAclResult().getId().toString())); } throw e; } }

Target:
public void deleteBucketAcl() throws IOException, SignatureException { PutBucketAclForUserSpectraS3Response putBucketAclForUserSpectraS3Response = null; try { putBucketAclForUserSpectraS3Response = client.putBucketAclForUserSpectraS3( new PutBucketAclForUserSpectraS3Request(BUCKET_NAME, BucketAclPermission.DELETE, spectraUUID)); final DeleteBucketAclSpectraS3Response deleteBucketAclSpectraS3Response = client .deleteBucketAclSpectraS3(new DeleteBucketAclSpectraS3Request( putBucketAclForUserSpectraS3Response.getBucketAclResult().getId().toString())); assertThat(deleteBucketAclSpectraS3Response.getStatusCode(), is(204)); } finally { if (putBucketAclForUserSpectraS3Response != null) { client.deleteBucketAclSpectraS3(new DeleteBucketAclSpectraS3Request( putBucketAclForUserSpectraS3Response.getBucketAclResult().getId().toString())); } } }
Source:
protected static BiConsumer<Map<String, Object>, Integer> toLoaderEnrichedOnError( Consumer<Map<String, Object>> loader) { return (map, lineno) -> { try { loader.accept(map); } catch (DirectoryException e) { e.addInfo(String.format("Exception: %s happened on line: %s", e.getMessage(), lineno)); throw e; } }; }

Target:
protected static BiConsumer<Map<String, Object>, Integer> toLoaderEnrichedOnError( Consumer<Map<String, Object>> loader) { return (map, lineno) -> { try { loader.accept(map); } catch (DirectoryException e) { e.addInfo("At line: " + lineno); throw e; } }; }
Source:
public void resizeVideoWithSetting() { int resizeNumber = 250; String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, articleName); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); VisualEditorAddMediaDialog mediaDialog = ve.clickVideoButton(); mediaDialog = mediaDialog.searchMedia("h"); ve = mediaDialog.addExistingMedia(1); ve.verifyVideos(1); Dimension source = ve.getVideoDimension(); ve.selectMedia(); VisualEditorMediaSettingsDialog mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.setCustomSize(resizeNumber, ImageSize.WIDTH); mediaSettingsDialog.clickApplyChangesButton(); ve.verifyVideoResized(source); source = ve.getVideoDimension(); mediaSettingsDialog = ve.openMediaSettings(); mediaSettingsDialog.selectSettings(Setting.ADVANCED); mediaSettingsDialog.setCustomSize(resizeNumber, ImageSize.HEIGHT); mediaSettingsDialog.clickApplyChangesButton(); ve.verifyVideoResized(source); VisualEditorSaveChangesDialog save = ve.clickPublishButton(); ArticlePageObject article = save.savePage(); article.verifyVEPublishComplete(); }

Target:
public void resizeVideoWithSetting() { int resizeNumber = 250; String articleName = PageContent.ARTICLE_NAME_PREFIX + DateTime.now().getMillis(); VisualEditorPageObject ve = new VisualEditorPageObject(driver).openVEOnArticle(wikiURL, articleName); VisualEditorAddMediaDialog mediaDialog = ve.searchVideo("h"); ve = mediaDialog.addExistingMedia(1); ve.verifyVideos(1); Dimension source = ve.getVideoDimension(); ve.selectMedia(); ve.resizeMedia(resizeNumber, ImageSize.WIDTH); ve.verifyVideoResized(source); source = ve.getVideoDimension(); ve.resizeMedia(resizeNumber, ImageSize.HEIGHT); ve.verifyVideoResized(source); ve.publish(); }
Source:
public Object getAdapter(Object element, Class key) { BtfEvent tmfEvent = (BtfEvent) element; if (IPropertySource.class.equals(key)) { return new BtfEventPropertySource(tmfEvent); } return null; }

Target:
public Object getAdapter(Object element, Class key) { if (element instanceof BtfEvent && IPropertySource.class.equals(key)) { BtfEvent tmfEvent = (BtfEvent) element; return new BtfEventPropertySource(tmfEvent); } return null; }
Source:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); final String[] expected = { "18: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "sun.tools.util.ModifierFilter.ALL_ACCESS"), "5: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), "9: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), "11: " + getCheckMessage(MSG_ORDERING, "java.io.File"), "13: " + getCheckMessage(MSG_ORDERING, "java.io.IOException"), }; verify(checkConfig, getPath("InputImportOrder.java"), expected); }

Target:
public void testDefault() throws Exception { final DefaultConfiguration checkConfig = createModuleConfig(ImportOrderCheck.class); final String[] expected = { "5: " + getCheckMessage(MSG_ORDERING, "java.awt.Dialog"), "9: " + getCheckMessage(MSG_ORDERING, "javax.swing.JComponent"), "11: " + getCheckMessage(MSG_ORDERING, "java.io.File"), "13: " + getCheckMessage(MSG_ORDERING, "java.io.IOException"), "18: " + getCheckMessage(MSG_SEPARATED_IN_GROUP, "sun.tools.util.ModifierFilter.ALL_ACCESS"), }; verify(checkConfig, getPath("InputImportOrder.java"), expected); }
Source:
public TestMediaWikiApiImageFetchingStrategy(Map<String, String> serverContent) { this.serverContent = serverContent; }

Target:
public TestMediaWikiApiImageFetchingStrategy(Map<String, String> serverContent) { Preconditions.checkNotNull(serverContent, "Please specify some server content for images used during the tests. See: TestMediaWikiApiImageFetchingStrategy#serverContent"); this.serverContent = ImmutableMap.copyOf(serverContent); }
Source:
switch (logger) { case "slf4j": setLoggerAdapter(new Slf4jLoggerAdapter()); break; case "jcl": setLoggerAdapter(new JclLoggerAdapter()); break; case "log4j": setLoggerAdapter(new Log4jLoggerAdapter()); break; case "jdk": setLoggerAdapter(new JdkLoggerAdapter()); break; case "log4j2": setLoggerAdapter(new Log4j2LoggerAdapter()); break; default: List<Class<? extends LoggerAdapter>> candidates = Arrays.asList( Log4jLoggerAdapter.class, Slf4jLoggerAdapter.class, Log4j2LoggerAdapter.class, JclLoggerAdapter.class, JdkLoggerAdapter.class ); for (Class<? extends LoggerAdapter> clazz : candidates) { try { setLoggerAdapter(clazz.newInstance()); break; } catch (Throwable ignored) { } } break; }

Target:
switch (logger) { case "slf4j": setLoggerAdapter(new Slf4jLoggerAdapter()); break; case "jcl": setLoggerAdapter(new JclLoggerAdapter()); break; case "log4j": setLoggerAdapter(new Log4jLoggerAdapter()); break; case "jdk": setLoggerAdapter(new JdkLoggerAdapter()); break; case "log4j2": setLoggerAdapter(new Log4j2LoggerAdapter()); break; default: List<Class<? extends LoggerAdapter>> candidates = Arrays.asList( Log4jLoggerAdapter.class, Slf4jLoggerAdapter.class, Log4j2LoggerAdapter.class, JclLoggerAdapter.class, JdkLoggerAdapter.class ); for (Class<? extends LoggerAdapter> clazz : candidates) { try { setLoggerAdapter(clazz.newInstance()); break; } catch (Throwable ignored) { } } }
Source:
public TriggerBasedScheduleLoader(final TriggerManager triggerManager) { this.triggerManager = triggerManager; this.triggerSource = ScheduleManager.triggerSource; }

Target:
public TriggerBasedScheduleLoader(final TriggerManager triggerManager) { this.triggerManager = triggerManager; this.triggerSource = ScheduleManager.SIMPLE_TIME_TRIGGER; }
Source:
private void exit() { process.destroy(); try { process.waitFor(); } catch ( InterruptedException ex ) { Thread.currentThread().interrupt(); throw new RuntimeException( "Interrupted whilst waiting for forced stub shutdown", ex); } }

Target:
private void exit() { process.destroy(); try { process.waitFor(); } catch ( InterruptedException ex ) { throw new RuntimeException( "Interrupted whilst waiting for forced stub shutdown", ex); } }
Source:
WorkbenchConfigurer getWorkbenchConfigurer() { if (workbenchConfigurer == null) { workbenchConfigurer = new WorkbenchConfigurer(e4Context); } return workbenchConfigurer; }

Target:
WorkbenchConfigurer getWorkbenchConfigurer() { if (workbenchConfigurer == null) { workbenchConfigurer = ContextInjectionFactory.make(WorkbenchConfigurer.class, e4Context); } return workbenchConfigurer; }
Source:
public <T> Configuration getEffectiveConfiguration( final CustomCommandLine activeCustomCommandLine, final CommandLine commandLine, final ProgramOptions programOptions, final List<T> jobJars) throws FlinkException { final ExecutionConfigAccessor executionParameters = ExecutionConfigAccessor.fromProgramOptions( checkNotNull(programOptions), checkNotNull(jobJars)); final Configuration executorConfig = checkNotNull(activeCustomCommandLine) .applyCommandLineOptionsToConfiguration(commandLine); final Configuration effectiveConfiguration = new Configuration(executorConfig); executionParameters.applyToConfiguration(effectiveConfiguration); LOG.debug("Effective executor configuration: {}", effectiveConfiguration); return effectiveConfiguration; }

Target:
private <T> Configuration getEffectiveConfiguration( final CustomCommandLine activeCustomCommandLine, final CommandLine commandLine, final ProgramOptions programOptions, final List<T> jobJars) throws FlinkException { final ExecutionConfigAccessor executionParameters = ExecutionConfigAccessor.fromProgramOptions( checkNotNull(programOptions), checkNotNull(jobJars)); final Configuration executorConfig = checkNotNull(activeCustomCommandLine) .applyCommandLineOptionsToConfiguration(commandLine); final Configuration effectiveConfiguration = new Configuration(executorConfig); executionParameters.applyToConfiguration(effectiveConfiguration); LOG.debug("Effective executor configuration: {}", effectiveConfiguration); return effectiveConfiguration; }
Source:
public AdminSourcePollerServiceBean(ConfigurationAdmin configurationAdmin) { bundleContext = getBundleContext(); this.configurationAdmin = configurationAdmin; mBeanServer = ManagementFactory.getPlatformMBeanServer(); ObjectName objName = null; try { objName = new ObjectName(AdminSourcePollerServiceBean.class.getName() + SERVICE_NAME); } catch (MalformedObjectNameException e) { LOGGER.error("Unable to create Admin Source Poller Service MBean with name [{}].", AdminSourcePollerServiceBean.class.getName() + SERVICE_NAME, e); } objectName = objName; }

Target:
public AdminSourcePollerServiceBean(ConfigurationAdmin configurationAdmin) { helper = getHelper(); helper.configurationAdmin = configurationAdmin; mBeanServer = ManagementFactory.getPlatformMBeanServer(); ObjectName objName = null; try { objName = new ObjectName(AdminSourcePollerServiceBean.class.getName() + SERVICE_NAME); } catch (MalformedObjectNameException e) { LOGGER.error("Unable to create Admin Source Poller Service MBean with name [{}].", AdminSourcePollerServiceBean.class.getName() + SERVICE_NAME, e); } objectName = objName; }
Source:
private void moveDocument(Exchange exchange) throws Exception { validateRequiredHeader(exchange, CamelCMISConstants.CMIS_DESTIONATION_FOLDER_ID); validateRequiredHeader(exchange, CamelCMISConstants.CMIS_SOURCE_FOLDER_ID); validateRequiredHeader(exchange, CamelCMISConstants.CMIS_OBJECT_ID); Message message = exchange.getIn(); String destinationFolderId = message.getHeader(CamelCMISConstants.CMIS_DESTIONATION_FOLDER_ID, String.class); String sourceFolderId = message.getHeader(CamelCMISConstants.CMIS_SOURCE_FOLDER_ID, String.class); String objectId = message.getHeader(CamelCMISConstants.CMIS_OBJECT_ID, String.class); Folder sourceFolder = (Folder) getSessionFacade().getObjectById(sourceFolderId); Folder targetFolder = (Folder) getSessionFacade().getObjectById(destinationFolderId); Document document = (Document) getSessionFacade().getObjectById(objectId); if(document != null) { if(document.getAllowableActions().getAllowableActions().contains(Action.CAN_MOVE_OBJECT) == false) { throw new CmisUnauthorizedException("Current user does not have permission to move " + objectId + document.getName()); } try { document.move(sourceFolder, targetFolder); log.info("Moved document from " + sourceFolder.getName() + " to " + targetFolder.getName() ); } catch (CmisRuntimeException e) { log.error("Cannot move document to folder " + targetFolder.getName() + " : " + e.getMessage()); } } else { log.error("Document is null, cannot move!"); } }

Target:
public void moveDocument(Exchange exchange) throws Exception { validateRequiredHeader(exchange, CamelCMISConstants.CMIS_DESTIONATION_FOLDER_ID); validateRequiredHeader(exchange, CamelCMISConstants.CMIS_SOURCE_FOLDER_ID); validateRequiredHeader(exchange, CamelCMISConstants.CMIS_OBJECT_ID); Message message = exchange.getIn(); String destinationFolderId = message.getHeader(CamelCMISConstants.CMIS_DESTIONATION_FOLDER_ID, String.class); String sourceFolderId = message.getHeader(CamelCMISConstants.CMIS_SOURCE_FOLDER_ID, String.class); String objectId = message.getHeader(CamelCMISConstants.CMIS_OBJECT_ID, String.class); Folder sourceFolder = (Folder) getSessionFacade().getObjectById(sourceFolderId); Folder targetFolder = (Folder) getSessionFacade().getObjectById(destinationFolderId); Document document = (Document) getSessionFacade().getObjectById(objectId); if (document != null) { if (!document.getAllowableActions().getAllowableActions().contains(Action.CAN_MOVE_OBJECT)) { throw new CamelCmisUnauthorizedException("Current user does not have permission to move " + objectId + document.getName()); } try { document.move(sourceFolder, targetFolder); log.info("Moved document from " + sourceFolder.getName() + " to " + targetFolder.getName()); } catch (Exception e) { throw new CamelCmisException("Cannot move document to folder " + targetFolder.getName() + " : " + e.getMessage(), e); } } else { log.error("Document is null, cannot move!"); } }
Source:
public static final byte[] readFully(final InputStream in, int sizeHint) throws IOException { final ByteArrayOutputStream bos = new ByteArrayOutputStream(sizeHint); final byte[] buf = new byte[2048]; for (;;) { final int read = in.read(buf, 0, buf.length); if (read == -1) { return bos.toByteArray(); } bos.write(buf, 0, read); } }

Target:
public static final byte[] readFully(final InputStream in, int sizeHint) throws IOException { byte[] out = new byte[sizeHint]; int pos = 0; while (pos < out.length) { int read = in.read(out, pos, out.length - pos); if (read < 0) { byte[] res = new byte[pos]; System.arraycopy(out, 0, res, 0, pos); return res; } pos += read; } int last = in.read(); if (last < 0) return out; TemporaryBuffer.Heap tmp = new TemporaryBuffer.Heap(Integer.MAX_VALUE); tmp.write(out); tmp.write(last); tmp.copy(in); return tmp.toByteArray(); }
Source:
List<MonitoringHandler> extractRuleSections( File file, String fileContent, Properties params ) { StringBuilder sb = new StringBuilder(); List<String> sections = new ArrayList<String>(); for( String s : Arrays.asList( fileContent.trim().split( "\n" ))) { s = s.trim(); if( s.length() == 0 || s.startsWith( COMMENT_DELIMITER )) continue; if( s.toLowerCase().startsWith( RULE_BEGINNING )) { if(sb.length() > 0) sections.add( sb.toString()); sb.setLength( 0 ); } sb.append( expandString(s, params) + "\n" ); } if(sb.length() > 0) sections.add( sb.toString()); List<MonitoringHandler> result = new ArrayList<MonitoringHandler> (); for( String s : sections ) { if( s.length() == 0 ) continue; Matcher m = this.eventPattern.matcher( s ); if( ! m.find()) continue; s = s.substring( m.end()).trim(); MonitoringHandler handler = createHandler( m.group( 1 ), m.group( 2 ), s ); if( handler != null ) result.add( handler ); else this.logger.warning( "No monitoring handler matched parser ID '" + m.group( 1 ) + "' in " + file + "." ); } return result; }

Target:
List<MonitoringHandler> extractRuleSections( File file, String fileContent, Properties params ) { StringBuilder sb = new StringBuilder(); List<String> sections = new ArrayList<String>(); for( String s : Arrays.asList( fileContent.trim().split( "\n" ))) { s = s.trim(); if( s.length() == 0 || s.startsWith( COMMENT_DELIMITER )) continue; if( s.toLowerCase().startsWith( RULE_BEGINNING )) { addSectionIfNotEmpty(sections, sb.toString()); sb.setLength( 0 ); } sb.append( expandString(s, params) + "\n" ); } addSectionIfNotEmpty(sections, sb.toString()); List<MonitoringHandler> result = new ArrayList<MonitoringHandler> (); for( String s : sections ) { if( s.length() == 0 ) continue; Matcher m = this.eventPattern.matcher( s ); if( ! m.find()) continue; s = s.substring( m.end()).trim(); MonitoringHandler handler = createHandler( m.group( 1 ), m.group( 2 ), s ); if( handler != null ) result.add( handler ); else this.logger.warning( "No monitoring handler matched parser ID '" + m.group( 1 ) + "' in " + file + "." ); } return result; }
Source:
public synchronized Realm getManagementRealm() { if (managementRealmConfig == null) { String managementUrl = getManagementRealmUrl(syncUser.getAuthenticationUrl()); managementRealmConfig = new SyncConfiguration.Builder(this, managementUrl) .modules(new PermissionModule()) .build(); } return Realm.getInstance(managementRealmConfig); }

Target:
public Realm getManagementRealm() { synchronized (this) { if (managementRealmConfig == null) { String managementUrl = getManagementRealmUrl(syncUser.getAuthenticationUrl()); managementRealmConfig = new SyncConfiguration.Builder(this, managementUrl) .modules(new PermissionModule()) .build(); } } return Realm.getInstance(managementRealmConfig); }
Source:
public ICPPEvaluation computeForFunctionCall(ActivationRecord record, ConstexprEvaluationContext context) { final ICPPEvaluation ownerEval = getOwnerEval(record); if (fMember instanceof ICPPMethod) { EvalBinding evalBinding = new EvalBinding(fMember, fType, getTemplateDefinition()); return evalBinding; } if(ownerEval == null) { return this; } int fieldPos = CPPASTFieldReference.getFieldPosition(fMember, fOwnerType); ICPPEvaluation evaluatedOwner = ownerEval.computeForFunctionCall(record, context); if (evaluatedOwner instanceof EvalPointer) { evaluatedOwner = ((EvalPointer) evaluatedOwner).dereference(); } if(fMember instanceof ICPPField) { ICPPField field = (ICPPField) fMember; if(field.getType() instanceof IArrayType) { EvalPointer evalPointer = new EvalPointer(record, new EvalCompositeAccess(new EvalCompositeAccess(evaluatedOwner, fieldPos), 0), evaluatedOwner.getValue(null).get(fieldPos).getTemplateDefinition()); return evalPointer; } } EvalReference evalRef = new EvalReference(record, new EvalCompositeAccess(evaluatedOwner, fieldPos), evaluatedOwner.getValue(null).get(fieldPos).getTemplateDefinition()); return evalRef; }

Target:
public ICPPEvaluation computeForFunctionCall(ActivationRecord record, ConstexprEvaluationContext context) { final ICPPEvaluation ownerEval = getOwnerEval(record); if (fMember instanceof ICPPMethod) { EvalBinding evalBinding = new EvalBinding(fMember, fType, getTemplateDefinition()); return evalBinding; } if(ownerEval == null) { return this; } int fieldPos = CPPASTFieldReference.getFieldPosition(fMember, fOwnerType); ICPPEvaluation evaluatedOwner = ownerEval.computeForFunctionCall(record, context); if (evaluatedOwner instanceof EvalPointer) { evaluatedOwner = ((EvalPointer) evaluatedOwner).dereference(); } if(fMember instanceof ICPPField) { ICPPField field = (ICPPField) fMember; if(field.getType() instanceof IArrayType) { EvalPointer evalPointer = new EvalPointer(record, new EvalCompositeAccess(new EvalCompositeAccess(evaluatedOwner, fieldPos), 0), getTemplateDefinition()); return evalPointer; } } EvalReference evalRef = new EvalReference(record, new EvalCompositeAccess(evaluatedOwner, fieldPos), getTemplateDefinition()); return evalRef; }
Source:
private Address(String address, String personal, boolean parse) { if (parse) { Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(address); if (tokens.length > 0) { Rfc822Token token = tokens[0]; mAddress = token.getAddress(); String name = token.getName(); if (!TextUtils.isEmpty(name)) { mPersonal = name; } else { mPersonal = (personal == null) ? null : personal.trim(); } } else { Timber.e(new IllegalArgumentException(), "address " + address + " is invalid"); } } else { mAddress = address; mPersonal = personal; } }

Target:
private Address(String address, String personal, boolean parse) { if (parse) { Rfc822Token[] tokens = Rfc822Tokenizer.tokenize(address); if (tokens.length > 0) { Rfc822Token token = tokens[0]; mAddress = token.getAddress(); String name = token.getName(); if (!TextUtils.isEmpty(name)) { mPersonal = name; } else { mPersonal = (personal == null) ? null : personal.trim(); } } else { Timber.e("Invalid address: %s", address); } } else { mAddress = address; mPersonal = personal; } }
Source:
public void addLegacyPasspointConfigWithCertCredential() throws Exception { String fqdn = "test.com"; String friendlyName = "Friendly Name"; long[] rcOIs = new long[] {0x1234L, 0x2345L}; String realm = "realm.com"; String caCertificateAlias = "CaCert"; String clientCertificateAlias = "ClientCert"; WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.FQDN = fqdn; wifiConfig.providerFriendlyName = friendlyName; wifiConfig.roamingConsortiumIds = rcOIs; wifiConfig.enterpriseConfig.setRealm(realm); wifiConfig.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS); wifiConfig.enterpriseConfig.setCaCertificateAlias(caCertificateAlias); wifiConfig.enterpriseConfig.setClientCertificateAlias(clientCertificateAlias); PasspointConfiguration passpointConfig = new PasspointConfiguration(); HomeSp homeSp = new HomeSp(); homeSp.setFqdn(fqdn); homeSp.setFriendlyName(friendlyName); homeSp.setRoamingConsortiumOis(rcOIs); passpointConfig.setHomeSp(homeSp); Credential credential = new Credential(); Credential.CertificateCredential certCredential = new Credential.CertificateCredential(); certCredential.setCertType("x509v3"); credential.setCertCredential(certCredential); credential.setRealm(realm); passpointConfig.setCredential(credential); assertTrue(PasspointManager.addLegacyPasspointConfig(wifiConfig)); verifyInstalledConfig(passpointConfig); }

Target:
public void addLegacyPasspointConfigWithCertCredential() throws Exception { String fqdn = "test.com"; String friendlyName = "Friendly Name"; long[] rcOIs = new long[] {0x1234L, 0x2345L}; String realm = "realm.com"; String caCertificateAlias = "CaCert"; String clientCertificateAlias = "ClientCert"; WifiConfiguration wifiConfig = new WifiConfiguration(); wifiConfig.FQDN = fqdn; wifiConfig.providerFriendlyName = friendlyName; wifiConfig.roamingConsortiumIds = rcOIs; wifiConfig.enterpriseConfig.setRealm(realm); wifiConfig.enterpriseConfig.setEapMethod(WifiEnterpriseConfig.Eap.TLS); wifiConfig.enterpriseConfig.setCaCertificateAlias(caCertificateAlias); wifiConfig.enterpriseConfig.setClientCertificateAlias(clientCertificateAlias); PasspointConfiguration passpointConfig = new PasspointConfiguration(); HomeSp homeSp = new HomeSp(); homeSp.setFqdn(fqdn); homeSp.setFriendlyName(friendlyName); homeSp.setRoamingConsortiumOis(rcOIs); passpointConfig.setHomeSp(homeSp); Credential credential = new Credential(); Credential.CertificateCredential certCredential = new Credential.CertificateCredential(); certCredential.setCertType(Credential.CertificateCredential.CERT_TYPE_X509V3); credential.setCertCredential(certCredential); credential.setRealm(realm); passpointConfig.setCredential(credential); assertTrue(PasspointManager.addLegacyPasspointConfig(wifiConfig)); verifyInstalledConfig(passpointConfig); }
Source:
void setNewElementYPosition(final Element elementReference, final Element newElement) { int referencePosition = getDndListComponent().getPositionY(elementReference); getDndListComponent().setPositionY(newElement, referencePosition); }

Target:
void setNewElementYPosition(final Element elementReference, final Element newElement) { final int referencePosition = getDndListComponent().getPositionY(elementReference); getDndListComponent().setPositionY(newElement, referencePosition); }
Source:
protected void performOvfUpdate(StoragePool pool, Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata) { if (ovfOnAnyDomainSupported(pool)) { markDomainsWithOvfsForOvfUpdate(vmsAndTemplateMetadata.keySet()); } else if (!getParameters().isUpdateOnlyDB()) { getOvfUpdateProcessHelper().executeUpdateVmInSpmCommand(pool.getId(), vmsAndTemplateMetadata, Guid.Empty); } int i = 0; while (i < proccessedIdsInfo.size()) { int sizeToUpdate = Math.min(StorageConstants.OVF_MAX_ITEMS_PER_SQL_STATEMENT, proccessedIdsInfo.size() - i); List<Guid> guidsForUpdate = proccessedIdsInfo.subList(i, i + sizeToUpdate); List<Long> ovfGenerationsForUpdate = proccessedOvfGenerationsInfo.subList(i, i + sizeToUpdate); List<String> ovfConfigurationsInfo = proccessedOvfConfigurationsInfo.subList(i, i + sizeToUpdate); getVmAndTemplatesGenerationsDao().updateOvfGenerations(guidsForUpdate, ovfGenerationsForUpdate, ovfConfigurationsInfo); i += sizeToUpdate; initProcessedInfoLists(); } }

Target:
protected void performOvfUpdate(StoragePool pool, Map<Guid, KeyValuePairCompat<String, List<Guid>>> vmsAndTemplateMetadata) { if (ovfOnAnyDomainSupported(pool)) { markDomainsWithOvfsForOvfUpdate(vmsAndTemplateMetadata.keySet()); } else if (getParameters().isUpdateStorage()) { getOvfUpdateProcessHelper().executeUpdateVmInSpmCommand(pool.getId(), vmsAndTemplateMetadata, Guid.Empty); } else { log.info("No storage update was performed."); } int i = 0; while (i < proccessedIdsInfo.size()) { int sizeToUpdate = Math.min(StorageConstants.OVF_MAX_ITEMS_PER_SQL_STATEMENT, proccessedIdsInfo.size() - i); List<Guid> guidsForUpdate = proccessedIdsInfo.subList(i, i + sizeToUpdate); List<Long> ovfGenerationsForUpdate = proccessedOvfGenerationsInfo.subList(i, i + sizeToUpdate); List<String> ovfConfigurationsInfo = proccessedOvfConfigurationsInfo.subList(i, i + sizeToUpdate); getVmAndTemplatesGenerationsDao().updateOvfGenerations(guidsForUpdate, ovfGenerationsForUpdate, ovfConfigurationsInfo); i += sizeToUpdate; initProcessedInfoLists(); } }
Source:
public Mono<ResponseEntity<?>> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { return handleExceptions(() -> { return wrapBlocking(() -> { WorkflowInstance instance = createWorkflowConverter.convert(req); long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); }); }); }

Target:
public Mono<ResponseEntity<?>> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { return handleExceptions(() -> wrapBlocking(() -> { WorkflowInstance instance = createWorkflowConverter.convert(req); long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); })); }
Source:
private void setupNullsFilter() { int count = topLevelOffsets[topLevelOffsetCount - 1]; nullsAllowed = ensureCapacity(nullsAllowed, count); nonNullsAllowed = ensureCapacity(nonNullsAllowed, count); for (int i = 0; i < count; i++) { long filter = elementFilters[i] & nullFilters; if (filter > 0) { TupleDomainFilter tupleDomainFilter = tupleDomainFilters[Long.numberOfTrailingZeros(filter)]; nullsAllowed[i] = tupleDomainFilter == IS_NULL; nonNullsAllowed[i] = tupleDomainFilter == IS_NOT_NULL; } else { nullsAllowed[i] = true; nonNullsAllowed[i] = true; } } nullsFilter.setup(nullsAllowed, nonNullsAllowed, topLevelOffsets); }

Target:
private void setupNullsFilter() { int count = topLevelOffsets[topLevelOffsetCount - 1]; nullsAllowed = ensureCapacity(nullsAllowed, count); nonNullsAllowed = ensureCapacity(nonNullsAllowed, count); for (int i = 0; i < count; i++) { long filter = elementFilters[i] & nullFilters; if (filter > 0) { TupleDomainFilter tupleDomainFilter = tupleDomainFilters[numberOfTrailingZeros(filter)]; nullsAllowed[i] = tupleDomainFilter == IS_NULL; nonNullsAllowed[i] = tupleDomainFilter == IS_NOT_NULL; } else { nullsAllowed[i] = true; nonNullsAllowed[i] = true; } } nullsFilter.setup(nullsAllowed, nonNullsAllowed, topLevelOffsets); }
Source:
public FlowControllingStreamObserver(StreamObserver<T> wrappedStreamObserver, AxonServerConfiguration configuration, Function<FlowControl, T> requestWrapper, Predicate<T> isConfirmationMessage) { this.wrappedStreamObserver = wrappedStreamObserver; this.clientId = configuration.getClientId(); this.remainingPermits = new AtomicLong( configuration.getInitialNrOfPermits().longValue() - configuration.getNewPermitsThreshold().longValue() ); this.newPermits = configuration.getNrOfNewPermits(); this.initialNrofPermits=configuration.getInitialNrOfPermits(); this.newPermitsRequest = requestWrapper.apply(createRequest(newPermits)); this.isConfirmationMessage = isConfirmationMessage; this.requestWrapper = requestWrapper; }

Target:
public FlowControllingStreamObserver(StreamObserver<T> wrappedStreamObserver, AxonServerConfiguration configuration, Function<FlowControl, T> requestWrapper, Predicate<T> isConfirmationMessage) { this(wrappedStreamObserver, configuration.getClientId(), configuration.getDefaultFlowControlConfiguration(), requestWrapper, isConfirmationMessage); }