auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void PostUpdateItemsAvailability(NewEditStorageModelBehavior behavior, IStorageModel item, boolean isNoStorageAttached) { storage_pool dataCenter = (storage_pool) getModel().getDataCenter().getSelectedItem(); Model model = (Model) item; model.setIsSelectable(dataCenter != null && ((dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && item.getRole() == StorageDomainType.Data) || (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && ((item.getRole() == StorageDomainType.Data && item.getType() == dataCenter.getstorage_pool_type()) || (item.getRole() == StorageDomainType.ImportExport && item.getType() == StorageType.NFS && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached) || item.getRole() == StorageDomainType.ISO && (item.getType() == StorageType.NFS || item.getType() == StorageType.LOCALFS) && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached)) || (getModel().getStorage() != null && item.getType() == getModel().getStorage() .getStorageType()))); behavior.OnStorageModelUpdated(item); }

Target:
public void PostUpdateItemsAvailability(NewEditStorageModelBehavior behavior, IStorageModel item, boolean isNoStorageAttached) { storage_pool dataCenter = (storage_pool) getModel().getDataCenter().getSelectedItem(); Model model = (Model) item; model.setIsSelectable(dataCenter != null && ((dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && item.getRole() == StorageDomainType.Data) || (!dataCenter.getId().equals(StorageModel.UnassignedDataCenterId) && ((item.getRole() == StorageDomainType.Data && item.getType() == dataCenter.getstorage_pool_type()) || (item.getRole() == StorageDomainType.ImportExport && item.getType() == StorageType.NFS && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached) || item.getRole() == StorageDomainType.ISO && item.getType().isFileDomain() && dataCenter.getstatus() != StoragePoolStatus.Uninitialized && isNoStorageAttached)) || (getModel().getStorage() != null && item.getType() == getModel().getStorage() .getStorageType()))); behavior.OnStorageModelUpdated(item); }
Source:
public void init(StreamGraph graph, Config config) { graph.setDefaultKeySerde(new StringSerde()); graph.setDefaultMsgSerde(new JsonSerde<>(PageView.class)); MessageStream<PageView> pageViews = graph.getInputStream("page-views", (k, v) -> (PageView) v); OutputStream<String, String, WindowPane<String, Collection<PageView>>> outputStream = graph.getOutputStream(TestRepartitionWindowApp.OUTPUT_TOPIC, new StringSerde(), new StringSerde(), m -> m.getKey().getKey(), m -> Integer.toString(m.getMessage().size())); pageViews .partitionBy(PageView::getUserId) .window(Windows.keyedSessionWindow(PageView::getUserId, Duration.ofSeconds(3))) .sendTo(outputStream); }

Target:
public void init(StreamGraph graph, Config config) { MessageStream<PageView> pageViews = graph.getInputStream(INPUT_TOPIC, new JsonSerdeV2<>(PageView.class)); OutputStream<KV<String, String>> outputStream = graph.getOutputStream(OUTPUT_TOPIC, new KVSerde<>(new StringSerde(), new StringSerde())); pageViews .partitionBy(PageView::getUserId, pv -> pv, new KVSerde<>(new StringSerde(), new JsonSerdeV2<>(PageView.class))) .window(Windows.keyedSessionWindow(KV::getKey, Duration.ofSeconds(3))) .map(windowPane -> KV.of(windowPane.getKey().getKey(), String.valueOf(windowPane.getMessage().size()))) .sendTo(outputStream); }
Source:
public void testDeleteFeedMediaOfItemRemoveFromQueue() throws IOException, ExecutionException, InterruptedException, TimeoutException { File dest = new File(getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER), "testFile"); assertTrue(dest.createNewFile()); Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); List<FeedItem> queue = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.UNPLAYED, feed); FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null, 0, 0); item.setMedia(media); items.add(item); queue.add(item); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setCompleteFeed(feed); adapter.setQueue(queue); adapter.close(); assertTrue(media.getId() != 0); assertTrue(item.getId() != 0); queue = DBReader.getQueue(); assertTrue(queue.size() != 0); DBWriter.deleteFeedMediaOfItem(getInstrumentation().getTargetContext(), media.getId()) .get(TIMEOUT, TimeUnit.SECONDS); media = DBReader.getFeedMedia(media.getId()); assertNotNull(media); assertFalse(dest.exists()); assertFalse(media.isDownloaded()); assertNull(media.getFile_url()); queue = DBReader.getQueue(); assertTrue(queue.size() == 0); }

Target:
public void testDeleteFeedMediaOfItemRemoveFromQueue() throws IOException, ExecutionException, InterruptedException, TimeoutException { assertTrue(UserPreferences.shouldDeleteRemoveFromQueue()); File dest = new File(getInstrumentation().getTargetContext().getExternalFilesDir(TEST_FOLDER), "testFile"); assertTrue(dest.createNewFile()); Feed feed = new Feed("url", null, "title"); List<FeedItem> items = new ArrayList<>(); List<FeedItem> queue = new ArrayList<>(); feed.setItems(items); FeedItem item = new FeedItem(0, "Item", "Item", "url", new Date(), FeedItem.UNPLAYED, feed); FeedMedia media = new FeedMedia(0, item, 1, 1, 1, "mime_type", dest.getAbsolutePath(), "download_url", true, null, 0, 0); item.setMedia(media); items.add(item); queue.add(item); PodDBAdapter adapter = PodDBAdapter.getInstance(); adapter.open(); adapter.setCompleteFeed(feed); adapter.setQueue(queue); adapter.close(); assertTrue(media.getId() != 0); assertTrue(item.getId() != 0); queue = DBReader.getQueue(); assertTrue(queue.size() != 0); DBWriter.deleteFeedMediaOfItem(getInstrumentation().getTargetContext(), media.getId()); Awaitility.await().until(() -> dest.exists() == false); media = DBReader.getFeedMedia(media.getId()); assertNotNull(media); assertFalse(dest.exists()); assertFalse(media.isDownloaded()); assertNull(media.getFile_url()); queue = DBReader.getQueue(); assertTrue(queue.size() == 0); }
Source:
private boolean updateDefinitionStatus(final TransactionContext context, final Concept concept) { final Set<String> newOwlAxiomExpressions = Optional.ofNullable(members) .map(Collection::stream) .orElseGet(Stream::empty) .filter(member -> SnomedRefSetType.OWL_AXIOM == member.type() || Concepts.REFSET_OWL_AXIOM.equals(member.getReferenceSetId())) .map(member -> (String) member.getProperties().get(SnomedRf2Headers.FIELD_OWL_EXPRESSION)) .collect(Collectors.toSet()); final String newDefinitionStatusId; if (!newOwlAxiomExpressions.isEmpty()) { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(newOwlAxiomExpressions).getConceptId(); } else { final String incomingDefinitionStatusId = definitionStatus == null ? DefinitionStatus.PRIMITIVE.getConceptId() : definitionStatus.getConceptId(); final Set<String> previousOwlExpressions = getPreviousOwlExpressions(concept.getId(), context); if (previousOwlExpressions.isEmpty()) { newDefinitionStatusId = incomingDefinitionStatusId; } else { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(previousOwlExpressions).getConceptId(); } } final String existingDefinitionStatusId = concept.getDefinitionStatus().getId(); if (!newDefinitionStatusId.equals(existingDefinitionStatusId)) { concept.setDefinitionStatus(context.lookup(newDefinitionStatusId, Concept.class)); return true; } else { return false; } }

