auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ModelAndView setupForm(SequencerPartitionContainer container, ModelMap model) throws IOException { model.put("container", container); model.put("containerPartitions", container.getPartitions().stream().map(parition -> Dtos.asDto(parition, true)).collect(Collectors.toList())); model.put("containerRuns", runService.listByContainerId(container.getId()).stream().map(Dtos::asDto).collect(Collectors.toList())); model.put("clusteringKits", kitService.listKitDescriptorsByType(KitType.CLUSTERING).stream() .filter(descriptor -> descriptor.getPlatformType() == container.getModel().getPlatformType()) .sorted(KitDescriptor::sortByName).collect(Collectors.toList())); model.put("multiplexingKits", kitService.listKitDescriptorsByType(KitType.MULTIPLEXING).stream() .filter(descriptor -> descriptor.getPlatformType() == container.getModel().getPlatformType()) .sorted(KitDescriptor::sortByName).collect(Collectors.toList())); model.put("flowCellVersions", containerService.listFlowCellVersions()); model.put("poreVersions", containerService.listPoreVersions()); return new ModelAndView("/pages/editSequencerPartitionContainer.jsp", model); }

Target:
private ModelAndView setupForm(SequencerPartitionContainer container, ModelMap model) throws IOException { model.put("container", container); model.put("containerPartitions", container.getPartitions().stream().map(partition -> Dtos.asDto(partition, true)).collect(Collectors.toList())); model.put("containerRuns", runService.listByContainerId(container.getId()).stream().map(Dtos::asDto).collect(Collectors.toList())); model.put("clusteringKits", kitService.listKitDescriptorsByType(KitType.CLUSTERING).stream() .filter(descriptor -> descriptor.getPlatformType() == container.getModel().getPlatformType()) .sorted(KitDescriptor::sortByName).collect(Collectors.toList())); model.put("multiplexingKits", kitService.listKitDescriptorsByType(KitType.MULTIPLEXING).stream() .filter(descriptor -> descriptor.getPlatformType() == container.getModel().getPlatformType()) .sorted(KitDescriptor::sortByName).collect(Collectors.toList())); model.put("flowCellVersions", containerService.listFlowCellVersions()); model.put("poreVersions", containerService.listPoreVersions()); return new ModelAndView("/pages/editSequencerPartitionContainer.jsp", model); }
Source:
public void setup() { ITmfTimestamp requestedTraceCutEnd = fRequestedTraceCutRange.getEndTime(); ITmfTimestamp requestedTraceCutStart = fRequestedTraceCutRange.getStartTime(); assertTrue(fOriginalExperiment.getTimeRange().contains(fRequestedTraceCutRange)); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, requestedTraceCutStart, requestedTraceCutEnd, fOriginalExperiment)); fexperimentItem.contextMenu("Export Time Selection as New Trace...").click(); SWTBotShell shell = fBot.shell("Export trace section to...").activate(); SWTBot dialogBot = shell.bot(); assertEquals("Experiment", dialogBot.text().getText()); dialogBot.text().setText("Experiment-trimmed"); dialogBot.button("OK").click(); SWTBotEditor newExperiment = fBot.editorByTitle("Experiment-trimmed"); newExperiment.setFocus(); fNewExperiment = ftraceManager.getActiveTrace(); assertNotNull("No active trace", fNewExperiment); assertEquals("Incorrect active trace", "Experiment-trimmed", fNewExperiment.getName()); WaitUtils.waitForJobs(); }

Target:
public void setup() { WaitUtils.waitForJobs(); SWTBotTreeItem tracesFolder = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); tracesFolder.contextMenu().menu("Open As Experiment...", "Generic Experiment").click(); SWTBotUtils.activateEditor(fBot, "Experiment"); SWTBotTreeItem project = SWTBotUtils.selectProject(fBot, PROJECT_NAME); SWTBotTreeItem experimentItem = SWTBotUtils.getTraceProjectItem(fBot, project, "Experiments", "Experiment"); experimentItem.select(); TmfTraceManager traceManager = TmfTraceManager.getInstance(); ITmfTrace trace = traceManager.getActiveTrace(); assertTrue(String.valueOf(trace), trace instanceof TmfExperiment); TmfExperiment experiment = (TmfExperiment) trace; assertNotNull(experiment); ITmfProjectModelElement elem = TmfProjectRegistry.findElement(experiment.getResource(), true); assertTrue(elem instanceof TmfExperimentElement); fOriginalExperiment = experiment; TmfTimeRange traceCutRange = getTraceCutRange(experiment); assertNotNull(traceCutRange); fRequestedTraceCutRange = traceCutRange; ITmfTimestamp requestedTraceCutEnd = traceCutRange.getEndTime(); ITmfTimestamp requestedTraceCutStart = traceCutRange.getStartTime(); assertTrue(experiment.getTimeRange().contains(traceCutRange)); TmfSignalManager.dispatchSignal(new TmfSelectionRangeUpdatedSignal(this, requestedTraceCutStart, requestedTraceCutEnd, experiment)); experimentItem.contextMenu("Export Time Selection as New Trace...").click(); SWTBotShell shell = fBot.shell("Export trace section to...").activate(); SWTBot dialogBot = shell.bot(); assertEquals("Experiment", dialogBot.text().getText()); dialogBot.text().setText("Experiment-trimmed"); dialogBot.button("OK").click(); SWTBotEditor newExperiment = fBot.editorByTitle("Experiment-trimmed"); newExperiment.setFocus(); fNewExperiment = traceManager.getActiveTrace(); assertNotNull("No active trace", fNewExperiment); assertEquals("Incorrect active trace", "Experiment-trimmed", fNewExperiment.getName()); WaitUtils.waitForJobs(); }
Source:
public void visitIdentifier(IdentifierTree tree) { if (tree.name().equals(exceptionIdentifier.name())) { isExceptionIdentifierUsed = true; } }

Target:
public void visitIdentifier(IdentifierTree tree) { if (!isExceptionIdentifierUsed && tree.name().equals(exceptionIdentifier.name())) { isExceptionIdentifierUsed = true; } }
Source:
public void convertProject( IProject project , IProgressMonitor monitor) throws CoreException{ Assert.isNotNull(project, "Project is null"); if(monitor == null ) monitor = new NullProgressMonitor(); HybridProject hp= HybridProject.getHybridProject(project); if(hp != null ) return; if(!CanConvertToHybridTester.canConvert(project)){ throw new CoreException(new Status(IStatus.ERROR, HybridCore.PLUGIN_ID, NLS.bind("Project {0} can not be converted to a hybrid mobile project" , project.getName(),null))); } addCommonPaths(project, monitor); addPlatformPaths(project, monitor); addNature(project, monitor); setUpJavaScriptProject(project, monitor); HybridProject newHybridProject = HybridProject.getHybridProject(project); if(newHybridProject.getEngineManager().getActiveEngines().length > 0){ newHybridProject.prepare(monitor); } }

