auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<INetworkNodeInfo> getNetworkNodes(List<String> statementIds) throws QuadrigaStorageException{ List<INetworkNodeInfo> networkNodeList = null; List<NetworkStatementsDTO> networkStatementsDTOList = dbconnect.getNetworkNodes(statementIds); if (networkStatementsDTOList != null) { networkNodeList = new ArrayList<INetworkNodeInfo>(); INetworkNodeInfo networkNodeInfo = null; for (NetworkStatementsDTO networkStatementsDTO : networkStatementsDTOList) { networkNodeInfo = networkNodeInfoFactory.createNetworkNodeInfoObject(); networkNodeInfo.setId(networkStatementsDTO.getStatementid()); networkNodeInfo.setStatementType(networkStatementsDTO.getStatementtype()); networkNodeInfo.setVersion(networkStatementsDTO.getVersion()); networkNodeInfo.setIsTop(networkStatementsDTO.getIstop()); networkNodeList.add(networkNodeInfo); } } return networkNodeList; }

Target:
public List<INetworkNodeInfo> getNetworkNodes(List<String> statementIds) throws QuadrigaStorageException{ return getNetworkNodeInfoList(dbconnect.getNetworkNodes(statementIds)); }
Source:
public void checkAllPreferences() { preferencesDialog.open(); preferencesDialog.select(mavenPreferencePage); assertTrue(mavenPreferencePage.getGroupId().equals("Warning")); assertTrue(mavenPreferencePage.getVersion().equals("Warning")); assertTrue(mavenPreferencePage.getProjectConfig().equals("Error")); assertTrue(mavenPreferencePage.getPluginExecution().equals("Error")); assertTrue(mavenPreferencePage.getManagedVersion().equals("Warning")); mavenPreferencePage.setGroupId("Ignore"); mavenPreferencePage.setVersion("Ignore"); mavenPreferencePage.setProjectConfig("Ignore"); mavenPreferencePage.setPluginExecution("Ignore"); mavenPreferencePage.setManagedVersion("Ignore"); assertTrue(mavenPreferencePage.getGroupId().equals("Ignore")); assertTrue(mavenPreferencePage.getVersion().equals("Ignore")); assertTrue(mavenPreferencePage.getProjectConfig().equals("Ignore")); assertTrue(mavenPreferencePage.getPluginExecution().equals("Ignore")); assertTrue(mavenPreferencePage.getManagedVersion().equals("Ignore")); mavenPreferencePage.restoreDefaults(); assertTrue(mavenPreferencePage.getGroupId().equals("Warning")); assertTrue(mavenPreferencePage.getVersion().equals("Warning")); assertTrue(mavenPreferencePage.getProjectConfig().equals("Error")); assertTrue(mavenPreferencePage.getPluginExecution().equals("Error")); assertTrue(mavenPreferencePage.getManagedVersion().equals("Warning")); preferencesDialog.cancel(); }

Target:
public void checkAllPreferences() { preferencesDialog.open(); preferencesDialog.select(mavenPreferencePage); mavenPreferencePage.setGroupId(MavenErrorSeverity.IGNORE); mavenPreferencePage.setVersion(MavenErrorSeverity.IGNORE); mavenPreferencePage.setProjectConfig(MavenErrorSeverity.IGNORE); mavenPreferencePage.setPluginExecution(MavenErrorSeverity.IGNORE); mavenPreferencePage.setManagedVersion(MavenErrorSeverity.IGNORE); assertTrue(mavenPreferencePage.getGroupId().equals(MavenErrorSeverity.IGNORE.getValue())); assertTrue(mavenPreferencePage.getVersion().equals(MavenErrorSeverity.IGNORE.getValue())); assertTrue(mavenPreferencePage.getProjectConfig().equals(MavenErrorSeverity.IGNORE.getValue())); assertTrue(mavenPreferencePage.getPluginExecution().equals(MavenErrorSeverity.IGNORE.getValue())); assertTrue(mavenPreferencePage.getManagedVersion().equals(MavenErrorSeverity.IGNORE.getValue())); preferencesDialog.cancel(); }
Source:
public IgniteMergeJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, Set<CorrelationId> variablesSet, JoinRelType joinType) { super(cluster, traitSet, left, right, condition, variablesSet, joinType); }

Target:
public IgniteMergeJoin(RelOptCluster cluster, RelTraitSet traitSet, RelNode left, RelNode right, RexNode condition, Set<CorrelationId> variablesSet, JoinRelType joinType) { super(cluster, traitSet, ImmutableList.of(), left, right, condition, variablesSet, joinType); }
Source:
public void test_load() throws Exception { int[] loadRefOpcodes = new int[] {Opcodes.ILOAD, Opcodes.LLOAD, Opcodes.FLOAD, Opcodes.DLOAD, Opcodes.ALOAD}; for (int loadRefOpcode : loadRefOpcodes) { SymbolicValue loadRef = new SymbolicValue(); ProgramState programState = execute(new Instruction(loadRefOpcode, 0), ProgramState.EMPTY_STATE.put(0, loadRef)); assertThat(programState.peekValue()).isEqualTo(loadRef); try { programState = execute(new Instruction(loadRefOpcode, 0), ProgramState.EMPTY_STATE); fail("No sv indexed should not generate a program state for "); } catch (NullPointerException npe) { assertThat(npe).hasMessage("Loading a symbolic value unindexed"); } } }

Target:
public void test_load() throws Exception { int[] loadRefOpcodes = new int[] {Opcodes.ILOAD, Opcodes.LLOAD, Opcodes.FLOAD, Opcodes.DLOAD, Opcodes.ALOAD}; for (int loadRefOpcode : loadRefOpcodes) { SymbolicValue loadRef = new SymbolicValue(); ProgramState programState = execute(new Instruction(loadRefOpcode, 0), ProgramState.EMPTY_STATE.put(0, loadRef)); assertThat(programState.peekValue()).isEqualTo(loadRef); assertThatThrownBy(() -> execute(new Instruction(loadRefOpcode, 0), ProgramState.EMPTY_STATE)).hasMessage("Loading a symbolic value unindexed"); } }
Source:
public S getSchemaByID(String topic, String id) { CachedSchemaTuple cacheKey = new CachedSchemaTuple(topic, id); S schema = cachedById.get(cacheKey); if (schema == null) { synchronized (this) { if (shouldFetchFromSchemaRegistry(id)) { schema = fetchFromSchemaRegistry(topic, id); } else { throw new SchemaNotFoundException(); } } } return schema; }

