auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private SseEventSourceImpl(final WebTarget target, final String name, final long reconnectDelay, final boolean open, final ScheduledExecutorService executor) { if (target == null) { throw new IllegalArgumentException(Messages.MESSAGES.webTargetIsNotSetForEventSource()); } this.target = target; this.reconnectDelay = reconnectDelay; this.alwaysReconnect = true; if (executor == null) { ScheduledExecutorService scheduledExecutor = null; if (target instanceof ResteasyWebTarget) { scheduledExecutor = ((ResteasyWebTarget) target).getResteasyClient().getScheduledExecutor(); } if (name != null) { this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, name); } else { <START> this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, String.format("sse-event-source(%s)", target.getUri())); <END> } } else { if (name != null) { this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, name); } else { this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, String.format("sse-event-source(%s)", target.getUri())); } } if (open) { open(); } }</code><technical_language>scheduledExecutor object parameter SseEventSourceScheduler constructors above</technical_language>

Target:
private SseEventSourceImpl(final WebTarget target, final String name, final long reconnectDelay, final boolean open, final ScheduledExecutorService executor) { if (target == null) { throw new IllegalArgumentException(Messages.MESSAGES.webTargetIsNotSetForEventSource()); } this.target = target; this.reconnectDelay = reconnectDelay; this.alwaysReconnect = true; if (executor == null) { ScheduledExecutorService scheduledExecutor = null; if (target instanceof ResteasyWebTarget) { scheduledExecutor = ((ResteasyWebTarget) target).getResteasyClient().getScheduledExecutor(); } if (name != null) { this.sseEventSourceScheduler = new SseEventSourceScheduler(scheduledExecutor, name); } else { this.sseEventSourceScheduler = new SseEventSourceScheduler(scheduledExecutor, String.format("sse-event-source(%s)", target.getUri())); } } else { if (name != null) { this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, name); } else { this.sseEventSourceScheduler = new SseEventSourceScheduler(executor, String.format("sse-event-source(%s)", target.getUri())); } } if (open) { open(); } }
Source:
<code>public void testMultiSliceAggregationOutput(boolean hashEnabled) { int fixedWidthSize = SIZE_OF_LONG + SIZE_OF_DOUBLE + SIZE_OF_DOUBLE; <START> int multiSlicePositionCount = (int) (1.3 * DEFAULT_MAX_PAGE_SIZE_IN_BYTES / fixedWidthSize); <END> List<Integer> hashChannels = Ints.asList(1); RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, hashChannels, BIGINT, BIGINT); List<Page> input = rowPagesBuilder .addSequencePage(multiSlicePositionCount, 0, 0) .build(); HashAggregationOperatorFactory operatorFactory = new HashAggregationOperatorFactory( 0, new PlanNodeId("test"), ImmutableList.of(BIGINT), hashChannels, ImmutableList.of(), Step.SINGLE, ImmutableList.of(COUNT.bind(ImmutableList.of(0), Optional.empty()), LONG_AVERAGE.bind(ImmutableList.of(1), Optional.empty())), rowPagesBuilder.getHashChannel(), Optional.empty(), 100_000, new DataSize(16, MEGABYTE), joinCompiler); assertEquals(toPages(operatorFactory, createDriverContext(), input).size(), 2); }</code><technical_language>I this is proper fix</technical_language>

Target:
public void testMultiSliceAggregationOutput(boolean hashEnabled) { int fixedWidthSize = SIZE_OF_LONG + SIZE_OF_LONG + SIZE_OF_LONG + SIZE_OF_DOUBLE; int multiSlicePositionCount = (int) (1.5 * PageBuilderStatus.DEFAULT_MAX_PAGE_SIZE_IN_BYTES / fixedWidthSize); List<Integer> hashChannels = Ints.asList(1); RowPagesBuilder rowPagesBuilder = rowPagesBuilder(hashEnabled, hashChannels, BIGINT, BIGINT); List<Page> input = rowPagesBuilder .addSequencePage(multiSlicePositionCount, 0, 0) .build(); HashAggregationOperatorFactory operatorFactory = new HashAggregationOperatorFactory( 0, new PlanNodeId("test"), ImmutableList.of(BIGINT), hashChannels, ImmutableList.of(), Step.SINGLE, ImmutableList.of(COUNT.bind(ImmutableList.of(0), Optional.empty()), LONG_AVERAGE.bind(ImmutableList.of(1), Optional.empty())), rowPagesBuilder.getHashChannel(), Optional.empty(), 100_000, new DataSize(16, MEGABYTE), joinCompiler); assertEquals(toPages(operatorFactory, createDriverContext(), input).size(), 2); }
Source:
<code>public void onEvent(SensorEvent<Boolean> event) { final MySqlNode node = (MySqlNode) event.getSource(); if (Boolean.TRUE.equals(event.getValue()) && Boolean.FALSE.equals(node.getAttribute(MySqlNode.SERVICE_UP)) && !Boolean.TRUE.equals(node.getAttribute(NODE_REPLICATION_INITIALIZED))) { <START> if (Boolean.TRUE.equals(node.getAttribute(NODE_REPLICATION_INITIALIZED))) { <END> return; } ((EntityLocal)node).setAttribute(NODE_REPLICATION_INITIALIZED, Boolean.TRUE); DynamicTasks.queueIfPossible(TaskBuilder.builder() .name("Configure master-slave replication on node") .body(new InitReplicationTask(cluster, node)) .build()) .orSubmitAsync(node); } }</code><technical_language>this condition true condition in if-statement above? If removed</technical_language>

Target:
public void onEvent(SensorEvent<Boolean> event) { final MySqlNode node = (MySqlNode) event.getSource(); if (Boolean.TRUE.equals(event.getValue()) && Boolean.FALSE.equals(node.getAttribute(MySqlNode.SERVICE_UP)) && !Boolean.TRUE.equals(node.getAttribute(NODE_REPLICATION_INITIALIZED))) { ((EntityLocal)node).setAttribute(NODE_REPLICATION_INITIALIZED, Boolean.TRUE); DynamicTasks.queueIfPossible(TaskBuilder.builder() .name("Configure master-slave replication on node") .body(new InitReplicationTask(cluster, node)) .build()) .orSubmitAsync(node); } }
Source:
<code>public E first(E defaultValue) { <START> if (size() > 0) { <END> return get(0); } else { return defaultValue; } }</code><technical_language>!isEmpty</technical_language>