Target:
private boolean updateDefinitionStatus(final TransactionContext context, final Concept concept) { final Set<String> newOwlAxiomExpressions = Optional.ofNullable(members) .map(Collection::stream) .orElseGet(Stream::empty) .filter(member -> SnomedRefSetType.OWL_AXIOM == member.type() || Concepts.REFSET_OWL_AXIOM.equals(member.getReferenceSetId())) .map(member -> (String) member.getProperties().get(SnomedRf2Headers.FIELD_OWL_EXPRESSION)) .collect(Collectors.toSet()); final String newDefinitionStatusId; if (!newOwlAxiomExpressions.isEmpty()) { newDefinitionStatusId = SnomedOWLAxiomHelper.getDefinitionStatusFromExpressions(newOwlAxiomExpressions).getConceptId(); } else { if (definitionStatus == null) return false; final String incomingDefinitionStatusId = definitionStatus.getConceptId(); newDefinitionStatusId = incomingDefinitionStatusId; } final String existingDefinitionStatusId = concept.getDefinitionStatus().getId(); if (!newDefinitionStatusId.equals(existingDefinitionStatusId)) { concept.setDefinitionStatus(context.lookup(newDefinitionStatusId, Concept.class)); return true; } else { return false; } }
Source:
default BitSet<T> tail() { if (isEmpty()) { throw new UnsupportedOperationException("tail of empty BitSet"); } else { return remove(head()); } }

Target:
default BitSet<T> tail() { if (isEmpty()) { throw new UnsupportedOperationException("tail of empty BitSet"); } else { return drop(1); } }
Source:
public void storageIsLazy() { assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); ShadowEnvironment.getExternalStorageDirectory(); ShadowEnvironment.getExternalStoragePublicDirectory(null); assertNotNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNotNull(ShadowEnvironment.EXTERNAL_FILES_DIR); }

