auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Collection<CacheEntry<K, Collection<V>>> performOperationRehashAware( IntermediateCollector<Collection<CacheEntry<K, Collection<V>>>> response) { BaseStream<?, ?> stream = supplier.get().sequential(); List<CacheEntry<K, Collection<V>>> collectedValues = new ArrayList(batchSize); ByRef<List<V>> ref = new ByRef<>(new ArrayList<>()); Object[] currentKey = new Object[1]; stream = ((Stream<Map.Entry<K, ?>>) stream).peek(e -> { List<V> list = ref.get(); if (!list.isEmpty()) { collectedValues.add(new ImmortalCacheEntry((K)currentKey[0], list)); if (collectedValues.size() >= batchSize) { response.sendDataResonse(collectedValues); collectedValues.clear(); list.clear(); } else { ref.set(new ArrayList<V>(list.size())); } } currentKey[0] = e.getKey(); }); for (IntermediateOperation intermediateOperation : intermediateOperations) { stream = intermediateOperation.perform(stream); } Stream<V> convertedStream = ((Stream<V>)stream); convertedStream.forEach(v -> { ref.get().add(v); }); List<V> lastList = ref.get(); if (lastList != null && !lastList.isEmpty()) { collectedValues.add(new ImmortalCacheEntry(currentKey[0], lastList)); } return collectedValues; }

Target:
public Collection<CacheEntry<K, Collection<V>>> performOperationRehashAware( IntermediateCollector<Collection<CacheEntry<K, Collection<V>>>> response) { BaseStream<?, ?> stream = supplier.get().sequential(); List<CacheEntry<K, Collection<V>>> collectedValues = new ArrayList(batchSize); ByRef<List<V>> currentList = new ByRef<>(new ArrayList<>()); ByRef<K> currentKey = new ByRef<>(null); stream = ((Stream<Map.Entry<K, ?>>) stream).peek(e -> { List<V> list = currentList.get(); if (!list.isEmpty()) { collectedValues.add(new ImmortalCacheEntry(currentKey.get(), list)); if (collectedValues.size() >= batchSize) { response.sendDataResonse(collectedValues); collectedValues.clear(); list.clear(); } else { currentList.set(new ArrayList<V>(list.size())); } } currentKey.set(e.getKey()); }); for (IntermediateOperation intermediateOperation : intermediateOperations) { stream = intermediateOperation.perform(stream); } Stream<V> convertedStream = ((Stream<V>)stream); convertedStream.forEach(v -> { currentList.get().add(v); }); List<V> lastList = currentList.get(); if (lastList != null && !lastList.isEmpty()) { collectedValues.add(new ImmortalCacheEntry(currentKey.get(), lastList)); } return collectedValues; }
Source:
private String getClassName(String niceIndexName) throws StandardException { String cName = ""; if(niceIndexName!=null){ cName = "IndexScan["+niceIndexName+"]"; }else{ cName = "TableScan["+getPrettyTableName(); if(pastTxId >= 0){ cName += "timeTravelTx(" + pastTxId + ")"; } cName += "]"; } if(isMultiProbing()) cName = "MultiProbe"+cName; if (isDistinctScan()) cName = "Distinct" + cName; if (specialMaxScan) cName = "LastKey" + cName; return cName; }

Target:
private String getClassName(String niceIndexName) throws StandardException { String cName = ""; if(niceIndexName!=null){ cName = "IndexScan["+niceIndexName; }else{ cName = "TableScan["+getPrettyTableName(); if(pastTxId >= 0){ cName += " timeTravelTx(" + pastTxId + ")"; } cName += "]"; } if(isMultiProbing()) cName = "MultiProbe"+cName; if (isDistinctScan()) cName = "Distinct" + cName; if (specialMaxScan) cName = "LastKey" + cName; return cName; }
Source:
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, Supplier<String> messageSupplier) { return assertThrows(expectedType, executable, nullSafeGet(messageSupplier)); }

Target:
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, Supplier<String> messageSupplier) { try { executable.execute(); } catch (Throwable actualException) { if (expectedType.isInstance(actualException)) { return (T) actualException; } else { throw new AssertionFailedError(getFailureWithSuppliedMessage(expectedType, messageSupplier), actualException); } } throw new AssertionFailedError(getFailureWithSuppliedMessage(expectedType, messageSupplier)); }
Source:
FetchRequest(@NonNull Set<ObjectId> wantIds, int depth, @NonNull Set<ObjectId> clientShallowCommits, @NonNull FilterSpec filterSpec, @NonNull Set<String> clientCapabilities, int deepenSince, @NonNull List<String> deepenNotRefs, @Nullable String agent) { this.wantIds = requireNonNull(wantIds); this.depth = depth; this.clientShallowCommits = requireNonNull(clientShallowCommits); this.filterSpec = filterSpec; this.clientCapabilities = requireNonNull(clientCapabilities); this.deepenSince = deepenSince; this.deepenNotRefs = requireNonNull(deepenNotRefs); this.agent = agent; }

Target:
FetchRequest(@NonNull Set<ObjectId> wantIds, int depth, @NonNull Set<ObjectId> clientShallowCommits, @NonNull FilterSpec filterSpec, @NonNull Set<String> clientCapabilities, int deepenSince, @NonNull List<String> deepenNotRefs, @Nullable String agent) { this.wantIds = requireNonNull(wantIds); this.depth = depth; this.clientShallowCommits = requireNonNull(clientShallowCommits); this.filterSpec = requireNonNull(filterSpec); this.clientCapabilities = requireNonNull(clientCapabilities); this.deepenSince = deepenSince; this.deepenNotRefs = requireNonNull(deepenNotRefs); this.agent = agent; }
Source:
public synchronized void put(URL schemaUrl, String schema) { sSchemaCache.put(schemaUrl, schema); }

Target:
public synchronized void put(URL schemaUrl, String schema) { mSchemaCache.put(schemaUrl, schema); }
Source:
void unregisterCapability(UnregistrationParams params) { params.getUnregisterations().forEach(reg -> { if ("workspace/didChangeWorkspaceFolders".equals(reg.getMethod())) { supportWorkspaceFoldersCapability = false; } else if ("workspace/executeCommand".equals(reg.getMethod())) { String id = reg.getId(); synchronized (dynamicRegistrations) { Runnable unregistrator = dynamicRegistrations.get(id); if (unregistrator != null) { unregistrator.run(); dynamicRegistrations.remove(id); } } } }); }

