auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void enqueue(Lifespan lifespan, int partitionNumber, List<SerializedPage> pages) { requireNonNull(lifespan, "lifespan is null"); checkState(partitionNumber == 0, "Expected partition number to be zero"); checkState(lifespanCompletionCallback != null, "lifespanCompletionCallback has to be set before starting enqueue data"); enqueue(lifespan, pages); }

Target:
public void enqueue(Lifespan lifespan, int partitionNumber, List<SerializedPage> pages) { checkState(partitionNumber == 0, "Expected partition number to be zero"); enqueue(lifespan, pages); }
Source:
protected static Comparator<Method> ignoringDeclaringClassAndMethodName() { return new Comparator<Method>() { @Override public int compare(Method o1, Method o2) { boolean equal = (ACCESS_MODIFIERS & o1.getModifiers() & o2.getModifiers()) != 0; equal = equal && o1.getReturnType().equals(o2.getReturnType()); Class<?>[] pTypes1 = o1.getParameterTypes(); Class<?>[] pTypes2 = o2.getParameterTypes(); equal = equal && pTypes1.length == pTypes2.length; if (equal) { for (int i = 0; i < pTypes1.length; i++) { equal = equal && pTypes1[i].equals(pTypes2[i]); } } return equal ? 0 : 1; } }; }

Target:
protected static Comparator<Method> ignoringDeclaringClassAndMethodName() { return internalMethodComparator(true, false, true); }
Source:
public TestProject(final boolean remove, String path, boolean insidews) throws CoreException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); Path ppath = new Path(path); String projectName = ppath.lastSegment(); URI locationURI; URI top; if (insidews) { top = root.getRawLocationURI(); } else { File tempName; try { tempName = testUtils.createTempDir("wssupplement"); } catch (IOException e) { throw new RuntimeException(e); } top = URIUtil.toURI(tempName.getAbsolutePath()); } if (!ppath.lastSegment().equals(path)) { locationURI = URIUtil.toURI(URIUtil.toPath(top).append(path)); } else locationURI = null; project = root.getProject(projectName); if (remove) project.delete(true, null); IProjectDescription description = ResourcesPlugin.getWorkspace() .newProjectDescription(projectName); description.setName(projectName); description.setLocationURI(locationURI); project.create(description, null); project.open(null); location = project.getLocation().toOSString(); javaProject = JavaCore.create(project); IFolder binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }

Target:
public TestProject(final boolean remove, String path, boolean insidews) throws CoreException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProjectDescription description = createDescription(remove, path, insidews, root); project = root.getProject(description.getName()); if (remove) project.delete(true, null); IPath locationBefore = description.getLocation(); if (locationBefore == null) locationBefore = root.getRawLocation().append(path); location = locationBefore.toOSString(); project.create(description, null); project.open(null); javaProject = JavaCore.create(project); IFolder binFolder = createBinFolder(); setJavaNature(); javaProject.setRawClasspath(new IClasspathEntry[0], null); createOutputFolder(binFolder); addSystemLibraries(); }
Source:
protected void addLocation(Location location) { if (location != null) { allLocations.add(location); } }

Target:
private void addLocation(Location location) { if (location != null) { allLocations.add(location); } }
Source:
public DownloadResponse head(String siteUrl) throws IOException, ReCaptchaException { final HttpsURLConnection con = (HttpsURLConnection) new URL(siteUrl).openConnection(); try { con.setRequestMethod("HEAD"); con.setConnectTimeout(30 * 1000); con.setReadTimeout(30 * 1000); con.setRequestProperty("User-Agent", USER_AGENT); if (!TextUtils.isEmpty(mCookies)) { con.setRequestProperty("Cookie", mCookies); } } catch (Exception e) { if (con.getResponseCode() == 429) { throw new ReCaptchaException("reCaptcha Challenge requested", con.getURL().toString()); } throw new IOException(con.getResponseCode() + " " + con.getResponseMessage(), e); } return new DownloadResponse(con.getResponseCode(), null, con.getHeaderFields()); }

Target:
public DownloadResponse head(String siteUrl) throws IOException, ReCaptchaException { final Request request = new Request.Builder() .head().url(siteUrl) .addHeader("User-Agent", USER_AGENT) .build(); final Response response = client.newCall(request).execute(); if (response.code() == 429) { throw new ReCaptchaException("reCaptcha Challenge requested", siteUrl); } return new DownloadResponse(response.code(), null, response.headers().toMultimap()); }
Source:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString("findinpage_text", findInPageInput.getText().toString()); outState.putString("findinpage_enabled", findInPageInput.getText().toString()); }

Target:
public void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString("findinpage_text", findInPageInput.getText().toString()); }
Source:
public void cleanup() { File tempFile = fTempFile; if (tempFile != null) { tempFile.delete(); } }

Target:
public void cleanup() { if (fTempFile != null) { fTempFile.delete(); } }
Source:
private static void watch(String path) { final BlockingQueue<FileWatchEvent> eventQueue = new ArrayBlockingQueue<FileWatchEvent>(16); Thread processorThread = new Thread(new Runnable() { @Override public void run() { while (!Thread.currentThread().isInterrupted()) { FileWatchEvent event; try { event = eventQueue.take(); } catch (InterruptedException e) { break; } if (event.getType() == FileWatchEvent.Type.FAILURE) { Throwable failure = event.getFailure(); assert failure != null; failure.printStackTrace(); } else { System.out.printf("Change detected: %s / '%s'%n", event.getType(), event.getPath()); } } } }, "File watcher client"); processorThread.setDaemon(true); processorThread.start(); FileWatcher watcher = createWatcher(path, eventQueue); try { System.out.println("Waiting - type ctrl-d to exit ..."); while (true) { int ch = System.in.read(); if (ch < 0) { break; } } } catch (Exception e) { throw new RuntimeException(e); } finally { try { watcher.close(); } catch (IOException e) { e.printStackTrace(); } processorThread.interrupt(); } System.out.println("Done"); }

