auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
ClusterModel(ClusterContext clusterContext, Set<AssignableReplica> assignableReplicas, Set<AssignableNode> assignableNodes, Map<String, IdealState> baselineAssignment, Map<String, IdealState> bestPossibleAssignment) { _clusterContext = clusterContext; _assignableReplicaIndex = new HashMap<>(); assignableReplicas.stream().forEach(rep -> { Map<String, AssignableReplica> replicaMap = _assignableReplicaIndex.getOrDefault(rep.getResourceName(), new HashMap<>()); replicaMap.put(rep.getReplicaKey(), rep); _assignableReplicaIndex.put(rep.getReplicaKey(), replicaMap); }); _assignableNodeMap = assignableNodes.stream() .collect(Collectors.toMap(AssignableNode::getInstanceName, node -> node)); _baselineAssignment = baselineAssignment; _bestPossibleAssignment = bestPossibleAssignment; }

Target:
ClusterModel(ClusterContext clusterContext, Set<AssignableReplica> assignableReplicas, Set<AssignableNode> assignableNodes, Map<String, IdealState> baselineAssignment, Map<String, IdealState> bestPossibleAssignment) { _clusterContext = clusterContext; _assignableReplicaMap = assignableReplicas.stream() .collect(Collectors.groupingBy(AssignableReplica::getResourceName, Collectors.toSet())); _assignableReplicaIndex = assignableReplicas.stream().collect(Collectors .groupingBy(AssignableReplica::getResourceName, Collectors .toMap(AssignableReplica::toString, replica -> replica, (oldValue, newValue) -> oldValue))); _assignableNodeMap = assignableNodes.stream() .collect(Collectors.toMap(AssignableNode::getInstanceName, node -> node)); _baselineAssignment = baselineAssignment; _bestPossibleAssignment = bestPossibleAssignment; }
Source:
private byte[] unwrapIntegrityProtectedMessage(byte[] message, int offset, int len) throws SaslException { int messageType = DigestUtils.decodeByteOrderedInteger(message, offset + len - 6, 2); int extractedSeqNum = DigestUtils.decodeByteOrderedInteger(message, offset + len - 4, 4); if (messageType != 1) { throw new SaslException("MessageType must equal to 1, but is different"); } if (extractedSeqNum != unwrapSeqNum) { throw new SaslException("Bad sequence number while unwrapping"); } byte[] extractedMessageMac = new byte[10]; byte[] extractedMessage = new byte[len - 16]; System.arraycopy(message, offset, extractedMessage, 0, len - 16); System.arraycopy(message, offset + len - 16, extractedMessageMac, 0, 10); byte[] expectedHmac = DigestUtils.computeHMAC(unwrapHmacKeyIntegrity, extractedSeqNum, hmacMD5, extractedMessage, 0, extractedMessage.length); if (Arrays2.equals(expectedHmac, 0, extractedMessageMac, 0, 10) == false) { return NO_BYTES; } unwrapSeqNum++; return extractedMessage; }

Target:
private byte[] unwrapIntegrityProtectedMessage(byte[] message, int offset, int len) throws SaslException { int messageType = decodeByteOrderedInteger(message, offset + len - 6, 2); int extractedSeqNum = decodeByteOrderedInteger(message, offset + len - 4, 4); if (messageType != 1) { throw new SaslException("MessageType must equal to 1, but is different"); } if (extractedSeqNum != unwrapSeqNum) { throw new SaslException("Bad sequence number while unwrapping"); } byte[] extractedMessageMac = new byte[10]; byte[] extractedMessage = new byte[len - 16]; System.arraycopy(message, offset, extractedMessage, 0, len - 16); System.arraycopy(message, offset + len - 16, extractedMessageMac, 0, 10); byte[] expectedHmac = computeHMAC(unwrapHmacKeyIntegrity, extractedSeqNum, hmacMD5, extractedMessage, 0, extractedMessage.length); if (Arrays2.equals(expectedHmac, 0, extractedMessageMac, 0, 10) == false) { return NO_BYTES; } unwrapSeqNum++; return extractedMessage; }
Source:
private List<Encounter> getAllEncountersByPatientMotechId(String motechId) { Validate.notEmpty(motechId, "MoTeCH Id cannot be empty"); List<Encounter> encounters = new ArrayList<>(); Patient patient = patientAdapter.getPatientByMotechId(motechId); if (patient != null) { encounters.addAll(getEncountersForPatient(patient)); } return encounters; }

Target:
private List<Encounter> getAllEncountersByPatientMotechId(String motechId) { Validate.notEmpty(motechId, "MOTECH Id cannot be empty"); List<Encounter> encounters = new ArrayList<>(); Patient patient = patientAdapter.getPatientByMotechId(motechId); if (patient != null) { encounters.addAll(getEncountersForPatient(patient)); } return encounters; }
Source:
public List<CompletionTime> getTraceCompletionTimes(String tenantId, Criteria criteria) { String index = client.getIndex(tenantId); try { RefreshRequestBuilder refreshRequestBuilder = client.getClient().admin().indices().prepareRefresh(index); client.getClient().admin().indices().refresh(refreshRequestBuilder.request()).actionGet(); BoolQueryBuilder query = ElasticsearchUtil.buildQuery(criteria, "timestamp", "businessTransaction"); SearchRequestBuilder request = client.getClient().prepareSearch(index) .setTypes(TRACE_COMPLETION_TIME_TYPE) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setTimeout(TimeValue.timeValueMillis(criteria.getTimeout())) .setSize(criteria.getMaxResponseSize()) .setQuery(query); SearchResponse response = request.execute().actionGet(); if (response.isTimedOut()) { msgLog.warnQueryTimedOut(); return null; } List<CompletionTime> ret = new ArrayList<CompletionTime>(); for (SearchHit searchHitFields : response.getHits()) { try { ret.add(mapper.readValue(searchHitFields.getSourceAsString(), CompletionTime.class)); } catch (Exception e) { msgLog.errorFailedToParse(e); } } return ret; } catch (org.elasticsearch.indices.IndexMissingException t) { if (msgLog.isTraceEnabled()) { msgLog.tracef("No index found, so unable to get completion count"); } } return null; }

