auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void beforeDocumentSaving(@NotNull final Document document) { if (!document.isWritable()) { return; } final Project[] projects = ProjectManager.getInstance().getOpenProjects(); if (projects.length == 0) { return; } final VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file == null || file.getFileType() != GoFileType.INSTANCE) { return; } Project project = null; for (Project possibleProject : projects) { if (ProjectRootManager.getInstance(possibleProject).getFileIndex().getSourceRootForFile(file) != null || ProjectRootManager.getInstance(possibleProject).getFileIndex().getContentRootForFile(file) != null) { project = possibleProject; break; } } if (project == null) { return; } GoProjectSettings.GoProjectSettingsBean settings = GoProjectSettings.getInstance(project).getState(); final Project p = project; if (settings.goimportsOnSave) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { if (p.isDisposed()) { return; } ProcessFileWithGoImports(p, file); } }); } else if (settings.goFmtOnSave) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { if (p.isDisposed()) { return; } ProcessFileWithGoFmt(p, file); } }); } }

Target:
public void beforeDocumentSaving(@NotNull final Document document) { if (!document.isWritable()) { return; } final VirtualFile file = FileDocumentManager.getInstance().getFile(document); if (file == null || file.getFileType() != GoFileType.INSTANCE) { return; } Project project = ProjectUtil.guessProjectForContentFile(file, GoFileType.INSTANCE); if (project == null) { return; } final PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document); if (psiFile == null) { return; } GoApplicationSettings.GoApplicationSettingsBean settings = GoApplicationSettings.getInstance().getState(); final Project finalProject = project; if (settings.goimportsOnSave) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { if (finalProject.isDisposed()) { return; } try { new GoImportsFileAction().doSomething(psiFile, finalProject, file, ""); } catch (ExecutionException ignored) { } } }); } else if (settings.goFmtOnSave) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { if (finalProject.isDisposed()) { return; } try { new GoFmtFileAction().doSomething(psiFile, finalProject, file, ""); } catch (ExecutionException ignored) { } } }); } }
Source:
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof GetServerInfoOperation) { if (operation.hashCode() == mWaitingForOpId) { onGetServerInfoFinish(result); } } else if (operation instanceof OAuth2GetAccessToken) { onGetOAuthAccessTokenFinish(result); } else if (operation instanceof GetRemoteUserNameOperation) { onGetUserNameFinish(result); } if (result.isSuccess() && mAction == ACTION_UPDATE_EXPIRED_TOKEN) { setResult(FileActivity.RESULT_OK); } }

Target:
public void onRemoteOperationFinish(RemoteOperation operation, RemoteOperationResult result) { if (operation instanceof GetServerInfoOperation) { if (operation.hashCode() == mWaitingForOpId) { onGetServerInfoFinish(result); } } else if (operation instanceof OAuth2GetAccessToken) { onGetOAuthAccessTokenFinish(result); } else if (operation instanceof GetRemoteUserNameOperation) { onGetUserNameFinish(result); } if (result.isSuccess() && mAction == ACTION_UPDATE_EXPIRED_TOKEN) { setResult(Activity.RESULT_OK); } }
Source:
private void loadData() { final ISegmentStoreProvider cga = getCga(); UIThreadRunnable.syncExec(() -> { fTableViewer.setData(cga); fDensityViewer.setSegmentProvider(cga); fDensityViewer.updateWithRange(TmfTimeRange.ETERNITY); fDensityViewer.refresh(); fTableViewer.refresh(); }); if (cga != null) { try { assertTrue(fLatch.await(20, TimeUnit.SECONDS)); } catch (InterruptedException e) { fail(e.getMessage()); } } setCga(null); }

Target:
private void loadData() { final ISegmentStoreProvider cga = getCga(); UIThreadRunnable.syncExec(() -> { fTableViewer.setData(cga); fDensityViewer.setSegmentProvider(cga); fDensityViewer.updateWithRange(TmfTimeRange.ETERNITY); fDensityViewer.refresh(); fTableViewer.refresh(); }); if (cga != null) { try { assertTrue(fLatch.await(20, TimeUnit.SECONDS)); } catch (InterruptedException e) { fail(e.getMessage()); } } }
Source:
public void shouldThrowIfRightGetLeft() { assertThat(Right(1).getLeft()); }

Target:
public void shouldThrowIfRightGetLeft() { Right(1).getLeft(); }
Source:
protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService(job.getJobDataSpaceApplication().getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); HashMap<String, String> gInfo = new HashMap<>(); gInfo.putAll(job.getGenericInformation()); gInfo.putAll(getGenericInformation()); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }

Target:
protected TaskLauncherInitializer getDefaultTaskLauncherInitializer(InternalJob job) { TaskLauncherInitializer tli = new TaskLauncherInitializer(); tli.setTaskId(getId()); tli.setJobOwner(job.getJobInfo().getJobOwner()); tli.setPreScript(getPreScript()); tli.setPostScript(getPostScript()); tli.setControlFlowScript(getFlowScript()); tli.setTaskInputFiles(getInputFilesList()); tli.setTaskOutputFiles(getOutputFilesList()); tli.setNamingService(job.getJobDataSpaceApplication().getNamingServiceStub()); tli.setIterationIndex(getIterationIndex()); tli.setReplicationIndex(getReplicationIndex()); Map<String, String> gInfo = getGenericInformationOverridden(job); tli.setGenericInformation(gInfo); tli.setForkEnvironment(getForkEnvironment()); if (isWallTimeSet()) { tli.setWalltime(wallTime); } tli.setPreciousLogs(isPreciousLogs()); tli.setVariables(job.getVariables()); tli.setPingPeriod(PASchedulerProperties.SCHEDULER_NODE_PING_FREQUENCY.getValueAsInt()); tli.setPingAttempts(PASchedulerProperties.SCHEDULER_NODE_PING_ATTEMPTS.getValueAsInt()); return tli; }
Source:
public void shouldReloadSchedulableMaterialsOnConfigRepoChange() { Set<MaterialConfig> schedulableMaterialConfigs = new HashSet<>(Arrays.asList(svnMaterial.config())); when(goConfigService.getSchedulableSCMMaterials()).thenReturn(schedulableMaterialConfigs); when(materialConfigConverter.toMaterials(schedulableMaterialConfigs)).thenReturn(new HashSet<>(Arrays.asList(svnMaterial))); Set<Material> materials = source.materialsForUpdate(); assertThat(materials.size(), is(1)); assertTrue(materials.contains(svnMaterial)); schedulableMaterialConfigs = new HashSet<>(Arrays.asList(svnMaterial.config(), gitMaterial.config())); when(goConfigService.getSchedulableSCMMaterials()).thenReturn(schedulableMaterialConfigs); when(materialConfigConverter.toMaterials(schedulableMaterialConfigs)).thenReturn(new HashSet<>(Arrays.asList(svnMaterial, gitMaterial))); when(serverHealthService.getAllLogs()).thenReturn(new ServerHealthStates()); source.onEntityConfigChange(mock(ConfigRepoConfig.class)); materials = source.materialsForUpdate(); assertThat(materials.size(), is(2)); assertTrue(materials.contains(svnMaterial)); assertTrue(materials.contains(gitMaterial)); }