Target:
public S getSchemaByID(String topic, String id) { CachedSchemaTuple cacheKey = new CachedSchemaTuple(topic, id); S schema = cachedById.get(cacheKey); if (schema == null) { synchronized (this) { if (shouldFetchFromSchemaRegistry(id)) { schema = fetchFromSchemaRegistry(topic, id); cachedById.putIfAbsent(new CachedSchemaTuple(topic, id), schema); } else { throw new SchemaNotFoundException(); } } } return schema; }
Source:
public String getRoomCapacity(String displayName) { UI.doubleClick(driver.findElement(By.xpath(" return roomCapacityTxtBox.getAttribute("value"); }

Target:
public String getRoomCapacity(String displayName) { UI.doubleClick(driver.findElement(By.xpath(" + displayName + "')and@class='ng-binding']"))); return roomCapacityTxtBox.getAttribute("value"); }
Source:
public void testValidate() { Message m = new StatsMessage(); Assert.assertFalse(MessageTest.assertValid(m)); m.setText("text"); Assert.assertFalse(MessageTest.assertValid(m)); m.setText("get"); Assert.assertTrue(MessageTest.assertValid(m)); m.setText("clean"); Assert.assertTrue(MessageTest.assertValid(m)); m.setText("reload"); Assert.assertTrue(MessageTest.assertValid(m)); m.setClassName(null); Assert.assertTrue(MessageTest.assertValid(m)); Assert.assertNull(m.getClassName()); m.setTags(new TreeSet<>()); Assert.assertTrue(MessageTest.assertValid(m)); assertEquals(new TreeSet<>(), m.getTags()); }

Target:
public void testValidate() { Message m = new StatsMessage(); assertFalse(MessageTest.assertValid(m)); m.setText("text"); assertFalse(MessageTest.assertValid(m)); m.setText("get"); assertTrue(MessageTest.assertValid(m)); m.setText("clean"); assertTrue(MessageTest.assertValid(m)); m.setText("reload"); assertTrue(MessageTest.assertValid(m)); m.setClassName(null); assertTrue(MessageTest.assertValid(m)); assertNull(m.getClassName()); m.setTags(new TreeSet<>()); assertTrue(MessageTest.assertValid(m)); assertEquals(new TreeSet<>(), m.getTags()); }
Source:
public TypeManagementPreferencePage() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); setDescription("Type Managament Preferences Page"); }

Target:
public TypeManagementPreferencePage() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); setDescription(Messages.typeManagementPreferencePageTitle); }
Source:
public Template createStringTemplate(String content, DocumentReference author) { DefaultTemplate newTemplate = new DefaultTemplate(null); newTemplate.content.setAuthorReference(author); newTemplate.content.content = content; return newTemplate; }

Target:
public Template createStringTemplate(String content, DocumentReference author) throws Exception { return new StringTemplate(content, author); }
Source:
public static Object countersToJson(Counters counters) { Map<String, Object> jsonObj = new HashMap<String, Object>(); if(counters==null) return jsonObj; Collection<String> counterGroups = counters.getGroupNames(); for (String groupName : counterGroups) { Map<String, String> counterStats = new HashMap<String, String>(); Group group = counters.getGroup(groupName); Iterator<Counters.Counter> it = group.iterator(); while (it.hasNext()) { Counter counter = it.next(); counterStats.put(counter.getDisplayName(), String.valueOf(counter.getCounter())); } jsonObj.put(groupName, counterStats); } return jsonObj; }

Target:
public static Object countersToJson(Counters counters) { Map<String, Object> jsonObj = new HashMap<String, Object>(); if (counters == null) { return jsonObj; } Collection<String> counterGroups = counters.getGroupNames(); for (String groupName : counterGroups) { Map<String, String> counterStats = new HashMap<String, String>(); Group group = counters.getGroup(groupName); Iterator<Counters.Counter> it = group.iterator(); while (it.hasNext()) { Counter counter = it.next(); counterStats.put(counter.getDisplayName(), String.valueOf(counter.getCounter())); } jsonObj.put(groupName, counterStats); } return jsonObj; }
Source:
protected ActionResult execute() { GateKeeper.inst().verifyAdminPrivileges(account); data = new AdminEmailComposePageData(account); BlobInfo blobInfo = extractImageKey(Const.ParamsNames.ADMIN_EMAIL_IMAGE_TO_UPLOAD); if (blobInfo == null) { data.isFileUploaded = false; data.fileSrcUrl = null; log.warning("Image Upload Failed"); statusToAdmin = "Image Upload Failed"; return createAjaxResult(data); } BlobKey blobKey = blobInfo.getBlobKey(); AppUrl fileSrcUrl = Config.getAppUrl(Const.ActionURIs.PUBLIC_IMAGE_SERVE) .withParam("blob-key", blobKey.getKeyString()); String absoluteFileSrcUrl = fileSrcUrl.toAbsoluteString(); data.fileSrcUrl = fileSrcUrl.toString(); log.info("New Image Uploaded : " + absoluteFileSrcUrl); statusToAdmin = "New Image Uploaded : " + "<a href=" + data.fileSrcUrl + " target=\"_blank\">" + absoluteFileSrcUrl + "</a>"; data.ajaxStatus = "Image Successfully Uploaded to Google Cloud Storage"; return createAjaxResult(data); }

Target:
protected ActionResult execute() { GateKeeper.inst().verifyAdminPrivileges(account); FileUploadPageData uploadPageData = prepareData(); AdminEmailComposePageData data = new AdminEmailComposePageData(account); data.isFileUploaded = uploadPageData.isFileUploaded; data.fileSrcUrl = uploadPageData.fileSrcUrl; data.ajaxStatus = uploadPageData.ajaxStatus; return createAjaxResult(data); }
Source:
public List<Map<String, String>> query(String queryStr) { return null; }

Target:
public List<Map<String, String>> query(String queryStr) { return Collections.emptyList(); }
Source:
private HashMap<String, String> extractAndReadPluginXmlFromArtifact(PluginArtifact artifact) { FileInputStream fileInputStream = null; ZipInputStream zipInputStream; ZipEntry zipEntry; HashMap<String, String> pluginMap = null; try { fileInputStream = new FileInputStream(artifact.getFile().getCanonicalPath()); zipInputStream = new ZipInputStream(fileInputStream); while ((zipEntry = zipInputStream.getNextEntry()) != null) { if (zipEntry.getName().endsWith("META-INF/maven/plugin.xml")) { pluginMap = readPluginXmlFile(zipInputStream); break; } } } catch (IOException e) { logger.error("*** Error occurred while trying to extract plugin.xml from artifact {}", artifact.getArtifactId(), e); } return pluginMap; }

Target:
private HashMap<String, String> extractAndReadPluginXmlFromArtifact(PluginArtifact artifact) { FileInputStream fileInputStream = null; ZipInputStream zipInputStream; ZipEntry zipEntry; HashMap<String, String> pluginMap = null; try { fileInputStream = new FileInputStream(artifact.getFile().getCanonicalPath()); zipInputStream = new ZipInputStream(fileInputStream); while ((zipEntry = zipInputStream.getNextEntry()) != null) { if (zipEntry.getName().endsWith("META-INF/maven/plugin.xml")) { pluginMap = readPluginXmlFile(zipInputStream); break; } } } catch (IOException e) { logger.error("Error occurred while trying to extract plugin.xml from artifact {}", artifact.getArtifactId(), e); } return pluginMap; }
Source:
public void dumpStatistics(String operation, String inputReference, long durationUs) { if (mOutputTimer.size() == 0) { Log.e(TAG, "No output produced"); return; } long totalTimeTakenNs = getTotalTime(); long timeTakenPerSec = (totalTimeTakenNs * 1000000) / durationUs; long timeToFirstFrameNs = mOutputTimer.get(0) - mStartTimeNs; long size = getTotalSize(); long intervalNs; long minTimeTakenNs = Long.MAX_VALUE; long maxTimeTakenNs = 0; long prevIntervalNs = mStartTimeNs; for (int idx = 0; idx < mOutputTimer.size() - 1; idx++) { intervalNs = mOutputTimer.get(idx) - prevIntervalNs; prevIntervalNs = mOutputTimer.get(idx); if (minTimeTakenNs > intervalNs) minTimeTakenNs = intervalNs; else if (maxTimeTakenNs < intervalNs) maxTimeTakenNs = intervalNs; } Log.i(TAG, "Input Reference : " + inputReference); Log.i(TAG, "Setup Time in nano sec : " + mInitTimeNs); Log.i(TAG, "Average Time in nano sec : " + totalTimeTakenNs / mOutputTimer.size()); Log.i(TAG, "Time to first frame in nano sec : " + timeToFirstFrameNs); Log.i(TAG, "Time taken (in nano sec) to " + operation + " 1 sec of content : " + timeTakenPerSec); Log.i(TAG, "Total bytes " + operation + "ed : " + size); Log.i(TAG, "Minimum Time in nano sec : " + minTimeTakenNs); Log.i(TAG, "Maximum Time in nano sec : " + maxTimeTakenNs); Log.i(TAG, "Destroy Time in nano sec : " + mDeInitTimeNs); }

Target:
public void dumpStatistics(String operation, String inputReference, long durationUs) { if (mOutputTimer.size() == 0) { Log.e(TAG, "No output produced"); return; } long totalTimeTakenNs = getTotalTime(); long timeTakenPerSec = (totalTimeTakenNs * 1000000) / durationUs; long timeToFirstFrameNs = mOutputTimer.get(0) - mStartTimeNs; long size = getTotalSize(); long intervalNs; long minTimeTakenNs = Long.MAX_VALUE; long maxTimeTakenNs = 0; long prevIntervalNs = mStartTimeNs; for (int idx = 0; idx < mOutputTimer.size() - 1; idx++) { intervalNs = mOutputTimer.get(idx) - prevIntervalNs; prevIntervalNs = mOutputTimer.get(idx); if (minTimeTakenNs > intervalNs) { minTimeTakenNs = intervalNs; } else if (maxTimeTakenNs < intervalNs) { maxTimeTakenNs = intervalNs; } } Log.i(TAG, "Input Reference : " + inputReference); Log.i(TAG, "Setup Time in nano sec : " + mInitTimeNs); Log.i(TAG, "Average Time in nano sec : " + totalTimeTakenNs / mOutputTimer.size()); Log.i(TAG, "Time to first frame in nano sec : " + timeToFirstFrameNs); Log.i(TAG, "Time taken (in nano sec) to " + operation + " 1 sec of content : " + timeTakenPerSec); Log.i(TAG, "Total bytes " + operation + "ed : " + size); Log.i(TAG, "Number of bytes " + operation + "ed per second : " + (size * 1000000000) / totalTimeTakenNs); Log.i(TAG, "Minimum Time in nano sec : " + minTimeTakenNs); Log.i(TAG, "Maximum Time in nano sec : " + maxTimeTakenNs); Log.i(TAG, "Destroy Time in nano sec : " + mDeInitTimeNs); }
Source:
private Image getIncomingChangesImage(TaskReview reviewContainer) { if (reviewContainer.getIncoming()) { if (reviewContainer.getSyncState() == SynchronizationState.INCOMING) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); } else { if (reviewContainer.getSyncState() == SynchronizationState.INCOMING_NEW) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW); } } } return null; }