Target:
public List<CompletionTime> getTraceCompletionTimes(String tenantId, Criteria criteria) { String index = client.getIndex(tenantId); try { RefreshRequestBuilder refreshRequestBuilder = client.getClient().admin().indices().prepareRefresh(index); client.getClient().admin().indices().refresh(refreshRequestBuilder.request()).actionGet(); BoolQueryBuilder query = ElasticsearchUtil.buildQuery(criteria, "timestamp", "businessTransaction"); SearchRequestBuilder request = client.getClient().prepareSearch(index) .setTypes(TRACE_COMPLETION_TIME_TYPE) .setSearchType(SearchType.DFS_QUERY_THEN_FETCH) .setTimeout(TimeValue.timeValueMillis(criteria.getTimeout())) .setSize(criteria.getMaxResponseSize()) .setQuery(query); SearchResponse response = request.execute().actionGet(); if (response.isTimedOut()) { msgLog.warnQueryTimedOut(); return null; } List<CompletionTime> ret = new ArrayList<CompletionTime>(); for (SearchHit searchHitFields : response.getHits()) { try { ret.add(mapper.readValue(searchHitFields.getSourceAsString(), CompletionTime.class)); } catch (JsonParseException|JsonMappingException e) { msgLog.errorFailedToParse(e); } catch (IOException e) { msgLog.errorFailedToParse(e); } } return ret; } catch (org.elasticsearch.indices.IndexMissingException t) { if (msgLog.isTraceEnabled()) { msgLog.tracef("No index found, so unable to get completion count"); } } return null; }
Source:
protected void connectUfs(UnderFileSystem fs) throws IOException { fs.connectFromMaster( NetworkAddressUtils.getConnectHost(NetworkAddressUtils.ServiceType.MASTER_RPC, ServerConfiguration.global())); }

Target:
protected void connectUfs(UnderFileSystem fs) { }
Source:
private double getScaleFactor() { return 72.0 / this.dpi; }

Target:
private double getScaleFactor() { return Constants.PDF_DPI / this.dpi; }
Source:
public void activateFilterIdsAndUpdateViewer(String[] filterIdsToActivate) { boolean updateFilterActivation = false; Arrays.sort(filterIdsToActivate); CommonFilterDescriptor[] visibleFilterDescriptors = (CommonFilterDescriptor[]) getVisibleFilterDescriptors(); int indexofFilterIdToBeActivated; List<String> nonUiVisible = null; for (int i = 0; i < visibleFilterDescriptors.length; i++) { indexofFilterIdToBeActivated = Arrays.binarySearch(filterIdsToActivate, visibleFilterDescriptors[i].getId()); if (indexofFilterIdToBeActivated >= 0 ^ isActive(visibleFilterDescriptors[i].getId())) { updateFilterActivation = true; } if (!visibleFilterDescriptors[i].isVisibleInUi()) { if (nonUiVisible == null) nonUiVisible = new ArrayList<String>(); nonUiVisible.add(visibleFilterDescriptors[i].getId()); } } if (updateFilterActivation) { if (nonUiVisible != null) { for (String element : filterIdsToActivate) nonUiVisible.add(element); filterIdsToActivate = nonUiVisible.toArray(new String[]{}); } setActiveFilterIds(filterIdsToActivate); persistFilterActivationState(); updateViewer(); StructuredViewer commonViewer = (StructuredViewer) contentService.getViewer(); commonViewer.setSelection(StructuredSelection.EMPTY); } }

Target:
public void activateFilterIdsAndUpdateViewer(String[] filterIdsToActivate) { boolean updateFilterActivation = false; Arrays.sort(filterIdsToActivate); CommonFilterDescriptor[] visibleFilterDescriptors = (CommonFilterDescriptor[]) getVisibleFilterDescriptors(); int indexofFilterIdToBeActivated; List<String> nonUiVisible = null; for (int i = 0; i < visibleFilterDescriptors.length; i++) { indexofFilterIdToBeActivated = Arrays.binarySearch(filterIdsToActivate, visibleFilterDescriptors[i].getId()); if (indexofFilterIdToBeActivated >= 0 ^ isActive(visibleFilterDescriptors[i].getId())) { updateFilterActivation = true; } if (!visibleFilterDescriptors[i].isVisibleInUi()) { if (nonUiVisible == null) nonUiVisible = new ArrayList<String>(); nonUiVisible.add(visibleFilterDescriptors[i].getId()); } } if (updateFilterActivation) { if (nonUiVisible != null) { for (String filterIdToActivate : filterIdsToActivate) nonUiVisible.add(filterIdToActivate); filterIdsToActivate = nonUiVisible.toArray(new String[]{}); } setActiveFilterIds(filterIdsToActivate); persistFilterActivationState(); updateViewer(); StructuredViewer commonViewer = (StructuredViewer) contentService.getViewer(); commonViewer.setSelection(StructuredSelection.EMPTY); } }
Source:
public long getFirstRowIndex() { if (firstRowIndex < 0) { throw new NotInPageFilteringModeException("First row index is not available"); } return firstRowIndex; }

Target:
public Optional<Long> getFirstRowIndex() { return firstRowIndex < 0 ? Optional.empty() : Optional.of(firstRowIndex); }
Source:
public void merge(SummaryCollection other, SummarizerFactory factory) { for (Entry<SummarizerConfiguration,MergedSummary> entry : other.mergedSummaries.entrySet()) { MergedSummary ms = mergedSummaries.get(entry.getKey()); if (ms == null) { mergedSummaries.put(entry.getKey(), entry.getValue()); } else { ms.merge(entry.getValue(), entry.getKey(), factory); } } this.totalFiles += other.totalFiles; }

Target:
public void merge(SummaryCollection other, SummarizerFactory factory) { for (Entry<SummarizerConfiguration,MergedSummary> entry : other.mergedSummaries.entrySet()) { MergedSummary ms = mergedSummaries.get(entry.getKey()); if (ms == null) { mergedSummaries.put(entry.getKey(), entry.getValue()); } else { ms.merge(entry.getValue(), entry.getKey(), factory); } } this.totalFiles += other.totalFiles; this.deletedFiles += other.deletedFiles; }
Source:
public void spec317_mustSignalOnErrorWhenPendingAboveLongMaxValue() throws Throwable { final long MAX_SPINS = 10; final long SPIN_ASSERT_DELAY = env.defaultTimeoutMillis() / MAX_SPINS; activePublisherTest(Integer.MAX_VALUE, new PublisherTestRun<T>() { @Override public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newBlackholeSubscriber(pub); sub.request(Long.MAX_VALUE - 1); long i = 0; boolean overflowSignalled = false; while (!overflowSignalled && i < MAX_SPINS) { sub.request(Long.MAX_VALUE - 1); try { Thread.sleep(SPIN_ASSERT_DELAY); env.assertAsyncErrorWithMessage(IllegalStateException.class, "3.17"); overflowSignalled = true; } catch (Throwable thr) { } i++; } env.debug(String.format("Signalled overflow after %d-th spin (of max: %d), with %dms delays: %s (`true` is expected)", i + 1, MAX_SPINS, SPIN_ASSERT_DELAY, overflowSignalled)); assertTrue(overflowSignalled, String.format("Expected overflow to be signalled after %d spins (max: %d), with delays: %d", i + 1, MAX_SPINS, SPIN_ASSERT_DELAY)); env.verifyNoAsyncErrors(env.defaultTimeoutMillis()); } }); }