Target:
public void shouldReloadSchedulableMaterialsOnConfigRepoChange() { Set<MaterialConfig> schedulableMaterialConfigs = new HashSet<>(Arrays.asList(svnMaterial.config(), gitMaterial.config())); when(goConfigService.getSchedulableSCMMaterials()).thenReturn(schedulableMaterialConfigs); when(materialConfigConverter.toMaterials(schedulableMaterialConfigs)).thenReturn(new HashSet<>(Arrays.asList(svnMaterial, gitMaterial))); when(serverHealthService.getAllLogs()).thenReturn(new ServerHealthStates()); source.onEntityConfigChange(mock(ConfigRepoConfig.class)); Set<Material> materials = source.materialsForUpdate(); assertThat(materials.size(), is(2)); assertTrue(materials.contains(svnMaterial)); assertTrue(materials.contains(gitMaterial)); }
Source:
public CTFCallsite getCallsite(String eventName, long ip) { final LinkedList<CTFCallsite> candidates = callsitesByName.get(eventName); final CTFCallsite dummyCs = new CTFCallsite(null, null, ip, null, -1); final int pos = Collections.binarySearch(candidates, dummyCs) + 1; if (pos >= candidates.size()) { return null; } if (pos < 0) { if (candidates.size() > -pos) { return candidates.get(-pos); } return candidates.getFirst(); } return candidates.get(pos); }

Target:
public CTFCallsite getCallsite(String eventName, long ip) { final TreeSet<CTFCallsite> candidates = callsitesByName.get(eventName); final CTFCallsite dummyCs = new CTFCallsite(null, null, ip, null, -1); final CTFCallsite callsite = candidates.ceiling(dummyCs); if(callsite == null){ return candidates.floor(dummyCs); } return callsite; }
Source:
public boolean shouldRetryRequest(HttpCommand command, IOException error) { return isSafeToRetryOnException(command) && ifReplayableBackoffAndReturnTrue(command); }

Target:
public boolean shouldRetryRequest(HttpCommand command, IOException error) { return ifReplayableBackoffAndReturnTrue(command); }
Source:
public void testFloatUDF() { HiveSimpleUDF udf = init(FloatUDF.class, new DataType[]{ DataTypes.FLOAT()}); assertEquals((float) udf.eval(3.0f), 3.0f, 1.0); }

Target:
public void testFloatUDF() { HiveSimpleUDF udf = init(FloatUDF.class, new DataType[]{ DataTypes.FLOAT()}); assertEquals(3.0f, (float) udf.eval(3.0f), 0); }
Source:
private Class<?> resolveDomainType(Class<?> repositoryInterface) { Assert.notNull(repositoryInterface, "RepositoryInterface must not be null!"); Class<?>[] arguments = resolveTypeArguments(repositoryInterface, Repository.class); return arguments == null ? null : arguments[0]; }

Target:
private Class<?> resolveDomainType(Class<?> repositoryInterface) { Class<?>[] arguments = resolveTypeArguments(repositoryInterface, Repository.class); if (arguments == null || arguments[0] == null) { throw new IllegalArgumentException(String.format("Could not resolve domain type of %s!", repositoryInterface)); } return arguments[0]; }
Source:
public static NotificationListenerManager get() { if (INSTANCE == null) { INSTANCE = new NotificationListenerManager(); } return INSTANCE; }

Target:
public static NotificationListenerManager get() { return INSTANCE; }
Source:
protected void writeEntries() { if (entries.get().isEmpty()) { return; } StreamManager streamManager = getStreamManager(); for (LogEntry entry : entries.get()) { Record record = recordOf(entry); if (entry != null) { streamManager.append(STREAM_NAME, record); } } }