Target:
public void convertProject( IProject project , IProgressMonitor monitor) throws CoreException{ Assert.isNotNull(project, "Project is null"); if(monitor == null ) monitor = new NullProgressMonitor(); HybridProject hp= HybridProject.getHybridProject(project); if(hp != null ) return; if(!CanConvertToHybridTester.canConvert(project)){ throw new CoreException(new Status(IStatus.ERROR, HybridCore.PLUGIN_ID, NLS.bind("Project {0} can not be converted to a hybrid mobile project" , project.getName(),null))); } addCommonPaths(project, monitor); addPlatformPaths(project, monitor); addNature(project, monitor); setUpJavaScriptProject(project, monitor); HybridProject newHybridProject = HybridProject.getHybridProject(project); if(newHybridProject.getEngineManager().hasActiveEngine()){ newHybridProject.prepare(monitor); } }
Source:
public ChannelFuture close(final ChannelPromise promise) { if (isNotValidPromise(promise, false)) { return promise; } EventExecutor executor = executor(); if (executor.inEventLoop()) { findAndInvokeClose(promise); } else { executor.execute(() -> findAndInvokeClose(promise)); } return promise; }

Target:
public ChannelFuture close(final ChannelPromise promise) { if (isNotValidPromise(promise, false)) { return promise; } EventExecutor executor = executor(); if (executor.inEventLoop()) { findAndInvokeClose(promise); } else { safeExecute(executor, () -> findAndInvokeClose(promise), promise, null); } return promise; }
Source:
public int enableSegments(final String dataSource, final Interval interval) { VersionedIntervalTimeline<String, DataSegment> versionedIntervalTimeline = getVersionedIntervalTimeline(dataSource, interval); return enableSegments( segmentIdsForInterval(versionedIntervalTimeline, interval).collect(Collectors.toSet()), versionedIntervalTimeline ); }

Target:
public int enableSegments(final String dataSource, final Interval interval) { List<Pair<DataSegment, Boolean>> segments = getDataSegmentsOverlappingInterval(dataSource, interval); List<DataSegment> segmentsToEnable = segments.stream() .filter(segment -> !segment.rhs && interval.contains(segment.lhs.getInterval())) .map(segment -> segment.lhs) .collect(Collectors.toList()); VersionedIntervalTimeline<String, DataSegment> versionedIntervalTimeline = VersionedIntervalTimeline.forSegments( segments.stream().filter(segment -> segment.rhs).map(segment -> segment.lhs).iterator() ); VersionedIntervalTimeline.addSegments(versionedIntervalTimeline, segmentsToEnable.iterator()); return enableSegments( segmentsToEnable, versionedIntervalTimeline ); }
Source:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getActivity().getApplication()).component().inject(this); if (!NetworkUtils.checkConnection(getActivity())) { getActivity().finish(); return; } if (savedInstanceState == null) { mSite = (SiteModel) getArguments().getSerializable(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(getActivity(), R.string.blog_not_found, ToastUtils.Duration.SHORT); getActivity().finish(); return; } mSiteSettings = SiteSettingsInterface.getInterface(getActivity(), mSite, this); }

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getActivity().getApplication()).component().inject(this); setRetainInstance(true); if (!NetworkUtils.checkConnection(getActivity())) { getActivity().finish(); return; } if (savedInstanceState == null) { mSite = (SiteModel) getArguments().getSerializable(WordPress.SITE); } else { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(getActivity(), R.string.blog_not_found, ToastUtils.Duration.SHORT); getActivity().finish(); return; } mSiteSettings = SiteSettingsInterface.getInterface(getActivity(), mSite, this); }
Source:
private void doTestNoIntention(String prefix) { String testName = getTestName(true); myFixture.configureByFile(testName + ".erl"); List<IntentionAction> availableIntentions = myFixture.filterAvailableIntentions(prefix); IntentionAction action = ContainerUtil.getFirstItem(availableIntentions); assertNull(action); }

Target:
private void doTestNoIntention(String prefix) { String testName = getTestName(true); myFixture.configureByFile(testName + ".erl"); assertNoIntentionsAvailable(prefix); }
Source:
public <T> Flowable<T> method(String name, Entity<?> entity, Class<T> responseType) { if (sc == null) { return Flowable.create(new FlowableOnSubscribe<T>() { @Override public void subscribe(FlowableEmitter<T> emitter) throws Exception { try { T response = syncInvoker.method(name, entity, responseType); emitter.onNext(response); emitter.onComplete(); } catch (Throwable e) { emitter.onError(e); } } }, BackpressureStrategy.DROP); } return Flowable.create(new FlowableOnSubscribe<T>() { @Override public void subscribe(FlowableEmitter<T> emitter) throws Exception { try { T response = syncInvoker.method(name, entity, responseType); emitter.onNext(response); emitter.onComplete(); } catch (Throwable e) { emitter.onError(e); } } }, BackpressureStrategy.DROP).subscribeOn(sc).observeOn(sc); }