Target:
public void spec317_mustSignalOnErrorWhenPendingAboveLongMaxValue() throws Throwable { final long MAX_SPINS = 10; final long SPIN_ASSERT_DELAY = env.defaultTimeoutMillis() / MAX_SPINS; activePublisherTest(Integer.MAX_VALUE, new PublisherTestRun<T>() { @Override public void run(Publisher<T> pub) throws Throwable { final ManualSubscriber<T> sub = env.newBlackholeSubscriber(pub); sub.request(Long.MAX_VALUE - 1); long i = 0; boolean overflowSignalled = false; while (!overflowSignalled && i < MAX_SPINS) { sub.request(Long.MAX_VALUE - 1); Thread.sleep(SPIN_ASSERT_DELAY); Throwable asyncError = env.dropAsyncError(); if (asyncError == null) { } else { env.assertAsyncErrorWithMessage(asyncError, IllegalStateException.class, "3.17"); overflowSignalled = true; } i++; } env.debug(String.format("Signalled overflow after %d-th spin (of max: %d), with %dms delays: %s (`true` is expected)", i + 1, MAX_SPINS, SPIN_ASSERT_DELAY, overflowSignalled)); assertTrue(overflowSignalled, String.format("Expected overflow to be signalled after %d spins (max: %d), with delays: %d", i + 1, MAX_SPINS, SPIN_ASSERT_DELAY)); env.verifyNoAsyncErrors(env.defaultTimeoutMillis()); } }); }
Source:
public ZookeeperConfigRefreshListener zookeeperConfigRefreshListener( RefreshEndpoint refreshEndpoint) { return new ZookeeperConfigRefreshListener("application", refreshEndpoint); }

Target:
public ZookeeperConfigRefreshListener zookeeperConfigRefreshListener( RefreshEndpoint refreshEndpoint) { return new ZookeeperConfigRefreshListener(refreshEndpoint); }
Source:
public static IndexSchemaManagementStrategy interpretPropertyValue(String propertyValue) { IndexSchemaManagementStrategy strategy = VALUES_BY_EXTERNAL_NAME.get( propertyValue ); if ( strategy == null ) { throw new IllegalArgumentException( "Unrecognized property value for an index schema management strategy: '" + propertyValue + "'. Please use one of " + VALUES_BY_EXTERNAL_NAME.keySet() ); } return strategy; }

Target:
public static IndexSchemaManagementStrategy interpretPropertyValue(String propertyValue) { final String normalizedName = propertyValue.trim().toLowerCase( Locale.ROOT ); IndexSchemaManagementStrategy strategy = VALUES_BY_EXTERNAL_NAME.get( normalizedName ); if ( strategy == null ) { throw new IllegalArgumentException( "Unrecognized property value for an index schema management strategy: '" + propertyValue + "'. Please use one of " + VALUES_BY_EXTERNAL_NAME.keySet() ); } return strategy; }
Source:
private void displayRandomization() { if ( isRandomized() ) { final Randomizer randomizer = reportConfiguration.getRunOrderParameters().getRandomizer(); final String pluginName = reportConfiguration.getPluginName(); log( "" ); log( String.format( "Tests are randomly ordered. Re-run the same execution order" + " with -D%s.runOrder=random:%d", pluginName, randomizer.getSeed() ) ); log( "" ); } }

Target:
private void displayRandomization() { if ( isRandomized() ) { final Randomizer randomizer = reportConfiguration.getRunOrderParameters().getRandomizer(); final String pluginName = reportConfiguration.getPluginName(); final String message = String.format( "Tests are randomly ordered. Re-run the same execution order" + " with -D%s.runOrder=random:%d", pluginName, randomizer.getSeed() ); log( "" ); log( message ); log( "" ); } }
Source:
public int shutdownAndGetConnectionCount() throws IOException, InterruptedException { try { serverSocket.close(); shutdownLatch.await(); } finally { serverThread.join(); return connectionAttempts.get(); } }

Target:
public int shutdownAndGetConnectionCount() throws IOException, InterruptedException { try { serverSocket.close(); shutdownLatch.await(1, TimeUnit.SECONDS); serverThread.join(200); assertFalse("serverThread failed to shut down quickly", serverThread.isAlive()); } finally { return connectionAttempts.get(); } }
Source:
public static byte[] generateApkSigningBlock( DataSource beforeCentralDir, DataSource centralDir, DataSource eocd, List<SignerConfig> signerConfigs) throws IOException, InvalidKeyException, SignatureException { if (signerConfigs.isEmpty()) { throw new IllegalArgumentException( "No signer configs provided. At least one is required"); } Set<ContentDigestAlgorithm> contentDigestAlgorithms = new HashSet<>(1); for (SignerConfig signerConfig : signerConfigs) { for (SignatureAlgorithm signatureAlgorithm : signerConfig.signatureAlgorithms) { contentDigestAlgorithms.add(signatureAlgorithm.getContentDigestAlgorithm()); } } long centralDirOffsetForDigesting = beforeCentralDir.size(); ByteBuffer eocdBuf = copyToByteBuffer(eocd); eocdBuf.order(ByteOrder.LITTLE_ENDIAN); ZipUtils.setZipEocdCentralDirectoryOffset(eocdBuf, centralDirOffsetForDigesting); Map<ContentDigestAlgorithm, byte[]> contentDigests; try { contentDigests = computeContentDigests( contentDigestAlgorithms, new DataSource[] { beforeCentralDir, centralDir, DataSources.asDataSource(eocdBuf)}); } catch (IOException e) { throw new IOException("Failed to read APK being signed"); } catch (DigestException e) { throw new SignatureException("Failed to compute digests of APK", e); } return generateApkSigningBlock(signerConfigs, contentDigests); }

