auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static int hashMemory(final Memory memory, final long position, final int length) { switch (length) { case 4: return 31 + memory.getInt(position); case 8: return 31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES); case 9: return 31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getByte(position + 2 * Integer.BYTES); case 12: return 31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES); case 13: return 31 * (31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES)) + memory.getByte(position + 3 * Integer.BYTES); case 16: return 31 * (31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES)) + memory.getInt(position + 3 * Integer.BYTES); default: int hashCode = 1; int remainingBytes = length; long pos = position; while (remainingBytes >= Integer.BYTES) { hashCode = 31 * hashCode + memory.getInt(pos); remainingBytes -= Integer.BYTES; pos += Integer.BYTES; } if (remainingBytes == 1) { hashCode = 31 * hashCode + memory.getByte(pos); } else if (remainingBytes == 2) { hashCode = 31 * hashCode + memory.getByte(pos); hashCode = 31 * hashCode + memory.getByte(pos + 1); } else if (remainingBytes == 3) { hashCode = 31 * hashCode + memory.getByte(pos); hashCode = 31 * hashCode + memory.getByte(pos + 1); hashCode = 31 * hashCode + memory.getByte(pos + 2); } return hashCode; } }

Target:
public static int hashMemory(final Memory memory, final long position, final int length) { switch (length) { case 4: return memory.getInt(position); case 8: return 31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES); case 9: return 31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getByte(position + 2 * Integer.BYTES); case 12: return 31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES); case 13: return 31 * (31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES)) + memory.getByte(position + 3 * Integer.BYTES); case 16: return 31 * (31 * (31 * (31 + memory.getInt(position)) + memory.getInt(position + Integer.BYTES)) + memory.getInt(position + 2 * Integer.BYTES)) + memory.getInt(position + 3 * Integer.BYTES); default: int hashCode = 1; int remainingBytes = length; long pos = position; while (remainingBytes >= Integer.BYTES) { hashCode = 31 * hashCode + memory.getInt(pos); remainingBytes -= Integer.BYTES; pos += Integer.BYTES; } if (remainingBytes == 1) { hashCode = 31 * hashCode + memory.getByte(pos); } else if (remainingBytes == 2) { hashCode = 31 * hashCode + memory.getByte(pos); hashCode = 31 * hashCode + memory.getByte(pos + 1); } else if (remainingBytes == 3) { hashCode = 31 * hashCode + memory.getByte(pos); hashCode = 31 * hashCode + memory.getByte(pos + 1); hashCode = 31 * hashCode + memory.getByte(pos + 2); } return hashCode; } }
Source:
public void play() { if (isPaused()) { togglePause(); } else if( !this.mobile ) { clickOnArea(2); } else { clickOnArea(4); } }

Target:
public void play() { if (isPausedWithOverlay()) { togglePause(); } else if( !this.mobile ) { clickOnArea(2); } else { clickOnArea(4); } }
Source:
public void evaluate() throws Exception { assertTrue(Franke.evaluate(0.0, 0.0) > 0); assertTrue(Franke.evaluate(1.0, 0.0) > 0); assertTrue(Franke.evaluate(0.0, 1.0) > 0); assertTrue(Franke.evaluate(1.0, 1.0) > 0); }

Target:
public void evaluate() throws Exception { assertTrue(Franke.evaluate(0.0, 0.0) > 0); assertTrue(Franke.evaluate(1.0, 0.0) > 0); assertTrue(Franke.evaluate(0.0, 1.0) > 0); assertTrue(Franke.evaluate(1.0, 1.0) > 0); assertTrue(Franke.evaluate(0.2, 0.2) > 0); assertTrue(Franke.evaluate(0.0, 0.0) < 1.22); assertTrue(Franke.evaluate(1.0, 0.0) < 1.22); assertTrue(Franke.evaluate(0.0, 1.0) < 1.22); assertTrue(Franke.evaluate(1.0, 1.0) < 1.22); assertTrue(Franke.evaluate(0.2, 0.2) < 1.22); }
Source:
private ExecutableContainer loadExecutableContainer(Session session, InternalTask task) { try { ExecutableContainer container = null; if (task.getClass().equals(InternalForkedScriptTask.class)) { TaskData taskData = queryScriptTaskData(session, task); if (taskData != null) { container = taskData.createExecutableContainer(); } } else if (task.getClass().equals(InternalScriptTask.class)) { TaskData taskData = queryScriptTaskData(session, task); if (taskData != null) { container = taskData.createExecutableContainer(); } } else { throw new IllegalArgumentException("Unexpected task class: " + task.getClass()); } if (container == null) { throw new DatabaseManagerException("Failed to load data for task " + task.getId()); } return container; } catch (Exception e) { throw new DatabaseManagerException(e); } }

Target:
private ExecutableContainer loadExecutableContainer(Session session, InternalTask task) { try { ExecutableContainer container = null; if (isScriptTask(task)) { TaskData taskData = queryScriptTaskData(session, task); if (taskData != null) { container = taskData.createExecutableContainer(); } } else { throw new IllegalArgumentException("Unexpected task class: " + task.getClass()); } if (container == null) { throw new DatabaseManagerException("Failed to load data for task " + task.getId()); } return container; } catch (Exception e) { throw new DatabaseManagerException(e); } }
Source:
public static String getName(Context cxt, int category) { if (category < 0 || category > CATEGORY_NAMES_ID.length) { return null; } return cxt.getString(CATEGORY_NAMES_ID[category - 1]); }

Target:
public static String getName(Context cxt, int category) { return (category > 0 && category < CATEGORY_NAMES_ID.length + 1) ? cxt.getString(CATEGORY_NAMES_ID[category - 1]) : null; }
Source:
private static String createUrl(String httpPath) { return String.format("%s/%s", server, httpPath); }