Target:
private Image getIncomingChangesImage(TaskReview reviewContainer) { if (reviewContainer.getSyncState() == SynchronizationState.INCOMING) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING); } else if (reviewContainer.getSyncState() == SynchronizationState.INCOMING_NEW) { return CommonImages.getImage(CommonImages.OVERLAY_SYNC_INCOMMING_NEW); } return CommonImages.getImage(CommonImages.OVERLAY_CLEAR); }
Source:
public boolean isFrozen() { return isFreeze; }

Target:
public boolean isFrozen() { return isFrozen; }
Source:
public List<? extends Host> getHosts(Collection<? extends StoragePool> pools) { Collection<Long> poolIds = new HashSet<>(); for (StoragePool p : pools) { poolIds.add(p.getId()); } return create() .select(HOST.fields()) .from(HOST) .join(STORAGE_POOL_HOST_MAP) .on(STORAGE_POOL_HOST_MAP.HOST_ID.eq(HOST.ID)) .where(STORAGE_POOL_HOST_MAP.REMOVED.isNull() .and(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID.in(poolIds))) .fetchInto(HostRecord.class); }

Target:
public List<? extends Host> getHosts(Collection<? extends StoragePool> pools) { if (pools == null || pools.isEmpty()) { return new ArrayList<>(); } Collection<Long> poolIds = new HashSet<>(); for (StoragePool p : pools) { poolIds.add(p.getId()); } return create() .select(HOST.fields()) .from(HOST) .join(STORAGE_POOL_HOST_MAP) .on(STORAGE_POOL_HOST_MAP.HOST_ID.eq(HOST.ID)) .where(STORAGE_POOL_HOST_MAP.REMOVED.isNull() .and(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID.in(poolIds))) .fetchInto(HostRecord.class); }
Source:
void synchronizeMailboxSynchronous(final Account account, final String folderName, final MessagingListener listener) { Timber.i("Synchronizing folder %s:%s", account.getDescription(), folderName); if (folderName.equals(account.getOutboxFolderName()) || folderName.equals(account.getErrorFolderName())) { for (MessagingListener l : getListeners(listener)) { l.synchronizeMailboxStarted(account, folderName); l.synchronizeMailboxFinished(account, folderName, 0, 0); } return; } String storeUri = account.getStoreUri(); if (ImapStore.isStoreUriImap(storeUri)) { ImapSyncInteractor syncInteractor = new ImapSyncInteractor(account, folderName, listener, this); syncInteractor.performSync(flagSyncHelper, messageDownloader, notificationController, syncHelper); } else { LegacySyncInteractor syncInteractor = new LegacySyncInteractor(account, folderName, listener, this); syncInteractor.performSync(messageDownloader, notificationController); } }