Target:
void unregisterCapability(UnregistrationParams params) { params.getUnregisterations().forEach(reg -> { String id = reg.getId(); Runnable unregistrator; synchronized (dynamicRegistrations) { unregistrator = dynamicRegistrations.get(id); dynamicRegistrations.remove(id); } if (unregistrator != null) { unregistrator.run(); } }); }
Source:
protected void checkTagsInNodeEquals(NodeMetadata node, ImmutableSet<String> tags) { if (view.unwrapApi(EC2Api.class).getTagApi().isPresent()) { super.checkTagsInNodeEquals(node, tags); } else { assertTrue(node.getTags().isEmpty(), "not expecting tags when tag extension isn't present" + node); } }

Target:
protected void checkTagsInNodeEquals(NodeMetadata node, ImmutableSet<String> tags) { if (view.unwrapApi(EC2Api.class).getTagApi().isPresent()) { super.checkTagsInNodeEquals(node, tags); } else { assertTrue(node.getTags().isEmpty(), "not expecting tags when tag extension isn't present: " + node); } }
Source:
public static <T extends Document> T buildMockDocument(Class<T> documentClass) { PowerMockito.suppress(PowerMockito.constructor(LedgerPostingDocumentBase.class)); T document = null; try { document = PowerMockito.spy(documentClass.newInstance()); } catch (InstantiationException | IllegalAccessException e) { e.printStackTrace(); throw new RuntimeException(e); } performInitializationFromSkippedConstructor(document); return document; }

Target:
public static <T extends Document> T buildMockDocument(Class<T> documentClass) { PowerMockito.suppress(PowerMockito.constructor(LedgerPostingDocumentBase.class)); T document = null; try { document = PowerMockito.spy(documentClass.newInstance()); } catch (InstantiationException | IllegalAccessException e) { throw new RuntimeException(e); } performInitializationFromSkippedConstructor(document); return document; }
Source:
public static void loadPropertiesFile(){ try { fileProperty = readFileProperties(); if (fileProperty != null) { setFileProperty(fileProperty); } } catch (Exception e) { e.printStackTrace(); } }

Target:
public void loadPropertiesFile() throws SynapseCommonsException { Properties properties = MiscellaneousUtil.loadProperties(SYNAPSE_PROPERTY_FILE); String filePath = properties.getProperty(FILE_PROPERTY_PATH); String fileName = properties.getProperty(FILE_PROPERTY_FILENAME); if ( null == fileName || fileName.isEmpty()) { throw new SynapseCommonsException(FILE_PROPERTY_FILENAME + "is empty or null"); } if ( null == filePath || filePath.isEmpty()) { throw new SynapseCommonsException(FILE_PROPERTY_PATH + "is empty or null"); } if (("default").equals(filePath)) { filePath = System.getProperty(CONF_LOCATION); } File file = new File(filePath + File.separator + fileName); boolean isFileExists = file.exists(); if (isFileExists) { try (InputStream in = new FileInputStream(filePath + File.separator + fileName)) { Properties rawProps = new Properties(); propertyMap = new HashMap(); rawProps.load(in); for (Map.Entry<Object, Object> propertyEntry : rawProps.entrySet()) { String strValue = (String) propertyEntry.getValue(); propertyMap.put(propertyEntry.getKey(), strValue); } if (LOG.isDebugEnabled()) { LOG.debug("Loaded factory properties from " + fileName + ": " + propertyMap); } } catch (IOException ex) { throw new SynapseCommonsException("Failed to read " + fileName, ex); } } else { throw new SynapseCommonsException(fileName + " file cannot found in " + filePath); } }
Source:
private boolean hasImmutableIndexWithKeyValueColumns(TableRef tableRef) { if (!hasImmutableIndex(tableRef)) { return false; } for (PTable index : tableRef.getTable().getIndexes()) { for (PColumn column : index.getPKColumns()) { if (!IndexUtil.isDataPKColumn(column) && (index.getIndexType() != IndexType.LOCAL || !column.getName().toString().equals(MetaDataUtil.VIEW_INDEX_ID_COLUMN_NAME))) { return true; } } } return false; }

Target:
private boolean hasImmutableIndexWithKeyValueColumns(TableRef tableRef) { if (!hasImmutableIndex(tableRef)) { return false; } for (PTable index : tableRef.getTable().getIndexes()) { for (PColumn column : index.getPKColumns()) { if (!IndexUtil.isDataPKColumn(column)) { return true; } } } return false; }
Source:
public boolean isActive(ITimeGraphEntry element) { if (element instanceof ControlFlowEntry) { ControlFlowEntry cfe = (ControlFlowEntry) element; TmfTraceManager traceManager = TmfTraceManager.getInstance(); TmfTraceContext traceContext = traceManager.getCurrentTraceContext(); TmfTimeRange winRange = traceContext.getWindowRange(); TmfTimeRange selRange = traceContext.getSelectionRange(); long beginTS = selRange.getStartTime().getValue(); long endTS = selRange.getEndTime().getValue(); if (beginTS == endTS) { beginTS = winRange.getStartTime().getValue(); endTS = winRange.getEndTime().getValue(); } ITmfTrace trace = cfe.getTrace(); ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID); if (ssq != null) { try { int statusQuark = ssq.getQuarkRelative(cfe.getThreadQuark(), Attributes.STATUS); long ssqEndTS = ssq.getCurrentEndTime(); long ssqBeginTS = ssq.getStartTime(); if (beginTS < ssqBeginTS) { beginTS = ssqBeginTS; } if (endTS > ssqEndTS) { endTS = ssqEndTS; } ITmfStateInterval currentInterval = ssq.querySingleState(beginTS, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } long ts = currentInterval.getEndTime(); while (ts != -1 && ts < endTS) { ts++; currentInterval = ssq.querySingleState(ts, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } ts = currentInterval.getEndTime(); } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } } } return false; }