Target:
public static byte[] generateApkSigningBlock( DataSource beforeCentralDir, DataSource centralDir, DataSource eocd, List<SignerConfig> signerConfigs) throws IOException, InvalidKeyException, SignatureException { if (signerConfigs.isEmpty()) { throw new IllegalArgumentException( "No signer configs provided. At least one is required"); } Set<ContentDigestAlgorithm> contentDigestAlgorithms = new HashSet<>(1); for (SignerConfig signerConfig : signerConfigs) { for (SignatureAlgorithm signatureAlgorithm : signerConfig.signatureAlgorithms) { contentDigestAlgorithms.add(signatureAlgorithm.getContentDigestAlgorithm()); } } long centralDirOffsetForDigesting = beforeCentralDir.size(); ByteBuffer eocdBuf = copyToByteBuffer(eocd); eocdBuf.order(ByteOrder.LITTLE_ENDIAN); ZipUtils.setZipEocdCentralDirectoryOffset(eocdBuf, centralDirOffsetForDigesting); Map<ContentDigestAlgorithm, byte[]> contentDigests; try { contentDigests = computeContentDigests( contentDigestAlgorithms, new DataSource[] { beforeCentralDir, centralDir, DataSources.asDataSource(eocdBuf)}); } catch (IOException e) { throw new IOException("Failed to read APK being signed", e); } catch (DigestException e) { throw new SignatureException("Failed to compute digests of APK", e); } return generateApkSigningBlock(signerConfigs, contentDigests); }
Source:
public void processObjectVersions(final Iterable<ObjectVersionReference> versions) { final Map<String, String> dsCreateDates = new HashMap<>(); versions.forEach(ov -> { final String objectId = ov.getObjectInfo().getPid(); final String f6ObjectId = FCREPO_ROOT + objectId; final OcflObjectSession session = sessionFactory.newSession(f6ObjectId); if (ov.isFirstVersion()) { writeObjectFiles(f6ObjectId, ov, session); } ov.listChangedDatastreams().forEach(dv -> { final var mimeType = resolveMimeType(dv); final String dsId = dv.getDatastreamInfo().getDatastreamId(); final String f6DsId = resolveF6DatastreamId(dsId, f6ObjectId, mimeType); final var datastreamFilename = lastPartFromId(f6DsId); if (dv.isFirstVersionIn(ov.getObject())) { dsCreateDates.put(dsId, dv.getCreated()); } final var createDate = dsCreateDates.get(dsId); final var datastreamHeaders = createDatastreamHeaders(dv, f6DsId, f6ObjectId, datastreamFilename, mimeType, createDate); if ("RE".contains(dv.getDatastreamInfo().getControlGroup())) { InputStream content = null; if (migrationType == MigrationType.VANILLA_OCFL) { content = IOUtils.toInputStream(dv.getExternalOrRedirectURL()); } session.writeResource(datastreamHeaders, content); } else { try (var content = dv.getContent()) { session.writeResource(datastreamHeaders, content); } catch (final IOException e) { throw new UncheckedIOException(e); } writeDescriptionFiles(f6DsId, datastreamFilename, createDate, datastreamHeaders, dv, session); } }); LOGGER.debug("Committing object <{}>", f6ObjectId); session.commit(); }); }

Target:
public void processObjectVersions(final Iterable<ObjectVersionReference> versions) { final Map<String, String> dsCreateDates = new HashMap<>(); versions.forEach(ov -> { final String objectId = ov.getObjectInfo().getPid(); final String f6ObjectId = FCREPO_ROOT + objectId; final OcflObjectSession session = sessionFactory.newSession(f6ObjectId); if (ov.isFirstVersion()) { writeObjectFiles(f6ObjectId, ov, session); } ov.listChangedDatastreams().forEach(dv -> { final var mimeType = resolveMimeType(dv); final String dsId = dv.getDatastreamInfo().getDatastreamId(); final String f6DsId = resolveF6DatastreamId(dsId, f6ObjectId, mimeType); final var datastreamFilename = lastPartFromId(f6DsId); if (dv.isFirstVersionIn(ov.getObject())) { dsCreateDates.put(dsId, dv.getCreated()); } final var createDate = dsCreateDates.get(dsId); final var datastreamHeaders = createDatastreamHeaders(dv, f6DsId, f6ObjectId, datastreamFilename, mimeType, createDate); if (externalHandlingMap.containsKey(dv.getDatastreamInfo().getControlGroup())) { InputStream content = null; if (migrationType == MigrationType.PLAIN_OCFL) { content = IOUtils.toInputStream(dv.getExternalOrRedirectURL()); } session.writeResource(datastreamHeaders, content); } else { try (var content = dv.getContent()) { session.writeResource(datastreamHeaders, content); } catch (final IOException e) { throw new UncheckedIOException(e); } writeDescriptionFiles(f6DsId, datastreamFilename, createDate, datastreamHeaders, dv, session); } }); LOGGER.debug("Committing object <{}>", f6ObjectId); session.commit(); }); }
Source:
public void show(Map<String, Status> changedFiles, String revision, Project project) { this.changedFiles = changedFiles; this.project = project; view.showDialog(); view.setEnableCompareButton(false); viewChangedFiles(); view.setEnableExpandCollapseButtons(treeViewEnabled); this.revision = revision; }

Target:
public void show(Map<String, Status> changedFiles, String revision, Project project) { this.changedFiles = changedFiles; this.project = project; this.revision = revision; view.setEnableCompareButton(false); view.setEnableExpandCollapseButtons(treeViewEnabled); view.showDialog(); viewChangedFiles(); }
Source:
public Note get(String noteId, AuthenticationInfo subject) throws IOException { BlobId blobId = makeBlobId(noteId); byte[] contents; try { contents = storage.readAllBytes(blobId); } catch (StorageException se) { throw new IOException("Could not read " + blobId.toString() + ": " + se.getMessage(), se); } Note note; try { note = Note.fromJson(new String(contents, encoding)); } catch (JsonParseException jpe) { throw new IOException( "Could note parse as json " + blobId.toString() + jpe.getMessage(), jpe); } for (Paragraph p : note.getParagraphs()) { if (p.getStatus() == Status.PENDING || p.getStatus() == Status.RUNNING) { p.setStatus(Status.ABORT); } List<ApplicationState> appStates = p.getAllApplicationStates(); if (appStates != null) { for (ApplicationState app : appStates) { if (app.getStatus() != ApplicationState.Status.ERROR) { app.setStatus(ApplicationState.Status.UNLOADED); } } } } return note; }