Target:
void synchronizeMailboxSynchronous(final Account account, final String folderName, final MessagingListener listener) { Timber.i("Synchronizing folder %s:%s", account.getDescription(), folderName); if (folderName.equals(account.getOutboxFolderName()) || folderName.equals(account.getErrorFolderName())) { for (MessagingListener l : getListeners(listener)) { l.synchronizeMailboxStarted(account, folderName); l.synchronizeMailboxFinished(account, folderName, 0, 0); } return; } String storeUri = account.getStoreUri(); if (ImapStore.isStoreUriImap(storeUri)) { ImapSyncInteractor syncInteractor = new ImapSyncInteractor(syncHelper, flagSyncHelper, this, messageDownloader, notificationController); syncInteractor.performSync(account, folderName, listener); } else { LegacySyncInteractor syncInteractor = new LegacySyncInteractor(this, messageDownloader, notificationController); syncInteractor.performSync(account, folderName, listener); } }
Source:
protected List<String> buildRunScriptCommand() { String touchCmd = String.format("touch %s; touch %s; touch %s; touch %s", stdoutPath, stderrPath, exitStatusPath, pidPath); String cmd = String.format("( %s > %s 2> %s < /dev/null ; echo $? > %s ) & disown", scriptPath, stdoutPath, stderrPath, exitStatusPath); MutableList.Builder<String> cmds = MutableList.<String>builder() .add((runAsRoot ? BashCommands.sudo(touchCmd) : touchCmd)) .add((runAsRoot ? BashCommands.sudo(cmd) : cmd)) .add("echo $! > "+pidPath) .add("RESULT=$?"); if (noExtraOutput==null || !noExtraOutput) { cmds.add("echo Executing async "+scriptPath); } cmds.add("exit $RESULT"); return cmds.build(); }

Target:
protected List<String> buildRunScriptCommand() { String touchCmd = String.format("touch %s %s %s %s", stdoutPath, stderrPath, exitStatusPath, pidPath); String cmd = String.format("( %s > %s 2> %s < /dev/null ; echo $? > %s ) & disown", scriptPath, stdoutPath, stderrPath, exitStatusPath); MutableList.Builder<String> cmds = MutableList.<String>builder() .add(runAsRoot ? BashCommands.sudo(touchCmd) : touchCmd) .add(runAsRoot ? BashCommands.sudo(cmd) : cmd) .add("echo $! > "+pidPath) .add("RESULT=$?"); if (noExtraOutput==null || !noExtraOutput) { cmds.add("echo Executing async "+scriptPath); } cmds.add("exit $RESULT"); return cmds.build(); }
Source:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); if (values.length == MEMBER_COUNT) { state.setCaretPosition(Integer.parseInt(values[3])); state.setCommitter(values[4]); state.setHeadCommit(ObjectId.fromString(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCaretPosition( CommitMessageComponentState.CARET_DEFAULT_POSITION); state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); } else { return null; } return state; }

Target:
public static CommitMessageComponentState loadState(Repository repository) { IDialogSettings dialogSettings = getDialogSettings(); String[] values = dialogSettings.getArray(repository.getDirectory() .getAbsolutePath()); if (values == null) { return null; } CommitMessageComponentState state = new CommitMessageComponentState(); state.setAmend(Boolean.parseBoolean(values[0])); state.setAuthor(values[1]); state.setCommitMessage(values[2]); if (values.length == MEMBER_COUNT) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); state.setCaretPosition(Integer.parseInt(values[5])); } else if (values.length == MEMBER_COUNT_WITHOUT_CARET_POSITION) { state.setCommitter(values[3]); state.setHeadCommit(ObjectId.fromString(values[4])); state.setCaretPosition( CommitMessageComponentState.CARET_DEFAULT_POSITION); } else { return null; } return state; }
Source:
public static void initAnalytics(Context context) { if (isAnalyticsActive() == false) { GoogleAnalytics.getInstance(context).setAppOptOut(true); } if (BuildConfig.DEBUG) { GoogleAnalytics.getInstance(context).setDryRun(true); } }

Target:
public static void initAnalytics(Context context) { if (!isAnalyticsActive()) { GoogleAnalytics.getInstance(context).setAppOptOut(true); } if (BuildConfig.DEBUG) { GoogleAnalytics.getInstance(context).setDryRun(true); } }
Source:
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes) { MultiSearchRequest request = new MultiSearchRequest(); Iterator<Class<?>> it = classes.iterator(); for (Query query : queries) { Class<?> clazz = it.next(); request.add(requestFactory.searchRequest(query, clazz, getIndexCoordinatesFor(clazz))); } MultiSearchResponse.Item[] items = getMultiSearchResult(request); List<SearchHits<?>> res = new ArrayList<>(queries.size()); int c = 0; Iterator<Class<?>> it1 = classes.iterator(); for (Query query : queries) { Class entityClass = it1.next(); SearchDocumentResponseCallback<SearchHits<?>> callback = new ReadSearchDocumentResponseCallback<>(entityClass, getIndexCoordinatesFor(entityClass)); SearchResponse response = items[c++].getResponse(); res.add(callback.doWith(SearchDocumentResponse.from(response))); } return res; }