Target:
public <T> Flowable<T> method(String name, Entity<?> entity, Class<T> responseType) { return create(() -> syncInvoker.method(name, entity, responseType)); }
Source:
private static String unescape(String s) throws URISyntaxException { if (s == null) return null; if (s.indexOf('%') < 0) return s; byte[] bytes; try { bytes = s.getBytes(Constants.CHARACTER_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } ByteArrayOutputStream os = new ByteArrayOutputStream(bytes.length); for (int i = 0; i < bytes.length; ++i) { byte c = bytes[i]; if (c == '%') { if (i + 2 > bytes.length) throw new URISyntaxException(s, JGitText.get().cannotParseGitURIish); int ascValue = Integer.parseInt(s.substring(i + 1, i + 3), 16); os.write(ascValue); i += 2; } else os.write(c); } return RawParseUtils.decode(os.toByteArray()); }

Target:
private static String unescape(String s) throws URISyntaxException { if (s == null) return null; if (s.indexOf('%') < 0) return s; byte[] bytes; try { bytes = s.getBytes(Constants.CHARACTER_ENCODING); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } byte[] os = new byte[bytes.length]; int j = 0; for (int i = 0; i < bytes.length; ++i) { byte c = bytes[i]; if (c == '%') { if (i + 2 > bytes.length) throw new URISyntaxException(s, JGitText.get().cannotParseGitURIish); int val = (RawParseUtils.parseHexInt4(bytes[i + 1]) << 4) | RawParseUtils.parseHexInt4(bytes[i + 2]); os[j++] = (byte) val; i += 2; } else os[j++] = c; } return RawParseUtils.decode(os, 0, j); }
Source:
private void update(MarshallerType type, Consumer<MarshallerContext> consumer) { if (type == GLOBAL) { synchronized (global) { consumer.accept(global); } return; } synchronized (persistence) { consumer.accept(persistence); } }

Target:
private void update(MarshallerType type, Consumer<MarshallerContext> consumer) { if (type == GLOBAL) { synchronized (global) { consumer.accept(global); } } else { synchronized (persistence) { consumer.accept(persistence); } } }
Source:
public UserDetails loadUserByUsername(String arg0) throws UsernameNotFoundException { IUser user; try { logger.debug("UserService: arg0: "+arg0); user = userManager.getUser(arg0); logger.debug("UserService: user: "+user); } catch (QuadrigaStorageException e) { e.printStackTrace(); throw new UsernameNotFoundException("Error getting user details.", e); } if (user == null) throw new UsernameNotFoundException("Couldn't find username."); List<QuadrigaGrantedAuthority> roles = new ArrayList<QuadrigaGrantedAuthority>(); for (IQuadrigaRole role : user.getQuadrigaRoles()) { roles.add(new QuadrigaGrantedAuthority(role.getId())); } UserDetails details = new QuadrigaUserDetails(user.getUserName(), user.getName(), user.getPassword(), roles, user.getEmail()); return details; }

Target:
public UserDetails loadUserByUsername(String arg0) throws UsernameNotFoundException { IUser user; try { user = userManager.getUser(arg0); } catch (QuadrigaStorageException e) { logger.error("Error while retrieving user details", e); throw new UsernameNotFoundException("Error getting user details.", e); } if (user == null) { throw new UsernameNotFoundException("Couldn't find username."); } List<QuadrigaGrantedAuthority> roles = new ArrayList<QuadrigaGrantedAuthority>(); for (IQuadrigaRole role : user.getQuadrigaRoles()) { roles.add(new QuadrigaGrantedAuthority(role.getId())); } UserDetails details = new QuadrigaUserDetails(user.getUserName(), user.getName(), user.getPassword(), roles, user.getEmail()); return details; }
Source:
public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(source.getLayout()::get); AnalyzeTableHandle analyzeTableHandle = context.tableWriteInfo.getAnalyzeTableHandle().orElseThrow(() -> new IllegalStateException("analyzeTableHandle is absent")); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishStatisticsCollection(session, analyzeTableHandle, computedStatistics), node.isRowCountEnabled(), descriptor); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }

Target:
public PhysicalOperation visitStatisticsWriterNode(StatisticsWriterNode node, LocalExecutionPlanContext context) { PhysicalOperation source = node.getSource().accept(this, context); StatisticAggregationsDescriptor<Integer> descriptor = node.getDescriptor().map(source.getLayout()::get); AnalyzeTableHandle analyzeTableHandle = context.getTableWriteInfo().getAnalyzeTableHandle().orElseThrow(() -> new VerifyException("analyzeTableHandle is absent")); OperatorFactory operatorFactory = new StatisticsWriterOperatorFactory( context.getNextOperatorId(), node.getId(), computedStatistics -> metadata.finishStatisticsCollection(session, analyzeTableHandle, computedStatistics), node.isRowCountEnabled(), descriptor); return new PhysicalOperation(operatorFactory, makeLayout(node), context, source); }
Source:
private boolean deQueueAction(ContainerPlacementRequestMessage requestMessage) { if (hasActiveContainerPlacementAction(requestMessage.getProcessorId()) || checkStandbyOrActiveContainerHasActivePlacementAction(requestMessage.getProcessorId())) { if (standbyContainerManager.isPresent()) { LOG.info("ContainerPlacement request: is en-queued because either active container or its standby replica has an in-progress placement action", requestMessage); } else { LOG.info("ContainerPlacement request: is en-queued because container has an in-progress placement action", requestMessage); } return false; } if (!samzaApplicationState.runningProcessors.containsKey(requestMessage.getProcessorId()) || samzaApplicationState.pendingProcessors.containsKey(requestMessage.getProcessorId())) { LOG.info("ContainerPlacement request: is en-queued because container is pending start", requestMessage); return false; } return true; }

Target:
private boolean deQueueAction(ContainerPlacementRequestMessage requestMessage) { if (checkIfActiveOrStandbyContainerHasActivePlacementAction(requestMessage)) { return false; } if (!samzaApplicationState.runningProcessors.containsKey(requestMessage.getProcessorId()) || samzaApplicationState.pendingProcessors.containsKey(requestMessage.getProcessorId())) { LOG.info("ContainerPlacement request: is en-queued because container is pending start", requestMessage); return false; } return true; }
Source:
public FullyQualifiedInfo getQualifiedInfo() { if (qualifiedInfo == null) { if (getExhibitor() != null && getExhibitor().getQualifiedInfo() != null) { FullyQualifiedInfo containerInfo = getExhibitor().getQualifiedInfo(); this.qualifiedInfo = new FullyQualifiedInfo(containerInfo.packagePath, containerInfo.fileName, getName(), null); } } return qualifiedInfo; }