Target:
public void storageIsLazy() { assertNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNull(ShadowEnvironment.EXTERNAL_FILES_DIR); Environment.getExternalStorageDirectory(); Environment.getExternalStoragePublicDirectory(null); assertNotNull(ShadowEnvironment.EXTERNAL_CACHE_DIR); assertNotNull(ShadowEnvironment.EXTERNAL_FILES_DIR); }
Source:
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { FrameLayout parentView = (FrameLayout) inflater.inflate(R.layout.fragment_page, container, false); webView = (WebView) parentView.findViewById(R.id.pageWebView); loadProgress = (ProgressBar) parentView.findViewById(R.id.pageLoadProgress); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); bridge = new CommunicationBridge(webView, "file:/ linkHandler = new LinkHandler(getActivity(), bridge); api = ((WikipediaApp)getActivity().getApplicationContext()).getPrimarySiteAPI(); if (savedInstanceState != null && savedInstanceState.containsKey(KEY_TITLE)) { title = savedInstanceState.getParcelable(KEY_TITLE); if (savedInstanceState.containsKey(KEY_PAGE)) { page = savedInstanceState.getParcelable(KEY_PAGE); } state = savedInstanceState.getInt(KEY_STATE); } if (title == null) { throw new RuntimeException("No PageTitle passed in to constructor or in instanceState"); } switch (state) { case STATE_NO_FETCH: new LeadSectionFetchTask().execute(); break; case STATE_INITIAL_FETCH: new RestSectionsFetchTask().execute(); break; case STATE_COMPLETE_FETCH: displayLeadSection(page); populateAllSections(page); break; } return parentView; }

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, final Bundle savedInstanceState) { FrameLayout parentView = (FrameLayout) inflater.inflate(R.layout.fragment_page, container, false); webView = (WebView) parentView.findViewById(R.id.pageWebView); loadProgress = (ProgressBar) parentView.findViewById(R.id.pageLoadProgress); webView.getSettings().setBuiltInZoomControls(true); webView.getSettings().setDisplayZoomControls(false); bridge = new CommunicationBridge(webView, "file:/ linkHandler = new LinkHandler(getActivity(), bridge, title.getSite()); api = ((WikipediaApp)getActivity().getApplicationContext()).getAPIForSite(title.getSite()); if (savedInstanceState != null && savedInstanceState.containsKey(KEY_TITLE)) { title = savedInstanceState.getParcelable(KEY_TITLE); if (savedInstanceState.containsKey(KEY_PAGE)) { page = savedInstanceState.getParcelable(KEY_PAGE); } state = savedInstanceState.getInt(KEY_STATE); } if (title == null) { throw new RuntimeException("No PageTitle passed in to constructor or in instanceState"); } switch (state) { case STATE_NO_FETCH: new LeadSectionFetchTask().execute(); break; case STATE_INITIAL_FETCH: new RestSectionsFetchTask().execute(); break; case STATE_COMPLETE_FETCH: displayLeadSection(page); populateAllSections(page); break; } return parentView; }
Source:
private void terminateRemainingProcesses(GdbLaunch launch, IDebugCommandRequest request) { MultiStatus status = new MultiStatus(GdbUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, Messages.DsfTerminateCommand_Terminate_failed, null); for (IProcess p : launch.getProcesses()) { if (p.canTerminate()) { try { p.terminate(); } catch(DebugException e) { status.merge(e.getStatus()); } } } if (!status.isOK()) { request.setStatus(status); } }

Target:
private void terminateRemainingProcesses(GdbLaunch launch, IDebugCommandRequest request) { MultiStatus status = new MultiStatus(GdbUIPlugin.PLUGIN_ID, DebugException.REQUEST_FAILED, Messages.DsfTerminateCommand_Terminate_failed, null); for (IProcess p : launch.getProcesses()) { if (p.canTerminate()) { try { p.terminate(); } catch(DebugException e) { status.merge(e.getStatus()); } } } if (!status.isOK()) { request.setStatus(status); } request.done(); }
Source:
protected void setDefaultSwitchTypeIfNeeded() { Cluster cluster = getCluster(); if (cluster.hasRequiredSwitchType(null)) { SwitchType defaultSwitchType = DefaultSwitchType.getDefaultSwitchType(cluster.getCompatibilityVersion()); cluster.setRequiredSwitchTypeForCluster(defaultSwitchType); } }

Target:
protected void setDefaultSwitchTypeIfNeeded() { Cluster cluster = getCluster(); if (cluster.isSetRequiredSwitchType()) { SwitchType defaultSwitchType = DefaultSwitchType.getDefaultSwitchType(cluster.getCompatibilityVersion()); cluster.setRequiredSwitchTypeForCluster(defaultSwitchType); } }
Source:
public ProjectToOrganization[] buildObject(Result hbaseResult, Oaf resolvedOafObject) throws InvalidProtocolBufferException { NavigableMap<byte[],byte[]> projOrgRelations = hbaseResult.getFamilyMap( relationColumnFamilyBytes); if (projOrgRelations!=null && projOrgRelations.size()>0) { List<ProjectToOrganization> results = new ArrayList<ProjectToOrganization>( projOrgRelations.size()); for (byte[] projOrgBytes : projOrgRelations.values()) { Oaf projOrgOAF = OafHelper.buildOaf(projOrgBytes); OafRel projOrgRel = projOrgOAF.getRel(); if (resultApprover!=null? resultApprover.approveBeforeBuilding(projOrgOAF): true) { ProjectToOrganization.Builder builder = ProjectToOrganization.newBuilder(); builder.setProjectId(projOrgRel.getSource()); builder.setOrganizationId(projOrgRel.getTarget()); results.add(builder.build()); } } return results.toArray(new ProjectToOrganization[results.size()]); } return null; }

Target:
public List<ProjectToOrganization> buildObject(Result hbaseResult, Oaf resolvedOafObject) throws InvalidProtocolBufferException { Preconditions.checkNotNull(hbaseResult); NavigableMap<byte[], byte[]> projOrgRelations = hbaseResult.getFamilyMap(relationColumnFamilyBytes); if (!MapUtils.isEmpty(projOrgRelations)) { List<ProjectToOrganization> projectOrganizationList = new ArrayList<ProjectToOrganization>( projOrgRelations.size()); for (byte[] projOrgBytes : projOrgRelations.values()) { Oaf projOrgOaf = OafHelper.buildOaf(projOrgBytes); if (resultApprover.approveBeforeBuilding(projOrgOaf)) { OafRel projOrgRel = projOrgOaf.getRel(); ProjectToOrganization.Builder builder = ProjectToOrganization.newBuilder(); builder.setProjectId(projOrgRel.getSource()); builder.setOrganizationId(projOrgRel.getTarget()); projectOrganizationList.add(builder.build()); } } return projectOrganizationList; } else { return Collections.emptyList(); } }
Source:
private int computeHashCode() { final int[] parts = new int[4]; parts[0] = (mapping == null) ? 0 : mapping.hashCode(); parts[1] = (semantic == null) ? 0 : getSemanticID(); parts[2] = (line == null) ? 0 : getLineID(); parts[3] = (column == null) ? 0 : getColumnID(); final String sep = "/"; return KeyCache.DEFAULT.getKey(parts[0] + sep + parts[1] + sep + parts[2] + sep + parts[3]); }

Target:
private int computeHashCode() { final int mappingCode = (mapping == null) ? 0 : mapping.hashCode(); final int semanticCode = (semantic == null) ? 0 : getSemanticID(); final int lineCode = (line == null) ? 0 : getLineID(); final int columnCode = (column == null) ? 0 : getColumnID(); final String sep = "/"; return KeyCache.DEFAULT.getKey(mappingCode + sep + semanticCode + sep + lineCode + sep + columnCode); }
Source:
public void streamsAreNotReused() throws IOException { final byte[] bytes = new byte[2 * StreamTestStreamStore.BLOCK_SIZE_IN_BYTES]; long id = timestampService.getFreshTimestamp(); Random rand = new Random(); rand.nextBytes(bytes); Sha256Hash hash = Sha256Hash.computeHash(bytes); ImmutableMap<Long, InputStream> streams = ImmutableMap.of(id, new CloseEnforcingInputStream(new ByteArrayInputStream(bytes))); storeStreamAndCheckHash(id, hash, streams); byte[] bytesInKvs = readBytesForSingleStream(id); assertArrayEquals(bytesInKvs, bytes); }

Target:
public void streamsAreNotReused() throws IOException { long id = timestampService.getFreshTimestamp(); byte[] bytes = generateRandomTwoBlockStream(); Sha256Hash hash = Sha256Hash.computeHash(bytes); Map<Long, InputStream> streams = ImmutableMap.of(id, new CloseEnforcingInputStream(new ByteArrayInputStream(bytes))); storeStreamAndCheckHash(id, hash, streams); byte[] bytesInKvs = readBytesForSingleStream(id); assertArrayEquals(bytesInKvs, bytes); }
Source:
public void testStationaryProbabilities() { for (final int padding : PADDINGS) { for (final RealMatrix transitionMatrix : TRANSITION_MATRICES) { final IntegerCopyNumberTransitionProbabilityCache cache = new IntegerCopyNumberTransitionProbabilityCache( new IntegerCopyNumberTransitionMatrixData(transitionMatrix, padding)); final double[] stationary = cache.getStationaryProbabilityVector().toArray(); final double[] stationaryFromMultiplication = cache.getTransitionProbabilityMatrix(Integer.MAX_VALUE) .getColumn(0); ArrayAsserts.assertArrayEquals(stationary, stationaryFromMultiplication, EPSILON); Assert.assertEquals(Arrays.stream(stationary).sum(), 1.0, EPSILON); } } }

Target:
public void testStationaryProbabilities() { for (final int padding : PADDINGS) { for (final RealMatrix transitionMatrix : TRANSITION_MATRICES) { final IntegerCopyNumberTransitionProbabilityCache cache = new IntegerCopyNumberTransitionProbabilityCache( new IntegerCopyNumberTransitionMatrix(transitionMatrix, padding)); final double[] stationary = cache.getStationaryProbabilityVector().toArray(); final double[] stationaryFromMultiplication = cache.getTransitionProbabilityMatrix(Integer.MAX_VALUE) .getColumn(0); ArrayAsserts.assertArrayEquals(stationary, stationaryFromMultiplication, EPSILON); Assert.assertEquals(Arrays.stream(stationary).sum(), 1.0, EPSILON); } } }
Source:
public void writeVariable(UserVariable userVariable) throws IOException { if (checkDeviceVariableKeyEmpty(userVariable)) { addKeyToUserVariable(userVariable); } if (!deviceVariablesFile.exists()) { deviceVariablesFile.createNewFile(); } synchronized (LOCK) { HashMap deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { deviceVariableMap = new HashMap<>(); } deviceVariableMap.put(userVariable.getDeviceValueKey(), userVariable.getValue()); writeMapToJson(deviceVariableMap); } }

Target:
public void writeVariable(UserVariable userVariable) throws IOException { synchronized (LOCK) { if (!deviceVariablesFile.exists()) { deviceVariablesFile.createNewFile(); } HashMap deviceVariableMap = readMapFromJson(); if (deviceVariableMap == null) { deviceVariableMap = new HashMap<>(); } deviceVariableMap.put(userVariable.getDeviceValueKey(), userVariable.getValue()); writeMapToJson(deviceVariableMap); } }
Source:
public List<ClientResponse> poll(long timeout, long now) { ensureActive(); if (!abortedSends.isEmpty()) { List<ClientResponse> responses = new ArrayList<>(); handleAbortedSends(responses); completeResponses(responses); return responses; } long metadataTimeout = metadataUpdater.maybeUpdate(now); try { this.selector.poll(Utils.min(timeout, metadataTimeout, defaultRequestTimeoutMs)); } catch (IOException e) { log.error("Unexpected error during I/O", e); } long updatedNow = this.time.milliseconds(); List<ClientResponse> responses = new ArrayList<>(); handleCompletedSends(responses, updatedNow); handleCompletedReceives(responses, updatedNow); handleDisconnections(responses, updatedNow); handleConnections(); handleInitiateApiVersionRequests(updatedNow); handleTimeOutConnections(responses, updatedNow); handleTimedOutRequests(responses, updatedNow); completeResponses(responses); return responses; }

Target:
public List<ClientResponse> poll(long timeout, long now) { ensureActive(); if (!abortedSends.isEmpty()) { List<ClientResponse> responses = new ArrayList<>(); handleAbortedSends(responses); completeResponses(responses); return responses; } long metadataTimeout = metadataUpdater.maybeUpdate(now); try { this.selector.poll(Utils.min(timeout, metadataTimeout, defaultRequestTimeoutMs)); } catch (IOException e) { log.error("Unexpected error during I/O", e); } long updatedNow = this.time.milliseconds(); List<ClientResponse> responses = new ArrayList<>(); handleCompletedSends(responses, updatedNow); handleCompletedReceives(responses, updatedNow); handleDisconnections(responses, updatedNow); handleConnections(); handleInitiateApiVersionRequests(updatedNow); handleTimeoutConnections(responses, updatedNow); handleTimeoutRequests(responses, updatedNow); completeResponses(responses); return responses; }
Source:
public DescriptorImpl() { super(ThrottleJobProperty.class); synchronized(propertiesByCategoryLock) { load(); if (!propertiesByCategory.isEmpty()) { propertiesByCategory = new HashMap<String,Map<ThrottleJobProperty,Void>>(); save(); } } }

Target:
public DescriptorImpl() { super(ThrottleJobProperty.class); synchronized(propertiesByCategoryLock) { load(); if (propertiesByCategory == null) { propertiesByCategory = new HashMap<String,Map<ThrottleJobProperty,Void>>(); } if (!propertiesByCategory.isEmpty()) { propertiesByCategory.clear(); save(); } } }
Source:
public InputStream handleException(Request request, Exception exception) { throw new RuntimeException("Request to worker failed", exception); }

Target:
public InputStream handleException(Request request, Exception exception) { throw new PrestoException(DRUID_BROKER_RESULT_ERROR, "Request to worker failed", exception); }
Source:
static HttpPipeline buildNullClientPipeline() { List<HttpPipelinePolicy> policies = new ArrayList<>(); policies.add(new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json;odata=minimalmetadata"))); return new HttpPipelineBuilder() .policies(policies.toArray(new HttpPipelinePolicy[0])) .httpClient(new NullHttpClient()) .build(); }

Target:
static HttpPipeline buildNullClientPipeline() { HttpPipelinePolicy[] policies = { new AddHeadersPolicy(new HttpHeaders().put("Accept", "application/json;odata=minimalmetadata")) }; return new HttpPipelineBuilder() .policies(policies) .httpClient(new NullHttpClient()) .build(); }
Source:
public void vuapClickToPlayShouldStartPlayingAdvertisementAfterClickOnPlayIcon(Page page, String slot) { AdsBaseObject ads = openPageWithVideoInLocalStorage(page, VuapVideos.VIDEO_10s); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, ads.findFirstIframeWithAd(slot), false); ads.scrollToSlot(slot); vuap.clickOnArea(2); VuapAssertions.verifyVideoPlay(vuap); }

Target:
public void vuapClickToPlayShouldStartPlayingAdvertisementAfterClickOnPlayIcon(Page page, String slot) { AdsBaseObject ads = new AdsBaseObject(driver, page.getUrl(), WindowSize.DESKTOP); final AutoplayVuap vuap = new AutoplayVuap(driver, slot, ads.findFirstIframeWithAd(slot), false); ads.scrollToSlot(slot); vuap.clickOnArea(2); VuapAssertions.verifyVideoPlay(vuap); }
Source:
boolean reachedCapacity() { return assignedTasks().size() >= capacity; }

Target:
boolean reachedCapacity() { return assignedTaskCount() >= capacity; }
Source:
protected boolean hasVideoAvailable() { if ( isTokenEvent ) { return tokenAd != null; } else { return incentivizedInterstitial.isAdReadyToDisplay(); } }

Target:
protected boolean hasVideoAvailable() { if ( isTokenEvent ) { return tokenAd != null; } else { return ( incentivizedInterstitial != null && incentivizedInterstitial.isAdReadyToDisplay() ); } }
Source:
public static void log(final MuzimaApplication muzimaApplication, final String tag, final String details){ if(isLoggingFeatureEnabled(muzimaApplication)) { User authenticatedUser = muzimaApplication.getAuthenticatedUser(); if (authenticatedUser != null) { String userId = authenticatedUser.getUuid(); log(muzimaApplication, tag, userId, getAndParseGpsLocationForLogging(muzimaApplication), details); } else { Log.e("MuzimaLoggerService", "Could not save logs"); } } }

Target:
public static void log(final MuzimaApplication muzimaApplication, final String tag, final String details){ if(isLoggingFeatureEnabled(muzimaApplication)) { User authenticatedUser = muzimaApplication.getAuthenticatedUser(); if (authenticatedUser != null) { String userId = authenticatedUser.getUuid(); log(muzimaApplication, tag, userId, getAndParseGPSLocationForLogging(muzimaApplication), details); } else { Log.e("MuzimaLoggerService", "Could not save logs"); } } }
Source:
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null).execute(); updateReferencedMessage(); finish(); } }