Target:
public boolean isActive(ITimeGraphEntry element) { if (element instanceof ControlFlowEntry) { ControlFlowEntry cfe = (ControlFlowEntry) element; TmfTraceManager traceManager = TmfTraceManager.getInstance(); TmfTraceContext traceContext = traceManager.getCurrentTraceContext(); TmfTimeRange winRange = traceContext.getWindowRange(); TmfTimeRange selRange = traceContext.getSelectionRange(); long beginTS = selRange.getStartTime().getValue(); long endTS = selRange.getEndTime().getValue(); if (beginTS == endTS) { beginTS = winRange.getStartTime().getValue(); endTS = winRange.getEndTime().getValue(); } ITmfTrace trace = cfe.getTrace(); ITmfStateSystem ssq = TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysis.ID); if (ssq != null) { beginTS = Math.max(beginTS, ssq.getStartTime()); endTS = Math.min(endTS, ssq.getCurrentEndTime()); if (beginTS > endTS) { return false; } try { int statusQuark = ssq.getQuarkRelative(cfe.getThreadQuark(), Attributes.STATUS); ITmfStateInterval currentInterval = ssq.querySingleState(beginTS, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } long ts = currentInterval.getEndTime(); while (ts != -1 && ts < endTS) { ts++; currentInterval = ssq.querySingleState(ts, statusQuark); if (isIntervalInStateActive(currentInterval)) { return true; } ts = currentInterval.getEndTime(); } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } } } return false; }
Source:
public BinaryContent transform(SourceResponse response, Map<String, Serializable> args) throws CatalogTransformerException { try { PrintWriter writer = printWriterProvider.build(Metacard.class); writer.setRawValue("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"); writer.startNode("metacards"); for (Map.Entry<String, String> nsRow : NAMESPACE_MAP.entrySet()) { writer.addAttribute(nsRow.getKey(), nsRow.getValue()); } if (response.getResults() != null && !response.getResults().isEmpty()) { StringWriter metacardContent = fjp.invoke( new MetacardForkTask( ImmutableList.copyOf(response.getResults()), geometryTransformer, threshold, metacardMarshaller)); writer.setRawValue(metacardContent.getBuffer().toString()); } writer.endNode(); ByteArrayInputStream bais = new ByteArrayInputStream(writer.makeString().getBytes(StandardCharsets.UTF_8)); return new BinaryContentImpl(bais, mimeType); } catch (Exception e) { LOGGER.info("Failed Query response transformation", e); throw new CatalogTransformerException("Failed Query response transformation"); } }

Target:
public BinaryContent transform(SourceResponse response, Map<String, Serializable> args) throws CatalogTransformerException { try { PrintWriter writer = printWriterProvider.build(Metacard.class); writer.setRawValue("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n"); writer.startNode("metacards"); for (Map.Entry<String, String> nsRow : NAMESPACE_MAP.entrySet()) { writer.addAttribute(nsRow.getKey(), nsRow.getValue()); } if (response.getResults() != null && !response.getResults().isEmpty()) { StringWriter metacardContent = fjp.invoke( new MetacardForkTask( ImmutableList.copyOf(response.getResults()), fjp, geometryTransformer, threshold, metacardMarshaller)); writer.setRawValue(metacardContent.getBuffer().toString()); } writer.endNode(); ByteArrayInputStream bais = new ByteArrayInputStream(writer.makeString().getBytes(StandardCharsets.UTF_8)); return new BinaryContentImpl(bais, mimeType); } catch (Exception e) { LOGGER.info("Failed Query response transformation", e); throw new CatalogTransformerException("Failed Query response transformation"); } }
Source:
EventHubAsyncClient(ConnectionOptions connectionOptions, ReactorProvider provider, ReactorHandlerProvider handlerProvider, TracerProvider tracerProvider) { Objects.requireNonNull(connectionOptions); Objects.requireNonNull(provider); Objects.requireNonNull(handlerProvider); this.connectionOptions = connectionOptions; this.tracerProvider = tracerProvider; this.eventHubName = connectionOptions.eventHubName(); this.connectionId = StringUtil.getRandomString("MF"); this.connectionMono = Mono.fromCallable(() -> { return (EventHubConnection) new ReactorConnection(connectionId, connectionOptions, provider, handlerProvider, new ResponseMapper()); }).doOnSubscribe(c -> hasConnection.set(true)) .cache(); this.defaultProducerOptions = new EventHubProducerOptions() .retry(connectionOptions.retry()); this.defaultConsumerOptions = new EventHubConsumerOptions() .retry(connectionOptions.retry()) .scheduler(connectionOptions.scheduler()); }

Target:
EventHubAsyncClient(ConnectionOptions connectionOptions, ReactorProvider provider, ReactorHandlerProvider handlerProvider, TracerProvider tracerProvider) { Objects.requireNonNull(connectionOptions, "'connectionOptions' cannot be null."); Objects.requireNonNull(provider, "'provider' cannot be null."); Objects.requireNonNull(handlerProvider, "'handlerProvider' cannot be null."); Objects.requireNonNull(tracerProvider, "'tracerProvider' cannot be null."); this.connectionOptions = connectionOptions; this.tracerProvider = tracerProvider; this.eventHubName = connectionOptions.eventHubName(); this.connectionId = StringUtil.getRandomString("MF"); this.connectionMono = Mono.fromCallable(() -> { return (EventHubConnection) new ReactorConnection(connectionId, connectionOptions, provider, handlerProvider, new ResponseMapper()); }).doOnSubscribe(c -> hasConnection.set(true)) .cache(); this.defaultProducerOptions = new EventHubProducerOptions() .retry(connectionOptions.retry()); this.defaultConsumerOptions = new EventHubConsumerOptions() .retry(connectionOptions.retry()) .scheduler(connectionOptions.scheduler()); }
Source:
public TextAnalyticsClientBuilder credential(TokenCredential tokenCredential) { Objects.requireNonNull(tokenCredential); this.tokenCredential = tokenCredential; this.subscriptionKey = null; return this; }