Target:
protected void writeEntries() { if (entries.get().isEmpty()) { return; } StreamManager streamManager = getStreamManager(); for (LogEntry entry : entries.get()) { if (entry != null) { Record record = recordOf(entry); streamManager.append(STREAM_NAME, record); } } }
Source:
private boolean performInternal(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { if (!SonarInstallation.isValid(getInstallationName(), listener)) { return false; } ArgumentListBuilder args = new ArgumentListBuilder(); EnvVars env = run.getEnvironment(listener); if (run instanceof AbstractBuild) { env.overrideAll(((AbstractBuild<?, ?>) run).getBuildVariables()); } SonarRunnerInstallation sri = getSonarRunnerInstallation(); if (sri == null) { args.add(launcher.isUnix() ? "sonar-runner" : "sonar-runner.bat"); } else { sri = sri.forNode(getComputer(workspace).getNode(), listener); sri = sri.forEnvironment(env); String exe = sri.getExecutable(launcher); if (exe == null) { Logger.printFailureMessage(listener); listener.fatalError(Messages.SonarRunner_ExecutableNotFound(sri.getName())); return false; } args.add(exe); env.put("SONAR_RUNNER_HOME", sri.getHome()); } addTaskArgument(args); addAdditionalOptions(args); args.add("-e"); ExtendedArgumentListBuilder argsBuilder = new ExtendedArgumentListBuilder(args, launcher.isUnix()); if (!populateConfiguration(argsBuilder, run, workspace, listener, env, getSonarInstallation())) { return false; } computeJdkToUse(run, workspace, listener, env); env.put("SONAR_RUNNER_OPTS", getJavaOpts()); long startTime = System.currentTimeMillis(); int r; try { r = executeSonarRunner(run, workspace, launcher, listener, args, env); } catch (IOException e) { handleErrors(run, listener, sri, startTime, e); r = -1; } return r == 0; }

Target:
private boolean performInternal(Run<?, ?> run, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException { if (!SonarInstallation.isValid(getInstallationName(), listener)) { return false; } ArgumentListBuilder args = new ArgumentListBuilder(); EnvVars env = run.getEnvironment(listener); if (run instanceof AbstractBuild) { env.overrideAll(((AbstractBuild<?, ?>) run).getBuildVariables()); } SonarRunnerInstallation sri = getSonarRunnerInstallation(); if (sri == null) { args.add(launcher.isUnix() ? "sonar-runner" : "sonar-runner.bat"); } else { sri = sri.forNode(getComputer(workspace).getNode(), listener); sri = sri.forEnvironment(env); String exe = sri.getExecutable(launcher); if (exe == null) { Logger.printFailureMessage(listener); listener.fatalError(Messages.SonarRunner_ExecutableNotFound(sri.getName())); return false; } args.add(exe); env.put("SONAR_RUNNER_HOME", sri.getHome()); } addTaskArgument(args); addAdditionalOptions(args); ExtendedArgumentListBuilder argsBuilder = new ExtendedArgumentListBuilder(args, launcher.isUnix()); if (!populateConfiguration(argsBuilder, run, workspace, listener, env, getSonarInstallation())) { return false; } computeJdkToUse(run, workspace, listener, env); env.put("SONAR_RUNNER_OPTS", getJavaOpts()); long startTime = System.currentTimeMillis(); int r; try { r = executeSonarRunner(run, workspace, launcher, listener, args, env); } catch (IOException e) { handleErrors(run, listener, sri, startTime, e); r = -1; } return r == 0; }
Source:
private Uri writeToFile(Bitmap bitmap) throws IOException { File temp = tempFile(); long tempFileSize = -1; int quality; do { quality = 100; do { trace(this, "writeToFile() :: Attempting to write bitmap=%s (%sx%s) to file=%s at quality=%s; size of last write=%s...", bitmap, bitmap.getWidth(), bitmap.getHeight(), temp, quality, tempFileSize); writeToFile(temp, bitmap, quality); quality -= 10; tempFileSize = temp.length(); if(tempFileSize <= MAX_FILE_SIZE) { trace(this, "writeToFile() :: wrote temp file %s with %s bytes (max size = %s bytes)", temp, tempFileSize, MAX_FILE_SIZE); return Uri.fromFile(temp); } } while(quality >= 0); bitmap = downsize(bitmap); } while(bitmap.getWidth() > MINIMUM_DIMENSION && bitmap.getHeight() > MINIMUM_DIMENSION); warn(this, "Failed to compress image small enough. Final quality=%s, tempFileSize=%s", quality, tempFileSize); return null; }

Target:
private Uri writeToFile(Bitmap bitmap) throws IOException { File temp = tempFile(); long tempFileSize = -1; int quality; do { for(quality=90; quality>=50; quality-=10) { trace(this, "writeToFile() :: Attempting to write bitmap=%s (%sx%s) to file=%s at quality=%s; size of last write=%s...", bitmap, bitmap.getWidth(), bitmap.getHeight(), temp, quality, tempFileSize); writeToFile(temp, bitmap, quality); tempFileSize = temp.length(); if(tempFileSize <= MAX_FILE_SIZE) { trace(this, "writeToFile() :: wrote temp file %s with %s bytes (max size = %s bytes)", temp, tempFileSize, MAX_FILE_SIZE); return Uri.fromFile(temp); } } bitmap = downsize(bitmap); } while(bitmap.getWidth() > MINIMUM_DIMENSION && bitmap.getHeight() > MINIMUM_DIMENSION); warn(this, "Failed to compress image small enough. Final quality=%s, tempFileSize=%s", quality, tempFileSize); return null; }
Source:
public static void main(String[] args) { Map<String, String> toolArguments = null; StringBuilder sb = new StringBuilder(); try { List<ModuleService> moduleServices = ExtensionsToolLoader.load(ModuleService.class); for(ModuleService moduleService : moduleServices) { sb.append(moduleService.getName() + " "); if ((args.length < 1) || !moduleService.getName().equals(args[0])) { continue; } toolArguments = moduleService.parseArguments(args); moduleService.run(toolArguments); } if(toolArguments == null) { if(args.length > 0) { System.out.println("Module '" + args[0] + "' was not found."); } System.out.println("Available modules: " + sb.toString()); } } catch (Throwable t) { t.printStackTrace(); System.exit(1); } }

Target:
public static void main(String[] args) { try { Map<String, String> argMap = parseArgs(args); Map<String, ModuleService> moduleServices = load(ModuleService.class); ModuleService moduleService = moduleServices.get(args[0]); if(args[0].equals(ARG_HELP)) { System.out.println(getUsage(moduleServices.keySet())); return; } if(moduleService != null) { moduleService.parseArguments(args); ExtensionsManager extensionsManager = new ExtensionsManager(); File config = new File(argMap.get(ARG_EXT_CONFIG)); if (!config.exists()) { throw new Exception("Could not find extension configuration at the specified path"); } extensionsManager.initialize(extensionsManager.load(config)); moduleService.run(extensionsManager); } else { System.out.println("No such " + args[0] + " module exists. To list existing modules use --help argument."); } } catch (Throwable t) { t.printStackTrace(); System.exit(1); } }
Source:
private JobManagerConnection associateWithJobManager( JobID jobID, ResourceID resourceID, JobMasterGateway jobMasterGateway) { checkNotNull(jobID); checkNotNull(resourceID); checkNotNull(jobMasterGateway); TaskManagerActions taskManagerActions = new TaskManagerActionsImpl(jobMasterGateway); CheckpointResponder checkpointResponder = new RpcCheckpointResponder(jobMasterGateway); GlobalAggregateManager aggregateManager = new RpcGlobalAggregateManager(jobMasterGateway); final LibraryCacheManager libraryCacheManager = new BlobLibraryCacheManager( blobCacheService.getPermanentBlobService(), taskManagerConfiguration.getClassLoaderResolveOrder(), taskManagerConfiguration.getAlwaysParentFirstLoaderPatterns(), fatalErrorHandler); ResultPartitionConsumableNotifier resultPartitionConsumableNotifier = new RpcResultPartitionConsumableNotifier( jobMasterGateway, getRpcService().getExecutor(), taskManagerConfiguration.getTimeout()); PartitionProducerStateChecker partitionStateChecker = new RpcPartitionStateChecker(jobMasterGateway); registerQueryableState(jobID, jobMasterGateway); return new JobManagerConnection( jobID, resourceID, jobMasterGateway, taskManagerActions, checkpointResponder, aggregateManager, libraryCacheManager, resultPartitionConsumableNotifier, partitionStateChecker); }

Target:
private JobManagerConnection associateWithJobManager( JobID jobID, ResourceID resourceID, JobMasterGateway jobMasterGateway) { checkNotNull(jobID); checkNotNull(resourceID); checkNotNull(jobMasterGateway); TaskManagerActions taskManagerActions = new TaskManagerActionsImpl(jobMasterGateway); CheckpointResponder checkpointResponder = new RpcCheckpointResponder(jobMasterGateway); GlobalAggregateManager aggregateManager = new RpcGlobalAggregateManager(jobMasterGateway); final boolean failOnJvmMetaspaceOomError = taskManagerConfiguration .getConfiguration() .getBoolean(CoreOptions.FAIL_ON_USER_CLASS_LOADING_METASPACE_OOM); final LibraryCacheManager libraryCacheManager = new BlobLibraryCacheManager( blobCacheService.getPermanentBlobService(), taskManagerConfiguration.getClassLoaderResolveOrder(), taskManagerConfiguration.getAlwaysParentFirstLoaderPatterns(), failOnJvmMetaspaceOomError ? fatalErrorHandler : null); ResultPartitionConsumableNotifier resultPartitionConsumableNotifier = new RpcResultPartitionConsumableNotifier( jobMasterGateway, getRpcService().getExecutor(), taskManagerConfiguration.getTimeout()); PartitionProducerStateChecker partitionStateChecker = new RpcPartitionStateChecker(jobMasterGateway); registerQueryableState(jobID, jobMasterGateway); return new JobManagerConnection( jobID, resourceID, jobMasterGateway, taskManagerActions, checkpointResponder, aggregateManager, libraryCacheManager, resultPartitionConsumableNotifier, partitionStateChecker); }
Source:
private void checkEventObjects(Object branchId, Object userArt) throws OseeArgumentException { if (!(branchId instanceof BranchId)) { throw new OseeArgumentException("BranchID provided to safety workflow creation event incorrect"); } if (!(userArt instanceof ArtifactReadable)) { throw new OseeArgumentException("User Artifact provided to safety workflow creation event incorrect"); } }

Target:
private void checkEventObjects(Object branchId, Object userArt) throws OseeArgumentException { if (!(branchId instanceof BranchId)) { throw new OseeArgumentException("BranchID provided to safety workflow creation event incorrect type: %s", branchId.toString()); } if (!(userArt instanceof ArtifactReadable)) { throw new OseeArgumentException("User Artifact provided to safety workflow creation event incorrect type: %s", userArt.toString()); } }
Source:
public Result mutateRow(RowMutations rm) throws IOException { final List<Mutation> m = rm.getMutations(); OperationStatus[] operationStatuses = batchMutate(m.toArray(new Mutation[0]), true, HConstants.NO_NONCE, HConstants.NO_NONCE); List<Result> results = Arrays.stream(operationStatuses) .filter(os -> os.getResult() != null) .map(OperationStatus::getResult) .collect(Collectors.toList()); if (results.isEmpty()) { return null; } return Result.create(results.stream() .filter(r -> r.rawCells() != null) .flatMap(r -> Arrays.stream(r.rawCells())) .collect(Collectors.toList())); }

Target:
public Result mutateRow(RowMutations rm) throws IOException { final List<Mutation> m = rm.getMutations(); OperationStatus[] statuses = batchMutate(m.toArray(new Mutation[0]), true, HConstants.NO_NONCE, HConstants.NO_NONCE); List<Result> results = new ArrayList<>(); for (OperationStatus status : statuses) { if (status.getResult() != null) { results.add(status.getResult()); } } if (results.isEmpty()) { return null; } List<Cell> cells = new ArrayList<>(); for (Result result : results) { if (result.rawCells() != null) { cells.addAll(Arrays.asList(result.rawCells())); } } return Result.create(cells); }
Source:
private List<PsiPackage> getTopLevelPackages() { Project myProject = presenterConfigModel.getProject(); ProjectViewSettings viewSettings = new ProjectViewSettings(); final List<VirtualFile> sourceRoots = new ArrayList<VirtualFile>(); final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject); ContainerUtil.addAll(sourceRoots, projectRootManager.getContentSourceRoots()); final PsiManager psiManager = PsiManager.getInstance(myProject); final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>(); final Set<PsiPackage> topLevelPackages = new HashSet<PsiPackage>(); for (final VirtualFile root : sourceRoots) { final PsiDirectory directory = psiManager.findDirectory(root); if (directory == null) { continue; } final PsiPackage directoryPackage = JavaDirectoryService.getInstance().getPackage(directory); if (directoryPackage == null || PackageUtil.isPackageDefault(directoryPackage)) { final PsiDirectory[] subdirectories = directory.getSubdirectories(); for (PsiDirectory subdirectory : subdirectories) { final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(subdirectory); if (aPackage != null && !PackageUtil.isPackageDefault(aPackage)) { topLevelPackages.add(aPackage); } } children.addAll(ProjectViewDirectoryHelper.getInstance(myProject).getDirectoryChildren(directory, viewSettings, false)); } else { topLevelPackages.add(directoryPackage); } } return new ArrayList<PsiPackage>(topLevelPackages); }

Target:
private List<PackageRoot> getTopLevelPackages() { Project myProject = presenterConfigModel.getProject(); ProjectViewSettings viewSettings = new ProjectViewSettings(); final List<VirtualFile> sourceRoots = new ArrayList<VirtualFile>(); final ProjectRootManager projectRootManager = ProjectRootManager.getInstance(myProject); ContainerUtil.addAll(sourceRoots, projectRootManager.getContentSourceRoots()); final PsiManager psiManager = PsiManager.getInstance(myProject); final List<AbstractTreeNode> children = new ArrayList<AbstractTreeNode>(); final Set<PackageRoot> topLevelPackages = new HashSet<PackageRoot>(); for (final VirtualFile root : sourceRoots) { final PsiDirectory directory = psiManager.findDirectory(root); if (directory == null) { continue; } final PsiPackage directoryPackage = JavaDirectoryService.getInstance().getPackage(directory); if (directoryPackage == null || PackageUtil.isPackageDefault(directoryPackage)) { final PsiDirectory[] subdirectories = directory.getSubdirectories(); for (PsiDirectory subdirectory : subdirectories) { final PsiPackage aPackage = JavaDirectoryService.getInstance().getPackage(subdirectory); if (aPackage != null && !PackageUtil.isPackageDefault(aPackage)) { PackageRoot packageRoot = new PackageRoot(root, aPackage); topLevelPackages.add(packageRoot); } } children.addAll(ProjectViewDirectoryHelper.getInstance(myProject).getDirectoryChildren(directory, viewSettings, false)); } else { PackageRoot packageRoot = new PackageRoot(root, directoryPackage); topLevelPackages.add(packageRoot); } } return new ArrayList<PackageRoot>(topLevelPackages); }
Source:
public List<Cue> getCues(long timeUs) { int index = Util.binarySearchFloor(cueTimesUs, timeUs, true, false); if (index == -1 || cues.get(index).isEmpty()) { return Collections.emptyList(); } else { return cues.get(index); } }

Target:
public List<Cue> getCues(long timeUs) { int index = Util.binarySearchFloor(cueTimesUs, timeUs, true, false); if (index == -1) { return Collections.emptyList(); } else { return cues.get(index); } }
Source:
public IFolder prepareTraceSupplementaryFolder(String supplFolderPath, boolean createFolder, IProgressMonitor progressMonitor) { IFolder folder = getTraceSupplementaryFolder(supplFolderPath); IFolder propertiesFolder = folder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER); if ((createFolder && propertiesFolder.exists() && propertiesFolder.isHidden()) || (!createFolder && folder.getParent().exists())) { return folder; } try { ICoreRunnable runnable = monitor -> { if (createFolder) { TraceUtils.createFolder(propertiesFolder, monitor); propertiesFolder.setHidden(true); } else { TraceUtils.createFolder((IFolder) folder.getParent(), monitor); } }; ResourcesPlugin.getWorkspace().run(runnable, folder.getProject(), IWorkspace.AVOID_UPDATE, progressMonitor); } catch (CoreException e) { Activator.getDefault().logError("Error creating supplementary folder " + folder.getFullPath(), e); } return folder; }