Target:
public List<SearchHits<?>> multiSearch(List<? extends Query> queries, List<Class<?>> classes) { Assert.notNull(queries, "queries must not be null"); Assert.notNull(classes, "classes must not be null"); Assert.isTrue(queries.size() == classes.size(), "queries and classes must have the same size"); MultiSearchRequest request = new MultiSearchRequest(); Iterator<Class<?>> it = classes.iterator(); for (Query query : queries) { Class<?> clazz = it.next(); request.add(requestFactory.searchRequest(query, clazz, getIndexCoordinatesFor(clazz))); } MultiSearchResponse.Item[] items = getMultiSearchResult(request); List<SearchHits<?>> res = new ArrayList<>(queries.size()); int c = 0; Iterator<Class<?>> it1 = classes.iterator(); for (Query query : queries) { Class entityClass = it1.next(); SearchDocumentResponseCallback<SearchHits<?>> callback = new ReadSearchDocumentResponseCallback<>(entityClass, getIndexCoordinatesFor(entityClass)); SearchResponse response = items[c++].getResponse(); res.add(callback.doWith(SearchDocumentResponse.from(response))); } return res; }
Source:
public void testDateInterval_FormatDateRange() { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, 2013); calendar.set(Calendar.MONTH, Calendar.JANUARY); calendar.set(Calendar.DAY_OF_MONTH, 20); long timeInMillis = calendar.getTimeInMillis(); String actual = DateIntervalFormat.formatDateRange(ULocale.getDefault(), TimeZone.getDefault(), timeInMillis, timeInMillis, DateUtils.FORMAT_NUMERIC_DATE); DateFormat format = new SimpleDateFormat("MM/dd/yyyy", ULocale.getDefault()); Date date = null; try { date = format.parse(actual); } catch (ParseException e) { e.printStackTrace(); } assertNotNull(date); }

Target:
public void testDateInterval_FormatDateRange() throws ParseException { Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.YEAR, 2013); calendar.set(Calendar.MONTH, Calendar.JANUARY); calendar.set(Calendar.DAY_OF_MONTH, 20); long timeInMillis = calendar.getTimeInMillis(); String actual = DateIntervalFormat.formatDateRange(ULocale.getDefault(), TimeZone.getDefault(), timeInMillis, timeInMillis, DateUtils.FORMAT_NUMERIC_DATE); DateFormat format = new SimpleDateFormat("MM/dd/yyyy", ULocale.getDefault()); Date date = format.parse(actual); assertThat(date).isNotNull(); }
Source:
private static void verifyOutputNames( List<DimensionSpec> dimensions, List<AggregatorFactory> aggregators, List<PostAggregator> postAggregators ) { final Set<String> outputNames = Sets.newHashSet(); for (DimensionSpec dimension : dimensions) { if (!outputNames.add(dimension.getOutputName())) { throw new IAE("Duplicate output name[%s]", dimension.getOutputName()); } } for (AggregatorFactory aggregator : aggregators) { if (!outputNames.add(aggregator.getName())) { throw new IAE("Duplicate output name[%s]", aggregator.getName()); } } for (PostAggregator postAggregator : postAggregators) { if (!outputNames.add(postAggregator.getName())) { throw new IAE("Duplicate output name[%s]", postAggregator.getName()); } } if (outputNames.contains(Column.TIME_COLUMN_NAME)) { throw new IAE("'__time' cannot be used as an output name for dimensions, aggregators, or post-aggregators."); } }

Target:
private static void verifyOutputNames( List<DimensionSpec> dimensions, List<AggregatorFactory> aggregators, List<PostAggregator> postAggregators ) { final Set<String> outputNames = Sets.newHashSet(); for (DimensionSpec dimension : dimensions) { if (!outputNames.add(dimension.getOutputName())) { throw new IAE("Duplicate output name[%s]", dimension.getOutputName()); } } for (AggregatorFactory aggregator : aggregators) { if (!outputNames.add(aggregator.getName())) { throw new IAE("Duplicate output name[%s]", aggregator.getName()); } } for (PostAggregator postAggregator : postAggregators) { if (!outputNames.add(postAggregator.getName())) { throw new IAE("Duplicate output name[%s]", postAggregator.getName()); } } if (outputNames.contains(Column.TIME_COLUMN_NAME)) { throw new IAE( "'%s' cannot be used as an output name for dimensions, aggregators, or post-aggregators.", Column.TIME_COLUMN_NAME ); } }
Source:
public <X> ExtendedQueryResult<T> orderDesc(SingularAttribute<T, X> attribute, boolean appendEntityName) { lastPaginatedQuery = null; if (!context.getRepositoryMethod().isQuery()) { context.addCriteriaBuilderPostProcessor(new OrderByCriteriaBuilderPostProcessor(attribute, OrderDirection.DESC)); } else { context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC, appendEntityName)); } return this; }

Target:
public <X> ExtendedQueryResult<T> orderDesc(SingularAttribute<T, X> attribute, boolean appendEntityName) { lastPaginatedQuery = null; if (context.getRepositoryMethod().isQuery()) { context.addQueryStringPostProcessor(new OrderByQueryStringPostProcessor(attribute, OrderDirection.ASC, appendEntityName)); } else { context.addCriteriaBuilderPostProcessor(new OrderByCriteriaBuilderPostProcessor(attribute, OrderDirection.DESC)); } return this; }
Source:
public void deleteAllLinks() { this.args.forEach(OutputAnchor::removeConnections); this.res.removeConnections(); this.attachedBlocks.forEach(block -> block.moveIntoContainer(this.wrapper.getPane().getTopLevel())); }

Target:
public void deleteAllLinks() { this.args.forEach(OutputAnchor::removeConnections); this.res.removeConnections(); this.attachedBlocks.forEach(block -> block.moveIntoContainer(this.getParentContainer())); }
Source:
public View onCreateActionView() { View view = View.inflate(fragment.getHostActivity(), R.layout.group_find_in_page, null); findInPageNext = view.findViewById(R.id.find_in_page_next); findInPageNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { fragment.hideSoftKeyboard(); if (!pageFragmentValid()) { return; } funnel.addFindNext(); fragment.getWebView().findNext(true); } }); findInPagePrev = view.findViewById(R.id.find_in_page_prev); findInPagePrev.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { fragment.hideSoftKeyboard(); if (!pageFragmentValid()) { return; } funnel.addFindPrev(); fragment.getWebView().findNext(false); } }); findInPageMatch = (TextView) view.findViewById(R.id.find_in_page_match); SearchView searchView = (SearchView) view.findViewById(R.id.find_in_page_input); searchView.setQueryHint(fragment.getHostActivity().getString(R.string.menu_page_find_in_page)); searchView.setFocusable(true); searchView.requestFocusFromTouch(); searchView.setOnQueryTextListener(searchQueryListener); searchView.setOnCloseListener(searchCloseListener); searchView.setIconified(false); searchView.setMaxWidth(Integer.MAX_VALUE); searchView.setInputType(EditorInfo.TYPE_CLASS_TEXT); searchView.setSubmitButtonEnabled(false); View searchEditPlate = searchView .findViewById(android.support.v7.appcompat.R.id.search_plate); searchEditPlate.setBackgroundColor(Color.TRANSPARENT); return view; }