Target:
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) { if (isDraft) { draftNeedsSaving = false; currentMessageBuilder = null; if (mAction == Action.EDIT_DRAFT && mMessageReference != null) { message.setUid(mMessageReference.getUid()); } boolean saveRemotely = recipientPresenter.isAllowSavingDraftRemotely(); new SaveMessageTask(getApplicationContext(), mAccount, mContacts, mHandler, message, mDraftId, saveRemotely).execute(); if (mFinishAfterDraftSaved) { finish(); } else { setProgressBarIndeterminateVisibility(false); } } else { currentMessageBuilder = null; new SendMessageTask(getApplicationContext(), mAccount, mContacts, message, mDraftId != INVALID_DRAFT_ID ? mDraftId : null, mMessageReference).execute(); finish(); } }
Source:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.size() == 0){ return ""; } String csv = ""; String fragments = ""; List<String> options; List<Integer> optionPoints = new ArrayList<Integer>(); Map<String, Integer[]> optionTotalCount = new LinkedHashMap<String, Integer[]>(); if(distributeToRecipients){ for(FeedbackResponseAttributes response : responses){ FeedbackConstantSumResponseDetails frd = (FeedbackConstantSumResponseDetails)response.getResponseDetails(); String recipientEmail = response.recipientEmail; String recipientName = bundle.getNameForEmail(recipientEmail); Integer[] pointCount = optionTotalCount.get(recipientName); if(pointCount == null){ pointCount = new Integer[]{0,0}; } pointCount[0] += frd.getAnswerList().get(0); pointCount[1] += 1; optionTotalCount.put(recipientName, pointCount); } } else { options = constSumOptions; for(int i=0 ; i<options.size() ; i++){ optionPoints.add(0); } for(FeedbackResponseAttributes response : responses){ FeedbackConstantSumResponseDetails frd = (FeedbackConstantSumResponseDetails)response.getResponseDetails(); for(int i=0 ; i<frd.getAnswerList().size(); i++){ optionPoints.set(i, optionPoints.get(i)+frd.getAnswerList().get(i)); } } for(int i=0 ; i<options.size() ; i++){ optionTotalCount.put(options.get(i), new Integer[]{optionPoints.get(i),responses.size()}); } } DecimalFormat df = new DecimalFormat("#.##"); for(Entry<String, Integer[]> entry : optionTotalCount.entrySet() ){ double average = (double)entry.getValue()[0]/entry.getValue()[1]; fragments += entry.getKey() + "," + df.format(average) + Const.EOL; } csv += (distributeToRecipients? "Recipient":"Option") + ", Average Points" + Const.EOL; csv += fragments + Const.EOL; return csv; }

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if(responses.size() == 0){ return ""; } String csv = ""; String fragments = ""; List<String> options = constSumOptions; Map<String, List<Integer>> optionPoints = generateOptionPointsMapping(responses); DecimalFormat df = new DecimalFormat("#.##"); for(Entry<String, List<Integer>> entry : optionPoints.entrySet() ){ String option; if(distributeToRecipients){ option = bundle.getNameForEmail(entry.getKey());; } else { option = options.get(Integer.parseInt(entry.getKey())); } List<Integer> points = entry.getValue(); double average = computeAverage(points); fragments += option + "," + df.format(average) + Const.EOL; } csv += (distributeToRecipients? "Recipient":"Option") + ", Average Points" + Const.EOL; csv += fragments + Const.EOL; return csv; }
Source:
public WildcardPattern(String pattern, char wildcard) { _pattern = pattern; _wildcard = wildcard; _startsWithDelim = (_pattern.charAt(0) == _wildcard); _endsWithDelim = (_pattern.charAt(pattern.length() - 1) == _wildcard); }