Target:
private static String createUrl(String httpPath) { if (httpPath == null) { return server.toString(); } try { return new URL(server, httpPath).toString(); } catch (MalformedURLException ex) { throw new RuntimeException(ex); } }
Source:
protected void endVmCommand() { initializeObjectState(); if (getParameters().getTaskGroupSuccess()) { getSnapshotDao().remove(getParameters().getSnapshotId()); } else { List<String> failedToRemoveDisks = new ArrayList<>(); for (VdcActionParametersBase parametersBase : getParameters().getImagesParameters()) { ImagesContainterParametersBase imagesParams = (ImagesContainterParametersBase) parametersBase; if (imagesParams.getTaskGroupSuccess()) { Snapshot snapshotWithoutImage = ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage( getParameters().getSnapshotId(), imagesParams.getImageId()); getSnapshotDao().update(snapshotWithoutImage); } else { log.errorFormat("Could not delete image {1} from snapshot {2}", getParameters().getSnapshotId(), imagesParams.getImageId()); DiskImage diskImage = getDiskImageDao().getSnapshotById(imagesParams.getImageId()); failedToRemoveDisks.add(diskImage.getDiskAlias()); } } if (!failedToRemoveDisks.isEmpty()) { addCustomValue("DiskAlias", StringUtils.join(failedToRemoveDisks, ", ")); AuditLogDirector.log(this, AuditLogType.USER_REMOVE_SNAPSHOT_FINISHED_FAILURE_PARTIAL_SNAPSHOT); } getSnapshotDao().updateStatus(getParameters().getSnapshotId(), SnapshotStatus.OK); } super.endVmCommand(); }

Target:
protected void endVmCommand() { initializeObjectState(); if (getParameters().getTaskGroupSuccess()) { getSnapshotDao().remove(getParameters().getSnapshotId()); } else { List<String> failedToRemoveDisks = new ArrayList<>(); for (VdcActionParametersBase parametersBase : getParameters().getImagesParameters()) { ImagesContainterParametersBase imagesParams = (ImagesContainterParametersBase) parametersBase; if (imagesParams.getTaskGroupSuccess()) { Snapshot snapshotWithoutImage = ImagesHandler.prepareSnapshotConfigWithoutImageSingleImage( getParameters().getSnapshotId(), imagesParams.getImageId()); getSnapshotDao().update(snapshotWithoutImage); } else { log.errorFormat("Could not delete image {0} from snapshot {1}", getParameters().getSnapshotId(), imagesParams.getImageId()); DiskImage diskImage = getDiskImageDao().getSnapshotById(imagesParams.getImageId()); failedToRemoveDisks.add(diskImage.getDiskAlias()); } } if (!failedToRemoveDisks.isEmpty()) { addCustomValue("DiskAliases", StringUtils.join(failedToRemoveDisks, ", ")); AuditLogDirector.log(this, AuditLogType.USER_REMOVE_SNAPSHOT_FINISHED_FAILURE_PARTIAL_SNAPSHOT); } getSnapshotDao().updateStatus(getParameters().getSnapshotId(), SnapshotStatus.OK); } super.endVmCommand(); }
Source:
private void setupContextListener() { IDebugContextManager contextManager = DebugUITools.getDebugContextManager(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); fDebugContextListener = new IDebugContextListener() { @Override public void debugContextChanged(DebugContextEvent event) { try { if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { ISelection s = event.getContext(); setDebugContext(s); } } catch (Throwable e) { e.printStackTrace(); } } }; contextService.addDebugContextListener(fDebugContextListener); setDebugContext(contextService.getActiveContext()); }

Target:
private void setupContextListener() { IDebugContextManager contextManager = DebugUITools.getDebugContextManager(); IDebugContextService contextService = contextManager .getContextService(getSite().getWorkbenchWindow()); fDebugContextListener = new IDebugContextListener() { @Override public void debugContextChanged(DebugContextEvent event) { if ((event.getFlags() & DebugContextEvent.ACTIVATED) != 0) { ISelection s = event.getContext(); setDebugContext(s); } } }; contextService.addDebugContextListener(fDebugContextListener); setDebugContext(contextService.getActiveContext()); }
Source:
protected ListedHashTree getLnpTestPlan() { ListedHashTree testPlan = new ListedHashTree(JMeterElements.testPlan()); HashTree threadGroup = testPlan.add( JMeterElements.threadGroup(NUMBER_OF_USER_ACCOUNTS, RAMP_UP_PERIOD, 1)); threadGroup.add(JMeterElements.csvDataSet(getPathToTestDataFile(getCsvConfigPath()))); threadGroup.add(JMeterElements.cookieManager()); threadGroup.add(JMeterElements.defaultSampler()); threadGroup.add(JMeterElements.onceOnlyController()) .add(JMeterElements.loginSampler()); String firstPath = "webapi/student?courseid=${courseId}"; threadGroup.add(JMeterElements.httpSampler(firstPath, GET, null)); String secondPath = "webapi/session?courseid=${courseId}&fsname=${fsname}&intent=STUDENT_SUBMISSION"; threadGroup.add(JMeterElements.httpSampler(secondPath, GET, null)); String thirdPath = "webapi/questions?courseid=${courseId}&fsname=${fsname}&intent=STUDENT_SUBMISSION"; threadGroup.add(JMeterElements.httpSampler(thirdPath, GET, null)); return testPlan; }