Target:
public Note get(String noteId, AuthenticationInfo subject) throws IOException { BlobId blobId = makeBlobId(noteId); byte[] contents; try { contents = storage.readAllBytes(blobId); } catch (StorageException se) { throw new IOException("Could not read " + blobId.toString() + ": " + se.getMessage(), se); } try { return Note.fromJson(new String(contents, encoding)); } catch (JsonParseException jpe) { throw new IOException( "Could note parse as json " + blobId.toString() + jpe.getMessage(), jpe); } }
Source:
public void ensureUserIsTryingToFollowPeergos() { String username = generateUsername(); String password = "password"; UserContext userContext = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); Boolean requestToFollowPeergos = userContext.getSocialState().join().pendingOutgoingFollowRequests.containsKey("peergos"); assertTrue("Pending follow request Peergos exists after sign-up", requestToFollowPeergos); userContext.unfollow("peergos"); requestToFollowPeergos = userContext.getFollowing().join().contains("peergos"); assertTrue("Unfollowed Peergos", !requestToFollowPeergos); userContext.logout(); UserContext renewedUserContext = UserContext.signIn(username, password, network, crypto).join(); renewedUserContext.ensureFollowingPeergos(); requestToFollowPeergos = renewedUserContext.getSocialState().join().pendingOutgoingFollowRequests.containsKey("peergos"); assertTrue("Peergos user is being followed again", requestToFollowPeergos); }

Target:
public void ensureUserIsTryingToFollowPeergos() { String username = generateUsername(); String password = "password"; UserContext userContext = PeergosNetworkUtils.ensureSignedUp(username, password, network, crypto); Boolean requestToFollowPeergos = userContext.getSocialState().join().pendingOutgoingFollowRequests.containsKey("peergos"); assertTrue("Pending follow request Peergos exists after sign-up", requestToFollowPeergos); UserContext peergosUser = UserContext.signIn("peergos", "testpassword", network, crypto).join(); List<FollowRequestWithCipherText> followRequests = peergosUser.processFollowRequests().join(); for (FollowRequestWithCipherText request : followRequests) { boolean accept = true; boolean reciprocate = true; peergosUser.sendReplyFollowRequest(request, accept, reciprocate).join(); } userContext = UserContext.signIn(username, password, network, crypto).join(); userContext.processFollowRequests().join(); userContext.unfollow("peergos"); Boolean followingPeergos = userContext.getFollowing().join().contains("peergos"); assertTrue("Unfollowed Peergos", !followingPeergos); userContext.logout(); UserContext renewedUserContext = UserContext.signIn(username, password, network, crypto).join(); renewedUserContext.ensureFollowingPeergos().join(); requestToFollowPeergos = renewedUserContext.getSocialState().join().pendingOutgoingFollowRequests.containsKey("peergos"); assertTrue("Pending request to follow Peergos is back", requestToFollowPeergos); }
Source:
void performFinish(IProgressMonitor monitor) { final IMarkerResolution resolution = getSelectedResolution(); if (resolution == null) return; final Object[] checked = markersTable.getCheckedElements(); if (checked.length == 0) return; if (resolution instanceof WorkbenchMarkerResolution) { try { getWizard().getContainer().run(false, true, monitor1 -> { IMarker[] markers = new IMarker[checked.length]; System.arraycopy(checked, 0, markers, 0, checked.length); ((WorkbenchMarkerResolution) resolution).run(markers, monitor1); }); } catch (InvocationTargetException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } catch (InterruptedException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } } else { try { getWizard().getContainer().run(false, true, monitor1 -> { monitor1.beginTask(MarkerMessages.MarkerResolutionDialog_Fixing, checked.length); for (Object element : checked) { getShell().getDisplay().readAndDispatch(); if (monitor1.isCanceled()) { return; } IMarker marker = (IMarker) element; monitor1.subTask(Util.getProperty(IMarker.MESSAGE, marker)); resolution.run(marker); monitor1.worked(1); } }); } catch (InvocationTargetException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } catch (InterruptedException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } } }

Target:
void performFinish(IProgressMonitor monitor) { final IMarkerResolution resolution = getSelectedResolution(); if (resolution == null) return; final Object[] checked = markersTable.getCheckedElements(); if (checked.length == 0) return; if (resolution instanceof WorkbenchMarkerResolution) { try { getWizard().getContainer().run(false, true, monitor1 -> { IMarker[] markers = new IMarker[checked.length]; System.arraycopy(checked, 0, markers, 0, checked.length); ((WorkbenchMarkerResolution) resolution).run(markers, monitor1); }); } catch (InvocationTargetException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } catch (InterruptedException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } } else { try { getWizard().getContainer().run(false, true, monitor1 -> { monitor1.beginTask(MarkerMessages.MarkerResolutionDialog_Fixing, checked.length); for (Object checkedElement : checked) { getShell().getDisplay().readAndDispatch(); if (monitor1.isCanceled()) { return; } IMarker marker = (IMarker) checkedElement; monitor1.subTask(Util.getProperty(IMarker.MESSAGE, marker)); resolution.run(marker); monitor1.worked(1); } }); } catch (InvocationTargetException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } catch (InterruptedException e) { StatusManager.getManager().handle( MarkerSupportInternalUtilities.errorFor(e)); } } }
Source:
public Image getImage(final String id) { Optional<Image> firstInterestingImage = Iterables.tryFind(listImages(), new Predicate<Image>() { public boolean apply(Image input) { return input.id().equals(id); } }); if (!firstInterestingImage.isPresent()) { throw new IllegalStateException("Cannot find image with the required slug " + id); } return firstInterestingImage.get(); }