Target:
public WildcardPattern(String pattern, char wildcard) { _pattern = pattern; _wildcard = wildcard; if(_pattern.isEmpty()){ _startsWithDelim = _endsWithDelim = false; } else { _startsWithDelim = _pattern.charAt(0) == _wildcard; _endsWithDelim = _pattern.charAt(pattern.length() - 1) == _wildcard; } }
Source:
public void shouldDeterminNodeIdFromResourceId() { String resourceIdString = "node[Test:1525957453778].interfaceSnmp[opennms-jvm]"; ResourceId resourceId = ResourceId.fromString(resourceIdString); ResourceDao resourceDao = Mockito.mock(ResourceDao.class); OnmsResource resource = Mockito.mock(OnmsResource.class); OnmsResource parentResource = Mockito.mock(OnmsResource.class); OnmsNode node = new OnmsNode(); node.setId(3); when(resourceDao.getResourceById(resourceId)).thenReturn(resource); when(resource.getParent()).thenReturn(parentResource); when(parentResource.getEntity()).thenReturn(node); KscDashlet dashlet = new KscDashlet( this.getClass().getSimpleName(), null, null, resourceDao, null); assertEquals(Integer.toString(3), dashlet.determineNodeIdByResourceId(resourceIdString)); }

Target:
public void shouldDeterminNodeIdFromResourceId() { String resourceIdString = "node[Test:1525957453778].interfaceSnmp[opennms-jvm]"; ResourceId resourceId = ResourceId.fromString(resourceIdString); ResourceDao resourceDao = Mockito.mock(ResourceDao.class); OnmsResource resource = Mockito.mock(OnmsResource.class); OnmsResource parentResource = Mockito.mock(OnmsResource.class); OnmsNode node = new OnmsNode(); node.setId(3); when(resourceDao.getResourceById(resourceId)).thenReturn(resource); when(resource.getParent()).thenReturn(parentResource); when(parentResource.getEntity()).thenReturn(node); KscDashlet dashlet = new KscDashlet( this.getClass().getSimpleName(), null, null, resourceDao, null); assertEquals(parentResource, dashlet.determineResourceByResourceId(resourceId)); }
Source:
private Gde(Parcel in) { in.readStringList(product); name = in.readString(); address = in.readString(); lat = in.readDouble(); lng = in.readDouble(); email = in.readString(); socialUrl = in.readString(); }