Target:
public TextAnalyticsClientBuilder credential(TokenCredential tokenCredential) { Objects.requireNonNull(tokenCredential, "'tokenCredential' cannot be null."); this.tokenCredential = tokenCredential; return this; }
Source:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.size() == 0) { return ""; } StringBuilder csv = new StringBuilder(100); StringBuilder fragments = new StringBuilder(); Map<String, Integer> answerFrequency = new LinkedHashMap<String, Integer>(); for (String option : mcqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } for (FeedbackResponseAttributes response : responses) { String answerString = response.getResponseDetails().getAnswerString(); Boolean isOtherOptionAnswer = ((FeedbackMcqResponseDetails) (response.getResponseDetails())).isOtherOptionAnswer(); if (isOtherOptionAnswer) { if (!answerFrequency.containsKey("Other")) { answerFrequency.put("Other", 1); } else { answerFrequency.put("Other", answerFrequency.get("Other") + 1); } } else { if (!answerFrequency.containsKey(answerString)) { answerFrequency.put(answerString, 1); } else { answerFrequency.put(answerString, answerFrequency.get(answerString) + 1); } } } DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, Integer> entry : answerFrequency.entrySet()) { fragments.append(Sanitizer.sanitizeForCsv(entry.getKey())).append(',') .append(entry.getValue().toString()).append(',') .append(df.format(100 * (double) entry.getValue() / responses.size())).append(Const.EOL); } csv.append("Choice, Response Count, Percentage").append(Const.EOL) .append(fragments.toString()); return csv.toString(); }

Target:
public String getQuestionResultStatisticsCsv( List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question, FeedbackSessionResultsBundle bundle) { if (responses.isEmpty()) { return ""; } StringBuilder fragments = new StringBuilder(); Map<String, Integer> answerFrequency = new LinkedHashMap<String, Integer>(); for (String option : mcqChoices) { answerFrequency.put(option, 0); } if (otherEnabled) { answerFrequency.put("Other", 0); } for (FeedbackResponseAttributes response : responses) { String answerString = response.getResponseDetails().getAnswerString(); Boolean isOtherOptionAnswer = ((FeedbackMcqResponseDetails) (response.getResponseDetails())).isOtherOptionAnswer(); if (isOtherOptionAnswer) { if (!answerFrequency.containsKey("Other")) { answerFrequency.put("Other", 0); } answerFrequency.put("Other", answerFrequency.get("Other") + 1); } else { if (!answerFrequency.containsKey(answerString)) { answerFrequency.put(answerString, 0); } answerFrequency.put(answerString, answerFrequency.get(answerString) + 1); } } DecimalFormat df = new DecimalFormat("#.##"); for (Entry<String, Integer> entry : answerFrequency.entrySet()) { fragments.append(Sanitizer.sanitizeForCsv(entry.getKey())).append(',') .append(entry.getValue().toString()).append(',') .append(df.format(100 * (double) entry.getValue() / responses.size())).append(Const.EOL); } return "Choice, Response Count, Percentage" + Const.EOL + fragments.toString(); }
Source:
public Set<ContainerModel> group(Set<TaskModel> tasks) { validateTasks(tasks); List<TaskModel> sortedTasks = new ArrayList<>(tasks); Collections.sort(sortedTasks); Map<TaskName, TaskModel>[] taskGroups = new Map[containerCount]; for (int i = 0; i < containerCount; i++) { taskGroups[i] = new HashMap<>(); } for (int i = 0; i < sortedTasks.size(); i++) { TaskModel tm = sortedTasks.get(i); taskGroups[i % containerCount].put(tm.getTaskName(), tm); } Set<ContainerModel> containerModels = new HashSet<>(); for (int i = 0; i < containerCount; i++) { containerModels.add(new ContainerModel(String.valueOf(i), taskGroups[i])); } return Collections.unmodifiableSet(containerModels); }

Target:
public Set<ContainerModel> group(Set<TaskModel> tasks) { validateTasks(tasks); List<TaskModel> sortedTasks = new ArrayList<>(tasks); Collections.sort(sortedTasks); Map<TaskName, TaskModel>[] taskGroups = new Map[containerCount]; for (int i = 0; i < containerCount; i++) { taskGroups[i] = new HashMap<>(); } for (int i = 0; i < sortedTasks.size(); i++) { TaskModel tm = sortedTasks.get(i); taskGroups[i % containerCount].put(tm.getTaskName(), tm); } Set<ContainerModel> containerModels = new HashSet<>(); for (int i = 0; i < containerCount; i++) { containerModels.add(new ContainerModel(String.valueOf(i), i, taskGroups[i])); } return Collections.unmodifiableSet(containerModels); }
Source:
public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); fileActions = new FileActions(this); dbxFileAction = new DbxFileActions(this); displayCloudStatus(); }

Target:
public EditorTopComponent() { initComponents(); setName(Bundle.CTL_EditorTopComponent()); setDisplayName("welcome.tex"); setToolTipText(Bundle.HINT_EditorTopComponent()); putClientProperty(TopComponent.PROP_CLOSING_DISABLED, Boolean.TRUE); putClientProperty(TopComponent.PROP_UNDOCKING_DISABLED, Boolean.TRUE); displayCloudStatus(); }
Source:
public void buildCatalog(IScopeContext context) { IConfigurationElement[] allContentTypeCEs = getConfigurationElements(); for (int i = 0; i < allContentTypeCEs.length; i++) if (allContentTypeCEs[i].getName().equals("content-type")) registerContentType(allContentTypeCEs[i]); for (String id : context.getNode(ContentType.PREF_USER_DEFINED) .get(ContentType.PREF_USER_DEFINED, ContentType.EMPTY_STRING) .split(ContentType.PREF_USER_DEFINED__SEPARATOR)) { IEclipsePreferences node = context.getNode(id); catalog.addContentType(ContentType.createContentType(catalog, id, node.get(ContentType.PREF_USER_DEFINED__NAME, ContentType.EMPTY_STRING), (byte) 0, new String[0], new String[0], node.get(ContentType.PREF_USER_DEFINED__BASE_TYPE_ID, null), null, Collections.emptyMap(), null)); } for (int i = 0; i < allContentTypeCEs.length; i++) if (allContentTypeCEs[i].getName().equals("file-association")) registerFileAssociation(allContentTypeCEs[i]); applyPreferences(); }

Target:
public void buildCatalog(IScopeContext context) { IConfigurationElement[] allContentTypeCEs = getConfigurationElements(); for (int i = 0; i < allContentTypeCEs.length; i++) if (allContentTypeCEs[i].getName().equals("content-type")) registerContentType(allContentTypeCEs[i]); for (String id : ContentTypeManager.getUserDefinedContentTypeIds(context)) { IEclipsePreferences node = context.getNode(id); catalog.addContentType(ContentType.createContentType(catalog, id, node.get(ContentType.PREF_USER_DEFINED__NAME, ContentType.EMPTY_STRING), (byte) 0, new String[0], new String[0], node.get(ContentType.PREF_USER_DEFINED__BASE_TYPE_ID, null), null, Collections.emptyMap(), null)); } for (int i = 0; i < allContentTypeCEs.length; i++) if (allContentTypeCEs[i].getName().equals("file-association")) registerFileAssociation(allContentTypeCEs[i]); applyPreferences(); }
Source:
public RulePhase getPhase() { if (isNullOrEmpty(getExecuteAfter()) && isNullOrEmpty(getExecuteAfterIDs()) && isNullOrEmpty(getExecuteBefore()) && isNullOrEmpty(getExecuteBeforeIDs())) { return RulePhase.MIGRATION_RULES; } return RulePhase.IMPLICIT; }