Target:
public ImageInRegion getImage(final String id) { RegionAndId regionAndId = fromSlashEncoded(id); Image image = api.imageApi().list(regionAndId.regionId(), ListImagesOptions.Builder.imageIds(regionAndId.id())) .firstMatch(Predicates.<Image>notNull()) .orNull(); if (image == null) return null; return ImageInRegion.create(regionAndId.regionId(), image); }
Source:
public void cacheManagerCanReconnect() throws Exception { URI connectionURI = CLUSTER.getConnectionURI(); try (PersistentCacheManager cacheManager = newCacheManagerBuilder() .with(cluster(connectionURI.resolve("/crud-cm")) .autoCreateOnReconnect(server -> server.defaultServerResource("primary-server-resource"))) .build(true)) { Cache<Long, String> cache = cacheManager.createCache("clustered-cache", newCacheConfigurationBuilder(Long.class, String.class, newResourcePoolsBuilder() .with(clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))) .build()); cache.put(1L, "one"); CLUSTER.getClusterControl().terminateAllServers(); CLUSTER.getClusterControl().startAllServers(); long end = System.nanoTime() + TimeUnit.SECONDS.toNanos(20); while (cache.get(1L) == null) { Thread.sleep(100); cache.put(1L, "two"); } assertThat(cache.get(1L), is("two")); } }

Target:
public void cacheManagerCanReconnect() throws Exception { URI connectionURI = CLUSTER.getConnectionURI(); try (PersistentCacheManager cacheManager = newCacheManagerBuilder() .with(cluster(connectionURI.resolve("/crud-cm")) .autoCreateOnReconnect(server -> server.defaultServerResource("primary-server-resource"))) .build(true)) { Cache<Long, String> cache = cacheManager.createCache("clustered-cache", newCacheConfigurationBuilder(Long.class, String.class, newResourcePoolsBuilder() .with(clusteredDedicated("primary-server-resource", 1, MemoryUnit.MB))) .build()); cache.put(1L, "one"); CLUSTER.getClusterControl().terminateAllServers(); CLUSTER.getClusterControl().startAllServers(); while (cache.get(1L) == null) { Thread.sleep(100); cache.put(1L, "two"); } assertThat(cache.get(1L), is("two")); } }
Source:
public void MobileLogin_004_failedLoginEmptyPassword_MOB_760() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); System.out.println(credentials.userName12); MobileSpecialUserLogin login = mobile.loginFailedDropDown(credentials.userName12, ""); login.verifyEmptyPasswordErrorMessage(); }

Target:
public void MobileLogin_004_failedLoginEmptyPassword_MOB_760() { MobileBasePageObject mobile = new MobileBasePageObject(driver); mobile.openHome(wikiURL); mobile.openRandomPage(); MobileSpecialUserLogin login = mobile.loginFailedDropDown(credentials.userName12, ""); login.verifyEmptyPasswordErrorMessage(); }
Source:
private static String parseBucketPath(final String testPath) { return testPath.substring(0, testPath.lastIndexOf(bucketObjectsSubstring)); }

Target:
private static String parseBucketPath(final String testPath) { final int endIndex = testPath.lastIndexOf(bucketObjectsSubstring); return testPath.substring(0, endIndex); }
Source:
private void testBCFCustomVersionCompatibility() throws IOException { final BCF2Codec bcfCodec = new BCF2Codec() { @Override protected void validateVersionCompatibility(final BCFVersion supportedVersion, final BCFVersion actualVersion) { Assert.assertNotEquals(supportedVersion, actualVersion); Assert.assertTrue(actualVersion.majorVersion == BCF2Codec.ALLOWED_MAJOR_VERSION && actualVersion.minorVersion != BCF2Codec.ALLOWED_MINOR_VERSION); } }; try (final FileInputStream fis = new FileInputStream(new File(TEST_DATA_DIR, "BCFVersion22Uncompressed.bcf")); final PositionalBufferedStream pbs = new PositionalBufferedStream(fis)) { bcfCodec.readHeader(pbs); } }

Target:
private void testBCFCustomVersionCompatibility() throws IOException { final BCF2Codec bcfCodec = new BCF2Codec() { @Override protected void validateVersionCompatibility(final BCFVersion supportedVersion, final BCFVersion actualVersion) { return; } }; try (final FileInputStream fis = new FileInputStream(new File(TEST_DATA_DIR, "BCFVersion22Uncompressed.bcf")); final PositionalBufferedStream pbs = new PositionalBufferedStream(fis)) { final FeatureCodecHeader featureCodecHeader = (FeatureCodecHeader) bcfCodec.readHeader(pbs); final VCFHeader vcfHeader = (VCFHeader) featureCodecHeader.getHeaderValue(); Assert.assertNotEquals(vcfHeader.getMetaDataInInputOrder().size(), 0); } }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { DestroyImageCommand<DestroyImageParameters> command = commandCoordinatorUtil.retrieveCommand(cmdId); Set<Guid> taskIds = new HashSet<>(command.getReturnValue().getVdsmTaskIdList()); Map<Guid, AsyncTaskStatus> idToStatusMap = commandCoordinatorUtil.pollTasks(taskIds); for (Map.Entry<Guid, AsyncTaskStatus> idToStatus : idToStatusMap.entrySet()) { final Guid id = idToStatus.getKey(); final AsyncTaskStatus status = idToStatus.getValue(); if (status.getTaskIsRunning()) { log.info("Waiting on destroy image command to complete the task (taskId = {})", id); return; } } List<Guid> failed = new ArrayList<>(); for (Map.Entry<Guid, AsyncTaskStatus> idToStatus : idToStatusMap.entrySet()) { final Guid id = idToStatus.getKey(); final AsyncTaskStatus status = idToStatus.getValue(); if (!status.getTaskEndedSuccessfully()) { failed.add(id); } } if (failed.isEmpty()) { command.setSucceeded(true); command.setCommandStatus(CommandStatus.SUCCEEDED); command.persistCommand(command.getParameters().getParentCommand()); log.info("Destroy image command has completed successfully for images '{}' with async tasks '{}'.", command.getParameters().getImageList(), taskIds); } else { command.setSucceeded(false); command.setCommandStatus(CommandStatus.FAILED); log.info("Destroy image command has failed for images '{}' with async tasks '{}'.", command.getParameters().getImageList(), failed); } command.persistCommand(command.getParameters().getParentCommand()); }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { DestroyImageCommand<DestroyImageParameters> command = commandCoordinatorUtil.retrieveCommand(cmdId); Set<Guid> taskIds = new HashSet<>(command.getReturnValue().getVdsmTaskIdList()); Map<Guid, AsyncTaskStatus> idToTaskStatusMap = commandCoordinatorUtil.pollTasks(taskIds); for (Map.Entry<Guid, AsyncTaskStatus> idToTaskStatus : idToTaskStatusMap.entrySet()) { Guid id = idToTaskStatus.getKey(); AsyncTaskStatus status = idToTaskStatus.getValue(); if (status.getTaskIsRunning()) { log.info("Waiting on destroy image command to complete the task (taskId = {})", id); return; } } List<Guid> failedTasks = new ArrayList<>(); for (Map.Entry<Guid, AsyncTaskStatus> idToStatus : idToTaskStatusMap.entrySet()) { Guid id = idToStatus.getKey(); AsyncTaskStatus status = idToStatus.getValue(); if (!status.getTaskEndedSuccessfully()) { failedTasks.add(id); } } if (failedTasks.isEmpty()) { command.setSucceeded(true); command.setCommandStatus(CommandStatus.SUCCEEDED); command.persistCommand(command.getParameters().getParentCommand()); log.info("Destroy image command has completed successfully for images '{}' with async tasks '{}'.", command.getParameters().getImageList(), taskIds); } else { command.setSucceeded(false); command.setCommandStatus(CommandStatus.FAILED); log.info("Destroy image command has failed for images '{}' with async tasks '{}'.", command.getParameters().getImageList(), failedTasks); } command.persistCommand(command.getParameters().getParentCommand()); }
Source:
static String getEngineSSHPublicKey() { final String keystoreFile = Config.<String>GetValue(ConfigValues.keystoreUrl); final String alias = Config.<String>GetValue(ConfigValues.CertAlias); final char[] password = Config.<String>GetValue(ConfigValues.keystorePass).toCharArray(); InputStream in = null; try { in = new FileInputStream(keystoreFile); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(in, password); final Certificate cert = ks.getCertificate(alias); if (cert == null) { Enumeration<String> aliases = ks.aliases(); log.info("Alias with name '"+alias+"' not found in "+keystoreFile); StringBuilder aliaslist = new StringBuilder(); while(aliases.hasMoreElements()) { if(aliaslist.length() != 0) { aliaslist.append(", "); } aliaslist.append(aliases.nextElement()); } log.info("aliases: " + aliaslist.toString()); throw new KeyStoreException( String.format( "Failed to find certificate store '%1$s' using alias '%2$s'", keystoreFile, alias ) ); } return OpenSSHUtils.getKeyString( cert.getPublicKey(), Config.<String>GetValue(ConfigValues.SSHKeyAlias) ); } catch (Exception e) { throw new RuntimeException( String.format( "Failed to decode own public key from store '%1$s' using alias '%2$s'", keystoreFile, alias ), e ); } finally { Arrays.fill(password, '*'); if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } }

Target:
protected static String getEngineSSHPublicKey() { final String keystoreFile = Config.<String>GetValue(ConfigValues.keystoreUrl); final String alias = Config.<String>GetValue(ConfigValues.CertAlias); final char[] password = Config.<String>GetValue(ConfigValues.keystorePass).toCharArray(); InputStream in = null; try { in = new FileInputStream(keystoreFile); KeyStore ks = KeyStore.getInstance("PKCS12"); ks.load(in, password); final Certificate cert = ks.getCertificate(alias); if (cert == null) { Enumeration<String> aliases = ks.aliases(); log.info("Alias with name '"+alias+"' not found in "+keystoreFile); StringBuilder aliaslist = new StringBuilder(); while(aliases.hasMoreElements()) { if(aliaslist.length() != 0) { aliaslist.append(", "); } aliaslist.append(aliases.nextElement()); } log.info("aliases: " + aliaslist.toString()); throw new KeyStoreException( String.format( "Failed to find certificate store '%1$s' using alias '%2$s'", keystoreFile, alias ) ); } return OpenSSHUtils.getKeyString( cert.getPublicKey(), Config.<String>GetValue(ConfigValues.SSHKeyAlias) ); } catch (Exception e) { throw new RuntimeException( String.format( "Failed to decode own public key from store '%1$s' using alias '%2$s'", keystoreFile, alias ), e ); } finally { Arrays.fill(password, '*'); if (in != null) { try { in.close(); } catch(IOException e) { log.error("Cannot close key store", e); } } } }
Source:
protected AbstractTreeElement setupFixtureData(ExternalDataInstance instance) { String ref = instance.getReference(); String userId = ""; User u = mSandbox.getLoggedInUser(); if (u != null) { userId = u.getUniqueId(); } String refId = ref.substring(ref.lastIndexOf('/') + 1, ref.length()); try { String key = refId + userId; TreeElement root = fixtureBases.retrieve(key); if (root == null) { FormInstance fixture = SandboxUtils.loadFixture(mSandbox, refId, userId); if (fixture == null) { throw new FixtureInitializationException(ref); } root = fixture.getRoot(); fixtureBases.register(key, root); } root.setParent(instance.getBase()); return root; } catch (IllegalStateException ise) { throw new FixtureInitializationException(ref); } }

Target:
protected AbstractTreeElement setupFixtureData(ExternalDataInstance instance) { String ref = instance.getReference(); String userId = ""; User u = mSandbox.getLoggedInUser(); if (u != null) { userId = u.getUniqueId(); } TreeElement fixtureRoot = loadFixtureRoot(ref, userId); fixtureRoot.setParent(instance.getBase()); return fixtureRoot; }
Source:
public void noQuorum(PaxosValue value) { leaderLog.warn("The most recent known information says this server is the leader," + " but there is no quorum right now {}", SafeArg.of("value", value)); noQuorum.mark(); }

Target:
public void noQuorum(PaxosValue value) { leaderLog.warn("The most recent known information says this server is the leader," + " but there is no quorum right now. The paxos value is {}", SafeArg.of("value", value)); noQuorum.mark(); }
Source:
public Command onFound() { return () -> highlightHelper() .withMinX(getMinX()) .withMinY(getMinY()) .withPaddingX(200) .withPaddingY(100) .highlight(row, column); }