Target:
public IFolder prepareTraceSupplementaryFolder(String supplFolderPath, boolean createFolder, IProgressMonitor progressMonitor) { SubMonitor subMonitor = SubMonitor.convert(progressMonitor); IFolder folder = getTraceSupplementaryFolder(supplFolderPath); IFolder propertiesFolder = folder.getFolder(TmfCommonConstants.TRACE_PROPERTIES_FOLDER); if ((createFolder && propertiesFolder.exists() && propertiesFolder.isHidden()) || (!createFolder && folder.getParent().exists())) { return folder; } try { ICoreRunnable runnable = monitor -> { if (createFolder) { TraceUtils.createFolder(propertiesFolder, monitor); propertiesFolder.setHidden(true); } else { TraceUtils.createFolder((IFolder) folder.getParent(), monitor); } }; ResourcesPlugin.getWorkspace().run(runnable, folder.getProject(), IWorkspace.AVOID_UPDATE, subMonitor); } catch (CoreException e) { Activator.getDefault().logError("Error creating supplementary folder " + folder.getFullPath(), e); } return folder; }
Source:
public static @Nullable ITmfStateInterval querySingleStackTop(ITmfStateSystem ss, long t, int stackAttributeQuark) throws AttributeNotFoundException, StateSystemDisposedException { ITmfStateValue curStackStateValue = ss.querySingleState(t, stackAttributeQuark).getStateValue(); if (curStackStateValue.isNull()) { return null; } int curStackDepth = curStackStateValue.unboxInt(); if (curStackDepth <= 0) { String message = "A top-level stack attribute cannot " + "have a value of 0 or less."; throw new StateValueTypeException(message); } int subAttribQuark = ss.getQuarkRelative(stackAttributeQuark, String.valueOf(curStackDepth)); return ss.querySingleState(t, subAttribQuark); }