Target:
protected ListedHashTree getLnpTestPlan() { ListedHashTree testPlan = new ListedHashTree(JMeterElements.testPlan()); HashTree threadGroup = testPlan.add( JMeterElements.threadGroup(NUMBER_OF_USER_ACCOUNTS, RAMP_UP_PERIOD, 1)); threadGroup.add(JMeterElements.csvDataSet(getPathToTestDataFile(getCsvConfigPath()))); threadGroup.add(JMeterElements.cookieManager()); threadGroup.add(JMeterElements.defaultSampler()); threadGroup.add(JMeterElements.onceOnlyController()) .add(JMeterElements.loginSampler()); String getSessionsPath = "webapi/student?courseid=${courseId}"; threadGroup.add(JMeterElements.httpSampler(getSessionsPath, GET, null)); String getSessionDetailsPath = "webapi/session?courseid=${courseId}&fsname=${fsname}&intent=STUDENT_SUBMISSION"; threadGroup.add(JMeterElements.httpSampler(getSessionDetailsPath, GET, null)); String getQuestionsPath = "webapi/questions?courseid=${courseId}&fsname=${fsname}&intent=STUDENT_SUBMISSION"; threadGroup.add(JMeterElements.httpSampler(getQuestionsPath, GET, null)); return testPlan; }
Source:
public OutputStream encodingStream(final Writer out) { checkNotNull(out); return new OutputStream() { int bitBuffer = 0; int bitBufferLength = 0; int writtenChars = 0; @Override public void write(int b) throws IOException { bitBuffer <<= 8; bitBuffer |= b & 0xFF; bitBufferLength += 8; while (bitBufferLength >= alphabet.bitsPerChar) { int charIndex = (bitBuffer >> (bitBufferLength - alphabet.bitsPerChar)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; bitBufferLength -= alphabet.bitsPerChar; } } @Override public void flush() throws IOException { out.flush(); } @Override public void close() throws IOException { if (bitBufferLength > 0) { int charIndex = (bitBuffer << (alphabet.bitsPerChar - bitBufferLength)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; if (paddingChar != null) { while (writtenChars % alphabet.charsPerChunk != 0) { out.write(paddingChar.charValue()); writtenChars++; } } } bitBufferLength = 0; out.close(); } }; }

Target:
public OutputStream encodingStream(final Writer out) { checkNotNull(out); return new OutputStream() { int bitBuffer = 0; int bitBufferLength = 0; int writtenChars = 0; @Override public void write(int b) throws IOException { bitBuffer <<= 8; bitBuffer |= b & 0xFF; bitBufferLength += 8; while (bitBufferLength >= alphabet.bitsPerChar) { int charIndex = (bitBuffer >> (bitBufferLength - alphabet.bitsPerChar)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; bitBufferLength -= alphabet.bitsPerChar; } } @Override public void flush() throws IOException { out.flush(); } @Override public void close() throws IOException { if (bitBufferLength > 0) { int charIndex = (bitBuffer << (alphabet.bitsPerChar - bitBufferLength)) & alphabet.mask; out.write(alphabet.encode(charIndex)); writtenChars++; bitBufferLength = 0; if (paddingChar != null) { while (writtenChars % alphabet.charsPerChunk != 0) { out.write(paddingChar.charValue()); writtenChars++; } } } out.close(); } }; }
Source:
private void handleUncaughtThrowable(Throwable t) { if (errored.compareAndSet(false, true)) { log.error("unrecoverable error in task feeder or one of its mapper threads. immediately halting jvm", t); Runtime.getRuntime().halt(1); } }

Target:
private void handleUncaughtThrowable(Throwable t) { if (errored.compareAndSet(false, true)) { log.error("unrecoverable error in task feeder or one of its mapper threads. immediately halting jvm", t); Shutdown.exit(1); } }
Source:
public static HttpMethod createHttpMethod(String httpMethodString) { if (METHOD_GET.equals(httpMethodString)) { return HttpMethod.GET; } else if (METHOD_PUT.equals(httpMethodString)) { return HttpMethod.PUT; } else if (METHOD_POST.equals(httpMethodString)) { return HttpMethod.POST; } else if (METHOD_DELETE.equals(httpMethodString)) { return HttpMethod.DELETE; } else { throw new IllegalArgumentException("given httpMethod '" + httpMethodString + "' is unknown"); } }

Target:
public static HttpMethod createHttpMethod(String httpMethodString) { return Optional.ofNullable(HttpMethod.fromString(httpMethodString)) .filter(m -> m == GET || m == POST || m == PUT || m == DELETE) .orElseThrow(() -> new IllegalArgumentException("Given HTTP Method '" + httpMethodString + "' is unknown")); }
Source:
static void beginEnqueueingWork(Context context, String osNotificationId, int androidNotificationId, String jsonPayload, boolean isRestoring, long timestamp, boolean isHighPriority) { Data inputData = new Data.Builder() .putInt(ANDROID_NOTIF_ID_WORKER_DATA_PARAM, androidNotificationId) .putString(JSON_PAYLOAD_WORKER_DATA_PARAM, jsonPayload) .putLong(TIMESTAMP_WORKER_DATA_PARAM, timestamp) .putBoolean(IS_RESTORING_WORKER_DATA_PARAM, isRestoring) .build(); OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(NotificationWorker.class) .setInputData(inputData) .build(); if (!Strings.isEmptyOrWhitespace(osNotificationId)) { if (notificationIds.contains(osNotificationId)) { OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "OSNotificationWorkManager notification with notificationId: " + osNotificationId + " already queued"); return; } else { notificationIds.add(osNotificationId); } } OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "OSNotificationWorkManager enqueueing notification work with notificationId: " + osNotificationId + " and jsonPayload: " + jsonPayload); WorkManager.getInstance(context) .enqueueUniqueWork(osNotificationId, ExistingWorkPolicy.KEEP, workRequest); }

Target:
static void beginEnqueueingWork(Context context, String osNotificationId, int androidNotificationId, String jsonPayload, boolean isRestoring, long timestamp, boolean isHighPriority) { Data inputData = new Data.Builder() .putInt(ANDROID_NOTIF_ID_WORKER_DATA_PARAM, androidNotificationId) .putString(JSON_PAYLOAD_WORKER_DATA_PARAM, jsonPayload) .putLong(TIMESTAMP_WORKER_DATA_PARAM, timestamp) .putBoolean(IS_RESTORING_WORKER_DATA_PARAM, isRestoring) .build(); OneTimeWorkRequest workRequest = new OneTimeWorkRequest.Builder(NotificationWorker.class) .setInputData(inputData) .build(); OneSignal.Log(OneSignal.LOG_LEVEL.DEBUG, "OSNotificationWorkManager enqueueing notification work with notificationId: " + osNotificationId + " and jsonPayload: " + jsonPayload); WorkManager.getInstance(context) .enqueueUniqueWork(osNotificationId, ExistingWorkPolicy.KEEP, workRequest); }
Source:
public Domain domain(final String name) { final Domain domain = this.origin.domain(name); return new Domain() { @Override public void create() { domain.create(); } @Override public void drop() { domain.drop(); } @Override public String name() { return domain.name(); } @Override public Item item(final String name) { return domain.item(name); } @Override public Iterable<Item> select(final SelectRequest request) { return new Iterable<Item>() { @Override public Iterator<Item> iterator() { return Iterators.filter( domain.select(request).iterator(), new Predicate<Item>() { @Override public boolean apply(final Item item) { return Long.parseLong(item.get("time")) < SanitizedDomains.this.limit; } } ); } }; } }; }

Target:
public Domain domain(final String name) { final Domain domain = this.origin.domain(name); return new Domain() { @Override public void create() { domain.create(); } @Override public void drop() { domain.drop(); } @Override public String name() { return domain.name(); } @Override public Item item(final String name) { return domain.item(name); } @Override public Iterable<Item> select(final SelectRequest request) { return new Iterable<Item>() { @Override public Iterator<Item> iterator() { return Iterators.filter( domain.select(request).iterator(), new Predicate<Item>() { @Override public boolean apply(final Item item) { final boolean good = SanitizedDomains.this.good(item); if (!good) { item.clear(); } return good; } } ); } }; } }; }
Source:
private void init( final OutputStream output, final SAMFileHeader header, final boolean writeHeader, final TaskAttemptContext ctx) throws IOException { origOutput = output; refSource = new ReferenceSource(Paths.get(URI.create(ctx.getConfiguration().get(CRAMInputFormat.REFERENCE_SOURCE_PATH_PROPERTY)))); if (null != header) { cramContainerStream = new CRAMContainerStreamWriter(origOutput, null, refSource, header, HadoopBAMID); if (writeHeader) { this.writeHeader(header); } } }

Target:
private void init( final OutputStream output, final SAMFileHeader header, final boolean writeHeader, final TaskAttemptContext ctx) throws IOException { origOutput = output; final URI referenceURI = URI.create( ctx.getConfiguration().get(CRAMInputFormat.REFERENCE_SOURCE_PATH_PROPERTY) ); refSource = new ReferenceSource(Paths.get(referenceURI)); if (header != null) { cramContainerStream = new CRAMContainerStreamWriter( origOutput, null, refSource, header, HADOOP_BAM_PART_ID); if (writeHeader) { this.writeHeader(header); } } }
Source:
public void enterImage() { clickOn(addMediaButton); clickOn(mediaLibraryButton); if (isElementDisplayed(allowMediaAccessButton)) { clickOn(allowMediaAccessButton); } onView(withIndex(withId(R.id.media_grid_item_image), 0)).perform(click()); clickOn(confirmButton); if (isElementDisplayed(onView(withText("LEAVE OFF")))) { clickOn(onView(withText("LEAVE OFF")).inRoot(isDialog())); } }

Target:
public void enterImage() { String addMediaButtonId = "media_button_container"; clickOn(addMediaButtonId); String mediaBarButtonId = "media_bar_button_library"; clickOn(mediaBarButtonId); if (isElementDisplayed(allowMediaAccessButton)) { clickOn(allowMediaAccessButton); } onView(withIndex(withId(R.id.media_grid_item_image), 0)).perform(click()); clickOn(confirmButton); if (isElementDisplayed(onView(withText("LEAVE OFF")))) { clickOn(onView(withText("LEAVE OFF")).inRoot(isDialog())); } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { PlotCommit commit = (PlotCommit) getSelection(getPage()).getFirstElement(); final Repository repository = getRepository(event); if (repository == null) return null; String currentBranch = getCurrentBranch(repository); final Ref ref = getRef(commit, repository, currentBranch); String jobname = NLS.bind( UIText.RebaseCurrentRefCommand_RebasingCurrentJobName, currentBranch, ref.getName()); RebaseCurrentRefCommand rebaseCurrentRef = new RebaseCurrentRefCommand( jobname) { @Override public RebaseOperation createRebaseOperation(ExecutionEvent event2) throws ExecutionException { return new RebaseOperation(repository, ref); } }; rebaseCurrentRef.execute(event); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { PlotCommit commit = (PlotCommit) getSelection(getPage()).getFirstElement(); final Repository repository = getRepository(event); if (repository == null) return null; String currentBranch = getCurrentBranch(repository); final Ref ref = getRef(commit, repository, currentBranch); String jobname = NLS.bind( UIText.RebaseCurrentRefCommand_RebasingCurrentJobName, currentBranch, ref.getName()); AbstractRebaseCommandHandler rebaseCurrentRef = new AbstractRebaseCommandHandler( jobname, UIText.RebaseCurrentRefCommand_RebaseCanceledMessage) { @Override protected RebaseOperation createRebaseOperation( ExecutionEvent event2) throws ExecutionException { return new RebaseOperation(repository, ref); } }; rebaseCurrentRef.execute(event); return null; }
Source:
public StepExecutionResult execute(ExecutionContext context) throws IOException, InterruptedException { Path filePath = filesystem.resolve(input); try { for (FileScrubber scrubber : scrubbers) { try (FileChannel channel = readWriteChannel(filePath)) { if (scrubber instanceof FileContentsScrubber) { ((FileContentsScrubber) scrubber).scrubFile(channel); } else if (scrubber instanceof FileAttributesScrubber) { ((FileAttributesScrubber) scrubber).scrubFileWithPath(filePath); } } } } catch (FileContentsScrubber.ScrubException e) { context.logError(e, "Error scrubbing non-deterministic metadata from %s", filePath); } return StepExecutionResults.SUCCESS; }

Target:
public StepExecutionResult execute(ExecutionContext context) throws IOException, InterruptedException { Path filePath = filesystem.resolve(input); try { for (FileScrubber scrubber : scrubbers) { try (FileChannel channel = readWriteChannel(filePath)) { if (scrubber instanceof FileContentsScrubber) { ((FileContentsScrubber) scrubber).scrubFile(channel); } else if (scrubber instanceof FileAttributesScrubber) { ((FileAttributesScrubber) scrubber).scrubFileWithPath(filePath); } } } } catch (FileContentsScrubber.ScrubException e) { context.logError(e, "Error scrubbing non-deterministic metadata from %s", filePath); return StepExecutionResults.ERROR; } return StepExecutionResults.SUCCESS; }
Source:
public PagesSpatialIndex get() { if (rtree.isEmpty()) { return EMPTY_INDEX; } else { return new PagesRTreeIndex(session, addresses, types, outputChannels, channels, rtree, spatialRelationshipTest, filterFunctionFactory); } }

Target:
public PagesSpatialIndex get() { if (rtree.isEmpty()) { return EMPTY_INDEX; } return new PagesRTreeIndex(session, addresses, types, outputChannels, channels, rtree, spatialRelationshipTest, filterFunctionFactory); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryGroups groupsUtil = RepositoryGroups.getInstance(); RepositoryGroup group; try { group = groupsUtil.createGroup(newGroupName(groupsUtil)); } catch (IllegalStateException e) { throw new ExecutionException(e.getLocalizedMessage(), e); } List<File> repoDirs = getSelectedRepositories(event); if (!repoDirs.isEmpty()) { groupsUtil.addRepositoriesToGroup(group, repoDirs); } CommonViewer viewer = getView(event).getCommonViewer(); viewer.refresh(); RepositoryGroupNode groupNode = new RepositoryGroupNode(group); viewer.setSelection(new StructuredSelection(groupNode), true); viewer.expandToLevel(groupNode, 1); IStructuredSelection sel = viewer.getStructuredSelection(); viewer.editElement(sel.getFirstElement(), 0); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { RepositoryGroups groupsUtil = RepositoryGroups.getInstance(); RepositoryGroup group; try { group = groupsUtil.createGroup(newGroupName(groupsUtil)); } catch (IllegalStateException e) { throw new ExecutionException(e.getLocalizedMessage(), e); } List<File> repoDirs = getSelectedRepositories(event); if (!repoDirs.isEmpty()) { groupsUtil.addRepositoriesToGroup(group, repoDirs); } RepositoriesView view = getView(event); CommonViewer viewer = view.getCommonViewer(); viewer.refresh(); RepositoryGroupNode groupNode = new RepositoryGroupNode(group); viewer.setSelection(new StructuredSelection(groupNode), true); view.expandNodeForGroup(group); IStructuredSelection sel = viewer.getStructuredSelection(); viewer.editElement(sel.getFirstElement(), 0); return null; }
Source:
public String getEditText() { return textArea.getAttribute("value"); }

Target:
private String getEditText() { return editArea.getAttribute("value"); }
Source:
@Deprecated public Integer getRotation() { return rotation; }

Target:
public Integer getRotation() { return rotation; }
Source:
private void assertStatus(final ClusterMemberStatus s, TransportEndpoint[] members) { Predicate<ClusterMember> predicate = new Predicate<ClusterMember>() { @Override public boolean apply(@Nullable ClusterMember input) { return input != null && input.status() == s; } }; Function<ClusterMember, TransportEndpoint> function = new Function<ClusterMember, TransportEndpoint>() { @Override public TransportEndpoint apply(ClusterMember input) { return input.endpoint(); } }; List<TransportEndpoint> list = newArrayList(transform(filter(target.members(), predicate), function)); assertEquals("expect " + s + ": " + list, members.length, list.size()); for (TransportEndpoint member : members) { assertTrue("expect " + s + ": " + member, list.contains(member)); } }

Target:
private void assertStatus(final ClusterMemberStatus s, TransportEndpoint[] members) { Predicate<ClusterMember> predicate = new Predicate<ClusterMember>() { @Override public boolean apply(ClusterMember input) { return input.status() == s; } }; Function<ClusterMember, TransportEndpoint> function = new Function<ClusterMember, TransportEndpoint>() { @Override public TransportEndpoint apply(ClusterMember input) { return input.endpoint(); } }; List<TransportEndpoint> list = newArrayList(transform(filter(target.members(), predicate), function)); assertEquals("expect " + s + ": " + list, members.length, list.size()); for (TransportEndpoint member : members) { assertTrue("expect " + s + ": " + member, list.contains(member)); } }
Source:
public ReminderThread(Context context) { valueToKey = new HashMap<>(); keyToValue = new HashMap<>(); this.mContext = context; runnable = new Runnable() { @Override public void run() { XPathExpression condition; try{ condition = XPathParseTool.parseXPath(xPathConditionString); }catch (Exception e){ e.printStackTrace(); return; } Hashtable<String, DataInstance> instances = new Hashtable<>(); instances.put("casedb", new ExternalDataInstance("jr://instance/casedb","casedb")); EvaluationContext ec = CommCareApplication._().getCurrentSessionWrapper().getEvaluationContext(instances); String caseXPathRef = "instance('casedb')/casedb/case[@case_type='" + caseTypeString + "']"; TreeReference caseType = XPathReference.getPathExpr(caseXPathRef).getReference(); List<TreeReference> refs = ec.expandReference(caseType); while(mContinuePolling) { long current = System.currentTimeMillis(); for(TreeReference ref : refs) { EvaluationContext internal = new EvaluationContext(ec, ref); Log.d("Result", condition.eval(internal).toString()); if((Boolean) condition.eval(internal)){ playNoise(); } } long delay = (System.currentTimeMillis() - current); try { Thread.sleep(sleepTime * 1000 - delay); System.out.println("Sleeping for" + String.valueOf(sleepTime*1000-delay)); sleepTime *= 2; } catch (InterruptedException e) { e.printStackTrace(); mContinuePolling = false; } } } }; myThread = new Thread(runnable); }

Target:
public ReminderThread(Context context) { this.mContext = context; runnable = new Runnable() { @Override public void run() { try{ evalulateAlertExpressions(); }catch(Exception e){ mContinuePolling = false; System.out.println("Stopping thread"); if(!Thread.interrupted()){ showNotification("Alerts have stopped because of an error!"); } } } }; myThread = new Thread(runnable); }
Source:
public void testAggregator() throws Exception { mMetricsMaster.addAggregator( new SumInstancesAggregator("metricA", MetricsSystem.InstanceType.WORKER, "metricA")); mMetricsMaster.addAggregator( new SumInstancesAggregator("metricB", MetricsSystem.InstanceType.WORKER, "metricB")); List<Metric> metrics1 = Lists.newArrayList( Metric.from("worker.192_1_1_1.metricA", 10, MetricType.GAUGE), Metric.from("worker.192_1_1_1.metricB", 20, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_1", metrics1); List<Metric> metrics2 = Lists.newArrayList( Metric.from("worker.192_1_1_2.metricA", 1, MetricType.GAUGE), Metric.from("worker.192_1_1_2.metricB", 2, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_2", metrics2); waitForAndCheckResult(() -> (Long) getGauge("metricA") == 11L); assertEquals(22L, getGauge("metricB")); List<Metric> metrics3 = Lists.newArrayList( Metric.from("worker.192_1_1_2.metricA", 3, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_2", metrics3); waitForAndCheckResult(() -> (Long) getGauge("metricA") == 13L); assertEquals(20L, getGauge("metricB")); }

Target:
public void testAggregator() throws Exception { mMetricsMaster.addAggregator( new SumInstancesAggregator("metricA", MetricsSystem.InstanceType.WORKER, "metricA")); mMetricsMaster.addAggregator( new SumInstancesAggregator("metricB", MetricsSystem.InstanceType.WORKER, "metricB")); List<Metric> metrics1 = Lists.newArrayList( Metric.from("worker.192_1_1_1.metricA", 10, MetricType.GAUGE), Metric.from("worker.192_1_1_1.metricB", 20, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_1", metrics1); List<Metric> metrics2 = Lists.newArrayList( Metric.from("worker.192_1_1_2.metricA", 1, MetricType.GAUGE), Metric.from("worker.192_1_1_2.metricB", 2, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_2", metrics2); checkMetricValue("metricA", 11L); checkMetricValue("metricB", 22L); List<Metric> metrics3 = Lists.newArrayList( Metric.from("worker.192_1_1_2.metricA", 3, MetricType.GAUGE)); mMetricsMaster.workerHeartbeat("192_1_1_2", metrics3); checkMetricValue("metricA", 13L); checkMetricValue("metricB", 20L); }
Source:
public void heartbeat() { if (mClosed) { return; } mThread.set(Thread.currentThread()); try { mBlockStore.checkStorage(); } catch (Exception e) { LOG.warn("Failed to check storage: {}", e.toString()); LOG.debug("Exception: ", e); } mThread.set(null); }

Target:
public void heartbeat() { try { mBlockStore.checkStorage(); } catch (Exception e) { LOG.warn("Failed to check storage: {}", e.toString()); LOG.debug("Exception: ", e); } }
Source:
public VDS getUpServer(Guid clusterId) { List<VDS> servers = DbFacade.getInstance() .getVdsDAO() .getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); if (servers == null || servers.isEmpty()) { throw new VdcBLLException(VdcBllErrors.NO_UP_SERVER_FOUND); } return servers.get(GlusterCoreUtil.random(servers.size() - 1)); }

Target:
public VDS getUpServer(Guid clusterId) { List<VDS> servers = getVdsDao() .getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); if (servers == null || servers.isEmpty()) { throw new VdcBLLException(VdcBllErrors.NO_UP_SERVER_FOUND); } return RandomUtils.instance().pickRandom(servers); }
Source:
public TextFormat getFormat() { return format; }

Target:
public TextFormat getFormat() { return this.format; }
Source:
public void loadPlugins() throws Exception { if (!pluginsLoading.compareAndSet(false, true)) { return; } for (File file : listFiles(installedPluginsDir)) { if (file.isDirectory()) { loadPlugin(file.getAbsolutePath()); } } for (String plugin : plugins) { if (plugin.startsWith("fbraptor") || plugin.startsWith("shardedmysql")) { continue; } loadPlugin(plugin); } metadata.verifyComparableOrderableContract(); pluginsLoaded.set(true); }

Target:
public void loadPlugins() throws Exception { if (!pluginsLoading.compareAndSet(false, true)) { return; } for (File file : listFiles(installedPluginsDir)) { if (file.isDirectory()) { loadPlugin(file.getAbsolutePath()); } } for (String plugin : plugins) { loadPlugin(plugin); } metadata.verifyComparableOrderableContract(); pluginsLoaded.set(true); }
Source:
private int indexOfSourceDecimalSeparator(String source) { String separator = fDecimalSeparator == '\'' ? "''" : String.valueOf(fDecimalSeparator); int patternPos = fPattern.indexOf(separator); int sourcePos = -1; while (patternPos != -1 && patternPos <= fPatternDecimalSeparatorIndex) { sourcePos = source.indexOf(fDecimalSeparator, sourcePos + 1); if (sourcePos == -1) { break; } char p = patternPos < fPattern.length() - 1 ? fPattern.charAt(patternPos + 1) : '\0'; if ((p >= 'a' && p <= 'z') || (p >= 'A' && p <= 'Z')) { while (sourcePos < source.length() - 1) { if (source.charAt(sourcePos + 1) == ' ') { sourcePos++; } else { break; } } } patternPos = fPattern.indexOf(separator, patternPos + separator.length()); } if (sourcePos == -1) { sourcePos = source.length(); } return sourcePos; }

Target:
private int indexOfSourceDecimalSeparator(String source) { String separator = fDecimalSeparator == '\'' ? "''" : String.valueOf(fDecimalSeparator); int patternPos = fPattern.indexOf(separator); int sourcePos = -1; while (patternPos != -1 && patternPos <= fPatternDecimalSeparatorIndex) { sourcePos = source.indexOf(fDecimalSeparator, sourcePos + 1); if (sourcePos == -1) { break; } char p = patternPos < fPattern.length() - 1 ? fPattern.charAt(patternPos + 1) : '\0'; if ((p >= 'a' && p <= 'z') || (p >= 'A' && p <= 'Z')) { while (sourcePos < source.length() - 1) { char s = source.charAt(sourcePos + 1); if (s == ' ' || s == '\t') { sourcePos++; } else { break; } } } patternPos = fPattern.indexOf(separator, patternPos + separator.length()); } if (sourcePos == -1) { sourcePos = source.length(); } return sourcePos; }
Source:
public List<ProviderSyncResult> updateAndGetStatuses(Stack stack, Set<InstanceMetaData> checkableInstances) { return checkedMeasure(() -> { List<ProviderSyncResult> results = new ArrayList<>(); List<CloudVmInstanceStatus> statuses = stackInstanceProviderChecker.checkStatus(stack, checkableInstances); statuses.forEach(s -> { Optional<InstanceMetaData> instanceMetaData = checkableInstances.stream() .filter(i -> s.getCloudInstance().getInstanceId().equals(i.getInstanceId())) .findFirst(); if (instanceMetaData.isPresent()) { InstanceStatus instanceStatus = updateStatuses(stack, s, instanceMetaData.get()); if (instanceStatus != null) { results.add(new ProviderSyncResult("", instanceStatus, false, s.getCloudInstance().getInstanceId())); } } else { LOGGER.info(":::Auto sync::: Cannot find instanceMetaData"); } }); checkableInstances.forEach(instanceMetaData -> { if (statuses.stream().noneMatch(s -> s.getCloudInstance().getInstanceId().equals(instanceMetaData.getInstanceId()))) { if (!flowLogService.isOtherFlowRunning(stack.getId())) { if (updateStatus) { setStatusIfNotTheSame(instanceMetaData, InstanceStatus.DELETED_ON_PROVIDER_SIDE); instanceMetaDataService.save(instanceMetaData); } else { LOGGER.debug("updateStatus flag is false, don't update status"); } } else { LOGGER.debug(":::Auto sync::: do not update instance status to deleted because flow is running for stack: {}", stack.getName()); } } }); return results; }, LOGGER, ":::Auto sync::: provider is checked in {}ms"); }

Target:
public List<ProviderSyncResult> updateAndGetStatuses(Stack stack, Set<InstanceMetaData> checkableInstances) { return checkedMeasure(() -> { List<ProviderSyncResult> results = new ArrayList<>(); List<CloudVmInstanceStatus> statuses = stackInstanceProviderChecker.checkStatus(stack, checkableInstances); if (flowLogService.isOtherFlowRunning(stack.getId())) { throw new InterruptSyncingException(":::Auto sync::: interrupt syncing in updateAndGetStatuses, flow is running on freeipa stack " + stack.getName()); } else { statuses.forEach(s -> { Optional<InstanceMetaData> instanceMetaData = checkableInstances.stream() .filter(i -> s.getCloudInstance().getInstanceId().equals(i.getInstanceId())) .findFirst(); if (instanceMetaData.isPresent()) { InstanceStatus instanceStatus = updateStatuses(s, instanceMetaData.get()); if (instanceStatus != null) { results.add(new ProviderSyncResult("", instanceStatus, false, s.getCloudInstance().getInstanceId())); } } else { LOGGER.info(":::Auto sync::: Cannot find instanceMetaData"); } }); checkableInstances.forEach(instanceMetaData -> { if (statuses.stream().noneMatch(s -> s.getCloudInstance().getInstanceId().equals(instanceMetaData.getInstanceId()))) { if (updateStatus) { setStatusIfNotTheSame(instanceMetaData, InstanceStatus.DELETED_ON_PROVIDER_SIDE); instanceMetaDataService.save(instanceMetaData); } else { LOGGER.debug("updateStatus flag is false, don't update status"); } } }); return results; } }, LOGGER, ":::Auto sync::: provider is checked in {}ms"); }
Source:
public static String doubleToGoString(double d) { if (d == Double.POSITIVE_INFINITY) { return "+Inf"; } if (d == Double.NEGATIVE_INFINITY) { return "-Inf"; } if (d == Double.NaN) { return "NaN"; } return Double.toString(d); }

Target:
public static String doubleToGoString(double d) { if (d == Double.POSITIVE_INFINITY) { return "+Inf"; } if (d == Double.NEGATIVE_INFINITY) { return "-Inf"; } if (Double.isNaN(d)) { return "NaN"; } return Double.toString(d); }
Source:
synchronized boolean writeToDirectories(List<File> directories) { boolean success = false; for (File dir : directories) { try { File statusFile = new File(dir, BOOKIE_STATUS_FILENAME); writeToFile(statusFile, toString()); success = true; } catch (IOException e) { LOG.warn("IOException while trying to write bookie status to directory {}." + " This is fine if not all directories are failed.", dir); } } if(success){ LOG.info("Successfully persist bookie status {}", this.bookieMode); } else { LOG.warn("Failed to persist bookie status {}", this.bookieMode); } return success; }

Target:
synchronized void writeToDirectories(List<File> directories) { boolean success = false; for (File dir : directories) { try { File statusFile = new File(dir, BOOKIE_STATUS_FILENAME); writeToFile(statusFile, toString()); success = true; } catch (IOException e) { LOG.warn("IOException while trying to write bookie status to directory {}." + " This is fine if not all directories are failed.", dir); } } if(success){ LOG.info("Successfully persist bookie status {}", this.bookieMode); } else { LOG.warn("Failed to persist bookie status {}", this.bookieMode); } }
Source:
private void initTable(CommonApplicationConstants constants) { String width = "284px"; searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getFirstName(); } }, constants.firsNamePermissionsPopup(), width); searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getLastName(); } }, constants.lastNamePermissionsPopup(), width); searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getLoginName(); } }, constants.userNamePermissionsPopup(), width); }