Target:
public FullyQualifiedInfo getQualifiedInfo() { HaxeExposableModel exhibitor = getExhibitor(); if (exhibitor != null) { FullyQualifiedInfo containerInfo = exhibitor.getQualifiedInfo(); if (containerInfo != null) { return new FullyQualifiedInfo(containerInfo.packagePath, containerInfo.fileName, getName(), null); } } return null; }
Source:
private Object getStorageDevicesVDSReturnVal(Guid hostId) { VDSReturnValue vdsRetValue = new VDSReturnValue(); vdsRetValue.setSucceeded(true); if (HOST_ID_WITH_NEW_DEVICES.equals(hostId)) { vdsRetValue.setReturnValue(Arrays.asList(getStorageDevice("sda", null), getStorageDevice("sdb", null), getStorageDevice("sdc", null))); } else if (HOST_ID_WITH_DEVICES_CHANGED.equals(hostId)) { List<StorageDevice> devices = new ArrayList<StorageDevice>(); devices.add(getStorageDevice("device-without-anychange", DEVICE_WITHOUT_ANYCHANGE)); devices.add(getStorageDevice("new-device-with-name-change", DEVICE_WITHOUT_ANYCHANGE)); StorageDevice device = getStorageDevice("device-with-change", DEVICE_WITH_CHANGE); device.setMountPoint("/temp-mount"); device.setFsType("XFS"); device.setSize(12345678L); devices.add(device); device = getStorageDevice("device-with-devuuid-but-name-changed-1", DEVICE_WITH_DEVUUID_BUT_NAME_CHANGED); device.setDevUuid("123456"); devices.add(device); devices.add(getStorageDevice("device-with-devuuid-but-name-changed", null)); vdsRetValue.setReturnValue(devices); } else { vdsRetValue.setReturnValue(Collections.EMPTY_LIST); } return vdsRetValue; }

Target:
private Object getStorageDevicesVDSReturnVal(Guid hostId) { VDSReturnValue vdsRetValue = new VDSReturnValue(); vdsRetValue.setSucceeded(true); if (HOST_ID_WITH_NEW_DEVICES.equals(hostId)) { vdsRetValue.setReturnValue(Arrays.asList(getStorageDevice("sda", null), getStorageDevice("sdb", null), getStorageDevice("sdc", null))); } else if (HOST_ID_WITH_DEVICES_CHANGED.equals(hostId)) { List<StorageDevice> devices = new ArrayList<StorageDevice>(); devices.add(getStorageDevice("device-without-anychange", DEVICE_WITHOUT_ANYCHANGE)); devices.add(getStorageDevice("new-device-with-name-change", DEVICE_WITH_NAME_CHANGE)); StorageDevice device = getStorageDevice("device-with-change", DEVICE_WITH_CHANGE); device.setMountPoint("/temp-mount"); device.setFsType("XFS"); device.setSize(12345678L); devices.add(device); device = getStorageDevice("device-with-devuuid-but-name-changed-1", DEVICE_WITH_DEVUUID_BUT_NAME_CHANGED); device.setDevUuid("123456"); devices.add(device); devices.add(getStorageDevice("device-with-devuuid-but-name-changed", null)); vdsRetValue.setReturnValue(devices); } else { vdsRetValue.setReturnValue(Collections.EMPTY_LIST); } return vdsRetValue; }
Source:
public void testVCFModeIsConcordantWithGATK3_5Results() throws Exception { Utils.resetRandomGenerator(); final File output = createTempFile("testVCFModeIsConcordantWithGATK3Results", ".vcf"); final File gatk3Output = new File(TEST_FILES_DIR + "expected.testVCFMode.gatk3.5.vcf"); final String[] args = new String[] { "-I", NA12878_20_21_WGS_bam, "-R", b37_reference_20_21, "-L", "20:10000000-10100000", "-O", output.getAbsolutePath(), "-pairHMM", "AVX_LOGLESS_CACHING" }; runCommandLine(args); final double concordance = calculateConcordance(output, gatk3Output); Assert.assertTrue(concordance >= 0.99, "Concordance with GATK 3.5 in VCF mode is < 99%"); }

Target:
public void testVCFModeIsConcordantWithGATK3_5Results() throws Exception { Utils.resetRandomGenerator(); final File output = createTempFile("testVCFModeIsConcordantWithGATK3Results", ".vcf"); final File gatk3Output = new File(TEST_FILES_DIR + "expected.testVCFMode.gatk3.5.vcf"); final String[] args = { "-I", NA12878_20_21_WGS_bam, "-R", b37_reference_20_21, "-L", "20:10000000-10100000", "-O", output.getAbsolutePath(), "-pairHMM", "AVX_LOGLESS_CACHING" }; runCommandLine(args); final double concordance = calculateConcordance(output, gatk3Output); Assert.assertTrue(concordance >= 0.99, "Concordance with GATK 3.5 in VCF mode is < 99%"); }
Source:
public static PatchEnvironmentRequest fromJSON(JsonReader jsonReader) { List<String> pipelineToAdd = extractListFromJson(jsonReader, "pipelines", "add"); List<String> pipelineToRemove = extractListFromJson(jsonReader, "pipelines", "remove"); List<String> agentsToAdd = extractListFromJson(jsonReader, "agents", "add"); List<String> agentsToRemove = extractListFromJson(jsonReader, "agents", "remove"); List<String> envVariablesToRemove = extractListFromJson(jsonReader, "environment_variables", "remove"); List<EnvironmentVariableConfig> environmentVariablesToAdd = new ArrayList<>(); if (jsonReader.hasJsonObject("environment_variables")) { jsonReader.readJsonObject("environment_variables").readArrayIfPresent("add", array -> array.forEach(envVariable -> environmentVariablesToAdd .add(EnvironmentVariableRepresenter.fromJSON(envVariable.getAsJsonObject())) )); } PatchEnvironmentRequest patchRequest = new PatchEnvironmentRequest( pipelineToAdd, pipelineToRemove, agentsToAdd, agentsToRemove, environmentVariablesToAdd, envVariablesToRemove ); return patchRequest; }