Target:
public static @Nullable ITmfStateInterval querySingleStackTop(ITmfStateSystem ss, long t, int stackAttributeQuark) throws AttributeNotFoundException, StateSystemDisposedException { ITmfStateValue curStackStateValue = ss.querySingleState(t, stackAttributeQuark).getStateValue(); if (curStackStateValue.isNull()) { return null; } int curStackDepth = curStackStateValue.unboxInt(); if (curStackDepth <= 0) { throw new StateValueTypeException(ss.getSSID() + " Quark:" + stackAttributeQuark + ", Stack depth:" + curStackDepth); } int subAttribQuark = ss.getQuarkRelative(stackAttributeQuark, String.valueOf(curStackDepth)); return ss.querySingleState(t, subAttribQuark); }
Source:
public void setTopicUuid(String topicId) { this.topicUuid = topicId; }

Target:
public void setTopicUuid(String topicId) { fields.put("topicUuid", topicId); }
Source:
public void publishAvatarData(byte[] data, String itemId) throws NoResponseException, NotConnectedException, XMPPErrorException, InterruptedException, PubSubException.NotALeafNodeException { DataExtension dataExtension = new DataExtension(data); getDataNode().publish(new PayloadItem<>(itemId, dataExtension)); }

Target:
public void publishAvatarData(byte[] data, String itemId) throws NoResponseException, NotConnectedException, XMPPErrorException, InterruptedException, PubSubException.NotALeafNodeException { DataExtension dataExtension = new DataExtension(data); getOrCreateDataNode().publish(new PayloadItem<>(itemId, dataExtension)); }
Source:
private static boolean isTrue(CharSequence value) { final char firstChar = value.charAt(0); return firstChar == 't' || firstChar == 'T'; }

Target:
private static boolean isTrue(CharSequence value) { return (value.charAt(0) | 32) == 't'; }
Source:
public void shouldNotSaveTaskWithInvalidRetryNumberValue() { Task t = new Task("name", trigger, asList(action)); t.setNumberOfRetries(-3); taskService.save(t); }