Target:
private void initTable(CommonApplicationConstants constants) { searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getFirstName(); } }, constants.firsNamePermissionsPopup(), MAX_COL_WIDTH); searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getLastName(); } }, constants.lastNamePermissionsPopup(), MAX_COL_WIDTH); searchItems.addColumn(new EntityModelTextColumn<DbUser>() { @Override public String getText(DbUser user) { return user.getLoginName(); } }, constants.userNamePermissionsPopup(), MAX_COL_WIDTH); }
Source:
public static Properties loadProperties(Properties properties, InputStream inputStream) throws IOException { try { properties.load(inputStream); return properties; } finally { close(inputStream); } }

Target:
public static Properties loadProperties(Properties properties, InputStream inputStream) throws IOException { properties.load(inputStream); return properties; }
Source:
private JsonResponse proceedToLogin(Subject currentUser, AuthenticationToken token) { JsonResponse response = null; try { logoutCurrentUser(); currentUser.getSession(true); LOG.info("Try to login"); currentUser.login(token); Set<String> roles = securityService.getAssociatedRoles(); String principal = securityService.getPrincipal(); String ticket; if ("anonymous".equals(principal)) { ticket = "anonymous"; } else { ticket = TicketContainer.instance.getTicket(principal); } Map<String, String> data = new HashMap<>(); data.put("principal", principal); data.put("roles", gson.toJson(roles)); data.put("ticket", ticket); response = new JsonResponse(Response.Status.OK, "", data); NotebookAuthorization.getInstance().setRoles(principal, roles); } catch (AuthenticationException uae) { LOG.error("Exception in login: ", uae); } return response; }