Target:
private static void watch(String path) throws InterruptedException { final BlockingQueue<FileWatchEvent> eventQueue = new ArrayBlockingQueue<FileWatchEvent>(16); Thread processorThread = new Thread(new Runnable() { @Override public void run() { while (!Thread.currentThread().isInterrupted()) { FileWatchEvent event; try { event = eventQueue.take(); } catch (InterruptedException e) { break; } if (event.getType() == FileWatchEvent.Type.FAILURE) { Throwable failure = event.getFailure(); assert failure != null; failure.printStackTrace(); } else { System.out.printf("Change detected: %s / '%s'%n", event.getType(), event.getPath()); } } } }, "File watcher client"); processorThread.setDaemon(true); processorThread.start(); FileWatcher watcher = createWatcher(path, eventQueue); try { System.out.println("Waiting - type ctrl-d to exit ..."); while (true) { int ch = System.in.read(); if (ch < 0) { break; } } } catch (Exception e) { throw new RuntimeException(e); } finally { try { watcher.close(); } catch (IOException e) { e.printStackTrace(); } processorThread.interrupt(); } System.out.println("Done"); }
Source:
public SettableFuture schedule(SourcePartitionedScheduler scheduler) { checkState(initialScheduled); List<Lifespan> recentlyCompletedDriverGroups; synchronized (this) { recentlyCompletedDriverGroups = ImmutableList.copyOf(this.recentlyCompletedDriverGroups); this.recentlyCompletedDriverGroups.clear(); newDriverGroupReady = SettableFuture.create(); } if (!recentlyCompletedDriverGroups.isEmpty()) { for (Lifespan driverGroup : recentlyCompletedDriverGroups) { IntListIterator driverGroupsIterator = nodeToDriverGroupsMap.get(driverGroupToNodeMap.get(driverGroup.getId())); if (!driverGroupsIterator.hasNext()) { continue; } int driverGroupId = driverGroupsIterator.nextInt(); scheduler.startLifespan(Lifespan.driverGroup(driverGroupId), partitionHandles.get(driverGroupId)); } } return newDriverGroupReady; }

Target:
public SettableFuture schedule(SourcePartitionedScheduler scheduler) { checkState(initialScheduled); List<Lifespan> recentlyCompletedDriverGroups; synchronized (this) { recentlyCompletedDriverGroups = ImmutableList.copyOf(this.recentlyCompletedDriverGroups); this.recentlyCompletedDriverGroups.clear(); newDriverGroupReady = SettableFuture.create(); } for (Lifespan driverGroup : recentlyCompletedDriverGroups) { IntListIterator driverGroupsIterator = nodeToDriverGroupsMap.get(driverGroupToNodeMap.get(driverGroup.getId())); if (!driverGroupsIterator.hasNext()) { continue; } int driverGroupId = driverGroupsIterator.nextInt(); scheduler.startLifespan(Lifespan.driverGroup(driverGroupId), partitionHandles.get(driverGroupId)); } return newDriverGroupReady; }
Source:
public String toString() { return "Pair[" + key + ", " + value + "]"; }

Target:
public String toString() { return "Pair(" + key + ", " + value + ")"; }
Source:
private static ClientRegistration.Builder getBuilder(String issuer, Supplier<ClientRegistration.Builder>... suppliers) { String errorMessage = "Unable to resolve Configuration with the provided Issuer of \"" + issuer + "\""; for (Supplier<ClientRegistration.Builder> supplier : suppliers) { try { ClientRegistration.Builder builder = supplier.get(); return builder; } catch (HttpClientErrorException e) { if (!e.getStatusCode().is4xxClientError()) { throw e; } } catch (IllegalArgumentException | IllegalStateException e) { throw e; } catch (RuntimeException e) { throw new IllegalArgumentException(errorMessage, e); } } throw new IllegalArgumentException(errorMessage); }

Target:
private static ClientRegistration.Builder getBuilder(String issuer, Supplier<ClientRegistration.Builder>... suppliers) { String errorMessage = "Unable to resolve Configuration with the provided Issuer of \"" + issuer + "\""; for (Supplier<ClientRegistration.Builder> supplier : suppliers) { try { return supplier.get(); } catch (HttpClientErrorException e) { if (!e.getStatusCode().is4xxClientError()) { throw e; } } catch (IllegalArgumentException | IllegalStateException e) { throw e; } catch (RuntimeException e) { throw new IllegalArgumentException(errorMessage, e); } } throw new IllegalArgumentException(errorMessage); }
Source:
public void updateRoutingTable(final EMRoutingTableUpdate routingTableUpdate) { checkInitialization(); final int oldOwnerId = routingTableUpdate.getOldOwnerId(); final int newOwnerId = routingTableUpdate.getNewOwnerId(); final String newEvalId = routingTableUpdate.getNewEvalId(); storeIdToEndpointId.put(newOwnerId, newEvalId); final int blockId = routingTableUpdate.getBlockId(); final int actualOldOwnerId = blockIdToStoreId.put(blockId, newOwnerId); if (oldOwnerId != actualOldOwnerId) { LOG.log(Level.FINER, "Mapping was stale about block {0}", blockId); } else { LOG.log(Level.FINE, "Mapping table in server resolver is updated"); } if (!blockIdToStoreId.containsValue(oldOwnerId)) { final String deletedServerId = storeIdToEndpointId.remove(oldOwnerId); if (deletedServerId != null && ongoingSyncs.remove(deletedServerId)) { msgSender.get().sendRoutingTableSyncReplyMsg(deletedServerId); } } }