Target:
public View onCreateActionView() { View view = View.inflate(fragment.getContext(), R.layout.group_find_in_page, null); findInPageNext = view.findViewById(R.id.find_in_page_next); findInPageNext.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { DeviceUtil.hideSoftKeyboard(view); if (!pageFragmentValid()) { return; } funnel.addFindNext(); fragment.getWebView().findNext(true); } }); findInPagePrev = view.findViewById(R.id.find_in_page_prev); findInPagePrev.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { fragment.hideSoftKeyboard(); if (!pageFragmentValid()) { return; } funnel.addFindPrev(); fragment.getWebView().findNext(false); } }); findInPageMatch = (TextView) view.findViewById(R.id.find_in_page_match); SearchView searchView = (SearchView) view.findViewById(R.id.find_in_page_input); searchView.setQueryHint(fragment.getContext().getString(R.string.menu_page_find_in_page)); searchView.setFocusable(true); searchView.requestFocusFromTouch(); searchView.setOnQueryTextListener(searchQueryListener); searchView.setOnCloseListener(searchCloseListener); searchView.setIconified(false); searchView.setMaxWidth(Integer.MAX_VALUE); searchView.setInputType(EditorInfo.TYPE_CLASS_TEXT); searchView.setSubmitButtonEnabled(false); View searchEditPlate = searchView .findViewById(android.support.v7.appcompat.R.id.search_plate); searchEditPlate.setBackgroundColor(Color.TRANSPARENT); return view; }
Source:
public RepositorySearchDialog(Collection<String> existingDirs) { this(existingDirs, false, false); }

Target:
public RepositorySearchDialog(Collection<String> existingDirs) { this(existingDirs, false, true); }
Source:
private void assertThreadIsNotAlive(final Thread thread) throws Exception { thread.join(9_000L); TestUtils.await().atMost(1L, TimeUnit.SECONDS).until(() -> !thread.isAlive()); }

Target:
private void assertThreadIsNotAlive(final Thread thread) throws Exception { thread.join(9000L); TestUtils.await().atMost(1000L, TimeUnit.MILLISECONDS).until(() -> !thread.isAlive()); }
Source:
public ExtensionBootstrapper(final ServletContext context, final Configuration configuration) { this.configuration = configuration; this.context = context; this.context.setAttribute(ExtensionContext.class.getName(), ExtensionController.getInstance()); ExtensionController.getInstance().init(this.context); }

Target:
public ExtensionBootstrapper(final ServletContext context, final Configuration configuration) { this.configuration = configuration; this.context = context; ExtensionController.getInstance().init(this.context); }
Source:
private void doInterpreterActions() { SolutionTimeStep stp = solutionInterpreter.next( CompletionState.RUNNING ); for ( TimeStepAction action: stp.actions ) { if ( action instanceof SelectAction ) { actionTypeSwitch.caseSelectAction( (SelectAction)action ); } else if ( action instanceof PlaceTokenAction ) { actionTypeSwitch.casePlaceTokenAction( (PlaceTokenAction)action ); } } }

Target:
private void doInterpreterActions() { SolutionTimeStep stp = solutionInterpreter.next( CompletionState.RUNNING ); for ( TimeStepAction action: stp.actions ) { if ( action instanceof SelectAction ) { uiPlayback.selectToken( (SelectAction)action ); } else if ( action instanceof PlaceTokenAction ) { uiPlayback.placeToken( (PlaceTokenAction)action ); } } }
Source:
public void setup() throws HandlerRequestException { resourceManagerGateway = new TestingResourceManagerGateway(); MetricFetcher metricFetcher = new TestingMetricFetcher(); initializeMetricStore(metricFetcher.getMetricStore()); testInstance = new TaskManagerDetailsHandler( () -> CompletableFuture.completedFuture(null), TestingUtils.TIMEOUT(), Collections.emptyMap(), TaskManagerDetailsHeaders.getInstance(), () -> CompletableFuture.completedFuture(resourceManagerGateway), metricFetcher ); handlerRequest = createRequest(); }

Target:
public void setup() throws HandlerRequestException { resourceManagerGateway = new TestingResourceManagerGateway(); metricFetcher = new TestingMetricFetcher(); testInstance = new TaskManagerDetailsHandler( () -> CompletableFuture.completedFuture(null), TestingUtils.TIMEOUT(), Collections.emptyMap(), TaskManagerDetailsHeaders.getInstance(), () -> CompletableFuture.completedFuture(resourceManagerGateway), metricFetcher ); }
Source:
public void applyCodeChanges(JsdiffChange[] changes) { AceEditorNative editor = widget_.getEditor(); EditSession session = editor.getSession(); Selection selection = session.getSelection(); AceCommandManager commandManager = editor.getCommandManager(); Consumer<Integer> advanceSelection = (Integer charsLeft) -> { Position startPos = selection.getCursor(); int row; int col = startPos.getColumn(); for (row = startPos.getRow(); row < session.getLength(); row++) { String line = session.getLine(row); int charsLeftInLine = line.length() - col; if (charsLeft <= charsLeftInLine) { col = col + charsLeft; break; } else { charsLeft -= (charsLeftInLine+1); col = 0; } } selection.moveCursorTo(row, col, false); }; for (int i = 0; i<changes.length; i++) { JsdiffChange change = changes[i]; if (i == 0) selection.moveCursorTo(0, 0, false); if (change.added) { commandManager.exec("insertstring", editor, change.value); } else if (change.removed) { advanceSelection.accept(change.count); for (int ch = 0; ch<change.count; ch++) commandManager.exec("backspace", editor); } else if (i != (changes.length-1)) { advanceSelection.accept(change.count); } } }