Target:
protected Gde(Parcel in) { name = in.readString(); address = in.readString(); email = in.readString(); socialUrl = in.readString(); product = in.createStringArrayList(); lat = in.readDouble(); lng = in.readDouble(); }
Source:
private String getClasspathOrModulePath(String... classpathElements) { char separator = ';'; return String.join("" + separator, classpathElements); }

Target:
private String getClasspathOrModulePath(String... classpathElements) { return String.join(";", classpathElements); }
Source:
private void checkStateOfWsAgent(WsAgentHealthStateDto agentHealthStateDto) { final int statusCode = agentHealthStateDto.getCode(); final String infoWindowTitle = "Workspace Agent Not Responding"; final ConfirmCallback stopCallback = new StopCallback(false, true); final ConfirmCallback stopAndReloadCallback = new StopCallback(true, false); if (statusCode == 200) { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, verify you have a" + " good network connection and restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } else { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } }

Target:
private void checkStateOfWsAgent(WsAgentHealthStateDto agentHealthStateDto) { final int statusCode = agentHealthStateDto.getCode(); final String infoWindowTitle = "Workspace Agent Not Responding"; final boolean reloadPage = true; final boolean createSnapshot = true; final ConfirmCallback stopCallback = new StopCallback(!reloadPage, createSnapshot); final ConfirmCallback stopAndReloadCallback = new StopCallback(reloadPage, !createSnapshot); if (statusCode == 200) { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, verify you have a" + " good network connection and restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } else { dialogFactory.createChoiceDialog(infoWindowTitle, "Workspace agent is no longer responding. To fix the problem, restart the workspace.", "Restart", "Close", stopAndReloadCallback, stopCallback).show(); } }
Source:
public static void close(final OnHeapStore onHeapStore) { onHeapStore.map.clear(); onHeapStore.disableStoreEventNotifications(); }

Target:
static void close(final OnHeapStore onHeapStore) { onHeapStore.map.clear(); onHeapStore.disableStoreEventNotifications(); }
Source:
public void run() { System.out.println("Druid version " + Initialization.class.getPackage().getImplementationVersion()); ExtensionsConfig config = Initialization.makeStartupInjector().getInstance(ExtensionsConfig.class); System.out.println(""); System.out.println("Registered Druid Modules"); for (DruidModule module : Initialization.getFromExtensions(config, DruidModule.class)) { String artifact = module.getClass().getPackage().getImplementationTitle(); String version = module.getClass().getPackage().getImplementationVersion(); if(artifact != null) { System.out.println( String.format( " - %s (%s-%s)", module.getClass().getCanonicalName(), module.getClass().getPackage().getImplementationTitle(), module.getClass().getPackage().getImplementationVersion() ) ); } else { System.out.println( String.format( " - %s", module.getClass().getCanonicalName() ) ); } } }

Target:
public void run() { System.out.println(StatusResource.getStatus()); }
Source:
public DistributedCacheFactory(HazelcastConnection connection, ObjectMapper mapper) { this.connection = connection; this.mapper = mapper; DistributedCache.setup(connection); }