Target:
public void updateRoutingTable(final EMRoutingTableUpdate routingTableUpdate) { checkInitialization(); final int oldOwnerId = routingTableUpdate.getOldOwnerId(); final int newOwnerId = routingTableUpdate.getNewOwnerId(); final String newEvalId = routingTableUpdate.getNewEvalId(); storeIdToEndpointId.put(newOwnerId, newEvalId); final int blockId = routingTableUpdate.getBlockId(); final int actualOldOwnerId = blockIdToStoreId.put(blockId, newOwnerId); if (oldOwnerId != actualOldOwnerId) { LOG.log(Level.WARNING, "Mapping was stale about block {0}. ExpectedOldOwnerId: {1}, ActualOldOwnerId: {2}", new Object[]{blockId, oldOwnerId, actualOldOwnerId}); } synchronized (this) { final Set<Integer> blockIdsInOldStore = storeIdToBlockIds.get(actualOldOwnerId); blockIdsInOldStore.remove(blockId); if (blockIdsInOldStore.isEmpty()) { storeIdToBlockIds.remove(actualOldOwnerId); final String deletedServerId = storeIdToEndpointId.remove(actualOldOwnerId); LOG.log(Level.INFO, "Server {0} is deleted from routing table", deletedServerId); if (ongoingSyncs.remove(deletedServerId)) { msgSender.get().sendRoutingTableSyncReplyMsg(deletedServerId); } } Set<Integer> blockIdsInNewStore = storeIdToBlockIds.get(newOwnerId); if (blockIdsInNewStore == null) { blockIdsInNewStore = storeIdToBlockIds.put(newOwnerId, new HashSet<>()); } blockIdsInNewStore.add(blockId); } LOG.log(Level.FINE, "Mapping table in server resolver is updated." + " BlockId: {0}, OldOwnerId: {1}, NewOwnerId {2}", new Object[]{blockId, actualOldOwnerId, newOwnerId}); }
Source:
public CompositeDisposable(@NonNull Iterable<? extends Disposable> disposables) { ObjectHelper.requireNonNull(disposables, "Disposables are null"); this.resources = new OpenHashSet<Disposable>(); for (Disposable d : disposables) { ObjectHelper.requireNonNull(d, "Disposable item in Disposables is null"); this.resources.add(d); } }

Target:
public CompositeDisposable(@NonNull Iterable<? extends Disposable> disposables) { ObjectHelper.requireNonNull(disposables, "disposables is null"); this.resources = new OpenHashSet<Disposable>(); for (Disposable d : disposables) { ObjectHelper.requireNonNull(d, "A Disposable item in the disposables sequence is null"); this.resources.add(d); } }
Source:
static Map<String, String> parseZkJsonAndPopulateZkInfo(String zkLayoutJsonString) throws JSONException { Map<String, String> dataCenterToZkAddress = new HashMap<>(); JSONObject root = new JSONObject(zkLayoutJsonString); JSONArray all = (root).getJSONArray(ZKINFO_STR); for (int i = 0; i < all.length(); i++) { JSONObject entry = all.getJSONObject(i); dataCenterToZkAddress.put(entry.getString(DATACENTER_STR), entry.getString(ZKCONNECTSTR_STR)); } return dataCenterToZkAddress; }

Target:
static Map<String, String> parseZkJsonAndPopulateZkInfo(String zkLayoutJsonString) throws JSONException { Map<String, String> dataCenterToZkAddress = new HashMap<>(); JSONObject root = new JSONObject(zkLayoutJsonString); JSONArray all = root.getJSONArray(ZKINFO_STR); for (int i = 0; i < all.length(); i++) { JSONObject entry = all.getJSONObject(i); dataCenterToZkAddress.put(entry.getString(DATACENTER_STR), entry.getString(ZKCONNECTSTR_STR)); } return dataCenterToZkAddress; }
Source:
public CloudConfig(VerifiableProperties verifiableProperties) { vcrClusterZkConnectString = verifiableProperties.getString("vcr.cluster.zk.connect.string", ""); vcrClusterName = verifiableProperties.getString("vcr.cluster.name"); vcrSslPort = verifiableProperties.getInteger("vcr.ssl.port", null); vcrReplicaMountPathPrefix = verifiableProperties.getString("vcr.replica.mount.path.prefix", "/tmp/vcr/"); }

Target:
public CloudConfig(VerifiableProperties verifiableProperties) { vcrClusterZkConnectString = verifiableProperties.getString("vcr.cluster.zk.connect.string", VCR_CLUSTER_ZK_CONNECT_STRING); vcrClusterName = verifiableProperties.getString("vcr.cluster.name", VCR_CLUSTER_NAME); vcrSslPort = verifiableProperties.getInteger("vcr.ssl.port", 6668); vcrReplicaMountPathPrefix = verifiableProperties.getString("vcr.replica.mount.path.prefix", VCR_REPLICA_MOUNT_PATH_PREFIX); }
Source:
public void testEvictCustomKeyValue() { CountMarshallingPojo.reset(); int expectedWrites = 0; int expectedReads = 0; for (int i = 0; i < CACHE_SIZE * 2; i++) { CountMarshallingPojo p1 = new CountMarshallingPojo((int) Util.random(2000)); CountMarshallingPojo p2 = new CountMarshallingPojo(24); Object old = cache.put(p1, p2); if (old != null) expectedReads++; expectedWrites += 2; } assertEquals(CACHE_SIZE, cache.getAdvancedCache().getDataContainer().size()); assertEquals(expectedWrites, CountMarshallingPojo.getMarshallCount()); assertEquals(expectedReads, CountMarshallingPojo.getUnmarshallCount()); }

Target:
public void testEvictCustomKeyValue() { EvictionPojoMarshaller.resetStats(); int expectedWrites = 0; int expectedReads = 0; for (int i = 0; i < CACHE_SIZE * 2; i++) { EvictionPojo p1 = new EvictionPojo(); p1.i = (int) Util.random(2000); EvictionPojo p2 = new EvictionPojo(); p2.i = 24; Object old = cache.put(p1, p2); if (old != null) expectedReads++; expectedWrites += 2; } assertEquals(CACHE_SIZE, cache.getAdvancedCache().getDataContainer().size()); assertEquals(expectedWrites, EvictionPojoMarshaller.writes.get()); assertEquals(expectedReads, EvictionPojoMarshaller.reads.get()); }
Source:
public void close(SelectionKey key) { SocketChannel socketChannel = channel(key); Transmissions transmissions = transmissions(key); if (transmissions != null) { logger.debug("Closing connection from {}", transmissions.connectionId); this.disconnected.add(transmissions.connectionId); this.keys.remove(transmissions.connectionId); activeConnections.set(this.keys.size()); transmissions.clearReceive(); transmissions.clearSend(); } key.attach(null); key.cancel(); try { socketChannel.socket().close(); socketChannel.close(); } catch (IOException e) { logger.error("Exception closing connection to node {}:", transmissions.connectionId, e); } this.metrics.selectorConnectionClosed.inc(); }