Target:
public RulePhase getPhase() { return RulePhase.MIGRATION_RULES; }
Source:
public void run( Value inlineValue ) { if ( expression instanceof VariablePath ) { Object myObj = (((VariablePath) expression).getValueOrValueVector()); if ( myObj instanceof Value ) { path.getValue(inlineValue).deepCopyWithLinks((Value) myObj); } if ( myObj instanceof ValueVector ) { path.getValueVector(inlineValue).deepCopyWithLinks((ValueVector) myObj); } } else { path.getValue(inlineValue).deepCopyWithLinks(expression.evaluate()); } }

Target:
public void run( Value inlineValue ) { if ( expression instanceof VariablePath ) { Object myObj = ((VariablePath) expression).getValueOrValueVector(); if ( myObj instanceof Value ) { path.getValue(inlineValue).deepCopyWithLinks((Value) myObj); } else if ( myObj instanceof ValueVector ) { path.getValueVector(inlineValue).deepCopyWithLinks((ValueVector) myObj); } else { throw new RuntimeException( "incomplete case analysis" ); } } else { path.getValue(inlineValue).deepCopyWithLinks(expression.evaluate()); } }
Source:
public void testAsyncGetFromReaders() throws IOException, ExecutionException, InterruptedException { Slice zero = ManagedStateTestUtils.getSliceFor("0"); long time = System.currentTimeMillis(); DefaultBucket.setDisableBloomFilterByDefault(true); testMeta.managedState.setup(testMeta.operatorContext); Map<Slice, Bucket.BucketedValue> unsavedBucket0 = ManagedStateTestUtils.getTestBucketData(0, time); testMeta.managedState.bucketsFileSystem.writeBucketData(time, 0, unsavedBucket0); ManagedStateTestUtils.validateBucketOnFileSystem(testMeta.managedState.getFileAccess(), 0, unsavedBucket0, 1); Future<Slice> valFuture = testMeta.managedState.getAsync(0, zero); Assert.assertEquals("value of zero", zero, valFuture.get()); testMeta.managedState.teardown(); }

Target:
public void testAsyncGetFromReaders() throws IOException, ExecutionException, InterruptedException { Slice zero = ManagedStateTestUtils.getSliceFor("0"); long time = System.currentTimeMillis(); DefaultBucket.setDisableBloomFilterByDefault(true); testMeta.managedState.setup(testMeta.operatorContext); Map<Slice, Bucket.BucketedValue> unsavedBucket0 = ManagedStateTestUtils.getTestBucketData(0, time); testMeta.managedState.bucketsFileSystem.writeBucketData(time, 0, unsavedBucket0, -1); ManagedStateTestUtils.validateBucketOnFileSystem(testMeta.managedState.getFileAccess(), 0, unsavedBucket0, 1); Future<Slice> valFuture = testMeta.managedState.getAsync(0, zero); Assert.assertEquals("value of zero", zero, valFuture.get()); testMeta.managedState.teardown(); }
Source:
public MobileEditPreviewPageObject clickPreview() { try { wait(500); } catch (InterruptedException e) { e.printStackTrace(); } WebElement editPreviewButton = waitForElementByCss(editPreviewButtonString); waitForElementClickableByElement(editPreviewButton); jQueryClick(editPreviewButton); return new MobileEditPreviewPageObject(driver); }

Target:
public MobileEditPreviewPageObject clickPreview() { waitForElementByElement(editPreviewButton); waitForElementClickableByElement(editPreviewButton); jQueryClick(editPreviewButton); return new MobileEditPreviewPageObject(driver); }
Source:
private void initViews() { previousButton = (Button) findViewById(R.id.button_previous); nextButton = (Button) findViewById(R.id.button_next); wordTextView = (TextView) findViewById(R.id.word_textview); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (currentIndex > 0) { currentIndex--; } loadWordAndShow(serverIDs[currentIndex]); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { if (currentIndex < serverIDs.length - 1) { currentIndex++; } loadWordAndShow(serverIDs[currentIndex]); } }); }

Target:
private void initViews() { previousButton = (Button) findViewById(R.id.button_previous); nextButton = (Button) findViewById(R.id.button_next); wordTextView = (TextView) findViewById(R.id.textview_word); indexTextView = (TextView) findViewById(R.id.textview_index); updateButtonsEnable(); updateIndexTextView(); previousButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[--currentIndex]); updateButtonsEnable(); updateIndexTextView(); } }); nextButton.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { loadWordAndShow(serverIDs[++currentIndex]); updateButtonsEnable(); updateIndexTextView(); } }); }
Source:
public boolean isAvailable() { return ModUtil.isModLoaded(Constants.BCLIB_MOD_ID); }

Target:
public boolean isAvailable() { return ModUtil.isModLoaded(Constants.BCLIB_MOD_ID, "[7.99.17,8.0)"); }
Source:
public static LogEntryComposite parseFoldTree(List<LogEntryComponent> logEntryComponents) { LogEntryComposite root = new LogEntryComposite(null); Stack<LogEntryComposite> foldStack = new Stack<>(); foldStack.push(root); for (LogEntryComponent logEntryComponent : logEntryComponents) { if (logEntryComponent instanceof TravisCommandLeaf) { TravisCommandLeaf command = (TravisCommandLeaf) logEntryComponent; if (command.getCommand().equals(TRAVIS_FOLD)) { if (command.getType().equals(START)) { LogEntryComposite logEntryComposite = new LogEntryComposite(command.getName()); foldStack.peek().append(logEntryComposite); foldStack.push(logEntryComposite); } else if (command.getType().equals(END)) { foldStack.pop(); } } } else { foldStack.peek().append(logEntryComponent); } } return root; }