Target:
public void shouldNotSaveTaskWithInvalidRetryNumberValue() { Task t = new Task("name", trigger, asList(action)); t.setNumberOfRetries(-3); try { taskService.save(t); } finally { verifyZeroInteractions(tasksDataService); } }
Source:
public void setUp() { fixture = new AggregateTestFixture<>(AnnotatedAggregate.class); mockCommandTargetResolver = mock(CommandTargetResolver.class); }

Target:
public void setUp() { fixture = new AggregateTestFixture<>(AnnotatedAggregate.class); }
Source:
public static Map<Long, List<Map.Entry<String, String>>> reOrderTagsQuery(Map<String, String> tagsQuery) { Map<Long, List<Map.Entry<String, String>>> costSortedMap = new TreeMap<>(); costSortedMap.put(GROUP_B_COST, new ArrayList<>()); costSortedMap.put(GROUP_C_COST, new ArrayList<>()); for (Map.Entry<String, String> tagQuery : tagsQuery.entrySet()) { if(tagQuery.getKey().startsWith("!")) { List<Map.Entry<String, String>> entries = costSortedMap.get(GROUP_C_COST); entries.add(tagQuery); costSortedMap.put(GROUP_C_COST, entries); } else { List<Map.Entry<String, String>> entries = costSortedMap.get(GROUP_B_COST); entries.add(tagQuery); costSortedMap.put(GROUP_B_COST, entries); } } return costSortedMap; }

Target:
public static Map<Long, List<Map.Entry<String, String>>> reOrderTagsQuery(Map<String, String> tagsQuery) { Map<Long, List<Map.Entry<String, String>>> costSortedMap = new TreeMap<>(); costSortedMap.put(GROUP_B_COST, new ArrayList<>()); costSortedMap.put(GROUP_C_COST, new ArrayList<>()); for (Map.Entry<String, String> tagQuery : tagsQuery.entrySet()) { if(tagQuery.getKey().startsWith("!")) { List<Map.Entry<String, String>> entries = costSortedMap.get(GROUP_C_COST); entries.add(tagQuery); } else { List<Map.Entry<String, String>> entries = costSortedMap.get(GROUP_B_COST); entries.add(tagQuery); } } return costSortedMap; }
Source:
public long propertiesReference() { long propertiesReference = getNextProp(); if ( read.hasTxStateWithChanges() ) { TransactionState txState = read.txState(); NodeState nodeState = txState.getNodeState( nodeReference() ); if ( nodeState.hasPropertyChanges() ) { long ref; if ( propertiesReference == NO_ID ) { ref = References.setNodeFlag( nodeReference() ); } else { ref = References.setTxStateFlag( propertiesReference ); } txState.registerProperties( ref, nodeState ); return ref; } } return propertiesReference; }

Target:
public long propertiesReference() { long propertiesReference = getNextProp(); if ( read.hasTxStateWithChanges() ) { TransactionState txState = read.txState(); NodeState nodeState = txState.getNodeState( nodeReference() ); if ( nodeState.hasPropertyChanges() ) { long ref; if ( propertiesReference == NO_ID ) { ref = References.setNodeFlag( nodeReference() ); } else { ref = References.setTxStateFlag( propertiesReference ); txState.registerProperties( ref, nodeState ); } return ref; } } return propertiesReference; }
Source:
private Iterable<SAMSequenceRecord> getSamSequenceRecordsIterable() { final SequenceDictionaryUtils.SamSequenceRecordsIterator samSequenceRecordIterator = new SequenceDictionaryUtils.SamSequenceRecordsIterator(REFERENCE_SEQUENCE, TRUNCATE_NAMES_AT_WHITESPACE); samSequenceRecordIterator.setGenomeAssembly(GENOME_ASSEMBLY); samSequenceRecordIterator.setSpecies(SPECIES); samSequenceRecordIterator.setUri(URI); return () -> samSequenceRecordIterator; }

Target:
private Iterable<SAMSequenceRecord> getSamSequenceRecordsIterable() { return () -> { final SequenceDictionaryUtils.SamSequenceRecordsIterator iterator = new SequenceDictionaryUtils.SamSequenceRecordsIterator(REFERENCE_SEQUENCE, TRUNCATE_NAMES_AT_WHITESPACE); iterator.setGenomeAssembly(GENOME_ASSEMBLY); iterator.setSpecies(SPECIES); iterator.setUri(URI); return iterator; }; }
Source:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { ctx.onReturn((ctx1, command1, rv, throwable) -> { if (throwable != null) throw throwable; CacheSet<K> keySet = (CacheSet<K>) rv; if (!enabled || hasSkipLoadFlag(command)) { return CompletableFuture.completedFuture(keySet); } CacheSet<K> wrappedKeySet = new WrappedKeySet(command, keySet); return CompletableFuture.completedFuture(wrappedKeySet); }); return ctx.continueInvocation(); }

Target:
public CompletableFuture<Void> visitKeySetCommand(InvocationContext ctx, KeySetCommand command) throws Throwable { return ctx.onReturn((rCtx, rCommand, rv, throwable) -> { if (throwable != null || !enabled || hasSkipLoadFlag(command)) { return null; } CacheSet<K> keySet = (CacheSet<K>) rv; CacheSet<K> wrappedKeySet = new WrappedKeySet(command, keySet); return CompletableFuture.completedFuture(wrappedKeySet); }); }
Source:
public void testSetOnlineAndOffline() throws Exception { Registration queueModeRegistration = givenASimpleClientWithQueueMode(); final CountDownLatch countDown = new CountDownLatch(2); instance.addListener(new PresenceListener() { @Override public void onOnline(Registration endpoint) { countDown.countDown(); } @Override public void onOffline(Registration endpoint) { countDown.countDown(); } }); instance.setOnline(queueModeRegistration); instance.setOffline(queueModeRegistration); assertTrue("Expected states not set. " + countDown.getCount() + " state left to be set", countDown.await(2, TimeUnit.SECONDS)); }