Target:
private void close(SelectionKey key) { SocketChannel socketChannel = channel(key); Transmissions transmissions = transmissions(key); if (transmissions != null) { logger.debug("Closing connection from {}", transmissions.connectionId); this.disconnected.add(transmissions.connectionId); this.keyMap.remove(transmissions.connectionId); activeConnections.set(this.keyMap.size()); transmissions.clearReceive(); transmissions.clearSend(); } key.attach(null); key.cancel(); try { socketChannel.socket().close(); socketChannel.close(); } catch (IOException e) { logger.error("Exception closing connection to node {}:", transmissions.connectionId, e); } this.metrics.selectorConnectionClosed.inc(); }
Source:
public void storeConfig() throws IOException { final Resource config = configPathDir.get(CONFIG_FILE_NAME); OutputStream fos = config.out(); try { this.configuration.store(fos, ""); } finally { fos.close(); } }

Target:
public void storeConfig() throws IOException { Resource config = configPathDir.get(CONFIG_FILE_NAME); try (OutputStream fos = config.out()) { this.configuration.store(fos, ""); } }
Source:
public void aboutToBeShown() { super.aboutToBeShown(); this.selectionListener = new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { IStructuredSelection selection = comboViewer.getStructuredSelection(); Object newValue = selection.getFirstElement(); controller.updateValue(newValue); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }; this.combo.addSelectionListener(this.selectionListener); this.controller.onNewValue(new IConsumer<Object>() { @Override public void apply(Object value) { if (!combo.isDisposed() && !(combo.getText() != null && combo.getText().equals(value))) { final ISelection selection; if (value != null) { selection = new StructuredSelection(value); } else { selection = null; } comboViewer.setSelection(selection); if (isEnabled() && !combo.isEnabled()) { combo.setEnabled(true); } } } }); this.controller.onNewCandidates(new IConsumer<List<Object>>() { @Override public void apply(List<Object> value) { if (!combo.isDisposed()) { if (value != null) { comboViewer.setInput(value.toArray()); } else { comboViewer.setInput(null); } if (isEnabled() && !combo.isEnabled()) { combo.setEnabled(true); } } } }); }

Target:
public void aboutToBeShown() { super.aboutToBeShown(); this.selectionListener = new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { IStructuredSelection selection = comboViewer.getStructuredSelection(); Object newValue = selection.getFirstElement(); controller.updateValue(newValue); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }; this.combo.addSelectionListener(this.selectionListener); this.controller.onNewValue(new IConsumer<Object>() { @Override public void apply(Object value) { if (!combo.isDisposed() && !(combo.getText() != null && combo.getText().equals(value))) { final ISelection selection; if (value != null) { selection = new StructuredSelection(value); } else { selection = null; } comboViewer.setSelection(selection); if (!combo.isEnabled()) { combo.setEnabled(true); } } } }); this.controller.onNewCandidates(new IConsumer<List<Object>>() { @Override public void apply(List<Object> value) { if (!combo.isDisposed()) { if (value != null) { comboViewer.setInput(value.toArray()); } else { comboViewer.setInput(null); } if (!combo.isEnabled()) { combo.setEnabled(true); } } } }); }
Source:
public String updateClasses(IResourceClass[] resourceClasses) { boolean different = false; if (this.resourceClasses.length != resourceClasses.length) different = true; else for (int i = 0; i < this.resourceClasses.length; ++i) { if (!this.resourceClasses[i].getId().equals(resourceClasses[i].getId()) || !this.resourceClasses[i].getHunamDescription().equals(resourceClasses[i].getHunamDescription())) { different = true; break; } } if (!different) return fResourceClassId; this.resourceClasses = resourceClasses; fResourceClassCombo.removeAll(); int width = populateCombo(); toolItem.setWidth(width + COMBO_TRIM_WIDTH); return fResourceClassId; }

Target:
public String updateClasses(IResourceClass[] resourceClasses) { boolean different = false; if (this.resourceClasses.length != resourceClasses.length) different = true; else for (int i = 0; i < this.resourceClasses.length; ++i) { if (!this.resourceClasses[i].getId().equals(resourceClasses[i].getId()) || !this.resourceClasses[i].getHumanDescription().equals(resourceClasses[i].getHumanDescription())) { different = true; break; } } if (!different) return fResourceClassId; this.resourceClasses = resourceClasses; fResourceClassCombo.removeAll(); int width = populateCombo(); toolItem.setWidth(width); return fResourceClassId; }
Source:
public void slightlyOccupiedAABBTest() { Level check = new Level(emptyPlayer, emptyUnit, new Grid<>(Arrays.asList( Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL, Cell.EMPTY, Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL), 3, 3)); CollisionHandler handler = new CollisionHandler(check); Cell cell = handler.checkLevelAABB( new AABB(new Point(1.5, 1.5), new Point(2.5, 2.5)), new Point(0, 0)); assertFalse(cell.getType() == Cell.EMPTY); }

Target:
public void slightlyOccupiedAABBTest() { Level check = new Level(emptyPlayer, emptyUnit, new Grid<>(Arrays.asList( Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL, Cell.EMPTY, Cell.WALL, Cell.WALL, Cell.WALL, Cell.WALL), 3, 3)); CollisionHandler handler = new CollisionHandler(check); Cell cell = handler.checkLevelAABB( new AABB(new Point(1.5, 1.5), new Point(2.5, 2.5)), new Point(0, 0)); assertNotEquals(cell, Cell.EMPTY); }
Source:
public String getColumnText(Object element, int columnIndex) { switch (columnIndex) { case 0: return getText(element); case 1: try { if (element instanceof StagingFolderEntry) { return null; } StagingEntry stagingEntry = (StagingEntry) element; Date modified; if (isStaged) { IFileRevision fileRevision = GitFileRevision.inIndex( stagingEntry.getRepository(), stagingEntry.getPath()); modified = new Date(fileRevision.getTimestamp()); } else { File file = new File(stagingEntry.getRepository() .getWorkTree(), stagingEntry.getPath()); modified = new Date(file.lastModified()); } if (showRelativeDate) return RelativeDateFormatter.format(modified); else return absoluteFormatter.format(modified); } catch (Exception e) { Activator.handleError(e.getCause().getMessage(), e.getCause(), false); return null; } default: return null; } }