Target:
public static LogEntryComposite parseFoldTree(List<LogEntryComponent> logEntryComponents) { LogEntryComposite root = new LogEntryComposite(null); Stack<LogEntryComposite> foldStack = new Stack<>(); foldStack.push(root); for (LogEntryComponent logEntryComponent : logEntryComponents) { if (logEntryComponent instanceof TravisCommandLeaf) { handleTravisCommand(foldStack, (TravisCommandLeaf) logEntryComponent); } else { foldStack.peek().append(logEntryComponent); } } return root; }
Source:
public void run() { try { for (AsyncTaskWorker taskWorker : taskWorkers) { taskWorker.init(); } long prevNs = clock.nanoTime(); while (!shutdownNow) { if (throwable != null) { log.error("Caught throwable and stopping run loop", throwable); throw new SamzaException(throwable); } long startNs = clock.nanoTime(); IncomingMessageEnvelope envelope = chooseEnvelope(); long chooseNs = clock.nanoTime(); containerMetrics.chooseNs().update(chooseNs - startNs); runTasks(envelope); long blockNs = clock.nanoTime(); blockIfBusy(); long currentNs = clock.nanoTime(); long activeNs = blockNs - chooseNs; long totalNs = currentNs - prevNs; prevNs = currentNs; containerMetrics.blockNs().update(currentNs - blockNs); if (totalNs != 0) { containerMetrics.utilization().set(((double) activeNs) / totalNs); } } } finally { workerTimer.shutdown(); callbackExecutor.shutdown(); if (callbackTimer != null) callbackTimer.shutdown(); } }

Target:
public void run() { try { for (AsyncTaskWorker taskWorker : taskWorkers) { taskWorker.init(); } long prevNs = clock.nanoTime(); while (!shutdownNow) { if (throwable != null) { log.error("Caught throwable and stopping run loop", throwable); throw new SamzaException(throwable); } long startNs = clock.nanoTime(); IncomingMessageEnvelope envelope = chooseEnvelope(); long chooseNs = clock.nanoTime(); containerMetrics.chooseNs().update(chooseNs - startNs); runTasks(envelope); long blockNs = clock.nanoTime(); blockIfBusy(envelope); long currentNs = clock.nanoTime(); long activeNs = blockNs - chooseNs; long totalNs = currentNs - prevNs; prevNs = currentNs; containerMetrics.blockNs().update(currentNs - blockNs); if (totalNs != 0) { containerMetrics.utilization().set(((double) activeNs) / totalNs); } } } finally { workerTimer.shutdown(); callbackExecutor.shutdown(); if (callbackTimer != null) callbackTimer.shutdown(); } }
Source:
public void trackAction(ActionDescription actionDescription) { if (SESSION_START != actionDescription.getCategory() && SESSION_STOP != actionDescription.getCategory()) { return; } StringBuilder jsonBuilder = new StringBuilder("{") .append("\"action\":\"").append(actionDescription.getCategory()).append("\",") .append("\"productVersion\":\"").append(getSoapUIVersion()).append("\",") .append("\"installId\":\"").append(getInstallId()).append("\",") .append("\n") .append("\"environment\": {") .append("\"osName\":\"").append(getOsName()).append("\",") .append("\"osVersion\":\"").append(getOsVersion()).append("\",") .append("\"userCountry\":\"").append(getUserCountry()).append("\",") .append("\"javaVersion\":\"").append(getJavaVersion()).append("\",") .append("\"screenSize\":\"").append(getStrScreenSize()).append("\",") .append("\"language\":\"").append(getUserLanguage()).append("\"") .append("},"); switch (actionDescription.getCategory()) { case SESSION_START: sessionStartTime = new Date(); sessionId = UUID.randomUUID().toString(); break; case SESSION_STOP: jsonBuilder.append("\"endTime\": ").append(new Date()); break; } jsonBuilder.append("\"sessionId\":\"").append(sessionId).append("\",") .append("\"startTime\":\"").append(sessionStartTime).append("\"") .append("}"); String jsonString = jsonBuilder.toString(); System.out.println(jsonString); sendRecord(SESSION_URL, jsonString); }

Target:
public void trackAction(ActionDescription actionDescription) { if (SESSION_START != actionDescription.getCategory() && SESSION_STOP != actionDescription.getCategory()) { return; } StringBuilder jsonBuilder = new StringBuilder("{") .append("\"action\":\"").append(actionDescription.getCategory()).append("\",") .append("\"productVersion\":\"").append(getSoapUIVersion()).append("\",") .append("\"installId\":\"").append(getInstallId()).append("\",") .append("\n") .append("\"environment\": {") .append("\"osName\":\"").append(getOsName()).append("\",") .append("\"osVersion\":\"").append(getOsVersion()).append("\",") .append("\"userCountry\":\"").append(getUserCountry()).append("\",") .append("\"javaVersion\":\"").append(getJavaVersion()).append("\",") .append("\"screenSize\":\"").append(getStrScreenSize()).append("\",") .append("\"language\":\"").append(getUserLanguage()).append("\"") .append("},"); switch (actionDescription.getCategory()) { case SESSION_START: sessionStartTime = new Date(); sessionId = UUID.randomUUID().toString(); break; case SESSION_STOP: jsonBuilder.append("\"endTime\": ").append(new Date()); break; } jsonBuilder.append("\"sessionId\":\"").append(sessionId).append("\",") .append("\"startTime\":\"").append(sessionStartTime).append("\"") .append("}"); String jsonString = jsonBuilder.toString(); sendRecord(SESSION_URL, jsonString); }
Source:
private void deleteBranches(final Set<Branch.NameKey> branchIds) { Util.PROJECT_SVC.deleteBranch(getProjectKey(), branchIds, new GerritCallback<Set<Branch.NameKey>>() { public void onSuccess(final Set<Branch.NameKey> deleted) { if (!deleted.isEmpty()) { for (int row = 1; row < table.getRowCount();) { final Branch k = getRowItem(row); if (k != null && deleted.contains(k.getNameKey())) { table.removeRow(row); } else { row++; } } } branchIds.removeAll(deleted); if (!branchIds.isEmpty()) { final SafeHtmlBuilder b = new SafeHtmlBuilder(); b.append(Util.C.branchDeletionOpenChanges()); b.br(); appendBranchOpenChangesLinks(b, branchIds); new ErrorDialog(b.toSafeHtml()).center(); } } private void appendBranchOpenChangesLinks(final SafeHtmlBuilder b, final Set<Branch.NameKey> branches) { b.openElement("p"); for (final Branch.NameKey branch : branches) { b.openAnchor(); final BranchLink link = new BranchLink(branch.getParentKey(), Change.Status.NEW, branch.get(), null); b.setAttribute("href", "/#" + link.getTargetHistoryToken()); b.setAttribute("target", "_blank"); b.append(branch.get()); b.closeAnchor(); b.br(); } b.closeElement("p"); } }); }