Target:
public void applyCodeChanges(JsdiffChange[] changes) { AceEditorNative editor = widget_.getEditor(); EditSession session = editor.getSession(); Selection selection = session.getSelection(); AceCommandManager commandManager = editor.getCommandManager(); Consumer<Integer> advanceSelection = (Integer charsLeft) -> { Position startPos = selection.getCursor(); int row = startPos.getRow(); int col = startPos.getColumn(); while (row < session.getLength()) { String line = session.getLine(row); int charsLeftInLine = line.length() + 1 - col; if (charsLeft < charsLeftInLine) { col = col + charsLeft; break; } else { charsLeft -= charsLeftInLine; col = 0; row++; } } selection.moveCursorTo(row, col, false); }; if (changes.length > 0) selection.moveCursorTo(0, 0, false); for (int i = 0; i<changes.length; i++) { JsdiffChange change = changes[i]; if (change.added) { commandManager.exec("insertstring", editor, change.value); } else if (change.removed) { advanceSelection.accept(change.count); for (int ch = 0; ch<change.count; ch++) commandManager.exec("backspace", editor); } else if (i != (changes.length-1)) { advanceSelection.accept(change.count); } } }
Source:
public void onPostUploaded(OnPostUploaded event) { if (getLifecycle().getCurrentState().isAtLeast(STARTED)) { int siteLocalId = AppPrefs.getSelectedSite(); SiteModel site = mSiteStore.getSiteByLocalId(siteLocalId); if (site != null && event.post != null && event.post.getLocalSiteId() == site.getId()) { mUploadUtilsWrapper.onPostUploadedSnackbarHandler( this, findViewById(R.id.coordinator), event.isError(), event.post, null, site); } } }

Target:
public void onPostUploaded(OnPostUploaded event) { int siteLocalId = AppPrefs.getSelectedSite(); SiteModel site = mSiteStore.getSiteByLocalId(siteLocalId); if (site != null && event.post != null && event.post.getLocalSiteId() == site.getId()) { mUploadUtilsWrapper.onPostUploadedSnackbarHandler( this, findViewById(R.id.coordinator), event.isError(), event.post, null, site); } }
Source:
public Flux<ServiceInstance> getInstances(String serviceId) { String serviceIdToQuery = serviceIdToQuery(serviceId); return Mono.justOrEmpty(serviceIdToQuery) .flatMapMany(getInstancesFromZookeeper()) .subscribeOn(Schedulers.elastic()) .map(zkInstance -> toZookeeperServiceInstance(serviceIdToQuery, zkInstance)); }

Target:
public Flux<ServiceInstance> getInstances(String serviceId) { String serviceIdToQuery = serviceIdToQuery(serviceId); return Mono.justOrEmpty(serviceIdToQuery) .flatMapMany(getInstancesFromZookeeper()) .subscribeOn(Schedulers.boundedElastic()) .map(zkInstance -> toZookeeperServiceInstance(serviceIdToQuery, zkInstance)); }
Source:
private void buildProjectActions() { if (this.projectActions != null) { return; } this.projectActions = Collections.synchronizedList(new ArrayList<SloccountProjectAction>()); this.projectActions.add(new SloccountProjectAction(this.build.getParent(), this.numBuildsInGraph)); }

Target:
private void buildProjectActions() { if (projectActions != null) { return; } CopyOnWriteArrayList<SloccountProjectAction> actions = new CopyOnWriteArrayList<>(); actions.add(new SloccountProjectAction(build.getParent(), numBuildsInGraph)); projectActions = actions; }
Source:
public AzureAccountInfo jsonToAzureAccountInfo(Map<String, Object> jsonData) { String objectId = ObjectUtils.toString(jsonData.get("objectId")); String objectType = ObjectUtils.toString(jsonData.get("objectType")); String userPrincipalName = ObjectUtils.toString(jsonData.get("userPrincipalName")); String accountName = ObjectUtils.toString(jsonData.get("mailNickname")); if(objectType != null && objectType.equalsIgnoreCase("Group")) { accountName = ObjectUtils.toString(jsonData.get("displayName")); } String name = ObjectUtils.toString(jsonData.get("displayName")); if (StringUtils.isBlank(name)) { name = accountName; } return new AzureAccountInfo(objectId, accountName, null, userPrincipalName, name); }

Target:
public AzureAccountInfo jsonToAzureAccountInfo(Map<String, Object> jsonData) { String objectId = ObjectUtils.toString(jsonData.get("objectId")); String objectType = ObjectUtils.toString(jsonData.get("objectType")); String userPrincipalName = ObjectUtils.toString(jsonData.get("userPrincipalName")); String accountName = ObjectUtils.toString(jsonData.get("mailNickname")); if("Group".equalsIgnoreCase(objectType)) { accountName = ObjectUtils.toString(jsonData.get("displayName")); } String name = ObjectUtils.toString(jsonData.get("displayName")); if (StringUtils.isBlank(name)) { name = accountName; } return new AzureAccountInfo(objectId, accountName, null, userPrincipalName, name); }
Source:
public CloudInitHandler(VmInit vmInit) { this.vmInit = vmInit; metaData = new HashMap<>(); userData = new HashMap<>(); files = new HashMap<>(); nextFileIndex = 0; this.sourceProtocol = NetConfigSourceProtocol.OPENSTACK_METADATA; }

Target:
public CloudInitHandler(VmInit vmInit) { this(vmInit, NetConfigSourceProtocol.OPENSTACK_METADATA); }
Source:
@Override public int read(@NonNull byte[] b, int off, int len) throws IOException { checkNotNull(b, "b is null"); if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int count = len; if (!source.request(position + count)) { count = available(); } if (count == 0) return -1; int copied = copyTo(b, off, count); position += copied; if (position > markLimit) { mark = -1; } return copied; }

Target:
@Override public int read(@NonNull byte[] b, int off, int len) throws IOException { if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } else if (len == 0) { return 0; } int count = len; if (!source.request(position + count)) { count = available(); } if (count == 0) return -1; int copied = copyTo(b, off, count); position += copied; if (position > markLimit) { markPosition = -1; } return copied; }
Source:
Grid createRow(final HostInterface hostInterface) { Grid row = new Grid(1, 2); row.setHeight("100%"); row.setWidth("100%"); Style gridStyle = row.getElement().getStyle(); gridStyle.setBorderColor("white"); gridStyle.setBorderWidth(1, Unit.PX); gridStyle.setBorderStyle(BorderStyle.SOLID); row.getColumnFormatter().setWidth(0, "30px"); row.getColumnFormatter().setWidth(1, "210px"); row.setWidget(0, 0, new HorizontalPanel() { { if (isSelectionAvailable) { add(getCheckBox()); } add(new InterfaceStatusImage(hostInterface.getStatus())); } }); row.setWidget(0, 1, HostInterfaceForm.createInterfaceLabel(hostInterface.getInterface())); return row; }