Target:
public String getColumnText(Object element, int columnIndex) { switch (columnIndex) { case 0: return getText(element); case 1: try { if (element instanceof StagingFolderEntry) { return null; } StagingEntry stagingEntry = (StagingEntry) element; Date modified; if (isStaged) { IFileRevision fileRevision = GitFileRevision.inIndex( stagingEntry.getRepository(), stagingEntry.getPath()); modified = new Date(fileRevision.getTimestamp()); } else { File file = new File(stagingEntry.getRepository() .getWorkTree(), stagingEntry.getPath()); modified = new Date(file.lastModified()); } if (showRelativeDate) { return RelativeDateFormatter.format(modified); } else { return absoluteFormatter.format(modified); } } catch (Exception e) { Activator.handleError(e.getCause().getMessage(), e.getCause(), false); return null; } default: return null; } }
Source:
public Optional<QosException> handle(Response response) { final Optional<QosException> result; switch (response.code()) { case 308: result = handle308(response); break; case 429: result = Optional.of(handle429(response)); break; case 503: result = Optional.of(handle503()); break; default: result = Optional.empty(); } result.ifPresent(exception -> response.close()); return result; }

Target:
public Optional<QosException> handle(Response response) { switch (response.code()) { case 308: return handle308(response); case 429: return Optional.of(handle429(response)); case 503: return Optional.of(handle503()); } return Optional.empty(); }
Source:
public String toString() { return "TaskStatusPlus{" + "id=" + id + ", type=" + type + ", createdTime=" + createdTime + ", queueInsertionTime=" + queueInsertionTime + ", state=" + state + ", duration=" + duration + ", location=" + location + ", dataSource=" + dataSource + "}"; }

Target:
public String toString() { return "TaskStatusPlus{" + "id='" + id + '\'' + ", type='" + type + '\'' + ", createdTime=" + createdTime + ", queueInsertionTime=" + queueInsertionTime + ", state=" + state + ", duration=" + duration + ", location=" + location + ", dataSource='" + dataSource + '\'' + ", errorMsg='" + errorMsg + '\'' + '}'; }
Source:
private void destroy(EntityRef ref) { long entityId = ref.getId(); entityStore.remove(entityId); entityManager.remove(entityId); if (ref instanceof PojoEntityRef) { ((PojoEntityRef) ref).invalidate(); } componentStore.remove(entityId); }

Target:
private void destroy(EntityRef ref) { long entityId = ref.getId(); entityStore.remove(entityId); entityManager.remove(entityId); ref.invalidate(); componentStore.remove(entityId); }
Source:
private void executeFileMove(FileActivity activity) throws IOException { SPath oldPath = activity.getOldPath(); IFile oldFile = oldPath.getFile(); SPath newPath = activity.getPath(); IFile newFile = newPath.getFile(); editorManager.moveFile(oldPath, newPath); oldFile.move(activity.getPath().getFullPath(), true); newFile.setContents(new ByteArrayInputStream(activity.getContent()), true, true); }

Target:
private void executeFileMove(FileActivity activity) throws IOException { SPath oldPath = activity.getOldPath(); IFile oldFile = oldPath.getFile(); SPath newPath = activity.getPath(); IFile newFile = newPath.getFile(); oldFile.move(activity.getPath().getFullPath(), true); byte[] content = activity.getContent(); if (content != null) { newFile.setContents(new ByteArrayInputStream(content), true, true); } editorManager.updateMapping(oldPath, newPath); }
Source:
public <T> T tryReadingVault(Supplier<T> action) throws Retry.ActionFailedException { Optional<Span> optionalSpan = initSpan("read"); return optionalSpan.map(span -> { try (Scope ignored = tracer.activateSpan(span)) { try { return action.get(); } catch (RuntimeException e) { LOGGER.error("Exception during reading vault", e); span.setTag(TracingUtil.ERROR, true); span.setTag(TracingUtil.MESSAGE, e.getMessage()); metricService.incrementMetricCounter(MetricType.VAULT_READ_FAILED); throw new Retry.ActionFailedException(e.getMessage()); } } finally { span.finish(); } }).orElseGet(action::get); }

Target:
public <T> T tryReadingVault(Supplier<T> action) throws Retry.ActionFailedException { return executeVaultOperationWithTrace(action, "read", MetricType.VAULT_READ_FAILED); }
Source:
public static Object getPropertyByEntry(String entryId, String subKey) throws Exception { Object value; try { ConcurrentHashMap<String, Object> entryMap = entryIdToKalturaLiveEntryMap.get(entryId); value = entryMap.get(subKey); } catch (Exception e) { logger.error("(" + entryId + ") Failed to get value for key \"" + subKey + "\". " + e); throw e; } logger.debug("(" + entryId + ") Successfully got entry (map size:" + entryIdToKalturaLiveEntryMap.size() + ")"); return value; }

Target:
public static Object getPropertyByEntry(String entryId, String subKey) throws Exception { Object value; try { ConcurrentHashMap<String, Object> entryMap = entryIdToKalturaLiveEntryMap.get(entryId); value = entryMap.get(subKey); } catch (Exception e) { logger.error("(" + entryId + ") Failed to get value for key \"" + subKey + "\". " + e); throw e; } logger.debug("(" + entryId + ") Successfully got entry subKey: (" + subKey + ")"); return value; }
Source:
private RemoteCallback<TestScenarioModelContent> getModelSuccessCallback() { return new RemoteCallback<TestScenarioModelContent>() { @Override public void callback(final TestScenarioModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenario = content.getScenario(); ifFixturesSizeZeroThenAddExecutionTrace(); dmo = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), scenario, content.getDataModel()); resetEditorPages(content.getOverview()); addImportsTab(importsWidget); addPage(kiePage); addPage(auditPage); redraw(); view.hideBusyIndicator(); } }; }