Target:
private JsonResponse proceedToLogin(Subject currentUser, AuthenticationToken token) { JsonResponse response = null; try { logoutCurrentUser(); currentUser.getSession(true); currentUser.login(token); Set<String> roles = securityService.getAssociatedRoles(); String principal = securityService.getPrincipal(); String ticket; if ("anonymous".equals(principal)) { ticket = "anonymous"; } else { ticket = TicketContainer.instance.getTicket(principal); } Map<String, String> data = new HashMap<>(); data.put("principal", principal); data.put("roles", gson.toJson(roles)); data.put("ticket", ticket); response = new JsonResponse(Response.Status.OK, "", data); NotebookAuthorization.getInstance().setRoles(principal, roles); } catch (AuthenticationException uae) { LOG.error("Exception in login: ", uae); } return response; }
Source:
public String getAvailableSchemas() throws AxisFault { String fileList = ""; StringBuilder fBuf = null; BufferedReader dis = null; try { InputStream in = PolicyEditorService.class.getResourceAsStream( ORG_WSO2_CARBON_POLICYEDITOR_XSD + "policies.xml"); dis = new BufferedReader(new InputStreamReader(in, Charsets.UTF_8)); fBuf = new StringBuilder(); String line = ""; while ((line = dis.readLine()) != null) { fBuf.append(line).append("\n"); } fileList = fBuf.toString(); } catch (IOException e) { throw new AxisFault("Axis fault while getting schemas.", e); } finally { if(dis != null){ try{ dis.close(); }catch (IOException ioe){ log.error("Error occurred while closing BufferedReader"); } } } return "<![CDATA[" + fileList + "]]>"; }