Target:
public E first(E defaultValue) { return firstImpl(false, defaultValue); }
Source:
<code>public void age() { Entity person = new DynamicEntity(personBirthDateMeta); person.set("birthdate", now().atOffset(UTC).toLocalDate()); <START> Bindings bindings = jsMagmaScriptEvaluator.createBindings(person); <END> Object result = jsMagmaScriptEvaluator.eval(bindings, "$('birthdate').age().value()"); assertEquals(result, 0d); Stopwatch sw = Stopwatch.createStarted(); for (int i = 0; i < 10000; i++) { jsMagmaScriptEvaluator.eval(bindings, "$('birthdate').age().value()"); } System.out.println(sw.elapsed(TimeUnit.MILLISECONDS) + " millis passed new"); sw.reset().start(); for (int i = 0; i < 10000; i++) { jsMagmaScriptEvaluator.eval("$('birthdate').age().value()", person); } System.out.println(sw.elapsed(TimeUnit.MILLISECONDS) + " millis passed old"); }</code><technical_language>Is suggest moving performance test a separate disabled test case executed manually fail complete time</technical_language>

Target:
public void age() { Entity person = new DynamicEntity(personBirthDateMeta); person.set("birthdate", now().atOffset(UTC).toLocalDate()); Object result = jsMagmaScriptEvaluator.eval("$('birthdate').age().value()", person); assertEquals(result, 0d); }
Source:
<code>public void createCollection(String collection, CloudSolrClient client) throws SolrFactoryException { try { <START> CollectionAdminResponse aliasResponse = <END> new CollectionAdminRequest.ListAliases().process(client); if (aliasResponse != null) { Map<String, String> aliases = aliasResponse.getAliases(); if (aliases != null && aliases.containsKey(collection)) { LOGGER.debug( "Solr({}): Collection exists as an Alias, will not create collection", collection); return; } } CollectionAdminResponse response = new CollectionAdminRequest.List().process(client); if (response.getResponse() == null) { throw new SolrFactoryException("Failed to get a list of existing collections"); } List<String> collections = (List<String>) response.getResponse().get("collections"); if (collections == null) { throw new SolrFactoryException("Failed to get a list of existing collections"); } if (!collections.contains(collection)) { response = CollectionAdminRequest.createCollection(collection, collection, shardCount, shardCount) .setMaxShardsPerNode(maximumShardsPerNode) .setReplicationFactor(replicationFactor) .process(client); if (!response.isSuccess()) { throw new SolrFactoryException( "Failed to create collection [" + collection + "]: " + response.getErrorMessages()); } if (!isCollectionReady(client, collection)) { throw new SolrFactoryException( "Solr collection [" + collection + "] was not ready in time."); } } else { LOGGER.debug("Solr({}): Collection already exists", collection); } } catch (SolrServerException | SolrException | IOException e) { throw new SolrFactoryException("Failed to create collection: " + collection, e); } }</code><technical_language>alias a configuration? this check done for uploadCoreConfiguration well</technical_language>

Target:
public void createCollection(String collection, CloudSolrClient client) throws SolrFactoryException { try { if (aliasExists(collection, client)) { LOGGER.debug( "Solr({}): Collection exists as an Alias, will not create collection", collection); return; } if (!collectionExists(collection, client)) { CollectionAdminResponse response = CollectionAdminRequest.createCollection(collection, collection, shardCount, shardCount) .setMaxShardsPerNode(maximumShardsPerNode) .setReplicationFactor(replicationFactor) .process(client); if (!response.isSuccess()) { throw new SolrFactoryException( "Failed to create collection [" + collection + "]: " + response.getErrorMessages()); } if (!isCollectionReady(client, collection)) { throw new SolrFactoryException( "Solr collection [" + collection + "] was not ready in time."); } } else { LOGGER.debug("Solr({}): Collection already exists", collection); } } catch (SolrServerException | SolrException | IOException e) { throw new SolrFactoryException("Failed to create collection: " + collection, e); } }
Source:
<code>public CrossesListDescriptionSheetParser(final T importedList, final UserDataManager userDataManager) { this.importedList = importedList; this.doParseDetails = true; this.doParseConditions = true; this.doParseFactors = true; this.doParseVariates = true; this.userDataManager = userDataManager; this.descriptionSheetIndex = 0; <START> ; <END> }</code><technical_language>remove</technical_language>

Target:
public CrossesListDescriptionSheetParser(final T importedList, final UserDataManager userDataManager) { this.importedList = importedList; this.doParseDetails = true; this.doParseConditions = true; this.doParseFactors = true; this.doParseVariates = true; this.userDataManager = userDataManager; this.descriptionSheetIndex = 0; }
Source:
<code>public static SortedKeyValueIterator<Key,Value> createSource(IteratorTestInput input) { <START> return new ColumnFamilySkippingIterator(new SortedMapIterator(Objects.requireNonNull(input).getInput())); <END> }</code><technical_language>good another iterator (or wrapping SMI) re-uses Key instances returned getters. Storing output of a source in a list map making a copy is a common pitfall. I a small iterator benchmark I modified printout identify of Key Value, currently notice instance potential re-used. I try verify if Keys exhibit behavior-- I heard anecdotes do</technical_language>

Target:
public static SortedKeyValueIterator<Key,Value> createSource(IteratorTestInput input) { return new SimpleKVReusingIterator(new ColumnFamilySkippingIterator(new SortedMapIterator(Objects.requireNonNull(input).getInput()))); }
Source:
<code><START> static public Date lastUpdate(Item item) { <END> if(isDefaultServiceAvailable()) { return lastUpdate(item, defaultService); } else { return null; } }</code><technical_language>@clinique other methods AbstractInstant in signature Date. I here, is in line rest</technical_language>