Target:
public static PatchEnvironmentRequest fromJSON(JsonReader jsonReader) { List<String> pipelineToAdd = new ArrayList<>(); List<String> pipelineToRemove = new ArrayList<>(); List<String> agentsToAdd = new ArrayList<>(); List<String> agentsToRemove = new ArrayList<>(); List<EnvironmentVariableConfig> envVariablesToAdd = new ArrayList<>(); List<String> envVariableToRemove = new ArrayList<>(); jsonReader.optJsonObject("pipelines").ifPresent(reader -> { pipelineToAdd.addAll(reader.readStringArrayIfPresent("add").orElse(emptyList())); pipelineToRemove.addAll(reader.readStringArrayIfPresent("remove").orElse(emptyList())); }); jsonReader.optJsonObject("agents").ifPresent(reader -> { agentsToAdd.addAll(reader.readStringArrayIfPresent("add").orElse(emptyList())); agentsToRemove.addAll(reader.readStringArrayIfPresent("remove").orElse(emptyList())); }); jsonReader.optJsonObject("environment_variables").ifPresent(reader -> { envVariableToRemove.addAll(reader.readStringArrayIfPresent("remove").orElse(emptyList())); reader.readArrayIfPresent("add", array -> array.forEach(envVariable -> envVariablesToAdd .add(EnvironmentVariableRepresenter.fromJSON(envVariable.getAsJsonObject())) )); }); PatchEnvironmentRequest patchRequest = new PatchEnvironmentRequest( pipelineToAdd, pipelineToRemove, agentsToAdd, agentsToRemove, envVariablesToAdd, envVariableToRemove ); return patchRequest; }
Source:
public void testForceDeleteArtifactAllowed(@MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_1) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_1, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath) throws IOException { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); final RootRepositoryPath repositoryPath = repositoryPathResolver.resolve(repository); final String artifactPathStr = repositoryPath.relativize(artifactPath).toString(); final RepositoryPath artifactRepositoryPath = repositoryPathResolver.resolve(repository, artifactPathStr); client.delete(storageId, repositoryId, artifactPathStr, true); final Path artifactFileInTrash = RepositoryFiles.trash(artifactRepositoryPath); final Path repositoryDir = repositoryPath.resolve(repositoryId).resolve(".trash"); assertFalse(Files.exists(artifactFileInTrash), "Failed to delete artifact during a force delete operation!"); assertFalse(Files.exists(repositoryDir.resolve(artifactPathStr)), "Failed to delete artifact during a force delete operation!"); }

Target:
public void testForceDeleteArtifactAllowed(@MavenRepository(repositoryId = REPOSITORY_WITH_FORCE_DELETE_1) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_WITH_FORCE_DELETE_1, id = "org.carlspring.strongbox:test-artifact-to-trash", versions = "1.1") Path artifactPath) throws IOException { final String storageId = repository.getStorage().getId(); final String repositoryId = repository.getId(); final RepositoryPath artifactRepositoryPath = (RepositoryPath) artifactPath.normalize(); final String artifactRepositoryPathStr = RepositoryFiles.relativizePath(artifactRepositoryPath); client.delete(storageId, repositoryId, artifactRepositoryPathStr, true); final Path artifactFileInTrash = RepositoryFiles.trash(artifactRepositoryPath); final RootRepositoryPath repositoryPath = repositoryPathResolver.resolve(repository); final Path repositoryDir = repositoryPath.resolve(repositoryId).resolve(".trash"); assertFalse(Files.exists(artifactFileInTrash), "Failed to delete artifact during a force delete operation!"); assertFalse(Files.exists(repositoryDir.resolve(artifactRepositoryPathStr)), "Failed to delete artifact during a force delete operation!"); }
Source:
public void saveTo(ConfigurationSection cs) { Validate.isTrue(isValid(), "Could not save admin entry: " + name + ". Entry not valid!"); cs.set("username", name); cs.set("active", active); cs.set("rank", rank.toString()); cs.set("ips", Lists.newArrayList(ips)); cs.set("last_login", FUtil.dateToString(lastLogin)); cs.set("login_message", loginMessage); cs.set("commandspy_isactive", commandSpyStatus); }

Target:
public void saveTo(ConfigurationSection cs) { Validate.isTrue(isValid(), "Could not save admin entry: " + name + ". Entry not valid!"); cs.set("username", name); cs.set("active", active); cs.set("rank", rank.toString()); cs.set("ips", Lists.newArrayList(ips)); cs.set("last_login", FUtil.dateToString(lastLogin)); cs.set("login_message", loginMessage); cs.set("commandspy", commandSpy); }
Source:
private String getAllDataFromAttribute(final LnClientConnection conn, final int classNumber, final DataObject obisCode, final int attributeValue) throws ProtocolAdapterException, IOException, TimeoutException { if (!obisCode.isByteArray()) { this.throwUnexpectedTypeProtocolAdapterException(); } final byte[] obisCodeByteArray = obisCode.value(); if (obisCodeByteArray.length != OBIS_CODE_BYTE_ARRAY_LENGTH) { this.throwUnexpectedTypeProtocolAdapterException(); } final AttributeAddress attributeAddress = new AttributeAddress(classNumber, this.createObisCode(obisCodeByteArray), attributeValue); LOGGER.info("Retrieving configuration objects data for class id: {}, obis code: {}, attribute id: {}", classNumber, obisCodeByteArray, attributeValue); final List<GetResult> getResultList = conn.get(attributeAddress); final GetResult getResult = getResultList.get(0); LOGGER.info("ResultCode: {}", getResult.resultCode()); return this.dlmsHelper.getDebugInfo(getResult.resultData()); }

Target:
private String getAllDataFromAttribute(final LnClientConnection conn, final int classNumber, final DataObject obisCode, final int attributeValue) throws ProtocolAdapterException, IOException, TimeoutException { if (!obisCode.isByteArray()) { this.throwUnexpectedTypeProtocolAdapterException(); } final byte[] obisCodeByteArray = obisCode.value(); if (obisCodeByteArray.length != OBIS_CODE_BYTE_ARRAY_LENGTH) { this.throwUnexpectedTypeProtocolAdapterException(); } final AttributeAddress attributeAddress = new AttributeAddress(classNumber, this.createObisCode(obisCodeByteArray), attributeValue); LOGGER.debug("Retrieving configuration objects data for class id: {}, obis code: {}, attribute id: {}", classNumber, obisCodeByteArray, attributeValue); final List<GetResult> getResultList = conn.get(attributeAddress); final GetResult getResult = getResultList.get(0); LOGGER.debug("ResultCode: {}", getResult.resultCode()); return this.dlmsHelper.getDebugInfo(getResult.resultData()); }
Source:
public PublicKey getPublicKey(String kid, URL url) { if (!checkRemote(url)) { return null; } Map<String, RSAPublicKey> urlKeys = keys.get(url); if (urlKeys == null) { return null; } PublicKey pk = urlKeys.get(kid); if (pk == null) { log.warn("Unknown kid: " + kid); return null; } return pk; }

Target:
public PublicKey getPublicKey(String kid, URL url) { Map<String, RSAPublicKey> urlKeys = checkRemote(url); if (urlKeys == null) { return null; } PublicKey pk = urlKeys.get(kid); if (pk == null) { log.warn("Unknown kid: " + kid); return null; } return pk; }
Source:
public boolean isSet(String key) { Attribute a = map.get(key); return a != null ? a.getState() == State.SET : false; }