Target:
public String getAvailableSchemas() throws AxisFault { String fileList = ""; StringBuilder fBuf = null; BufferedReader dis = null; try { InputStream in = PolicyEditorService.class.getResourceAsStream( ORG_WSO2_CARBON_POLICYEDITOR_XSD + "policies.xml"); dis = new BufferedReader(new InputStreamReader(in, Charsets.UTF_8)); fBuf = new StringBuilder(); String line = ""; while ((line = dis.readLine()) != null) { fBuf.append(line).append("\n"); } fileList = fBuf.toString(); } catch (IOException e) { throw new AxisFault("Axis fault while getting schemas.", e); } finally { IdentityIOStreamUtils.closeReader(dis); } return "<![CDATA[" + fileList + "]]>"; }
Source:
private void verifyEvents(boolean isClustered, StateListener<String, String> listener, List<CacheEntry<String, String>> expected) { assertEquals(listener.events.size(), isClustered ? expected.size() : expected.size() * 2); int eventPosition = 0; for (CacheEntryEvent<String, String> event : listener.events) { int position; boolean even; if (isClustered) { even = true; position = eventPosition; } else { even = (eventPosition & 1) == 1; position = eventPosition / 2; } assertEquals(event.getType(), Event.Type.CACHE_ENTRY_CREATED); assertEquals(event.getKey(), expected.get(position).getKey()); assertEquals(event.isPre(), !even); if (even) { assertEquals(event.getValue(), expected.get(position).getValue()); } else { assertNull(event.getValue()); } eventPosition++; } }