Target:
public void testSetOnlineAndOffline() throws Exception { Registration queueModeRegistration = givenASimpleClientWithQueueMode(); instance.addListener(new PresenceListener() { int onlineStatusCountDown = 0; int offlineStatusCountDown = 0; @Override public void onOnline(Registration registration) { onlineStatusCountDown++; assertTrue("Expected online state to be invoked only once but invoked" + onlineStatusCountDown, onlineStatusCountDown == 1); } @Override public void onOffline(Registration registration) { offlineStatusCountDown++; assertTrue("Expected offline state to be invoked only once but invoked" + offlineStatusCountDown, offlineStatusCountDown == 1); } }); instance.setOnline(queueModeRegistration); instance.setOnline(queueModeRegistration); instance.setOffline(queueModeRegistration); instance.setOffline(queueModeRegistration); }
Source:
private ICompletionProposal[] convertToVersionProposals(List<String> versions) { List<String> dest = new ArrayList<>(); dest.addAll(versions); if (!versions.contains(ITargetConstants.UNIT_VERSION_ATTR_GENERIC)) { dest.add(ITargetConstants.UNIT_VERSION_ATTR_GENERIC); } List<ICompletionProposal> result = new ArrayList<>(); for (String version : dest) { StyledString displayString = TargetDefinitionContentAssist.getFilteredStyledString(version, searchTerm); if (displayString == null || displayString.length() == 0) { continue; } result.add(new InstallableUnitProposal(displayString, offset - searchTerm.length(), searchTerm.length())); } return result.toArray(new ICompletionProposal[result.size()]); }

Target:
private ICompletionProposal[] convertToVersionProposals(List<String> versions) { List<String> dest = new ArrayList<>(); dest.addAll(versions); Collections.sort(dest, (v1, v2) -> (new Version(v2)).compareTo(new Version(v1))); if (!versions.contains(ITargetConstants.UNIT_VERSION_ATTR_GENERIC)) { dest.add(ITargetConstants.UNIT_VERSION_ATTR_GENERIC); } List<ICompletionProposal> result = new ArrayList<>(); for (String version : dest) { StyledString displayString = TargetDefinitionContentAssist.getFilteredStyledString(version, searchTerm); if (displayString == null || displayString.length() == 0) { continue; } result.add(new InstallableUnitProposal(displayString, offset - searchTerm.length(), searchTerm.length())); } return result.toArray(new ICompletionProposal[result.size()]); }
Source:
private void diplayToolTip(Point hoverPoint, BigInteger subAddress) { StringBuilder sb = new StringBuilder("0x").append(subAddress.toString(16)).append("\n"); fLabelContent.setText(sb.toString()); Rectangle shellBounds = fToolTipShell.getBounds(); shellBounds.x = hoverPoint.x; shellBounds.y = hoverPoint.y + getCellWidth(); fToolTipShell.setBounds(shellBounds); fToolTipShell.pack(); fToolTipShell.setVisible(true); }

Target:
private void diplayToolTip(Point hoverPoint, BigInteger subAddress) { StringBuilder sb = new StringBuilder("0x").append(subAddress.toString(16)); fLabelContent.setText(sb.toString()); Rectangle shellBounds = fToolTipShell.getBounds(); shellBounds.x = hoverPoint.x; shellBounds.y = hoverPoint.y + getCellHeight(); fToolTipShell.setBounds(shellBounds); fToolTipShell.pack(); fToolTipShell.setVisible(true); }
Source:
private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final ArrayBlockingQueue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int availableProcessors = Runtime.getRuntime().availableProcessors(); final JobGroup buildGroup = new JobGroup("Building Modules Group", availableProcessors, 1); Job monitorUpdateJob = new Job("Build Progress") { private int fLastNumberOfScannedFiles = 0; public IStatus run(IProgressMonitor inner) { while (!queue.isEmpty()) { if (monitor.isCanceled()) { buildGroup.cancel(); break; } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - fLastNumberOfScannedFiles; monitor.worked(steps); fLastNumberOfScannedFiles += steps; try { Thread.sleep(100); } catch (InterruptedException e) { return Status.OK_STATUS; } } return Status.OK_STATUS; } }; monitorUpdateJob.setSystem(true); monitorUpdateJob.schedule(); try { for (int i = 0; i < availableProcessors; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.setJobGroup(buildGroup); job.schedule(); } buildGroup.join(0, null); } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }

Target:
private void processInParallel(final List<ISourceModule> modules, int buildType, IBuildState state, final IScriptProject project, final IProgressMonitor monitor) { final Queue<ISourceModule> queue = new ArrayBlockingQueue<ISourceModule>( modules.size(), true, modules); int maxThreads = Math.min(modules.size() / 2, Runtime.getRuntime().availableProcessors()); List<Job> jobs = new ArrayList<Job>(maxThreads); try { for (int i = 0; i < maxThreads; i++) { Job job = new BuildModulesJob(queue, buildType, state); job.schedule(); jobs.add(job); } int lastNumberOfScannedFiles = 0; for (Job job : jobs) { while (!job.join(100, null)) { if (monitor.isCanceled()) { job.cancel(); continue; } int numberOfScannedFiles = modules.size() - queue.size(); monitor.subTask(NLS.bind( Messages.ValidatorBuilder_buildModuleSubTask, (int) ((numberOfScannedFiles * 100f) / modules.size()), project.getElementName())); int steps = numberOfScannedFiles - lastNumberOfScannedFiles; monitor.worked(steps); lastNumberOfScannedFiles += steps; } } } catch (OperationCanceledException e) { DLTKCore.error(e); } catch (InterruptedException e) { DLTKCore.error(e); } }
Source:
public static void copyTo(Localized from, Localized to) { to.locale = from.locale; }

Target:
protected static void copyTo(Localized from, Localized to) { to.locale = from.locale; }
Source:
public CurrentServerInfo getServerInfo() { return new CurrentServerInfo(nanosSince(startTime), serverInfo); }

Target:
public ServerInfo getServerInfo() { return new ServerInfo(version, environment, coordinator, Optional.of(nanosSince(startTime))); }
Source:
protected void onFinishInflate() { super.onFinishInflate(); setOrientation(HORIZONTAL); final int[] buttonIDs = { R.id.direction_1, R.id.direction_2, R.id.direction_3, R.id.direction_4 }; for (int i = 0; i < FAN_DIRECTION_COUNT; i++) { ImageView button = (ImageView) findViewById(buttonIDs[i]); button.setTag(i); button.setOnClickListener(v -> { int direction = (int)v.getTag(); if (direction != mCurrentDirection) { updateFanButtonToOn(direction); mListener.onFanDirectionClicked(direction); } }); mButtonArray.add(button); } }