Target:
public boolean isSet(String key) { return (getState(key) == State.SET); }
Source:
private void maybeWriteToChannel() { if (firstChunk.isComplete() && readCalled) { while (operationException.get() == null && chunkIndexToBuffer.containsKey(indexOfNextChunkToWriteOut)) { ByteBuffer chunkBuf = chunkIndexToBuffer.remove(indexOfNextChunkToWriteOut); asyncWritableChannel.write(chunkBuf, chunkAsyncWriteCallback); indexOfNextChunkToWriteOut++; } if (operationException.get() != null || numChunksWrittenOut.get() == numChunksTotal) { completeRead(); } } }

Target:
private void maybeWriteToChannel() { if (firstChunk.isComplete() && readCalled) { while (operationException.get() == null && chunkIndexToBuffer.containsKey(indexOfNextChunkToWriteOut)) { ByteBuffer chunkBuf = chunkIndexToBuffer.remove(indexOfNextChunkToWriteOut); asyncWritableChannel.write(chunkBuf, chunkAsyncWriteCallback); indexOfNextChunkToWriteOut++; } if (operationException.get() != null || numChunksWrittenOut == numChunksTotal) { completeRead(); } } }
Source:
public String getUrl(int requestId, CheckerInfo checkerInfo) { return String.format(URL, checkerInfo.getCurrencyBase().toLowerCase(), checkerInfo.getCurrencyCounter().toLowerCase()); }

Target:
public String getUrl(int requestId, CheckerInfo checkerInfo) { return String.format(URL, checkerInfo.getCurrencyBaseLowerCase(), checkerInfo.getCurrencyCounterLowerCase()); }
Source:
public static Parameter summaryYears() { return new ParameterBuilder() .name("summaryYears") .description("Select summary data for 1, 5, or all years.") .modelRef(new ModelRef("string")) .parameterType("query") .required(false) .allowableValues(new AllowableListValues(Arrays.asList("1", "5", "all"), "LIST")) .build(); }

Target:
public static Parameter summaryYears() { return new ParameterBuilder() .name("summaryYears") .description("Select summary data for 1, 5, or all years. If no summary year is selected, all years is returned by default.") .modelRef(new ModelRef("string")) .parameterType("query") .required(false) .allowableValues(new AllowableListValues(Arrays.asList("1", "5", "all"), "LIST")) .build(); }
Source:
protected Node[] createNodes(AbstractFile t) { Node[] node = new Node[1]; if(t.isDir()){ return node; } else { node[0] = new DataResultFilterNode(new FileNode(t, false), DirectoryTreeTopComponent.findInstance().getExplorerManager()); return node; } }

Target:
protected Node[] createNodes(AbstractFile t) { Node[] node = new Node[1]; node[0] = new DataResultFilterNode(new FileNode(t, false), DirectoryTreeTopComponent.findInstance().getExplorerManager()); return node; }
Source:
public static void tryWipeCache() { try { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); if (userDb != null) { SqlStorage.wipeTable(userDb, TABLE_NAME); } String username = CommCareApplication.instance().getSession().getLoggedInUser().getUsername(); setEntityCacheWipedPref(username, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); } catch (SessionUnavailableException e) { e.printStackTrace(); } }

Target:
public static void tryWipeCache() { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); SqlStorage.wipeTable(userDb, TABLE_NAME); String uuid = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); setEntityCacheWipedPref(uuid, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); }
Source:
public Node toRootNode() { if (zippers.size() == 0) { return commonRoot; } List<AstZipper> curZippers = new ArrayList<>(zippers); while (curZippers.size() > 1) { List<AstZipper> deepestZippers = getDeepestZippers(curZippers); Map<Node, List<AstZipper>> sameParent = zipperWithSameParent(deepestZippers); List<AstZipper> newZippers = new ArrayList<>(); for (Map.Entry<Node, List<AstZipper>> entry : sameParent.entrySet()) { AstZipper newZipper = moveUp(entry.getKey(), entry.getValue()); newZippers.add(newZipper); } curZippers.removeAll(deepestZippers); curZippers.addAll(newZippers); } assertTrue(curZippers.size() == 1, "illegal state"); return curZippers.get(0).toRoot(); }

Target:
public Node toRootNode() { if (zippers.size() == 0) { return commonRoot; } List<AstZipper> curZippers = new ArrayList<>(zippers); while (curZippers.size() > 1) { List<AstZipper> deepestZippers = getDeepestZippers(curZippers); Map<Node, List<AstZipper>> sameParent = zipperWithSameParent(deepestZippers); List<AstZipper> newZippers = new ArrayList<>(); for (Map.Entry<Node, List<AstZipper>> entry : sameParent.entrySet()) { AstZipper newZipper = moveUp(entry.getKey(), entry.getValue()); Optional<AstZipper> zipperToBeReplaced = curZippers.stream().filter(zipper -> zipper.getCurNode() == entry.getKey()).findFirst(); zipperToBeReplaced.ifPresent(curZippers::remove); newZippers.add(newZipper); } curZippers.removeAll(deepestZippers); curZippers.addAll(newZippers); } assertTrue(curZippers.size() == 1, "unexpected state: all zippers must share the same root node"); return curZippers.get(0).toRoot(); }
Source:
public void checkContainers() throws InterruptedException { long minIntervalMs = getMinIntervalMs(); for (String containerPath : getCandidates()) { long startMs = Time.currentElapsedTime(); ByteBuffer path = ByteBuffer.wrap(containerPath.getBytes()); Request request = new Request(null, 0, 0, ZooDefs.OpCode.deleteContainer, path, null); try { LOG.info(String.format("Attempting to delete candidate container: %s", containerPath)); requestProcessor.processRequest(request); } catch (Exception e) { LOG.error(String.format("Could not delete container: %s" , containerPath), e); } long elapsedMs = Time.currentElapsedTime() - startMs; long waitMs = minIntervalMs - elapsedMs; if (waitMs > 0) { Thread.sleep(waitMs); } } }