Target:
private void verifyEvents(boolean isClustered, StateListener<String, String> listener, List<CacheEntry<String, String>> expected) { assertEquals(listener.events.size(), isClustered ? expected.size() : expected.size() * 2); int eventPosition = 0; for (CacheEntryEvent<String, String> event : listener.events) { int position; boolean isPost; if (isClustered) { isPost = true; position = eventPosition; } else { isPost = (eventPosition & 1) == 1; position = eventPosition / 2; } assertEquals(event.getType(), Event.Type.CACHE_ENTRY_CREATED); assertEquals(event.getKey(), expected.get(position).getKey()); assertEquals(event.isPre(), !isPost); if (isPost) { assertEquals(event.getValue(), expected.get(position).getValue()); } else { assertNull(event.getValue()); } eventPosition++; } }
Source:
public String getQuotaStatsFieldName() { return QUOTA_FIELD_NAME; }

Target:
public String getQuotaStatsFieldName() { return QUOTA_STATS_FIELD_NAME; }
Source:
public Object doWork() { final String sampleName = FilenameUtils.getBaseName(snpCountsFile.getAbsolutePath()); final AllelicPanelOfNormals allelicPoN = allelicPoNFile != null ? AllelicPanelOfNormals.read(allelicPoNFile) : AllelicPanelOfNormals.EMPTY_PON; final AllelicCountCollection acc = new AllelicCountCollection(snpCountsFile); final AlleleFractionSegmenter segmenter = new AlleleFractionSegmenter(initialNumStates, acc, allelicPoN); final TargetCollection<AllelicCount> tc = new HashedListTargetCollection<>(acc.getCounts()); final List<Pair<SimpleInterval, Double>> segmentation = segmenter.findSegments(); final List<ModeledSegment> segments = segmentation.stream() .map(pair -> new ModeledSegment(pair.getLeft(), tc.targetCount(pair.getLeft()), pair.getRight())) .collect(Collectors.toList()); SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }

Target:
public Object doWork() { final String sampleName = FilenameUtils.getBaseName(snpCountsFile.getAbsolutePath()); final AllelicPanelOfNormals allelicPoN = allelicPoNFile != null ? AllelicPanelOfNormals.read(allelicPoNFile) : AllelicPanelOfNormals.EMPTY_PON; final AllelicCountCollection acc = new AllelicCountCollection(snpCountsFile); final AlleleFractionSegmenter segmenter = new AlleleFractionSegmenter(initialNumStates, acc, allelicPoN); final List<ModeledSegment> segments = segmenter.getModeledSegments(); SegmentUtils.writeModeledSegmentFile(outputSegmentsFile, segments, sampleName, true); return "SUCCESS"; }
Source:
public PcapTimestampScale getTimestampPrecision() { return PcapTimestampScale.MICROSECOND; }

Target:
public PcapTimestampScale getTimestampPrecision() { return PcapTimestampScale.NANOSECOND; }