Target:
static public AbstractInstant lastUpdate(Item item) { if(isDefaultServiceAvailable()) { return lastUpdate(item, defaultService); } else { return null; } }
Source:
<code>public <O> ListenableFuture<O> borrowBatchAsync(int maxSize, Function<List<T>, BorrowResult<T, O>> function) { checkArgument(maxSize >= 0, "maxSize must be at least 0"); ListenableFuture<List<T>> borrowedListFuture; <START> AtomicBoolean borrowerIncremented = new AtomicBoolean(); <END> synchronized (this) { List<T> list = getBatch(maxSize); if (!list.isEmpty()) { borrowedListFuture = immediateFuture(list); borrowerIncremented.set(true); borrowerCount++; } else if (finishing && borrowerCount == 0) { borrowedListFuture = immediateFuture(ImmutableList.of()); } else { borrowedListFuture = Futures.transform(notEmptySignal, ignored -> { synchronized (this) { List<T> batch = getBatch(maxSize); if (!batch.isEmpty()) { borrowerIncremented.set(true); borrowerCount++; } return batch; } }, executor); } } return Futures.transform( borrowedListFuture, elements -> { try { BorrowResult<T, O> borrowResult; borrowResult = function.apply(elements); if (!borrowerIncremented.get()) { checkArgument(borrowResult.getElementsToInsert().isEmpty(), "Function must not insert anything when no element is borrowed"); return borrowResult.getResult(); } for (T element : borrowResult.getElementsToInsert()) { offer(element); } return borrowResult.getResult(); } finally { if (borrowerIncremented.get()) { synchronized (this) { borrowerCount--; signalIfFinishing(); } } } }); }</code><technical_language>I need this. increment list is empty check in transform</technical_language>

Target:
public <O> ListenableFuture<O> borrowBatchAsync(int maxSize, Function<List<T>, BorrowResult<T, O>> function) { checkArgument(maxSize >= 0, "maxSize must be at least 0"); ListenableFuture<List<T>> borrowedListFuture; synchronized (this) { List<T> list = getBatch(maxSize); if (!list.isEmpty()) { borrowedListFuture = immediateFuture(list); borrowerCount++; } else if (finishing && borrowerCount == 0) { borrowedListFuture = immediateFuture(ImmutableList.of()); } else { borrowedListFuture = Futures.transform( notEmptySignal, ignored -> { synchronized (this) { List<T> batch = getBatch(maxSize); if (!batch.isEmpty()) { borrowerCount++; } return batch; } }, executor); } } return Futures.transform( borrowedListFuture, elements -> { try { BorrowResult<T, O> borrowResult = function.apply(elements); if (elements.isEmpty()) { checkArgument(borrowResult.getElementsToInsert().isEmpty(), "Function must not insert anything when no element is borrowed"); return borrowResult.getResult(); } for (T element : borrowResult.getElementsToInsert()) { offer(element); } return borrowResult.getResult(); } finally { if (!elements.isEmpty()) { synchronized (this) { borrowerCount--; signalIfFinishing(); } } } }); }
Source:
<code>private static void assertTypeIsBindable(final MetaClass type) { <START> if ((!type.isAnnotationPresent(Bindable.class) && !getConfiguredBindableTypes().contains(type)) <END> || getConfiguredNonBindableTypes().contains(type)) { throw new GenerationException(type.getName() + " must be a @Bindable type when used as @Model"); } }</code><technical_language>this logic is more complex, sense reuse isBindableType here</technical_language>

Target:
private static void assertTypeIsBindable(final MetaClass type) { if (!isBindableType(type)) { throw new GenerationException(type.getName() + " must be a @Bindable type when used as @Model"); } }
Source:
<code>public String[] getSubpictureStreamSelectionDescriptors(String formatMatch) { SubpictureFormat[] afs = getSubpictureFormats(formatMatch); String[] rv = new String[afs.length]; for (int i = 0; i < afs.length; i++) { rv[i] = "# " + (i + 1); String lang = afs[i].getLanguage(); if (lang != null && lang.length() > 0) <START> rv[i] += " " + lang + (afs[i].getForced() ? " [Forced]" : ""); <END> } return rv; }</code><technical_language>Put a Sage.rez() "Forced"</technical_language>

Target:
public String[] getSubpictureStreamSelectionDescriptors(String formatMatch) { SubpictureFormat[] afs = getSubpictureFormats(formatMatch); String[] rv = new String[afs.length]; for (int i = 0; i < afs.length; i++) { rv[i] = "# " + (i + 1); String lang = afs[i].getLanguage(); if (lang != null && lang.length() > 0) rv[i] += " " + lang + (afs[i].getForced() ? " [" + sage.Sage.rez("Forced") + "]" : ""); } return rv; }
Source:
<code>private LRNLayer(@Parameter(LayerIndex.class) final int index, @Parameter(LayerInputShape.class) final String inputShape, @Parameter(LocalSize.class) final int localSize, @Parameter(Alpha.class) final float alpha, @Parameter(Beta.class) final float beta, @Parameter(K.class) final float k, final MatrixFactory matrixFactory) { super(index, inputShape); <START> this.localSize = localSize; END> this.alpha = alpha; this.beta = beta; this.k = k; this.matrixFactory = matrixFactory; this.padSize = (localSize - 1) / 2; if (getInputShape().length == 3) { this.channelSize = getInputShape()[1] * getInputShape()[2]; } else { this.channelSize = getInputShape()[0] * getInputShape()[1]; } }</code><technical_language>adding some logic assert localSize is odd number</technical_language>