Target:
Grid createRow(final HostInterface hostInterface) { Grid row = new Grid(1, 2); row.setHeight("100%"); row.setWidth("100%"); Style gridStyle = row.getElement().getStyle(); gridStyle.setBorderColor("white"); gridStyle.setBorderWidth(1, Unit.PX); gridStyle.setBorderStyle(BorderStyle.SOLID); row.getColumnFormatter().setWidth(0, "30px"); row.getColumnFormatter().setWidth(1, "210px"); row.setWidget(0, 0, new HorizontalPanel() { { if (isSelectionAvailable) { add(getCheckBox()); } add(new InterfaceStatusImage(hostInterface.getStatus())); } }); row.setWidget(0, 1, new InterfaceLabelWithToolTip(hostInterface.getInterface()).getLabel()); return row; }
Source:
public boolean isFinished() { try (YarnClient yarnClient = StramClientUtils.createYarnClient(conf)) { ApplicationReport appReport = yarnClient.getApplicationReport(appId); if (appReport != null) { if (appReport.getFinalApplicationStatus() == null || appReport.getFinalApplicationStatus() == FinalApplicationStatus.UNDEFINED) { return false; } } return true; } catch (YarnException | IOException e) { throw Throwables.propagate(e); } }

Target:
public boolean isFinished() { try { ApplicationReport appReport = yarnClient.getApplicationReport(appId); if (appReport != null) { if (appReport.getFinalApplicationStatus() == null || appReport.getFinalApplicationStatus() == FinalApplicationStatus.UNDEFINED) { return false; } } return true; } catch (YarnException | IOException e) { throw Throwables.propagate(e); } }
Source:
public Object visit(ASTConstructorDeclaration node, Object data) { int cyclo = (int) Metrics.get(OperationMetricKey.CYCLO, node); if (showMethodsComplexity && cyclo >= reportLevel) { addViolation(data, node, new String[] {"constructor", node.getQualifiedName().getOperation(), "" + cyclo}); } return data; }

Target:
public Object visit(ASTConstructorDeclaration node, Object data) { int cyclo = (int) Metrics.get(OperationMetricKey.CYCLO, node, cycloVersion); if (showMethodsComplexity && cyclo >= reportLevel) { addViolation(data, node, new String[] {"constructor", node.getQualifiedName().getOperation(), "" + cyclo}); } return data; }
Source:
public boolean hasAnyAcceptedCardType3dsRequired() { return cardTypes.stream() .filter(CardTypeEntity::isRequires3ds) .count() > 0; }

Target:
public boolean hasAnyAcceptedCardType3dsRequired() { return cardTypes.stream() .anyMatch(CardTypeEntity::isRequires3ds); }
Source:
public void setKSessions(final List<String> ksessions) { String[] names = ksessions.toArray(new String[ksessions.size()]); ksessionSelect.setup(ksessionSelectContainer, buildOptions(names), names[0], new Consumer<String>() { @Override public void accept(String s) { onSelectionChange(); } }); }

Target:
public void setKSessions(final List<String> ksessions) { String[] names = ksessions.toArray(new String[ksessions.size()]); ksessionSelect.setup(ksessionSelectContainer, buildOptions(names), names[0], s -> onSelectionChange()); }
Source:
public IVariable makeVariable(int valueNumber) { if (doPrimitives) { SymbolTable st = ir.getSymbolTable(); if (st.isConstant(valueNumber)) { if (st.isBooleanConstant(valueNumber)) { return new TypeVariable(language.getPrimitive(language.getConstantType(Boolean.TRUE))); } } } return new TypeVariable(TypeAbstraction.TOP); }

Target:
public IVariable makeVariable(int valueNumber) { SymbolTable st = ir.getSymbolTable(); if (doPrimitives) { if (st.isConstant(valueNumber)) { if (st.isBooleanConstant(valueNumber)) { return new TypeVariable(language.getPrimitive(language.getConstantType(Boolean.TRUE))); } } } return new TypeVariable(TypeAbstraction.TOP); }
Source:
public synchronized List<List<Object>> addOrUpdate(DBObject object, DBObject oldObject) { if (oldObject != null) { this.remove(oldObject); } DBObject key = getKeyFor(object); if (unique) { if (mapValues.containsKey(key)) { return extractFields(object, key.toMap().keySet()); } mapValues.put(key, Collections.singletonList(object)); } else { List<DBObject> values = mapValues.get(key); if (values == null) { values = new ArrayList<DBObject>(); mapValues.put(key, values); } values.add(object); } return Collections.emptyList(); }

Target:
public synchronized List<List<Object>> addOrUpdate(DBObject object, DBObject oldObject) { if (oldObject != null) { this.remove(oldObject); } DBObject key = getKeyFor(object); if (unique) { if (mapValues.containsKey(key)) { return extractFields(object, key.keySet()); } mapValues.put(key, Collections.singletonList(object)); } else { List<DBObject> values = mapValues.get(key); if (values == null) { values = new ArrayList<DBObject>(); mapValues.put(key, values); } values.add(object); } return Collections.emptyList(); }
Source:
private void checkDiff() { try { getConfigDao().getConfigDiff() .stream() .forEach(configDiff -> console.writeFormat("Option name: %s, Current value: %s, Default value: %s, version: %s\n", configDiff.getOptionName(), configDiff.getOptionValue(), configDiff.getDefaultValue(), configDiff.getVersion())); } catch (Exception e) { log.debug("Error details: ", e); } }

Target:
private void checkDiff() { try { console.writeFormat("%-40s | %-40s | %-40s | %s\n", "Option name", "Default value", "User value", "Version"); console.writeLine(String.format("%s", StringUtils.repeat("-", 136))); getConfigDao().getConfigDiff() .stream() .filter(configKey -> configKey.getKey() != null) .forEach(configDiff -> console.writeFormat("%-40s | %-40s | %-40s | %s\n", configDiff.getKey(), StringUtils.abbreviate(configDiff.getValue(), 40), StringUtils.abbreviate(configDiff.getDefaultValue(), 40), configDiff.getVersion())); } catch (Exception e) { log.error("Error details: ", e); } }
Source:
public void handleUnimprovedDaysSpentInputChange( ChangeEvent event ) { try { Long value = unimprovedDaysSpentInput.getValue().isEmpty() ? null : Long.parseLong( unimprovedDaysSpentInput.getValue() ); presenter.onUnimprovedDaysSpentChange( value ); } catch ( NumberFormatException e ) { } }

Target:
public void handleUnimprovedDaysSpentInputChange( ChangeEvent event ) { boolean isNumeric = unimprovedDaysSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onUnimprovedDaysSpentChange( Long.parseLong( unimprovedDaysSpentInput.getValue() ) ); } else { presenter.onUnimprovedDaysSpentChange( 0l ); unimprovedDaysSpentInput.setValue( "0" ); } }