Target:
private RemoteCallback<TestScenarioModelContent> getModelSuccessCallback() { return new RemoteCallback<TestScenarioModelContent>() { @Override public void callback(final TestScenarioModelContent content) { if (versionRecordManager.getCurrentPath() == null) { return; } scenario = content.getScenario(); ifFixturesSizeZeroThenAddExecutionTrace(); dmo = oracleFactory.makeAsyncPackageDataModelOracle(versionRecordManager.getCurrentPath(), scenario, content.getDataModel()); resetEditorPages(content.getOverview()); addImportsTab(importsWidget); addPage(settingsPage); addPage(auditPage); redraw(); view.hideBusyIndicator(); } }; }
Source:
public ViewpointSelectionCallbackWithConfimationAndDependenciesHandling() { super(); this.askUserForDependencyActivation = true; }

Target:
public ViewpointSelectionCallbackWithConfimationAndDependenciesHandling() { this(true); }
Source:
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { final Identity identity; try (final DefaultAgentProxy agentProxy = new DefaultAgentProxy()) { identity = agentProxy.list().get(0); } final RecordingTlsClientProtocol protocol = new RecordingTlsClientProtocol( s.getInputStream(), s.getOutputStream(), new SecureRandom()); final SshAgentTlsClient tlsClient = new SshAgentTlsClient(username, identity, protocol); protocol.connect(tlsClient); return new SshAgentTlsSocket(tlsClient, s); }

Target:
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException { final RecordingTlsClientProtocol protocol = new RecordingTlsClientProtocol( s.getInputStream(), s.getOutputStream(), new SecureRandom()); final SshAgentTlsClient tlsClient = new SshAgentTlsClient(agentProxy, identity, username, protocol); protocol.connect(tlsClient); return new SshAgentTlsSocket(tlsClient, s); }
Source:
public void dump(PrintWriter writer) { writer.println("===============BEGIN PICASSO STATS ==============="); writer.println("Memory Cache Stats"); writer.print(" Max Cache Size: "); writer.println(maxSize); writer.print(" Cache Size: "); writer.println(size); writer.print(" Cache % Full: "); writer.println((int) Math.ceil((float) size / maxSize * 100)); writer.print(" Cache Hits: "); writer.println(cacheHits); writer.print(" Cache Misses: "); writer.println(cacheMisses); writer.print(" Download Count: "); writer.println(downloadCount); writer.print(" Total Download Size: "); writer.println(totalDownloadSize); writer.print(" Average Download Size: "); writer.println(averageDownloadSize); writer.println("Bitmap Stats"); writer.print(" Total Bitmaps Decoded: "); writer.println(originalBitmapCount); writer.print(" Total Bitmap Size: "); writer.println(totalOriginalBitmapSize); writer.print(" Total Transformed Bitmaps: "); writer.println(transformedBitmapCount); writer.print(" Total Transformed Bitmap Size: "); writer.println(totalTransformedBitmapSize); writer.print(" Average Bitmap Size: "); writer.println(averageOriginalBitmapSize); writer.print(" Average Transformed Bitmap Size: "); writer.println(averageTransformedBitmapSize); writer.println("===============END PICASSO STATS ==============="); writer.flush(); }

Target:
public void dump(PrintWriter writer) { writer.println("===============BEGIN PICASSO STATS ==============="); writer.println("Memory Cache Stats"); writer.print(" Max Cache Size: "); writer.println(maxSize); writer.print(" Cache Size: "); writer.println(size); writer.print(" Cache % Full: "); writer.println((int) Math.ceil((float) size / maxSize * 100)); writer.print(" Cache Hits: "); writer.println(cacheHits); writer.print(" Cache Misses: "); writer.println(cacheMisses); writer.println("Network Stats"); writer.print(" Download Count: "); writer.println(downloadCount); writer.print(" Total Download Size: "); writer.println(totalDownloadSize); writer.print(" Average Download Size: "); writer.println(averageDownloadSize); writer.println("Bitmap Stats"); writer.print(" Total Bitmaps Decoded: "); writer.println(originalBitmapCount); writer.print(" Total Bitmap Size: "); writer.println(totalOriginalBitmapSize); writer.print(" Total Transformed Bitmaps: "); writer.println(transformedBitmapCount); writer.print(" Total Transformed Bitmap Size: "); writer.println(totalTransformedBitmapSize); writer.print(" Average Bitmap Size: "); writer.println(averageOriginalBitmapSize); writer.print(" Average Transformed Bitmap Size: "); writer.println(averageTransformedBitmapSize); writer.println("===============END PICASSO STATS ==============="); writer.flush(); }
Source:
public void shouldReturnNoChanges() throws Exception { changeFilesInProject(); showSynchronizationDialog("org.eclipse.egit.ui"); bot.shell("Synchronize repository: egit/.git").activate(); bot.comboBox(0).setSelection(0); bot.comboBox(1).setSelection(0); bot.comboBox(2).setSelection(0); bot.comboBox(3).setSelection(1); bot.button("OK").click(); bot.waitUntil(shellIsActive("Confirm Open Perspective"), 15000); bot.button("No").click(); SWTBotShell gitResSyncShell = bot.shell("Git Resource Synchronization"); bot.waitUntil(shellCloses(gitResSyncShell), 6000000); SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }

Target:
public void shouldReturnNoChanges() throws Exception { changeFilesInProject(); showSynchronizationDialog("org.eclipse.egit.ui"); bot.shell("Synchronize repository: egit" + File.separator + ".git") .activate(); bot.comboBox(0).setSelection("local .git"); bot.comboBox(1).setSelection("HEAD"); bot.comboBox(2).setSelection("local .git"); bot.comboBox(3).setSelection("master"); bot.button("OK").click(); handleConfirmOpenPerspective(); bot.waitUntil(shellIsActive("Git Resource Synchronization"), 15000); SWTBotShell gitResSyncShell = bot.shell("Git Resource Synchronization"); bot.waitUntil(shellCloses(gitResSyncShell), 300000); SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }
Source:
public static boolean currentUserIsAnonymous() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication == null || (currentUserHasRole(AUTHORITY_ANONYMOUS) && !currentUserHasRole(AUTHORITY_USER)); }