Target:
public Command onFound() { return () -> { double paddingX = getPaddingX(column); double paddingY = getPaddingY(row); highlightHelper() .withMinX(getMinX()) .withMinY(getMinY()) .withPaddingX(paddingX) .withPaddingY(paddingY) .highlight(row, column); }; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> selectedNodes = getSelectedNodes(event); if (selectedNodes == null || selectedNodes.isEmpty()) { MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } if (!(((List) selectedNodes).get(0) instanceof RepositoryTreeNode)) { MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } RepositoryTreeNode node = selectedNodes.get(0); String path; switch (node.getType()) { case REPO: case WORKINGDIR: path = node.getRepository().getWorkTree().toString(); break; case FOLDER: path = ((FolderNode) node).getObject().getPath().toString(); break; default: MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } ImportProjectsWizardDialog dlg = new ImportProjectsWizardDialog( getShell(event), new GitCreateProjectViaWizardWizard( node.getRepository(), path)); dlg.setHelpAvailable(false); dlg.open(); return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { List<RepositoryTreeNode> selectedNodes = getSelectedNodes(event); if (selectedNodes == null || selectedNodes.isEmpty()) { MessageDialog .openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } if (!(((List) selectedNodes).get(0) instanceof RepositoryTreeNode)) { MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } RepositoryTreeNode node = selectedNodes.get(0); String path; switch (node.getType()) { case REPO: case WORKINGDIR: path = node.getRepository().getWorkTree().toString(); break; case FOLDER: path = ((FolderNode) node).getObject().getPath().toString(); break; default: MessageDialog.openError(Display.getDefault().getActiveShell(), UIText.ImportProjectsWrongSelection, UIText.ImportProjectsSelectionInRepositoryRequired); return null; } WizardDialog dlg = new WizardDialog( getShell(event), new GitCreateProjectViaWizardWizard(node.getRepository(), path)) { @Override protected IDialogSettings getDialogBoundsSettings() { return Activator.getDefault().getDialogSettings(); } }; dlg.setHelpAvailable(false); dlg.open(); return null; }
Source:
public JobFailureAndKillHandlerLogicTask(@NotNull final Registry registry) { super(registry); this.timerId = registry.createId("genie.jobs.tasks.jobFailureAndKillHandlerLogicTask.timer"); }

Target:
public JobFailureAndKillHandlerLogicTask(@NotNull final Registry registry) { super(registry); this.timerId = getRegistry().createId("genie.jobs.tasks.jobFailureAndKillHandlerLogicTask.timer"); }
Source:
public void shouldHaveOrderedSpliterator() { assertThat(Lazy.of(() -> 1).spliterator().hasCharacteristics(Spliterator.ORDERED | Spliterator.SORTED)); }

Target:
public void shouldHaveOrderedSpliterator() { assertThat(Lazy.of(() -> 1).spliterator().hasCharacteristics(Spliterator.ORDERED)).isTrue(); }
Source:
public static KeyStore loadKeystore(final byte[] ksData, final String storePassword) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { assert ksData != null; final KeyStore ks = KeyStore.getInstance("JKS"); try (final ByteArrayInputStream is = new ByteArrayInputStream(ksData)) { ks.load(is, storePassword != null ? storePassword.toCharArray() : null); } return ks; }

Target:
public static KeyStore loadKeystore(final byte[] ksData, final String storePassword) throws KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException { Preconditions.checkNotNull(ksData, "Keystore data cannot be null"); final KeyStore ks = KeyStore.getInstance("JKS"); try (final ByteArrayInputStream is = new ByteArrayInputStream(ksData)) { ks.load(is, storePassword != null ? storePassword.toCharArray() : null); } return ks; }
Source:
public void setChangeInfo(GerritRepository gerritRepository, ChangeInfo element) { filesTab.setGerritRepository(gerritRepository); fChangeInfo.reset(); setFilesCommentStats(gerritRepository, element.getChange_id(), element.getCurrentRevision(), new NullProgressMonitor()); fChangeInfo.setNumber(element.get_number()); fChangeInfo.setId(element.getId()); fChangeInfo.setChange_id(element.getChange_id()); fChangeInfo.setStatus(element.getStatus()); fChangeInfo.setProject(element.getProject()); fChangeInfo.setBranch(element.getBranch()); fChangeInfo.setUpdated(element.getUpdated()); fChangeInfo.setTopic(element.getTopic()); fChangeInfo.setCodeReviewedTally(element.getCodeReviewedTally()); fChangeInfo.setVerifiedTally(element.getVerifiedTally()); setCurrentRevisionAndMessageTab(gerritRepository, element.getChange_id()); summaryTab.setTabs(gerritRepository, element); buttonEnablement(); }

Target:
public void setChangeInfo(GerritRepository gerritRepository, ChangeInfo element) { filesTab.setGerritRepository(gerritRepository); fChangeInfo.reset(); filesTab.setFileStat(gerritRepository, element.getChange_id(), element.getCurrentRevision(), new NullProgressMonitor()); fChangeInfo.setNumber(element.get_number()); fChangeInfo.setId(element.getId()); fChangeInfo.setChange_id(element.getChange_id()); fChangeInfo.setStatus(element.getStatus()); fChangeInfo.setProject(element.getProject()); fChangeInfo.setBranch(element.getBranch()); fChangeInfo.setUpdated(element.getUpdated()); fChangeInfo.setTopic(element.getTopic()); fChangeInfo.setCodeReviewedTally(element.getCodeReviewedTally()); fChangeInfo.setVerifiedTally(element.getVerifiedTally()); setCurrentRevisionAndMessageTab(gerritRepository, element.getChange_id()); summaryTab.setTabs(gerritRepository, element); buttonEnablement(); }
Source:
public SmartBanner scrollDown() { PageObjectLogging.logInfo("Smart banner is visible"); wait.forElementVisible(smartBannerComponent); PageObjectLogging.logInfo("Scroll down"); jsActions.scrollBy(0, 100); PageObjectLogging.logInfo("Smart banner position is fixed at the top"); wait.forElementPresent(smartBannerComponent); Assertion.assertFalse( driver.findElement(smartBannerComponent).getLocation().getY() == SMART_BANNER_POS_Y, "Smart banner position is not fixed at the top" ); return this; }

Target:
public SmartBanner scrollDown() { PageObjectLogging.logInfo("Smart banner is visible"); wait.forElementVisible(smartBannerComponent); PageObjectLogging.logInfo("Scroll down"); jsActions.scrollBy(0, 100); PageObjectLogging.logInfo("Smart banner position is not fixed at the top"); wait.forElementPresent(smartBannerComponent); Assertion.assertFalse( driver.findElement(smartBannerComponent).getLocation().getY() == SMART_BANNER_POS_Y, "Smart banner position is not fixed at the top" ); return this; }