Target:
public void checkContainers() throws InterruptedException { long minIntervalMs = getMinIntervalMs(); for (String containerPath : getCandidates()) { long startMs = Time.currentElapsedTime(); ByteBuffer path = ByteBuffer.wrap(containerPath.getBytes()); Request request = new Request(null, 0, 0, ZooDefs.OpCode.deleteContainer, path, null); try { LOG.info("Attempting to delete candidate container: {}", containerPath); requestProcessor.processRequest(request); } catch (Exception e) { LOG.error("Could not delete container: {}", containerPath, e); } long elapsedMs = Time.currentElapsedTime() - startMs; long waitMs = minIntervalMs - elapsedMs; if (waitMs > 0) { Thread.sleep(waitMs); } } }
Source:
protected TimeGraphMarkerAxis createTimeGraphMarkerAxis(Composite parent, @NonNull TimeGraphColorScheme colorScheme, @NonNull ITimeDataProvider timeProvider) { TimeGraphMarkerAxisExtension timeGraphMarkerAxis = new TimeGraphMarkerAxisExtension(parent, colorScheme, timeProvider); Tree tree = fTreeViewer.getTree(); tree.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { Rectangle bounds = timeGraphMarkerAxis.getAxisBounds(); e.gc.setBackground(timeGraphMarkerAxis.getBackground()); timeGraphMarkerAxis.drawMarkerAxis(bounds, bounds.width, e.gc); } }); tree.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { Rectangle bounds = timeGraphMarkerAxis.getAxisBounds(); if (bounds.contains(e.x, e.y)) { timeGraphMarkerAxis.mouseDown(e, bounds, bounds.width); } } }); tree.getHorizontalBar().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { tree.redraw(); } }); return timeGraphMarkerAxis; }

Target:
protected TimeGraphMarkerAxis createTimeGraphMarkerAxis(Composite parent, @NonNull TimeGraphColorScheme colorScheme, @NonNull ITimeDataProvider timeProvider) { TimeGraphMarkerAxisExtension timeGraphMarkerAxis = new TimeGraphMarkerAxisExtension(parent, colorScheme, timeProvider); Tree tree = fTreeViewer.getTree(); tree.addPaintListener(e -> { Rectangle bounds = timeGraphMarkerAxis.getAxisBounds(); e.gc.setBackground(timeGraphMarkerAxis.getBackground()); timeGraphMarkerAxis.drawMarkerAxis(bounds, bounds.width, e.gc); }); tree.addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { Rectangle bounds = timeGraphMarkerAxis.getAxisBounds(); if (bounds.contains(e.x, e.y)) { timeGraphMarkerAxis.mouseDown(e, bounds, bounds.width); } } }); tree.getHorizontalBar().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { tree.redraw(); } }); return timeGraphMarkerAxis; }
Source:
void sync(int sourceRepoIndex, int destRepoIndex, AuthenticationInfo subject) throws IOException { LOG.info("Sync started"); NotebookAuthorization auth = NotebookAuthorization.getInstance(); NotebookRepo srcRepo = getRepo(sourceRepoIndex); NotebookRepo dstRepo = getRepo(destRepoIndex); List <NoteInfo> allSrcNotes = srcRepo.list(subject); List <NoteInfo> srcNotes = auth.filterByUser(allSrcNotes, subject); List <NoteInfo> dstNotes = dstRepo.list(subject); Map<String, List<String>> noteIds = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo, subject); List<String> pushNoteIds = noteIds.get(pushKey); List<String> pullNoteIds = noteIds.get(pullKey); List<String> delDstNoteIds = noteIds.get(delDstKey); if (!pushNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be pushed"); for (String id : pushNoteIds) { LOG.info("ID : " + id); } pushNotes(subject, pushNoteIDs, srcRepo, dstRepo, false); } else { LOG.info("Nothing to push"); } if (!pullNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be pulled"); for (String id : pullNoteIds) { LOG.info("ID : " + id); } pushNotes(subject, pullNoteIDs, dstRepo, srcRepo, true); } else { LOG.info("Nothing to pull"); } if (!delDstNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be deleted from dest"); for (String id : delDstNoteIds) { LOG.info("ID : " + id); } deleteNotes(subject, delDstNoteIds, dstRepo); } else { LOG.info("Nothing to delete from dest"); } LOG.info("Sync ended"); }

Target:
void sync(int sourceRepoIndex, int destRepoIndex, AuthenticationInfo subject) throws IOException { LOG.info("Sync started"); NotebookAuthorization auth = NotebookAuthorization.getInstance(); NotebookRepo srcRepo = getRepo(sourceRepoIndex); NotebookRepo dstRepo = getRepo(destRepoIndex); List <NoteInfo> allSrcNotes = srcRepo.list(subject); List <NoteInfo> srcNotes = auth.filterByUser(allSrcNotes, subject); List <NoteInfo> dstNotes = dstRepo.list(subject); Map<String, List<String>> noteIds = notesCheckDiff(srcNotes, srcRepo, dstNotes, dstRepo, subject); List<String> pushNoteIds = noteIds.get(pushKey); List<String> pullNoteIds = noteIds.get(pullKey); List<String> delDstNoteIds = noteIds.get(delDstKey); if (!pushNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be pushed"); for (String id : pushNoteIds) { LOG.info("ID : " + id); } pushNotes(subject, pushNoteIds, srcRepo, dstRepo, false); } else { LOG.info("Nothing to push"); } if (!pullNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be pulled"); for (String id : pullNoteIds) { LOG.info("ID : " + id); } pushNotes(subject, pullNoteIds, dstRepo, srcRepo, true); } else { LOG.info("Nothing to pull"); } if (!delDstNoteIds.isEmpty()) { LOG.info("Notes with the following IDs will be deleted from dest"); for (String id : delDstNoteIds) { LOG.info("ID : " + id); } deleteNotes(subject, delDstNoteIds, dstRepo); } else { LOG.info("Nothing to delete from dest"); } LOG.info("Sync ended"); }
Source:
public TrackingContext(String clientCorrelationID) { if ((clientCorrelationID.length() > MAX_CLIENT_CORRELATION_ID_LENGTH) || (!clientCorrelationID.matches(CLIENT_CORRELATION_ID_PATTERN))) { this.clientCorrelationID = DEFAULT_FS_AZURE_CLIENT_CORRELATION_ID; LOG.debug("Invalid config provided; correlation id not included in header."); } else if (clientCorrelationID.length() > 0) { this.clientCorrelationID = clientCorrelationID + ":"; LOG.debug("Client correlation id has been validated and set successfully."); } else { this.clientCorrelationID = DEFAULT_FS_AZURE_CLIENT_CORRELATION_ID; LOG.debug( "Correlation id not provided in config, hence excluded from header."); } }