Target:
public static boolean currentUserIsAnonymous() { Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); return authentication == null || (authentication instanceof AnonymousAuthenticationToken); }
Source:
public String getDisplayName() { return "Jenkins Global Configuration File (secrets are filtered out unless saved in clear in the config.xml file)"; }

Target:
public String getDisplayName() { return "Jenkins Global Configuration File (Encrypted secrets are redacted)"; }
Source:
protected Map<String, Integer> getPortMap() { return ImmutableMap.of("http", getEntity().getAttribute(WebAppService.HTTP_PORT)); }

Target:
protected Map<String, Integer> getPortMap() { return ImmutableMap.of("http", getHttpPort()); }
Source:
public void setUp() throws Exception { this.workspaceName = NameGenerator.generate("workspace", 5); dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, workspaceName, Collections.emptyList(), null); }

Target:
public void setUp() throws Exception { dashboard.open(); createWorkspaceHelper.createAndEditWorkspaceFromStack( Devfile.JAVA_MAVEN, WORKSPACE_NAME, Collections.emptyList(), null); }
Source:
private Date calculateExpirationValue(long value, String units) { Calendar currentTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Long longObj = -value; if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_SEC) && units != null) { currentTime.add(Calendar.SECOND, longObj.intValue()); } else if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_MIN) && units != null) { currentTime.add(Calendar.MINUTE, longObj.intValue()); } else if (units.equalsIgnoreCase(NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_HOUR) && units != null) { currentTime.add(Calendar.HOUR_OF_DAY, longObj.intValue()); } else { currentTime.add(Calendar.DAY_OF_YEAR, longObj.intValue()); } return currentTime.getTime(); }