Target:
private LRNLayer(@Parameter(LayerIndex.class) final int index, @Parameter(LayerInputShape.class) final String inputShape, @Parameter(LocalSize.class) final int localSize, @Parameter(Alpha.class) final float alpha, @Parameter(Beta.class) final float beta, @Parameter(K.class) final float k, final MatrixFactory matrixFactory) { super(index, inputShape); this.localSize = localSize; this.alpha = alpha; this.beta = beta; this.k = k; this.paddingSize = (localSize - 1) / 2; this.matrixFactory = matrixFactory; if (getInputShape().length == 2) { this.inputChannel = 1; this.inputSize = getInputShape()[0] * getInputShape()[1]; } else { this.inputChannel = getInputShape()[0]; this.inputSize = getInputShape()[1] * getInputShape()[2]; } }
Source:
<code>public void waitRemoveItemsByPath(String pathToItem) { loadPageTimeout.until( <START> ExpectedConditions.not( <END> ExpectedConditions.presenceOfAllElementsLocatedBy( By.xpath(String.format(" }</code><technical_language>static import for simplifying static method references similar done in other parts of code</technical_language>

Target:
public void waitRemoveItemsByPath(String pathToItem) { loadPageTimeout.until( not( presenceOfAllElementsLocatedBy( By.xpath(String.format(" }
Source:
<code>private boolean hasNoSecurityConstraint(XmlFile file) { NodeList nodeList = evaluate(securityConstraintExpression, file.getNamespaceUnawareDocument()); <START> return (nodeList.getLength() == 0); <END> }</code><technical_language>need for parenthesis</technical_language>

Target:
private boolean hasNoSecurityConstraint(XmlFile file) { NodeList nodeList = evaluate(securityConstraintExpression, file.getNamespaceUnawareDocument()); return nodeList.getLength() == 0; }
Source:
<code>private InsertOptions buildInsertOptions() { final InsertOptions options = InsertOptions.insertOptions(); if (persistTo != PersistTo.NONE || replicateTo != ReplicateTo.NONE) { options.durability(persistTo, replicateTo); } else if (durabilityLevel != DurabilityLevel.NONE) { options.durability(durabilityLevel); } <START> if (expiry != null && !expiry.equals(Duration.ofSeconds(0))) { <END> options.expiry(expiry); } else if (domainType.isAnnotationPresent(Document.class)) { Document documentAnn = domainType.getAnnotation(Document.class); long durationSeconds = documentAnn.expiryUnit().toSeconds(documentAnn.expiry()); options.expiry(Duration.ofSeconds(durationSeconds)); } return options; }</code><technical_language>Nit: Duration.ZERO;</technical_language>

Target:
private InsertOptions buildInsertOptions() { final InsertOptions options = InsertOptions.insertOptions(); if (persistTo != PersistTo.NONE || replicateTo != ReplicateTo.NONE) { options.durability(persistTo, replicateTo); } else if (durabilityLevel != DurabilityLevel.NONE) { options.durability(durabilityLevel); } if (expiry != null && ! expiry.isZero()) { options.expiry(expiry); } else if (domainType.isAnnotationPresent(Document.class)) { Document documentAnn = domainType.getAnnotation(Document.class); long durationSeconds = documentAnn.expiryUnit().toSeconds(documentAnn.expiry()); options.expiry(Duration.ofSeconds(durationSeconds)); } return options; }
Source:
<code>public Object getProperty(String key, Object defaultValue) { Object value = null; if (StringUtils.isNotEmpty(prefix) && StringUtils.isNotEmpty(id)) { value = getInternalProperty(prefix + id + "." + key); } if (value == null && StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } <START> if (value == null) { <END> value = getInternalProperty(key); if (value == null) { value = defaultValue; } } return value; }</code><technical_language>simplified if (value == null) { = getInternalProperty(key); } return value!=null? value:defaultValue;</technical_language>

Target:
public Object getProperty(String key, Object defaultValue) { Object value = null; if (StringUtils.isNotEmpty(prefix) && StringUtils.isNotEmpty(id)) { value = getInternalProperty(prefix + id + "." + key); } if (value == null && StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } if (value == null) { value = getInternalProperty(key); } return value != null ? value : defaultValue; }
Source:
<code><START> public Set<Integer> extractVariableIdsFromDataset(final Integer studyId, final Integer datasetId) { <END> final Set<Integer> variableIds = new HashSet<>(); boolean isPlotDataset = false; final List<DmsProject> projects = this.daoFactory.getDmsProjectDAO().getDatasetsByStudy(studyId); final List<Integer> projectIds = new ArrayList<>(); for (final DmsProject dmsProject : projects) { projectIds.add(dmsProject.getProjectId()); if (dmsProject.getProjectId().equals(datasetId) && dmsProject.getDatasetType().getDatasetTypeId().intValue() == DatasetTypeEnum.PLOT_DATA.getId()) { isPlotDataset = true; } } final List<MeasurementVariable> measurementVariables; if (isPlotDataset) { measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(projectIds, Arrays .asList(VariableType.TRAIT.getId(), VariableType.ENVIRONMENT_DETAIL.getId(), VariableType.STUDY_CONDITION.getId())); } else { measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(Arrays.asList(datasetId), Arrays .asList(VariableType.TRAIT.getId())); } for (final MeasurementVariable measurementVariable : measurementVariables) { variableIds.add(measurementVariable.getTermId()); } return variableIds; }</code><technical_language>this method useful else for _MissingFormulaVariablesInStudy_ logic? is if (isPlotDataset) { } else { } conditional related that? need public? I big methods discouraged, if logic is vote for including this code inline in method if turn out big. package-private _Possible related to_ <LINK_0></technical_language>

Target:
Set<Integer> extractVariableIdsFromDataset(final Integer studyId, final Integer datasetId) { final Set<Integer> variableIds = new HashSet<>(); boolean isPlotDataset = false; final List<DatasetDTO> projects = this.daoFactory.getDmsProjectDAO().getDatasets(studyId); final List<Integer> projectIds = new ArrayList<>(); for (final DatasetDTO datasetDTO : projects) { projectIds.add(datasetDTO.getDatasetId()); if (datasetDTO.getDatasetId().equals(datasetId) && datasetDTO.getDatasetTypeId().intValue() == DatasetTypeEnum.PLOT_DATA.getId()) { isPlotDataset = true; } } final List<MeasurementVariable> measurementVariables; if (isPlotDataset) { measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(projectIds, CALCULATED_VARIABLE_VARIABLE_TYPES); } else { measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(Collections.singletonList(datasetId), Collections.singletonList(VariableType.TRAIT.getId())); } for (final MeasurementVariable measurementVariable : measurementVariables) { variableIds.add(measurementVariable.getTermId()); } return variableIds; }
Source:
<code>public boolean updatePostContentNewEditor(boolean isAutoSave, String title, String content) { if (mPost == null) { return false; } if (!isAutoSave) { } boolean titleChanged = PostUtils.updatePostTitleIfDifferent(mPost, title); <START> boolean contentChanged = compareCurrentMediaMarkedUploadingToOriginal(content); <END> if (contentChanged) { mPost.setContent(content); } else { if (mEditorFragment instanceof AztecEditorFragment) { contentChanged = ((AztecEditorFragment)mEditorFragment).hasHistory(); if (contentChanged) { mPost.setContent(content); } else if (!((AztecEditorFragment)mEditorFragment).isHistoryEnabled()){ contentChanged = PostUtils.updatePostContentIfDifferent(mPost, content); } } else { contentChanged = PostUtils.updatePostContentIfDifferent(mPost, content); } } if (!mPost.isLocalDraft() && (titleChanged || contentChanged)) { mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } return titleChanged || contentChanged; }</code><technical_language>feels this block simplified to: boolean contentChanged; if (compareCurrentMediaMarkedUploadingToOriginal(content)) { contentChanged = true; } else if (mEditorFragment instanceof AztecEditorFragment && ((AztecEditorFragment) mEditorFragment).isHistoryEnabled()) { contentChanged = ((AztecEditorFragment) mEditorFragment).hasHistory(); } else { contentChanged = mPost.getContent().compareTo(content) != 0; } if (contentChanged) { mPost.setContent(content); }</technical_language>

Target:
public boolean updatePostContentNewEditor(boolean isAutoSave, String title, String content) { if (mPost == null) { return false; } if (!isAutoSave) { } boolean titleChanged = PostUtils.updatePostTitleIfDifferent(mPost, title); boolean contentChanged; if (compareCurrentMediaMarkedUploadingToOriginal(content)) { contentChanged = true; } else if (mEditorFragment instanceof AztecEditorFragment && ((AztecEditorFragment) mEditorFragment).isHistoryEnabled()) { contentChanged = ((AztecEditorFragment) mEditorFragment).hasHistory(); } else { contentChanged = mPost.getContent().compareTo(content) != 0; } if (contentChanged) { mPost.setContent(content); } if (!mPost.isLocalDraft() && (titleChanged || contentChanged)) { mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); } return titleChanged || contentChanged; }
Source:
<code>public static double getOrbitalTheta(int orbitalDistance, float solarSize) { <START> double orbitalPeriod = 0; <END> orbitalPeriod = 48D*Math.pow((Math.pow(orbitalDistance, 3)*Math.pow(Math.PI, 2)*10D)/solarSize, 0.5D); return ((AdvancedRocketry.proxy.getWorldTimeUniversal(0) % 24000D*orbitalPeriod)/24000D*orbitalPeriod)*(2D*Math.PI); }</code><technical_language>shortened double orbitalPeriod = 48D*Math.pow((Math.pow(orbitalDistance, 3)*Math.pow(Math.PI, 2)*10D)/solarSize, 0.5D);</technical_language>

Target:
public static double getOrbitalTheta(int orbitalDistance, float solarSize) { double orbitalPeriod = 48D*Math.pow((Math.pow(orbitalDistance, 3)*Math.pow(Math.PI, 2)*10D)/solarSize, 0.5D); return ((AdvancedRocketry.proxy.getWorldTimeUniversal(0) % 24000D*orbitalPeriod)/24000D*orbitalPeriod)*(2D*Math.PI); }
Source:
<code>private void plugDiskToVmIfNeeded() { <START> if (getVm() != null && getParameters().getPlugDiskToVm() && getVm().getStatus() != VMStatus.Down) { <END> HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId()); Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params); } }</code><technical_language>1. VM null this point. 2. HotPlugDiskToVMCommand validates VM status is UP, PAUSED. Checking VM status is redundant, shared lock VM status changed , if do HotPlug does</technical_language>

Target:
private void plugDiskToVmIfNeeded() { if (Boolean.TRUE.equals(getParameters().getPlugDiskToVm()) && getVm() != null && getVm().getStatus() != VMStatus.Down) { HotPlugDiskToVmParameters params = new HotPlugDiskToVmParameters(getVmId(), getParameters().getDiskInfo().getId()); VdcReturnValueBase returnValue = Backend.getInstance().runInternalAction(VdcActionType.HotPlugDiskToVm, params); if (!returnValue.getSucceeded()) { AuditLogDirector.log(this, AuditLogType.USER_FAILED_HOTPLUG_DISK); } } }
Source:
<code>public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if (args == null) { return Collections.emptyList(); } else if (args.length == 1) { <START> return StringUtil.copyPartialMatches(args[0], SOUNDS, new ArrayList(SOUNDS.size())); <END> } else if (args.length == 2) { return StringUtil.copyPartialMatches(args[1], SOURCES, new ArrayList(SOURCES.size())); } else if (args.length == 3) { return super.tabComplete(sender, alias, args); } else { return Collections.emptyList(); } }</code><technical_language>do similar I for [Give command](<LINK_0> (in order behavior vanilla)</technical_language>

Target:
public List<String> tabComplete(CommandSender sender, String alias, String[] args) throws IllegalArgumentException { if (args == null) { return Collections.emptyList(); } else if (args.length == 1) { String sound = args[0]; if (!sound.startsWith("minecraft:")) { final int colonIndex = sound.indexOf(':'); sound = "minecraft:" + sound.substring(colonIndex == -1 ? 0 : (colonIndex + 1)); } return StringUtil.copyPartialMatches(sound, SOUNDS, new ArrayList(SOUNDS.size())); } else if (args.length == 2) { return StringUtil.copyPartialMatches(args[1], SOURCES, new ArrayList(SOURCES.size())); } else if (args.length == 3) { return super.tabComplete(sender, alias, args); } else { return Collections.emptyList(); } }
Source:
<code>public void setApplicationAttributes(AttributeMap map) { <START> this.applicationId = map.get(LogicalPlan.APPLICATION_ID); <END> getStore().setTableName(applicationId); }</code><technical_language>Change this DAGContext.APPLICATION_ID</technical_language>

Target:
public void setApplicationAttributes(AttributeMap map) { this.applicationId = map.get(DAGContext.APPLICATION_ID); getStore().setTableName(applicationId); }
Source:
<code>private void suggestBranchName(String ref) { if (nameText.getText().length() == 0 || nameIsSuggestion) { <START> int indexOfLastSlash = ref.lastIndexOf("/"); END> String branchNameSuggestion = indexOfLastSlash != -1 ? ref.substring(indexOfLastSlash + 1) : ref; nameText.setText(branchNameSuggestion); nameIsSuggestion = true; } }</code><technical_language>is coding for in line 311 ff is dialog is opened. suggestion is if base ref starts "remotes" is a tag. I sense. E.g., I a local branch created "Fetch Gerrit..." funcionality called "change/3435/1" suggested name is 1. I do care this, I is more important is behavior consistent for cases: opening dialog a branch switching "Source ref" in dialog drop down. This reflected in coding also</technical_language>

Target:
private void suggestBranchName(String ref) { if (nameText.getText().length() == 0 || nameIsSuggestion) { String branchNameSuggestion = getProposedTargetName(ref); if (branchNameSuggestion != null) { nameText.setText(branchNameSuggestion); nameText.selectAll(); nameIsSuggestion = true; } } }
Source:
<code><START> public static boolean getUseBMX() { <END> return useBMX; }</code><technical_language>This static. choice of BMX apache server, agent</technical_language>

Target:
public boolean getUseBMX() { return useBMX; }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Account account = (Account) o; if (id != account.id) { return false; } if (!name.equals(account.name)) { return false; } if (status != account.status) { return false; } <START> if (snapshotVersion != account.snapshotVersion) { <END> return false; } if (!containerIdToContainerMap.equals(account.containerIdToContainerMap)) { return false; } return containerNameToContainerMap.equals(account.containerNameToContainerMap); }</code><technical_language>is a good idea include this in equals - accounts equal virtue of properties - snapshot versions, correct</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } Account account = (Account) o; if (id != account.id) { return false; } if (!name.equals(account.name)) { return false; } if (status != account.status) { return false; } return containerIdToContainerMap.equals(account.containerIdToContainerMap); }
Source:
<code>public void should_send_mail_with_expanded_tokens() { jenkins.restart(); <START> <END> setUpMailer(); FreeStyleJob job = createFreeStyleJob(); P projectAction = createProjectAction(job); job.editPublisher(projectAction.getFreeStyleSettings(), settings -> settings.setBuildFailedTotalAll("0")); String name = projectAction.getUrl().toUpperCase(); String title = "Analysis-Result"; configureEmailNotification(job, String.format("%s: ${%s_RESULT}", title, name), String.format("%s: ${%s_COUNT}-${%s_FIXED}-${%s_NEW}", title, name, name, name)); buildFailingJob(job); verifyReceivedMail(String.format("%s: FAILURE", title), String.format("%s: %d-0-%d", title, getNumberOfWarnings(), getNumberOfWarnings())); }</code><technical_language>Restarting Jenkins Plugin Installation is broken correct approach: slows tests unnecessarily. E.g., I start tests empty installation, I a populated PLUGINS_DIR. In this case restart is totally superfluous. Is a check if restart is required</technical_language>

Target:
public void should_send_mail_with_expanded_tokens() { checkExtensionAreDeployed("hudson.plugins.analysis.tokens.AbstractTokenMacro", Collections.EMPTY_SET); setUpMailer(); FreeStyleJob job = createFreeStyleJob(); P projectAction = createProjectAction(job); job.editPublisher(projectAction.getFreeStyleSettings(), settings -> settings.setBuildFailedTotalAll("0")); String name = projectAction.getUrl().toUpperCase(); String title = "Analysis-Result"; configureEmailNotification(job, String.format("%s: ${%s_RESULT}", title, name), String.format("%s: ${%s_COUNT}-${%s_FIXED}-${%s_NEW}", title, name, name, name)); buildFailingJob(job); verifyReceivedMail(String.format("%s: FAILURE", title), String.format("%s: %d-0-%d", title, getNumberOfWarnings(), getNumberOfWarnings())); }
Source:
<code>public void testVirtualService() throws Exception { List<CSWInfo> infos = GeoServerExtensions.extensions(CSWInfo.class); <START> <END> Catalog catalog = getCatalog(); GeoServer geoServer = getGeoServer(); CSWInfo localCSW = new CSWInfoImpl(); localCSW.setName("localCSW"); localCSW.setWorkspace(catalog.getWorkspaceByName("gs")); localCSW.setAbstract("Local CSW"); CSWInfo globalCSW = geoServer.getService(CSWInfo.class); globalCSW.setAbstract("Global CSW"); geoServer.add(localCSW); geoServer.save(globalCSW); Document dom = getAsDOM(BASEPATH + "?service=csw&version=2.0.2&request=GetCapabilities"); print(dom); checkValidationErrors(dom); assertEquals("Global CSW", xpath.evaluate(" dom = getAsDOM("gs/" + BASEPATH + "?service=csw&version=2.0.2&request=GetCapabilities"); print(dom); checkValidationErrors(dom); assertEquals("Local CSW", xpath.evaluate(" }</code><technical_language>Extra blank line</technical_language>

Target:
public void testVirtualService() throws Exception { List<CSWInfo> infos = GeoServerExtensions.extensions(CSWInfo.class); Catalog catalog = getCatalog(); GeoServer geoServer = getGeoServer(); CSWInfo localCSW = new CSWInfoImpl(); localCSW.setName("localCSW"); localCSW.setWorkspace(catalog.getWorkspaceByName("gs")); localCSW.setAbstract("Local CSW"); CSWInfo globalCSW = geoServer.getService(CSWInfo.class); globalCSW.setAbstract("Global CSW"); geoServer.add(localCSW); geoServer.save(globalCSW); Document dom = getAsDOM(BASEPATH + "?service=csw&version=2.0.2&request=GetCapabilities"); checkValidationErrors(dom); assertEquals("Global CSW", xpath.evaluate(" dom = getAsDOM("gs/" + BASEPATH + "?service=csw&version=2.0.2&request=GetCapabilities"); checkValidationErrors(dom); assertEquals("Local CSW", xpath.evaluate(" }
Source:
<code>protected void executeCommand() { getParameters().setEntityId(getVmTemplateId()); RemoveVMVDSCommandParameters tempVar = new RemoveVMVDSCommandParameters(getParameters().getStoragePoolId(), getVmTemplateId()); tempVar.setStorageDomainId(getParameters().getStorageDomainId()); Backend.getInstance().getResourceManager().RunVdsCommand(VDSCommandType.RemoveVM, tempVar); List<DiskImage> images = getParameters().getImages(); if (!images.isEmpty()) { for (DiskImage image : images) { ArrayList<Guid> storageIds = new ArrayList<Guid>(); storageIds.add(getParameters().getStorageDomainId()); image.setStorageIds(storageIds); image.setStoragePoolId(getParameters().getStoragePoolId()); } RemoveAllVmImagesParameters tempVar2 = new RemoveAllVmImagesParameters(getVmId(), images); tempVar2.setParentCommand(getActionType()); tempVar2.setEntityId(getParameters().getEntityId()); tempVar2.setForceDelete(true); tempVar2.setParentParameters(getParameters()); VdcReturnValueBase vdcRetValue = Backend.getInstance().runInternalAction(VdcActionType.RemoveAllVmImages, tempVar2, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (vdcRetValue.getSucceeded()) { getReturnValue().getTaskIdList().addAll(vdcRetValue.getInternalTaskIdList()); setSucceeded(true); } else { getReturnValue().setFault(vdcRetValue.getFault()); } } <START> EndRemoveTemplate(); <END> }</code><technical_language>remove this method - useless</technical_language>

Target:
protected void executeCommand() { getParameters().setEntityId(getVmTemplateId()); RemoveVMVDSCommandParameters tempVar = new RemoveVMVDSCommandParameters(getParameters().getStoragePoolId(), getVmTemplateId()); tempVar.setStorageDomainId(getParameters().getStorageDomainId()); Backend.getInstance().getResourceManager().RunVdsCommand(VDSCommandType.RemoveVM, tempVar); List<DiskImage> images = getParameters().getImages(); if (!images.isEmpty()) { for (DiskImage image : images) { ArrayList<Guid> storageIds = new ArrayList<Guid>(); storageIds.add(getParameters().getStorageDomainId()); image.setStorageIds(storageIds); image.setStoragePoolId(getParameters().getStoragePoolId()); } RemoveAllVmImagesParameters tempVar2 = new RemoveAllVmImagesParameters(getVmId(), images); tempVar2.setParentCommand(getActionType()); tempVar2.setEntityId(getParameters().getEntityId()); tempVar2.setForceDelete(true); tempVar2.setParentParameters(getParameters()); VdcReturnValueBase vdcRetValue = Backend.getInstance().runInternalAction(VdcActionType.RemoveAllVmImages, tempVar2, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (vdcRetValue.getSucceeded()) { getReturnValue().getTaskIdList().addAll(vdcRetValue.getInternalTaskIdList()); setSucceeded(true); } else { getReturnValue().setFault(vdcRetValue.getFault()); } } setCommandShouldBeLogged(false); setSucceeded(true); }
Source:
<code>public void connectLocal() { this.serverConnection = ApiConnection.LOCAL; if (!isServerRouteLoaded()) { return; } this.serverAddress = serverRoute.getLocalAddress(); this.serverApi = buildServerApi(); <START> ServerConnectionDetectingTask.execute(serverRoute); <END> }</code><technical_language>added this line here? This automatically choose local address switch remote address if ping local address fails. Adding this dissolves purpose of Local Remote mode explicitly</technical_language>

Target:
public void connectLocal() { this.serverConnection = ApiConnection.LOCAL; if (!isServerRouteLoaded()) { return; } this.serverAddress = serverRoute.getLocalAddress(); this.serverApi = buildServerApi(); finishServerConnectionDetection(); }
Source:
<code>void remove(I key) { Integer prev = this.identityMap.remove(key); <START> if (prev != null) this.objectList.set(prev, null); <END> }</code><technical_language>please body of if line</technical_language>

Target:
void remove(I key) { Integer prev = this.identityMap.remove(key); if (prev != null) { this.objectList.set(prev, null); } }
Source:
<code>public final void cleanExpiredUsersSessions() { Date now = new Date(); <START> <END> Iterator<Entry<String, SessionInfo>> iter = sessionInfoMap.entrySet().iterator(); Set<String> tokens = sessionInfoMap.values().stream() .map(sessionInfo -> (String) sessionInfo.contentOfSession.get(SSO_ACCESS_TOKEN_PARAMETER_NAME)) .collect(Collectors.toSet()); Map<String, Boolean> sessionStatuses = ssoSessionValidator.getSessionStatuses(tokens); while (iter.hasNext()) { Entry<String, SessionInfo> entry = iter.next(); ConcurrentMap<String, Object> sessionMap = entry.getValue().contentOfSession; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); boolean sessionValid = sessionStatuses.getOrDefault( sessionMap.get(SSO_ACCESS_TOKEN_PARAMETER_NAME), false); if (((hardLimit != null && hardLimit.before(now)) || (softLimit != null && softLimit.before(now))) || !(boolean) sessionMap.get(SESSION_VALID_PARAMETER_NAME) || !sessionValid) { removeSessionImpl(entry.getKey(), Acct.ReportReason.PRINCIPAL_SESSION_EXPIRED, "Session has expired for principal %1$s", getUserName(entry.getKey())); if (sessionValid) { SsoOAuthServiceUtils.revoke((String) sessionMap.get(SSO_ACCESS_TOKEN_PARAMETER_NAME), ""); } } } }</code><technical_language>is this empty line for</technical_language>

Target:
public final void cleanExpiredUsersSessions() { Date now = new Date(); Iterator<Entry<String, SessionInfo>> iter = sessionInfoMap.entrySet().iterator(); Set<String> tokens = sessionInfoMap.values().stream() .map(sessionInfo -> (String) sessionInfo.contentOfSession.get(SSO_ACCESS_TOKEN_PARAMETER_NAME)) .collect(Collectors.toSet()); Map<String, Boolean> sessionStatuses = ssoSessionValidator.getSessionStatuses(tokens); while (iter.hasNext()) { Entry<String, SessionInfo> entry = iter.next(); ConcurrentMap<String, Object> sessionMap = entry.getValue().contentOfSession; Date hardLimit = (Date) sessionMap.get(HARD_LIMIT_PARAMETER_NAME); Date softLimit = (Date) sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); String token = (String) sessionMap.get(SSO_ACCESS_TOKEN_PARAMETER_NAME); boolean sessionValid = StringUtils.isEmpty(token) ? false : sessionStatuses.getOrDefault(token, false); if (((hardLimit != null && hardLimit.before(now)) || (softLimit != null && softLimit.before(now))) || !(boolean) sessionMap.get(SESSION_VALID_PARAMETER_NAME) || !sessionValid) { removeSessionImpl(entry.getKey(), Acct.ReportReason.PRINCIPAL_SESSION_EXPIRED, "Session has expired for principal %1$s", getUserName(entry.getKey())); if (sessionValid) { SsoOAuthServiceUtils.revoke((String) sessionMap.get(SSO_ACCESS_TOKEN_PARAMETER_NAME), ""); } } } }
Source:
<code>@Test public void testRowValueExpression() { String expected = "INSERT INTO \"EMPS\"\n" + "VALUES (ROW(1, 'Fred')),\n" + "(ROW(2, 'Eric'))"; sql("insert into emps values ROW(1,'Fred'),ROW(2, 'Eric')") .withDialect(SqlDialect.DatabaseProduct.CALCITE.getDialect()) .ok(expected); expected = "INSERT INTO `emps`\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; <START> sql("insert into emps values (1,'Fred'),(2, 'Eric')") <END> .withDialect(SqlDialect.DatabaseProduct.MYSQL.getDialect()) .ok(expected); expected = "INSERT INTO \"EMPS\"\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; sql("insert into emps values (1,'Fred'),(2, 'Eric')") .withDialect(SqlDialect.DatabaseProduct.ORACLE.getDialect()) .ok(expected); expected = "INSERT INTO [EMPS]\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; sql("insert into [EMPS] values (1,'Fred'),(2, 'Eric')") .withDialect(SqlDialect.DatabaseProduct.MSSQL.getDialect()) .ok(expected); }</code><technical_language>for sql() method? same</technical_language>

Target:
@Test public void testRowValueExpression() { String expected = "INSERT INTO \"EMPS\"\n" + "VALUES (ROW(1, 'Fred')),\n" + "(ROW(2, 'Eric'))"; String sql = "insert into emps values (1,'Fred'),(2, 'Eric')"; sql(sql) .withDialect(SqlDialect.DatabaseProduct.CALCITE.getDialect()) .ok(expected); expected = "INSERT INTO `emps`\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; sql(sql) .withDialect(SqlDialect.DatabaseProduct.MYSQL.getDialect()) .ok(expected); expected = "INSERT INTO \"EMPS\"\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; sql(sql) .withDialect(SqlDialect.DatabaseProduct.ORACLE.getDialect()) .ok(expected); expected = "INSERT INTO [EMPS]\n" + "VALUES (1, 'Fred'),\n" + "(2, 'Eric')"; sql(sql) .withDialect(SqlDialect.DatabaseProduct.MSSQL.getDialect()) .ok(expected); }
Source:
<code>public void deployUnDeployBPMNPackage() throws Exception { init(); ActivitiRestClient tester = new ActivitiRestClient(bpsServer.getInstance().getPorts().get("http"), bpsServer.getInstance().getHosts().get("default")); String filePath = FrameworkPathUtil.getSystemResourceLocation() + File.separator + BPMNTestConstants.DIR_ARTIFACTS + File.separator + BPMNTestConstants.DIR_BPMN + File.separator + "HelloApprove.bar"; String fileName = "HelloApprove.bar"; String[] deploymentResponse; deploymentResponse = tester.deployBPMNPackage(filePath, fileName); Assert.assertTrue("Deployment Successful", deploymentResponse[0].contains(BPMNTestConstants.CREATED)); String[] deploymentCheckResponse = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.assertTrue("Deployment Present", deploymentCheckResponse[2].contains(fileName)); String status = tester.unDeployBPMNPackage(deploymentResponse[1]); <START> Assert.assertTrue("Package UnDeployed", status.contains(BPMNTestConstants.NO_CONTENT)); <END> }</code><technical_language>undeployment check if a deployment name exists. Test succeeds if deployment is there</technical_language>

Target:
public void deployUnDeployBPMNPackage() throws Exception { init(); ActivitiRestClient tester = new ActivitiRestClient(bpsServer.getInstance().getPorts().get("http"), bpsServer.getInstance().getHosts().get("default")); String filePath = FrameworkPathUtil.getSystemResourceLocation() + File.separator + BPMNTestConstants.DIR_ARTIFACTS + File.separator + BPMNTestConstants.DIR_BPMN + File.separator + "HelloApprove.bar"; String fileName = "HelloApprove.bar"; String[] deploymentResponse = {}; String[] deploymentCheckResponse = {}; String deploymentStatus = ""; try { deploymentResponse = tester.deployBPMNPackage(filePath, fileName); Assert.assertTrue("Deployment Successful", deploymentResponse[0].contains(BPMNTestConstants.CREATED)); } catch (Exception exception) { log.error("Failed to Deploy BPMN Package " + fileName, exception); Assert.fail("Failed to Deploy BPMN Package " + fileName); } try { deploymentCheckResponse = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.assertTrue("Deployment Present", deploymentCheckResponse[2].contains(fileName)); } catch (Exception exception) { log.error("Deployed BPMN Package " + fileName + " Not Present", exception); Assert.fail("Deployed BPMN Package " + fileName + " Not Present"); } try { deploymentStatus = tester.unDeployBPMNPackage(deploymentResponse[1]); Assert.assertTrue("Package UnDeployed", deploymentStatus.contains(BPMNTestConstants.NO_CONTENT)); } catch (Exception exception) { log.error("BPMN Package cannot be undeployed " + fileName, exception); Assert.fail("BPMN Package cannot be undeployed " + fileName); } try { String[] unDeployCheck = tester.getDeploymentInfoById(deploymentResponse[1]); Assert.fail("Package Not Present"); } catch (Exception exception) { Assert.assertTrue("BPMN Package " + fileName + " Does Not Exist", BPMNTestConstants.NOT_AVAILABLE.equals(exception.getMessage())); log.error("BPMN Package " + fileName + " Still Exists", exception); } }
Source:
<code>public void testContinousIntegrationCommentsAreRemoved() throws Exception { ChangeDetailXAsResult result = parseFile("testdata/ChangeDetailX_hudson.json"); ChangeDetailX changeDetailX = result.result; assertEquals(1, changeDetailX.getMessages().size()); ChangeMessage lastMessageLeft = changeDetailX.getMessages().get(0); <START> boolean doesNotContainHudsonMessage = !lastMessageLeft.getMessage().contains("hudson.eclipse.org"); <END> assertEquals(true, doesNotContainHudsonMessage); }</code><technical_language>assertFalse(lastMessageLeft.getMessage().contains("hudson.eclipse.org"))</technical_language>

Target:
public void testContinousIntegrationCommentsAreRemoved() throws Exception { ChangeDetailXAsResult result = parseFile("testdata/ChangeDetailX_hudson.json"); ChangeDetailX changeDetailX = result.result; assertEquals(1, changeDetailX.getMessages().size()); ChangeMessage lastMessageLeft = changeDetailX.getMessages().get(0); assertFalse(lastMessageLeft.getMessage().contains("hudson.eclipse.org")); }