Target:
protected void onFinishInflate() { super.onFinishInflate(); setOrientation(HORIZONTAL); for (int i = 0; i < FAN_DIRECTION_COUNT; i++) { ImageView button = (ImageView) findViewById(FAN_DIRECTION_BUTTON_IDS[i]); button.setTag(i); button.setOnClickListener(v -> { int direction = (int) v.getTag(); if (direction != mCurrentDirection) { updateFanButtonToOn(direction); if (mListener != null) { mListener.onFanDirectionClicked(direction); } } }); mButtonArray.add(button); } }
Source:
public void testRenameColumn() throws Exception { TestUtils.assertMemoryLeak( () -> { try { createX(); Assert.assertEquals(ALTER, compiler.compile("alter table x rename column e z", sqlExecutionContext).getType()); String expected = "{\"columnCount\":16,\"columns\":[{\"index\":0,\"name\":\"i\",\"type\":\"INT\"},{\"index\":1,\"name\":\"sym\",\"type\":\"SYMBOL\"},{\"index\":2,\"name\":\"amt\",\"type\":\"DOUBLE\"},{\"index\":3,\"name\":\"timestamp\",\"type\":\"TIMESTAMP\"},{\"index\":4,\"name\":\"b\",\"type\":\"BOOLEAN\"},{\"index\":5,\"name\":\"c\",\"type\":\"STRING\"},{\"index\":6,\"name\":\"d\",\"type\":\"DOUBLE\"},{\"index\":7,\"name\":\"z\",\"type\":\"FLOAT\"},{\"index\":8,\"name\":\"f\",\"type\":\"SHORT\"},{\"index\":9,\"name\":\"g\",\"type\":\"DATE\"},{\"index\":10,\"name\":\"ik\",\"type\":\"SYMBOL\"},{\"index\":11,\"name\":\"j\",\"type\":\"LONG\"},{\"index\":12,\"name\":\"k\",\"type\":\"TIMESTAMP\"},{\"index\":13,\"name\":\"l\",\"type\":\"BYTE\"},{\"index\":14,\"name\":\"m\",\"type\":\"BINARY\"},{\"index\":15,\"name\":\"n\",\"type\":\"STRING\"}],\"timestampIndex\":3}"; try (TableReader reader = engine.getReader(AllowAllCairoSecurityContext.INSTANCE, "x", TableUtils.ANY_TABLE_VERSION)) { sink.clear(); reader.getMetadata().toJson(sink); TestUtils.assertEquals(expected, sink); } Assert.assertEquals(0, engine.getBusyWriterCount()); Assert.assertEquals(0, engine.getBusyReaderCount()); } finally { engine.releaseAllReaders(); engine.releaseAllWriters(); } } ); }

Target:
public void testRenameColumn() throws Exception { TestUtils.assertMemoryLeak( () -> { try { createX(); Assert.assertEquals(ALTER, compiler.compile("alter table x rename column e to z", sqlExecutionContext).getType()); String expected = "{\"columnCount\":16,\"columns\":[{\"index\":0,\"name\":\"i\",\"type\":\"INT\"},{\"index\":1,\"name\":\"sym\",\"type\":\"SYMBOL\"},{\"index\":2,\"name\":\"amt\",\"type\":\"DOUBLE\"},{\"index\":3,\"name\":\"timestamp\",\"type\":\"TIMESTAMP\"},{\"index\":4,\"name\":\"b\",\"type\":\"BOOLEAN\"},{\"index\":5,\"name\":\"c\",\"type\":\"STRING\"},{\"index\":6,\"name\":\"d\",\"type\":\"DOUBLE\"},{\"index\":7,\"name\":\"z\",\"type\":\"FLOAT\"},{\"index\":8,\"name\":\"f\",\"type\":\"SHORT\"},{\"index\":9,\"name\":\"g\",\"type\":\"DATE\"},{\"index\":10,\"name\":\"ik\",\"type\":\"SYMBOL\"},{\"index\":11,\"name\":\"j\",\"type\":\"LONG\"},{\"index\":12,\"name\":\"k\",\"type\":\"TIMESTAMP\"},{\"index\":13,\"name\":\"l\",\"type\":\"BYTE\"},{\"index\":14,\"name\":\"m\",\"type\":\"BINARY\"},{\"index\":15,\"name\":\"n\",\"type\":\"STRING\"}],\"timestampIndex\":3}"; try (TableReader reader = engine.getReader(AllowAllCairoSecurityContext.INSTANCE, "x", TableUtils.ANY_TABLE_VERSION)) { sink.clear(); reader.getMetadata().toJson(sink); TestUtils.assertEquals(expected, sink); } Assert.assertEquals(0, engine.getBusyWriterCount()); Assert.assertEquals(0, engine.getBusyReaderCount()); } finally { engine.releaseAllReaders(); engine.releaseAllWriters(); } } ); }
Source:
public boolean isAllowSidebandAll() { return advertiseSidebandAll; }

Target:
public boolean isAllowSidebandAll() { return allowSidebandAll; }
Source:
public List<org.kie.server.controller.api.model.runtime.Container> startScanner(ServerTemplate serverTemplate, final ContainerSpec containerSpec, final long interval) { return callRemoteKieServerOperation(serverTemplate, containerSpec, new RemoteKieServerOperation<Void>(){ @Override public Void doOperation(KieServicesClient client, Container container) { KieScannerResource scannerResource = new KieScannerResource(); scannerResource.setPollInterval(interval); scannerResource.setStatus(KieScannerStatus.STARTED); ServiceResponse<KieScannerResource> response = client.updateScanner(containerSpec.getId(), scannerResource); if (!response.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { logger.debug("Scanner failed to start on server instance due to {}", container.getUrl(), response.getMsg()); } collectContainerInfo(containerSpec, client, container); return null; } }); }

Target:
public List<Container> startScanner(ServerTemplate serverTemplate, final ContainerSpec containerSpec, final long interval) { return callRemoteKieServerOperation(serverTemplate, containerSpec, new RemoteKieServerOperation<Void>(){ @Override public Void doOperation(KieServicesClient client, Container container) { KieScannerResource scannerResource = new KieScannerResource(); scannerResource.setPollInterval(interval); scannerResource.setStatus(KieScannerStatus.STARTED); ServiceResponse<KieScannerResource> response = client.updateScanner(containerSpec.getId(), scannerResource); if (!response.getType().equals(ServiceResponse.ResponseType.SUCCESS)) { logger.debug("Scanner failed to start on server instance due to {}", container.getUrl(), response.getMsg()); } collectContainerInfo(containerSpec, client, container); return null; } }); }