Target:
private void deleteBranches(final Set<Branch.NameKey> branchIds) { Util.PROJECT_SVC.deleteBranch(getProjectKey(), branchIds, new GerritCallback<Set<Branch.NameKey>>() { public void onSuccess(final Set<Branch.NameKey> deleted) { if (!deleted.isEmpty()) { for (int row = 1; row < table.getRowCount();) { final Branch k = getRowItem(row); if (k != null && deleted.contains(k.getNameKey())) { table.removeRow(row); } else { row++; } } } branchIds.removeAll(deleted); if (!branchIds.isEmpty()) { final VerticalPanel p = new VerticalPanel(); final ErrorDialog errorDialog = new ErrorDialog(p); final Label l = new Label(Util.C.branchDeletionOpenChanges()); l.setStyleName(Gerrit.RESOURCES.css().errorDialogText()); p.add(l); for (final Branch.NameKey branch : branchIds) { final BranchLink link = new BranchLink(branch.getParentKey(), Change.Status.NEW, branch.get(), null) { @Override public void go() { errorDialog.hide(); super.go(); }; }; p.add(link); } errorDialog.center(); } } }); }
Source:
private void impl$reAssignValuesFromIncomingInfo(final WorldInfo info, final CallbackInfo ci) { final WorldProperties properties = (WorldProperties) info; if (((WorldInfoBridge) info).bridge$isValid()) { this.dimensionType = (SpongeDimensionType) properties.getDimensionType(); this.dimensionType = (SpongeDimensionType) properties.getDimensionType(); this.difficulty = properties.getDifficulty(); this.serializationBehavior = properties.getSerializationBehavior(); this.isEnabled = properties.isEnabled(); this.loadOnStartup = properties.doesLoadOnStartup(); this.keepSpawnLoaded = properties.doesKeepSpawnLoaded(); this.generateSpawnOnLoad = properties.doesGenerateSpawnOnLoad(); this.pvpEnabled = properties.isPVPEnabled(); this.bonusChestEnabled = properties.doesGenerateBonusChest(); this.generatorSettings = properties.getGeneratorSettings(); } }

Target:
private void impl$reAssignValuesFromIncomingInfo(final WorldInfo info, final CallbackInfo ci) { final WorldProperties properties = (WorldProperties) info; if (!((WorldInfoBridge) info).bridge$isValid()) { return; } this.impl$logicType = (SpongeDimensionType) properties.getDimensionType(); this.impl$difficulty = properties.getDifficulty(); this.impl$serializationBehavior = properties.getSerializationBehavior(); this.impl$isEnabled = properties.isEnabled(); this.impl$loadOnStartup = properties.doesLoadOnStartup(); this.impl$keepSpawnLoaded = properties.doesKeepSpawnLoaded(); this.impl$generateSpawnOnLoad = properties.doesGenerateSpawnOnLoad(); this.impl$pvpEnabled = properties.isPVPEnabled(); this.bonusChestEnabled = properties.doesGenerateBonusChest(); this.impl$generatorSettings = properties.getGeneratorSettings(); }
Source:
protected void configure() { bind(ProjectsCollection.class); bind(DashboardsCollection.class); DynamicMap.mapOf(binder(), PROJECT_KIND); DynamicMap.mapOf(binder(), DASHBOARD_KIND); put(PROJECT_KIND).to(PutProject.class); get(PROJECT_KIND).to(GetProject.class); get(PROJECT_KIND, "description").to(GetDescription.class); put(PROJECT_KIND, "description").to(PutDescription.class); delete(PROJECT_KIND, "description").to(PutDescription.class); get(PROJECT_KIND, "parent").to(GetParent.class); put(PROJECT_KIND, "parent").to(SetParent.class); get(PROJECT_KIND, "head").to(GetHead.class); put(PROJECT_KIND, "head").to(SetHead.class); child(PROJECT_KIND, "dashboards").to(DashboardsCollection.class); get(DASHBOARD_KIND).to(GetDashboard.class); put(DASHBOARD_KIND).to(SetDashboard.class); delete(DASHBOARD_KIND).to(DeleteDashboard.class); install(new FactoryModuleBuilder().build(CreateProject.Factory.class)); }

Target:
protected void configure() { bind(ProjectsCollection.class); bind(DashboardsCollection.class); DynamicMap.mapOf(binder(), PROJECT_KIND); DynamicMap.mapOf(binder(), DASHBOARD_KIND); put(PROJECT_KIND).to(PutProject.class); get(PROJECT_KIND).to(GetProject.class); get(PROJECT_KIND, "description").to(GetDescription.class); put(PROJECT_KIND, "description").to(PutDescription.class); delete(PROJECT_KIND, "description").to(PutDescription.class); get(PROJECT_KIND, "parent").to(GetParent.class); put(PROJECT_KIND, "parent").to(SetParent.class); get(PROJECT_KIND, "HEAD").to(GetHead.class); put(PROJECT_KIND, "HEAD").to(SetHead.class); child(PROJECT_KIND, "dashboards").to(DashboardsCollection.class); get(DASHBOARD_KIND).to(GetDashboard.class); put(DASHBOARD_KIND).to(SetDashboard.class); delete(DASHBOARD_KIND).to(DeleteDashboard.class); install(new FactoryModuleBuilder().build(CreateProject.Factory.class)); }
Source:
public void selectAll(){ int numberOfFiles = mAdapter.getCount(); for(int i = 0; i < numberOfFiles; i++){ File file = (File) mAdapter.getItem(i); if (file != null) { if (file.isDirectory()) { } else { getListView().setItemChecked(i, true); mContainerActivity.onFileClick(file); } } } }