Target:
private Date calculateExpirationValue(long value, String units) { Calendar currentTime = Calendar.getInstance(TimeZone.getTimeZone("GMT")); Long longObj = -value; if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_SEC.equalsIgnoreCase(units)) { currentTime.add(Calendar.SECOND, longObj.intValue()); } else if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_MIN.equalsIgnoreCase(units)) { currentTime.add(Calendar.MINUTE, longObj.intValue()); } else if (NhincConstants.ASYNC_DB_REC_EXP_VAL_UNITS_HOUR.equalsIgnoreCase(units)) { currentTime.add(Calendar.HOUR_OF_DAY, longObj.intValue()); } else { currentTime.add(Calendar.DAY_OF_YEAR, longObj.intValue()); } return currentTime.getTime(); }
Source:
public void getAccountPropertiesWithResponse() { formTrainingAsyncClient.getAccountPropertiesWithResponse().subscribe(response -> { AccountProperties accountProperties = response.getValue(); System.out.printf("Max number of models that can be trained for this account: %s%n", accountProperties.getLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountPropertiesWithResponse }

Target:
public void getAccountPropertiesWithResponse() { formTrainingAsyncClient.getAccountPropertiesWithResponse().subscribe(response -> { System.out.printf("Response Status Code: %d.", response.getStatusCode()); AccountProperties accountProperties = response.getValue(); System.out.printf("Max number of models that can be trained for this account: %s%n", accountProperties.getLimit()); System.out.printf("Current count of trained custom models: %d%n", accountProperties.getCount()); }); END: com.azure.ai.formrecognizer.FormTrainingAsyncClient.getAccountPropertiesWithResponse }
Source:
public void onFocus() { if ( !loading && context != null ) { dataModelerWBContext.setActiveContext( context ); enableDataModelerDocksWhenIsHidden(); } }

Target:
public void onFocus() { if ( !loading && context != null ) { dataModelerWBContext.setActiveContext( context ); showDataModellerDocks(); } }
Source:
public void run() { if (getListener() == null) { logger.info(this + " No listener bound to server connection factory; will not read; exiting..."); return; } try { this.serverChannel = ServerSocketChannel.open(); int port = super.getPort(); getTcpSocketSupport().postProcessServerSocket(this.serverChannel.socket()); this.serverChannel.configureBlocking(false); if (getLocalAddress() == null) { this.serverChannel.socket().bind(new InetSocketAddress(port), Math.abs(getBacklog())); } else { InetAddress whichNic = InetAddress.getByName(getLocalAddress()); this.serverChannel.socket().bind(new InetSocketAddress(whichNic, port), Math.abs(getBacklog())); } if (logger.isInfoEnabled()) { logger.info(this + " Listening"); } publishServerListeningEvent(getPort()); final Selector selector = Selector.open(); if (this.serverChannel == null) { if (logger.isDebugEnabled()) { logger.debug(this + " stopped before registering the server channel"); } } else { this.serverChannel.register(selector, SelectionKey.OP_ACCEPT); setListening(true); this.selector = selector; doSelect(this.serverChannel, selector); } } catch (IOException e) { if (isActive()) { logger.error("Error on ServerChannel; port = " + getPort(), e); publishServerExceptionEvent(e); } stop(); } finally { setListening(false); } }

Target:
public void run() { if (getListener() == null) { logger.info(this + " No listener bound to server connection factory; will not read; exiting..."); return; } try { this.serverChannel = ServerSocketChannel.open(); int port = super.getPort(); getTcpSocketSupport().postProcessServerSocket(this.serverChannel.socket()); this.serverChannel.configureBlocking(false); if (getLocalAddress() == null) { this.serverChannel.socket().bind(new InetSocketAddress(port), Math.abs(getBacklog())); } else { InetAddress whichNic = InetAddress.getByName(getLocalAddress()); this.serverChannel.socket().bind(new InetSocketAddress(whichNic, port), Math.abs(getBacklog())); } if (logger.isInfoEnabled()) { logger.info(this + " Listening"); } final Selector selector = Selector.open(); if (this.serverChannel == null) { if (logger.isDebugEnabled()) { logger.debug(this + " stopped before registering the server channel"); } } else { this.serverChannel.register(selector, SelectionKey.OP_ACCEPT); setListening(true); publishServerListeningEvent(getPort()); this.selector = selector; doSelect(this.serverChannel, selector); } } catch (IOException e) { if (isActive()) { logger.error("Error on ServerChannel; port = " + getPort(), e); publishServerExceptionEvent(e); } stop(); } finally { setListening(false); } }
Source:
public void delete(final RyaStatement statement, final MongoDBRdfConfiguration conf) throws RyaDAOException { final boolean canDelete = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canDelete) { final DBObject obj = storageStrategy.getQuery(statement); coll.remove(obj); } }

Target:
public void delete(final RyaStatement statement, final MongoDBRdfConfiguration conf) throws RyaDAOException { final boolean canDelete = DocumentVisibilityUtil.doesUserHaveDocumentAccess(auths, statement.getColumnVisibility()); if (canDelete) { final DBObject obj = storageStrategy.getQuery(statement); coll.remove(obj); } else { throw new RyaDAOException("User does not have the required authorizations to delete statement"); } }
Source:
DeerIdSearcherAndOwlResolver equivDeerSearchResolver() { TransportClient esClient = getTransportClient(); ContentTitleSearcher contentSearcher = new EsContentTitleSearcher(esClient); return new DeerIdSearcherAndOwlResolver( contentSearcher, Long.parseLong(esTimeout), null, null ); }

Target:
SearchResolver equivDeerSearchResolver() { TransportClient esClient = getTransportClient(); ContentTitleSearcher contentSearcher = new EsContentTitleSearcher(esClient); return new DeerSearchResolver( contentSearcher, Long.parseLong(esTimeout), null, null ); }
Source:
public Boolean waitListOfFilesNames(final String text) { return new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until((ExpectedCondition<Boolean>) webDriver -> suggestionPanel.getText().contains(text)); }

Target:
public void waitListOfFilesNames(final String text) { new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until((ExpectedCondition<Boolean>) webDriver -> suggestionPanel.getText().contains(text)); }
Source:
public AutoCompletionCandidates doAutoCompleteJobName(@AncestorInPath @CheckForNull Item project, @QueryParameter String value) { final AutoCompletionCandidates candidates = new AutoCompletionCandidates(); final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null) { return null; } if (project == null || !project.hasPermission(Item.CONFIGURE)) { return candidates; } for (AbstractProject job: jenkins.getAllItems(AbstractProject.class)) { if (job.getFullName().contains(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }

Target:
public AutoCompletionCandidates doAutoCompleteJobName(@AncestorInPath @CheckForNull Item project, @QueryParameter String value) { final AutoCompletionCandidates candidates = new AutoCompletionCandidates(); final Jenkins jenkins = Jenkins.getInstance(); if (jenkins == null || project == null || !project.hasPermission(Item.CONFIGURE)) { return candidates; } for (AbstractProject job: jenkins.getAllItems(AbstractProject.class)) { if (job.getFullName().contains(value)) { if (job.hasPermission(Item.READ)) { candidates.add(job.getFullName()); } } } return candidates; }
Source:
public void getTokenShouldReturnToken() { BitreserveClient bitreserveClient = new BitreserveClient("foobar"); Assert.assertEquals(bitreserveClient.getToken().getToken(), "foobar"); }

Target:
public void getTokenShouldReturnToken() { BitreserveClient bitreserveClient = new BitreserveClient("foobar"); Assert.assertEquals(bitreserveClient.getToken().getBearerToken(), "foobar"); }
Source:
private String updateConfigurationValue(final String line, GCType configuredGC, Map<String, JVMOption> upsertSet, Map<String, JVMOption> excludeSet) { JVMOption option = JVMOption.parse(line); if (option == null) return line; GCType gcType = GCTuner.isOptionAvailable(option); if (gcType != null) { option.setCommented(gcType != configuredGC); } if (upsertSet != null && upsertSet.containsKey(option.getJvmOption())) { JVMOption configuration = upsertSet.get(option.getJvmOption()); option.setCommented(false); option.setValue(configuration.getValue()); upsertSet.remove(option.getJvmOption()); } ; if (excludeSet != null && excludeSet.containsKey(option.getJvmOption())) option.setCommented(true); return option.toString(); }

Target:
private String updateConfigurationValue(final String line, GCType configuredGC, Map<String, JVMOption> upsertSet, Map<String, JVMOption> excludeSet) { JVMOption option = JVMOption.parse(line); if (option == null) return line; if (option.isHeapJVMOption()) { String configuredValue = null; switch (option.getJvmOption()) { case "-Xmn": configuredValue = config.getHeapNewSize(); break; default: configuredValue = config.getHeapSize(); break; } setHeapSetting(configuredValue, option); } GCType gcType = GCTuner.getGCType(option); if (gcType != null) { option.setCommented(gcType != configuredGC); } if (upsertSet != null && upsertSet.containsKey(option.getJvmOption())) { JVMOption configuration = upsertSet.get(option.getJvmOption()); option.setCommented(false); option.setValue(configuration.getValue()); upsertSet.remove(option.getJvmOption()); } ; if (excludeSet != null && excludeSet.containsKey(option.getJvmOption())) option.setCommented(true); return option.toJVMOptionString(); }
Source:
public void completeCrossDeviceEmailLinkFlow() { setTitle(R.string.fui_email_link_confirm_email_header); EmailLinkEmailPromptFragment fragment = EmailLinkEmailPromptFragment.newInstance(); switchFragment(fragment, R.id.fragment_register_email, EmailLinkCrossDeviceLinkingFragment.TAG, true, true); }

Target:
public void completeCrossDeviceEmailLinkFlow() { EmailLinkPromptEmailFragment fragment = EmailLinkPromptEmailFragment.newInstance(); switchFragment(fragment, R.id.fragment_register_email, EmailLinkCrossDeviceLinkingFragment.TAG, true, true); }