Target:
public TrackingContext(String clientCorrelationID) { if (clientCorrelationID == null) clientCorrelationID = EMPTY_STRING; if ((clientCorrelationID.length() > MAX_CLIENT_CORRELATION_ID_LENGTH) || (!clientCorrelationID.matches(CLIENT_CORRELATION_ID_PATTERN))) { this.clientCorrelationID = EMPTY_STRING; LOG.debug("Invalid config provided; correlation id not included in header."); } else if (clientCorrelationID.length() > 0) { this.clientCorrelationID = clientCorrelationID + ":"; } else { this.clientCorrelationID = EMPTY_STRING; } }
Source:
public static boolean start() throws IOException, InterruptedException, NoSuchFieldException, IllegalAccessException { if (!new File(getPathSpec()).exists() || !new File(getPathFixture()).exists()) { return false; } if (process != null && isAlive(process)) { System.out.println(String.format("stripe-mock is already running, port = %s", port)); return true; } else { process = null; port = null; pid = null; } ProcessBuilder processBuilder = new ProcessBuilder() .command( "stripe-mock", "-http-port", "0", "-spec", getPathSpec(), "-fixtures", getPathFixture(), "-strict-version-check" ); try { process = processBuilder.start(); } catch (IOException e) { System.out.println(String.format( "Error while starting stripe-mock, fixtures = %s and %s, error message = %s", getPathSpec(), getPathFixture(), e.getMessage() )); System.exit(1); } pid = getProcessId(process); if (isAlive(process)) { System.out.println(String.format("Started stripe-mock, PID = %s", pid)); System.out.println("Finding port bound to stripe-mock..."); port = detectBoundPort(process); if (port == null) { System.out.println(String.format("Unable to find port for stripe-mock, PID = %s", pid)); System.exit(1); } } else { System.out.println( String.format("stripe-mock terminated early, exit value = %d", process.exitValue())); System.exit(1); } return true; }

Target:
public static boolean start() throws IOException, InterruptedException, NoSuchFieldException, IllegalAccessException { if (!new File(getPathSpec()).exists() || !new File(getPathFixture()).exists()) { return false; } if (process != null && isAlive(process)) { System.out.println(String.format("stripe-mock is already running, port = %s", port)); return true; } else { process = null; port = null; pid = null; } ProcessBuilder processBuilder = new ProcessBuilder() .command( "stripe-mock", "-http-port", "0", "-spec", getPathSpec(), "-fixtures", getPathFixture() ); try { process = processBuilder.start(); } catch (IOException e) { System.out.println(String.format( "Error while starting stripe-mock, fixtures = %s and %s, error message = %s", getPathSpec(), getPathFixture(), e.getMessage() )); System.exit(1); } pid = getProcessId(process); if (isAlive(process)) { System.out.println(String.format("Started stripe-mock, PID = %s", pid)); System.out.println("Finding port bound to stripe-mock..."); port = detectBoundPort(process); if (port == null) { System.out.println(String.format("Unable to find port for stripe-mock, PID = %s", pid)); System.exit(1); } } else { System.out.println( String.format("stripe-mock terminated early, exit value = %d", process.exitValue())); System.exit(1); } return true; }
Source:
private static void clip3primeEndsTo5primeEnds(final SAMRecord pos, final SAMRecord neg, final boolean hardClipReads, final boolean useUnclippedEnds) { final int negEnd = useUnclippedEnds? neg.getUnclippedEnd() : neg.getEnd(); final int posStart = useUnclippedEnds? pos.getUnclippedStart() : pos.getStart(); final int posLastUnclipped = getReadPositionAtReferencePositionIgnoreSoftClips(pos, negEnd); int negFirstBaseToClip = getReadPositionAtReferencePositionIgnoreSoftClips(neg, posStart - 1); negFirstBaseToClip = negFirstBaseToClip > 0 ? (neg.getReadLength() + 1) - negFirstBaseToClip : 0; if(posLastUnclipped > 0 && posLastUnclipped < pos.getReadLength()) { clip3PrimeEndOfRead(pos, posLastUnclipped + 1, hardClipReads); } if(negFirstBaseToClip > 0) { clip3PrimeEndOfRead(neg, negFirstBaseToClip, hardClipReads); } }

Target:
private static void clip3primeEndsTo5primeEnds(final SAMRecord pos, final SAMRecord neg, final boolean hardClipReads, final boolean useUnclippedEnds) { final int negEnd = useUnclippedEnds? neg.getUnclippedEnd() : neg.getEnd(); final int posStart = useUnclippedEnds? pos.getUnclippedStart() : pos.getStart(); final int pos3PrimeMostUnclipped = getReadPositionAtReferencePositionIgnoreSoftClips(pos, negEnd); if (pos3PrimeMostUnclipped > 0 && pos3PrimeMostUnclipped < pos.getReadLength()) { final int pos5PrimeMostClipped = pos3PrimeMostUnclipped + 1; clip3PrimeEndOfRead(pos, pos5PrimeMostClipped, hardClipReads); } final int neg5PrimeMostBaseToClipPositionFromStart = getReadPositionAtReferencePositionIgnoreSoftClips(neg, posStart - 1); final int negFirstBaseFrom5PrimeEndToClip = neg5PrimeMostBaseToClipPositionFromStart > 0 ? (neg.getReadLength() + 1) - neg5PrimeMostBaseToClipPositionFromStart : 0; if (negFirstBaseFrom5PrimeEndToClip > 0) { clip3PrimeEndOfRead(neg, negFirstBaseFrom5PrimeEndToClip, hardClipReads); } }
Source:
protected void handleDemandLoadException(Resource resource, IOException exception) throws RuntimeException { try { super.handleDemandLoadException(resource, exception); } catch (Exception e) { } }

Target:
protected void handleDemandLoadException(Resource resource, IOException exception) throws RuntimeException { try { super.handleDemandLoadException(resource, exception); } catch (RuntimeException e) { } }
Source:
public BookmarkEventRequest(ISegmentStore<ISegment> bookmarks) { super(bookmarks); fCategories.put(CATEGORY, fDefaultColors.get(0)); }

Target:
public BookmarkEventRequest(ISegmentStore<ISegment> bookmarks) { super(bookmarks); fCategories.put(LOG_CATEGORY, new RGBA(0, 0, 0, 100)); fCategories.put(STDOUT_CATEGORY, new RGBA(90, 90, 90, 70)); }