Target:
public void selectAll(){ int numberOfFiles = mAdapter.getCount(); for(int i = 0; i < numberOfFiles; i++){ File file = (File) mAdapter.getItem(i); if (file != null) { if (!file.isDirectory()) { getListView().setItemChecked(i, true); mContainerActivity.onFileClick(file); } } } }
Source:
protected List<AttributeStatement> createHomeCommunityIdAttributeStatements(final CallbackProperties properties) { LOG.debug("SamlCallbackHandler.addAssertStatements() -- Begin"); List<AttributeStatement> statements = Collections.emptyList(); final String communityId = properties.getHomeCommunity(); if (communityId != null) { statements = OpenSAML2ComponentBuilder.getInstance().createHomeCommunitAttributeStatement( appendPrefixHomeCommunityID(communityId)); } else { LOG.debug("Home Community ID is missing"); } return statements; }

Target:
protected List<AttributeStatement> createHomeCommunityIdAttributeStatements(final CallbackProperties properties) { LOG.debug("SamlCallbackHandler.addAssertStatements() -- Begin"); List<AttributeStatement> statements = Collections.emptyList(); final String communityId = properties.getHomeCommunity(); if (StringUtils.isNotBlank(communityId)) { statements = OpenSAML2ComponentBuilder.getInstance().createHomeCommunitAttributeStatement( appendPrefixHomeCommunityID(communityId)); } else { LOG.debug("Home Community ID is missing"); } return statements; }
Source:
public ApiKey generateApiKey() { URI uri = new URIBase(getBaseUri()).path("_api/v2/api_keys").build(); InputStream response = couchDbClient.post(uri, null); return getResponse(response, ApiKey.class, getGson()); }

Target:
public ApiKey generateApiKey() { URI uri = new URIBase(getBaseUri()).path("_api").path("v2").path("api_keys").build(); InputStream response = couchDbClient.post(uri, null); return getResponse(response, ApiKey.class, getGson()); }
Source:
public Response updateTokenDescription(JsonNode payload) { return withTokenLinkAndDescription(payload, (token_link, description) -> { boolean updated = authDao.updateTokenDescription(token_link, description); if (updated) { return Response.ok(ImmutableMap.of("token_link", token_link, "description", description)).build(); } return Response.status(NOT_FOUND).entity(ImmutableMap.of("message", "Could not update token description")).build(); }); }

Target:
public Response updateTokenDescription(JsonNode payload) { return withTokenLinkAndDescription(payload, (token_link, description) -> { boolean updated = authDao.updateTokenDescription(token_link, description); if (updated) { return ok(ImmutableMap.of("token_link", token_link, "description", description)).build(); } return notFoundResponse(logger, "Could not update token description"); }); }
Source:
public void afterPropertiesSet() throws Exception { Properties properties = new Properties(); properties.put("locators", "localhost[7777]"); properties.put("log-level", "warning"); properties.put("mcast-port", "0"); this.cache = new CacheFactory(properties).create(); RegionFactory<String, Set<String>> regionFactory = this.cache.createRegionFactory(RegionShortcut.REPLICATE); this.consumerGroupsRegion = regionFactory.create(CONSUMER_GROUPS_REGION); }

Target:
public void afterPropertiesSet() throws Exception { RegionFactory<String, ConsumerGroupTracker> regionFactory = this.cache.createRegionFactory(RegionShortcut.REPLICATE); this.consumerGroupsRegion = regionFactory.setScope(Scope.GLOBAL).create(CONSUMER_GROUPS_REGION); }
Source:
public static void init(ObjectMapper mapper) { log.info("finding expression functions.."); for (NamedType subType : resolveSubtypes(mapper, Function.Library.class)) { Parser.register(subType.getType()); } }

Target:
public static void init(ObjectMapper mapper) { List<Class<?>> libraries = Lists.transform( resolveSubtypes(Function.Library.class, mapper), new com.google.common.base.Function<NamedType, Class<?>>() { @Override public Class<?> apply(NamedType input) { return input.getType(); } } ); log.info("finding expression functions in libraries [%s]..", libraries); for (Class<?> library : libraries) { Parser.register(library); } }
Source:
private void newPostSetup() { mIsNewPost = true; if (mSite == null) { showErrorAndFinish(R.string.blog_not_found); return; } if (!mSite.isVisible()) { showErrorAndFinish(R.string.error_blog_hidden); return; } PostModel post = mPostStore.instantiatePostModel(mSite, mIsPage, null, null); post.setStatus(PostStatus.DRAFT.toString()); mEditPostRepository.setPost(post); EventBus.getDefault().postSticky( new PostEvents.PostOpenedInEditor(mEditPostRepository.getLocalSiteId(), mEditPostRepository.getId())); mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST); }

Target:
private void newPostSetup() { mIsNewPost = true; if (mSite == null) { showErrorAndFinish(R.string.blog_not_found); return; } if (!mSite.isVisible()) { showErrorAndFinish(R.string.error_blog_hidden); return; } mEditPostRepository.setInTransaction(() -> { PostModel post = mPostStore.instantiatePostModel(mSite, mIsPage, null, null); post.setStatus(PostStatus.DRAFT.toString()); return post; }); EventBus.getDefault().postSticky( new PostEvents.PostOpenedInEditor(mEditPostRepository.getLocalSiteId(), mEditPostRepository.getId())); mShortcutUtils.reportShortcutUsed(Shortcut.CREATE_NEW_POST); }
Source:
public List<FileAndCommitsForTimePeriod> getFrequentlyChangedFiles( long projectId, String commitHash, Date startDate, int frequency, List<FilePattern> filePatterns) { Pair<List<String>, List<String>> includesAndExcludes = mapPatternsToRegex(filePatterns); return mapFileAndCommitsForTimePeriodResult( fileRepository.getFrequentlyChangedFiles( projectId, commitHash, startDate.getTime(), frequency, includesAndExcludes.getFirst(), includesAndExcludes.getSecond())); }

Target:
public List<FileAndCommitsForTimePeriod> getFrequentlyChangedFiles( long projectId, String commitHash, Date startDate, int frequency, List<FilePattern> filePatterns) { Pair<List<String>, List<String>> includesAndExcludes = PatternUtil.mapPatternsToRegex(filePatterns); return mapFileAndCommitsForTimePeriodResult( fileRepository.getFrequentlyChangedFiles( projectId, commitHash, startDate.getTime(), frequency, includesAndExcludes.getFirst(), includesAndExcludes.getSecond())); }