Target:
public DistributedCacheFactory(HazelcastConnection connection, ObjectMapper mapper) { this.connection = connection; this.mapper = mapper; this.connection.getHazelcastConfig().addMapConfig(getDefaultMapConfig()); }
Source:
public void method_behavior_yields() { SymbolicExecutionVisitor sev = createSymbolicExecutionVisitor("src/test/resources/se/MethodYields.java"); Optional<MethodSymbol> topMethod = sev.behaviorCache.keySet().stream().filter(s -> "method".equals(s.name())).findFirst(); assertThat(topMethod.isPresent()).isTrue(); MethodBehavior mb = sev.behaviorCache.get(topMethod.get()); List<MethodYield> yields = mb.yields(); assertThat(yields).hasSize(3); List<MethodYield> trueResults = yields.stream().filter(my -> BooleanConstraint.TRUE.equals(my.result.constraint)).collect(Collectors.toList()); assertThat(trueResults).hasSize(1); assertThat(trueResults.get(0).parameters[0].constraint.isNull()).isTrue(); List<MethodYield> falseResults = yields.stream().filter(my -> BooleanConstraint.FALSE.equals(my.result.constraint)).collect(Collectors.toList()); assertThat(falseResults).hasSize(2); assertThat(falseResults.stream().filter(my -> !my.parameters[0].constraint.isNull()).count()).isEqualTo(2); assertThat(falseResults.stream().filter(my -> BooleanConstraint.FALSE.equals(my.parameters[1].constraint)).count()).isEqualTo(1); assertThat(falseResults.stream().filter(my -> my.parameters[1].constraint == null).count()).isEqualTo(1); }

Target:
public void method_behavior_yields() { SymbolicExecutionVisitor sev = createSymbolicExecutionVisitor("src/test/resources/se/MethodYields.java"); Optional<MethodSymbol> topMethod = sev.behaviorCache.keySet().stream().filter(s -> "method".equals(s.name())).findFirst(); assertThat(topMethod.isPresent()).isTrue(); MethodBehavior mb = sev.behaviorCache.get(topMethod.get()); List<MethodYield> yields = mb.yields(); assertThat(yields).hasSize(3); List<MethodYield> trueResults = yields.stream().filter(my -> BooleanConstraint.TRUE.equals(my.resultConstraint)).collect(Collectors.toList()); assertThat(trueResults).hasSize(1); MethodYield trueResult = trueResults.get(0); assertThat(trueResult.parametersConstraints[0].isNull()).isTrue(); assertThat(trueResult.parametersConstraints[1]).isNull(); assertThat(trueResult.resultIndex).isEqualTo(-1); List<MethodYield> falseResults = yields.stream().filter(my -> BooleanConstraint.FALSE.equals(my.resultConstraint)).collect(Collectors.toList()); assertThat(falseResults).hasSize(2); assertThat(falseResults.stream().filter(my -> !my.parametersConstraints[0].isNull()).count()).isEqualTo(2); assertThat(falseResults.stream().filter(my -> BooleanConstraint.FALSE.equals(my.parametersConstraints[1]) && my.resultIndex == 1).count()).isEqualTo(1); assertThat(falseResults.stream().filter(my -> BooleanConstraint.TRUE.equals(my.parametersConstraints[1]) && my.resultIndex == -1).count()).isEqualTo(1); }
Source:
private String parseParamsForSystemInformation(ParameterSet params, JSONObject obj) throws Exception { String subselector = "OVERVIEW"; if (params.toArray().length > 1) { return "Incorrect number of arguments to @SystemInformation (expects 1, received " + params.toArray().length + ")"; } if (params.toArray().length == 1) { Object first = params.toArray()[0]; if (!(first instanceof String)) { return "First argument to @SystemInformation must be a valid STRING selector, instead was " + first; } subselector = (String)first; if (!(subselector.equalsIgnoreCase("OVERVIEW") || subselector.equalsIgnoreCase("DEPLOYMENT") || subselector.equalsIgnoreCase("LICENSE"))) { return "Invalid @SystemInformation selector " + subselector; } } obj.put("subselector", subselector); obj.put("interval", false); return null; }

Target:
private String parseParamsForSystemInformation(ParameterSet params, JSONObject obj) throws Exception { String subselector = "OVERVIEW"; if (params.toArray().length > 1) { return "Incorrect number of arguments to @SystemInformation (expects 1, received " + params.toArray().length + ")"; } if (params.toArray().length == 1) { Object first = params.toArray()[0]; if (!(first instanceof String)) { return "First argument to @SystemInformation must be a valid STRING selector, instead was " + first; } subselector = (String)first; if (!VALID_SUBSELECTORS.contains(subselector)) { return "Invalid @SystemInformation selector " + subselector; } } obj.put("subselector", subselector); obj.put("interval", false); return null; }
Source:
private boolean initVirtResources() { if (InitializeStorage()) { processFence(); processStoragePoolStatus(); runUpdateMomPolicy(getVdsGroup(), getVds()); } else { Map<String, String> customLogValues = new HashMap<>(); customLogValues.put("StoragePoolName", getStoragePoolName()); if (problematicDomains != null && !problematicDomains.isEmpty()) { customLogValues.put("StorageDomainNames", StringUtils.join(Entities.objectNames(problematicDomains), ',')); } setNonOperational(NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE, customLogValues); return false; } return true; }

Target:
private boolean initVirtResources() { if (InitializeStorage()) { processFence(); processStoragePoolStatus(); runUpdateMomPolicy(getVdsGroup(), getVds()); } else { Map<String, String> customLogValues = new HashMap<>(); customLogValues.put("StoragePoolName", getStoragePoolName()); if (problematicDomains != null && !problematicDomains.isEmpty()) { customLogValues.put("StorageDomainNames", StringUtils.join(Entities.objectNames(problematicDomains), ", ")); } setNonOperational(NonOperationalReason.STORAGE_DOMAIN_UNREACHABLE, customLogValues); return false; } return true; }
Source:
protected void onMethodInvocationFound(MethodInvocationTree isPresentMIT) { previousMITInChain(isPresentMIT) .filter(FIND_METHODS::anyMatch) .ifPresent(findMIT -> previousMITInChain(findMIT).filter(FILTER_METHODS::anyMatch) .ifPresent(filterMIT -> context.reportIssue(this, identifierFromMethodInvocationChain(filterMIT), identifierFromMethodInvocationChain(isPresentMIT), "Replace this \"filter()." + identifierFromMethodInvocationChain(findMIT).name() +"().isPresent()\" chain with \"anyMatch()\""))); }

Target:
protected void onMethodInvocationFound(MethodInvocationTree isPresentMIT) { previousMITInChain(isPresentMIT) .filter(FIND_METHODS::anyMatch) .ifPresent(findMIT -> previousMITInChain(findMIT).filter(FILTER_METHODS::anyMatch) .ifPresent(filterMIT -> context.reportIssue(this, MethodsHelper.methodName(filterMIT), MethodsHelper.methodName(isPresentMIT), "Replace this \"filter()." + MethodsHelper.methodName(findMIT).name() +"().isPresent()\" chain with \"anyMatch()\""))); }
Source:
public void stopRecording(Client c) { if (!kHandler.isConnected() || !hasRightsToRecord(c)) { return; } kHandler.getRoom(c.getRoomId()).stopRecording(this, c); Optional<StreamDesc> osd = c.getScreenStream(); if (osd.isPresent()) { pauseSharing(c, osd.get().getUid()); } }

Target:
public void stopRecording(Client c) { if (!kHandler.isConnected() || !hasRightsToRecord(c)) { return; } kHandler.getRoom(c.getRoomId()).stopRecording(this, c); c.getScreenStream().ifPresent(sd -> { if (!sd.hasActivity(Activity.SCREEN)) { pauseSharing(c, sd.getUid()); } }); }
Source:
private boolean areSubscribersBehindByMax() { boolean behind = false; if (backPressureEnabled) { int count = 0; for (Block curr = last; curr != null; curr = curr.prev, count++) { if (count >= (MAX_COUNT_OF_INMEM_BLOCKS - 1)) { if (curr.refCount.get() != 0) { behind = true; break; } } } } return behind; }

Target:
public boolean areSubscribersBehindByMax() { boolean behind = false; if (backPressureEnabled) { int count = 0; synchronized (this) { Block curr = last.prev; while ((curr != null) && (++count < (MAX_COUNT_OF_INMEM_BLOCKS - 2))) { curr = curr.prev; } while (!behind && (curr != null)) { behind = (curr.refCount.get() != 0); curr = curr.prev; } } } return behind; }
Source:
private void assertCommitsAfterBase(SWTBotTable table, String... commitMsgs) throws Exception { TestUtil.waitForJobs(50, 5000); bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return table.rowCount() >= commitMsgs.length; } @Override public String getFailureMessage() { return "CommitGraphTable did not become empty"; } }); List<Matcher<? super String>> matchers = new ArrayList<>(); matchers.add(equalTo("Initial commit")); matchers.add(startsWith("Touched at")); matchers.add(equalTo("A new file in a new folder")); for (String msg : commitMsgs) { matchers.add(equalTo(msg)); } Assert.assertThat("Expected different commits", getCommitMsgsFromUi(table), is(arrayContainingInAnyOrder(matchers))); }

Target:
private void assertCommitsAfterBase(SWTBotTable table, String... commitMsgs) throws Exception { TestUtil.waitForJobs(50, 5000); int expectedNumberOfCommits = commitMsgs.length + 3; bot.waitUntil(new DefaultCondition() { @Override public boolean test() throws Exception { return table.rowCount() == expectedNumberOfCommits; } @Override public String getFailureMessage() { return "CommitGraphTable did not get expected number of rows: " + expectedNumberOfCommits; } }); List<Matcher<? super String>> matchers = new ArrayList<>(); matchers.add(equalTo("Initial commit")); matchers.add(startsWith("Touched at")); matchers.add(equalTo("A new file in a new folder")); for (String msg : commitMsgs) { matchers.add(equalTo(msg)); } Assert.assertThat("Expected different commits", getCommitMsgsFromUi(table), is(arrayContainingInAnyOrder(matchers))); }
Source:
public static void checkValid(BoundedContextName name) { checkNotNull(name); checkNotEmptyOrBlank(name.getValue(), "name"); }

Target:
public static void checkValid(BoundedContextName name) throws IllegalArgumentException { checkNotEmptyOrBlank(name.getValue(), "name"); }
Source:
public int hashCode() { int result = name != null ? name.hashCode() : 0; result = 31 * result + (permissions != null ? permissions.hashCode() : 0); result = 31 * result + mask; return result; }

Target:
public int hashCode() { int result = name.hashCode(); result = 31 * result + permissions.hashCode(); result = 31 * result + mask; return result; }
Source:
private void updateView(final List<Project> projects) { view.clearProjects(); projects.stream().forEach(project -> { final TileWidget tileWidget = tileWidgets.get(); final POM pom = project.getPom(); tileWidget.init(project.getProjectName(), pom != null ? pom.getDescription() : "", String.valueOf(project.getNumberOfAssets()), view.getNumberOfAssetsMessage(13), selectCommand(project)); view.addProject(tileWidget.getView().getElement()); }); }

Target:
private void updateView(final List<Project> projects) { view.clearProjects(); projects.stream().forEach(project -> { final TileWidget tileWidget = createProjectWidget(project); view.addProject(tileWidget.getView().getElement()); }); }
Source:
protected List<MethodMatcher> getMethodInvocationMatchers() { return ImmutableList.of( MethodMatcher.create().typeDefinition("java.sql.DriverManager").name("getConnection").withAnyParameters() ); }

Target:
protected List<MethodMatcher> getMethodInvocationMatchers() { return METHOD_MATCHERS; }
Source:
protected void executeQueryCommand() { InstanceType instance; GetVmTemplateParameters params = getParameters(); if (params.getName() != null) { instance = vmTemplateDao.getInstanceTypeByName(params.getName(), getUserID(), getParameters().isFiltered()); } else { instance = vmTemplateDao.get(getParameters().getId(), getUserID(), getParameters().isFiltered()); } getQueryReturnValue().setReturnValue(instance); }

Target:
protected void executeQueryCommand() { InstanceType instance; GetVmTemplateParameters params = getParameters(); if (params.getName() != null) { instance = vmTemplateDao.getInstanceTypeByName(params.getName(), getUserID(), getParameters().isFiltered()); } else { instance = vmTemplateDao.getInstanceType(getParameters().getId()); } getQueryReturnValue().setReturnValue(instance); }