auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public UniformGranularitySpec( @JsonProperty("gran") Granularity granularity, @JsonProperty("intervals") List<Interval> inputIntervals ) { List<Interval> granularIntervals = Lists.newArrayList(); if (inputIntervals != null) { for (Interval inputInterval : inputIntervals) { Iterables.addAll(granularIntervals, granularity.getIterable(inputInterval)); } } this.granularity = granularity; this.inputIntervals = inputIntervals == null ? Collections.EMPTY_LIST : ImmutableList.copyOf(inputIntervals); this.wrappedSpec = new ArbitraryGranularitySpec(granularIntervals); }

Target:
public UniformGranularitySpec( @JsonProperty("gran") Granularity granularity, @JsonProperty("intervals") List<Interval> inputIntervals ) { this.granularity = granularity; if (inputIntervals != null) { List<Interval> granularIntervals = Lists.newArrayList(); for (Interval inputInterval : inputIntervals) { Iterables.addAll(granularIntervals, granularity.getIterable(inputInterval)); } this.inputIntervals = ImmutableList.copyOf(inputIntervals); this.wrappedSpec = new ArbitraryGranularitySpec(granularIntervals); } else { this.inputIntervals = null; this.wrappedSpec = null; } }
Source:
public Path getWorkingDirectory() { return new Path(pathToString(workingDirectory)); }

Target:
public Path getWorkingDirectory() { return workingDirectory; }
Source:
protected CommandStatus monitorJob() { int exitValue = -1; while (exitValue != 0) { try { exitValue = job.exitValue(); } catch (IllegalThreadStateException e) { try { commandConfig.getStdErr().write(getClass().getName() + "IllegalThreadStateException!: " + e); } catch (IOException e1) { e1.printStackTrace(); } } try { job.waitFor(1000, TimeUnit.MILLISECONDS); exitValue = job.exitValue(); } catch (InterruptedException e) { try { commandConfig.getStdErr().write(getClass().getName() + " InterruptedException!: " + e); } catch (IOException e1) { e1.printStackTrace(); } } if (!job.isAlive()) { logger.info("Job is no longer alive, done monitoring"); break; } } try { commandConfig.getStdOut().write("INFO: Command::monitorJob Message: Exit value = " + exitValue + "\n"); } catch (IOException e) { e.printStackTrace(); } logger.info("Finished monitoring job with exit value: " + exitValue); if (exitValue == 0) return CommandStatus.SUCCESS; else return CommandStatus.FAILED; }

Target:
protected CommandStatus monitorJob() { while (exitValue != 0) { try { exitValue = job.exitValue(); } catch (IllegalThreadStateException e) { try { logger.warn("IllegalThreadStateException, still going to keep monitoring the job..."); commandConfig.getStdErr().write(getClass().getName() + "IllegalThreadStateException!: " + e); } catch (IOException e1) { logger.error("Couldn't write to stderr file! Returning failed.", e1); return CommandStatus.FAILED; } } try { job.waitFor(1000, TimeUnit.MILLISECONDS); exitValue = job.exitValue(); } catch (InterruptedException e) { try { logger.error("Couldn't wait for the job to finish..."); commandConfig.getStdErr().write(getClass().getName() + " InterruptedException!: " + e); } catch (IOException e1) { logger.error("Couldn't write exception to error file! Returning failed.", e1); return CommandStatus.FAILED; } } if (!job.isAlive()) { logger.info("Job is no longer alive, done monitoring"); break; } } try { commandConfig.getStdOut().write("INFO: Command::monitorJob Message: Exit value = " + exitValue + "\n"); } catch (IOException e) { logger.error("Couldn't write final command exit value to the std out file. Returning failed. Exit value = " + exitValue, e); return CommandStatus.FAILED; } logger.info("Finished monitoring job with exit value: " + exitValue); if (exitValue != 0) return CommandStatus.FAILED; return CommandStatus.SUCCESS; }
Source:
private boolean patternShouldBeRequested(){ if ((System.currentTimeMillis() - timeStamp) > PATTERN_TIMEOUT && visibleAcctivitiesCounter <= 0 ){ return patternIsEnabled(); } return false; }

Target:
private boolean patternShouldBeRequested() { if ((System.currentTimeMillis() - timeStamp) > PATTERN_TIMEOUT && mVisibleActivitiesCounter <= 0 ) { return patternIsEnabled(); } return false; }
Source:
private Report generateFailedReport(IStatus status) { String reason = "AUT is terminated"; Report report = TestSuiteUtils.generateFailedReport((ITestCase) getActualElement(), reason); Node root = report.getRoot(); ReportFactory reportFactory = new ReportFactoryImpl(); ReportBuilderStore store = reportFactory.createReportBuilderStore(); store.setReport(report); store.setCurrentNode(root); ReportBuilder reportBuilder = ReportBuilder.load(store); INodeBuilder nodeBuilder = reportBuilder.getCurrent(); nodeBuilder.appendLog(LoggingCategory.NORMAL, testListener.getLog()); root.setEndTime(root.getStartTime() + getTime()); return reportBuilder.getReportCopy(); }

Target:
private Report generateFailedReport(IStatus status) { String reason = "AUT is terminated"; Report report = TestSuiteUtils.generateFailedReport((ITestCase) getActualElement(), reason); Node root = report.getRoot(); root.setEndTime(root.getStartTime() + getTime()); ReportHelper.appendLog(root, LoggingCategory.NORMAL, testListener.getLog()); return report; }
Source:
protected void reportWalkEnd( WalkerContext context, String fromPath ) throws WalkerException { if ( context.isStopped() ) { if ( context.getStopCause() == null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Walker was stopped programatically, not because of error." ); } } else if ( context.getStopCause() instanceof TaskInterruptedException ) { getLogger().info( "Canceled walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } else { if ( context.getStopCause() instanceof ItemNotFoundException ) { getLogger().debug( "Aborted walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } else { getLogger().debug( "Aborted walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } throw new WalkerException( context, "Aborted walking on repository ID='" + context.getRepository().getId() + "' from path='" + fromPath + "'." ); } } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Finished walking on ResourceStore '" + context.getRepository().getId() + "' from path '" + context.getContext().get( WALKER_WALKED_FROM_PATH ) + "'." ); } } }

Target:
protected void reportWalkEnd( WalkerContext context, String fromPath ) throws WalkerException { if ( context.isStopped() ) { if ( context.getStopCause() == null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Walker was stopped programatically, not because of error." ); } } else if ( context.getStopCause() instanceof TaskInterruptedException ) { getLogger().info( "Canceled walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } else { if ( context.getStopCause() instanceof ItemNotFoundException ) { getLogger().debug( "Aborted walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } else { getLogger().info( "Aborted walking on repository from path \"{}\", cause: {}", new Object[] { RepositoryStringUtils.getHumanizedNameString( context.getRepository() ), fromPath, context.getStopCause().getMessage() } ); } throw new WalkerException( context, "Aborted walking on repository ID='" + context.getRepository().getId() + "' from path='" + fromPath + "'." ); } } else { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Finished walking on ResourceStore '" + context.getRepository().getId() + "' from path '" + context.getContext().get( WALKER_WALKED_FROM_PATH ) + "'." ); } } }
Source:
public void validate() throws Exception { String command = getText(); Set<String> allowedText = new TreeSet<>(Arrays.asList("get-repo-type")); if (command == null) { throw new Exception("The message text must contain one of '" + allowedText.toString() + "'"); } if (!allowedText.contains(command)) { throw new Exception("The message text must contain one of '" + allowedText.toString() + "'"); } if (getTags().size() == 0) { throw new Exception("All repository messages must have at least one tag"); } super.validate(); }

Target:
public void validate() throws Exception { String command = getText(); Set<String> allowedTexts = new TreeSet<>(Arrays.asList("get-repo-type")); if (command == null) { throw new Exception("The message text must contain one of '" + allowedTexts.toString() + "'"); } if (!allowedTexts.contains(command)) { throw new Exception("The message text must contain one of '" + allowedTexts.toString() + "'"); } if (getTags().size() == 0) { throw new Exception("All repository messages must have at least one tag"); } super.validate(); }
Source:
public StreamCaseMerge execute( IOperator operator ) { operator.setUDFBolt(this.getUDFBolt()); String[] sourceList = new String[sources.length]; for( int i=0; i < sources.length; i++ ) { sourceList[i] = sources[i].getNodeId(); } this.multipleOperators.addOperatorProcessingDescription( new OperatorProcessingDescription( operator, sourceList )); return casemerge; }

Target:
public StreamCaseMerge execute(IOperator operator) { operator.setUDFBolt(getUDFBolt()); multipleOperators.addOperatorProcessingDescription(new OperatorProcessingDescription(operator, getSources() )); return casemerge; }
Source:
public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; Object sample = null; if (countsEnabled && this.metricsCaptor != null) { sample = this.metricsCaptor.start(); } try { if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } if (countsEnabled) { start = handlerMetrics.beforeHandle(); handleMessageInternal(message); if (sample != null) { sendTimer().stop(sample); } handlerMetrics.afterHandle(start, true); } else { handleMessageInternal(message); } } catch (Exception e) { if (sample != null) { buildSendTimer(false, e.getClass().getSimpleName()).stop(sample); } if (countsEnabled) { handlerMetrics.afterHandle(start, false); } if (e instanceof MessagingException) { throw (MessagingException) e; } throw new MessageHandlingException(message, "error occurred in message handler [" + this + "]", e); } }

Target:
public void handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); Assert.notNull(message.getPayload(), "Message payload must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } MetricsContext start = null; boolean countsEnabled = this.countsEnabled; AbstractMessageHandlerMetrics handlerMetrics = this.handlerMetrics; SampleFacade sample = null; if (countsEnabled && this.metricsCaptor != null) { sample = this.metricsCaptor.start(); } try { if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } if (countsEnabled) { start = handlerMetrics.beforeHandle(); handleMessageInternal(message); if (sample != null) { sample.stop(sendTimer()); } handlerMetrics.afterHandle(start, true); } else { handleMessageInternal(message); } } catch (Exception e) { if (sample != null) { sample.stop(buildSendTimer(false, e.getClass().getSimpleName())); } if (countsEnabled) { handlerMetrics.afterHandle(start, false); } throw IntegrationUtils.wrapInHandlingExceptionIfNecessary(message, () -> "error occurred in message handler [" + this + "]", e); } }
Source:
public String getUserId() { if (authenticationName == null) return "N/A"; return authenticationName; }

Target:
public String getUserId() { if (authenticationName == null) { return "N/A"; } return authenticationName; }
Source:
static public ResultHolder getPsiElementType(PsiElement element, @Nullable PsiElement resolveContext) { if (element == resolveContext) return SpecificTypeReference.getInvalid(element).createHolder(); if (element instanceof HaxeReferenceExpression) { PsiElement targetElement = ((HaxeReferenceExpression)element).resolve(); if (targetElement instanceof HaxePsiField) { return getTypeFromFieldDeclaration((HaxePsiField)targetElement, element); } } else if (element instanceof HaxeArrayLiteral) { HaxeArrayLiteral arrayLiteral = (HaxeArrayLiteral)element; if (arrayLiteral.getExpressionList() != null) { final List<HaxeExpression> expressions = arrayLiteral.getExpressionList().getExpressionList(); if (!expressions.isEmpty()) { ResultHolder arrayElementType = getPsiElementType(expressions.get(0), arrayLiteral.getContext()); return SpecificTypeReference.createArray(arrayElementType).createHolder(); } } PsiElement context = element.getContext(); if (context instanceof HaxeVarInit) { HaxePsiField field = PsiTreeUtil.getParentOfType(context, HaxePsiField.class); if (field != null) { SpecificHaxeClassReference fieldType = getTypeFromTypeTag(field.getTypeTag(), element).getClassType(); if (fieldType != null && fieldType.isArray()) { return SpecificTypeReference.createArray(fieldType.getArrayElementType()).createHolder(); } } } } return getPsiElementType(element, (AnnotationHolder)null).result; }

Target:
static public ResultHolder getPsiElementType(PsiElement element, @Nullable PsiElement resolveContext) { if (element == resolveContext) return SpecificTypeReference.getInvalid(element).createHolder(); if (element instanceof HaxeReferenceExpression) { PsiElement targetElement = ((HaxeReferenceExpression)element).resolve(); if (targetElement instanceof HaxePsiField) { return getTypeFromFieldDeclaration((HaxePsiField)targetElement, element); } } return getPsiElementType(element, (AnnotationHolder)null).result; }
Source:
protected int getNbPendingBackgroundRequests() { int nbBackgroundRequests = 0; synchronized (fLock) { for (ITmfEventRequest request : fPendingCoalescedRequests) { if (request.getExecType().equals(ExecutionType.BACKGROUND)) { nbBackgroundRequests++; } } } return nbBackgroundRequests; }

Target:
private int getNbPendingBackgroundRequests() { int nbBackgroundRequests = 0; synchronized (fLock) { for (ITmfEventRequest request : fPendingCoalescedRequests) { if (request.getExecType().equals(ExecutionType.BACKGROUND)) { nbBackgroundRequests++; } } } return nbBackgroundRequests; }
Source:
public void testParsingUncommonTimeZoneAbbreviations() { String fmt = "yyyy-MM-dd HH:mm:ss.SSS z"; String date = "2010-12-23 12:44:57.0 CET"; assertEquals(1293104697000L, parseDate(Locale.UK, fmt, date).getTimeInMillis()); try { parseDate(Locale.US, fmt, date); fail(); } catch (junit.framework.AssertionFailedError expected) { } }

Target:
public void testParsingUncommonTimeZoneAbbreviations() { String fmt = "yyyy-MM-dd HH:mm:ss.SSS z"; String date = "2010-12-23 12:44:57.0 CET"; assertEquals(1293104697000L, parseDate(Locale.UK, fmt, date).getTimeInMillis()); assertCannotParse(Locale.US, fmt, date); }
Source:
protected String generateHandlerBeanName(String originalBeanName, Method method, Class<? extends Annotation> annotationType) { return super.generateHandlerBeanName(originalBeanName, method, annotationType) .replaceFirst(IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX, ".source"); }

Target:
protected String generateHandlerBeanName(String originalBeanName, Method method, Class<? extends Annotation> annotationType) { return super.generateHandlerBeanName(originalBeanName, method, annotationType) .replaceFirst(IntegrationConfigUtils.HANDLER_ALIAS_SUFFIX + "$", ".source"); }
Source:
public String getBackupIdentifier() { return Const.SystemParams.BACKUP_LOG_MSG + GET_BACKUP_NAME + "::" + courseId; }

Target:
public String getBackupIdentifier() { return Const.SystemParams.BACKUP_LOG_MSG + ATTRIBUTE_NAME + "::" + feedbackResponseId; }
Source:
private String createIndexIndexStatementForIndex(String indexName, List<String> columns) { String tableName = IndexManager.tableNameForIndex(indexName); String sqlIndexName = tableName.concat("_index"); Joiner joiner = Joiner.on(",").skipNulls(); String cols = joiner.join(columns); return String.format("CREATE INDEX \"%s\" ON \"%s\" ( %s )", sqlIndexName, tableName, cols); }

Target:
private String createIndexIndexStatementForIndex(String indexName, List<String> columns) { String tableName = IndexManager.tableNameForIndex(indexName); String sqlIndexName = tableName.concat("_index"); Joiner joiner = Joiner.on(",").skipNulls(); String cols = joiner.join(columns); return String.format(Locale.ENGLISH, "CREATE INDEX \"%s\" ON \"%s\" ( %s )", sqlIndexName, tableName, cols); }
Source:
public void writeOutput(DataPipe cr) { try { for (Map.Entry<String, String> entry : cr.getDataMap().entrySet()) { csvFile.write(entry.getValue()); csvFile.write(","); } csvFile.write("\n"); } catch (IOException e) { System.out.println("ERROR! Failed to write to csv file"); } }

Target:
public void writeOutput(DataPipe cr) { String[] nextLine = new String[cr.getDataMap().entrySet().size()]; int count = 0; for (Map.Entry<String, String> entry : cr.getDataMap().entrySet()) { nextLine[count] = entry.getValue(); count++; } csvFile.writeNext(nextLine); }
Source:
protected void doUpdateItem(Widget widget, E element, boolean fullMap) { boolean oldBusy = isBusy(); setBusy(true); try { if (widget instanceof Item) { final Item item = (Item) widget; if (fullMap) { associate(element, item); } else { E data = (E) item.getData(); if (data != null) { unmapElement(data, item); } item.setData(element); mapElement(element, item); } int columnCount = doGetColumnCount(); if (columnCount == 0) columnCount = 1; ViewerRow<E> viewerRowFromItem = getViewerRowFromItem(item); boolean isVirtual = (getControl().getStyle() & SWT.VIRTUAL) != 0; if (isVirtual) { viewerRowFromItem = (ViewerRow<E>) viewerRowFromItem.clone(); } for (int column = 0; column < columnCount || column == 0; column++) { ViewerColumn<E,I> columnViewer = getViewerColumn(column); ViewerCell<E> cellToUpdate = updateCell(viewerRowFromItem, column, element); if (isVirtual) { cellToUpdate = new ViewerCell<E>(cellToUpdate.getViewerRow(), cellToUpdate.getColumnIndex(), element); } columnViewer.refresh(cellToUpdate); updateCell(null, 0, null); if (item.isDisposed()) { unmapElement(element, item); return; } } } } finally { setBusy(oldBusy); } }

Target:
protected void doUpdateItem(Widget widget, E element, boolean fullMap) { boolean oldBusy = isBusy(); setBusy(true); try { if (widget instanceof Item) { final Item item = (Item) widget; if (fullMap) { associate(element, item); } else { @SuppressWarnings("unchecked") E data = (E) item.getData(); if (data != null) { unmapElement(data, item); } item.setData(element); mapElement(element, item); } int columnCount = doGetColumnCount(); if (columnCount == 0) columnCount = 1; ViewerRow<E> viewerRowFromItem = getViewerRowFromItem(item); boolean isVirtual = (getControl().getStyle() & SWT.VIRTUAL) != 0; if (isVirtual) { @SuppressWarnings("unchecked") ViewerRow<E> viewerRowFromItemClone = (ViewerRow<E>) viewerRowFromItem.clone(); viewerRowFromItem = viewerRowFromItemClone; } for (int column = 0; column < columnCount || column == 0; column++) { ViewerColumn<E,I> columnViewer = getViewerColumn(column); ViewerCell<E> cellToUpdate = updateCell(viewerRowFromItem, column, element); if (isVirtual) { cellToUpdate = new ViewerCell<E>(cellToUpdate.getViewerRow(), cellToUpdate.getColumnIndex(), element); } columnViewer.refresh(cellToUpdate); updateCell(null, 0, null); if (item.isDisposed()) { unmapElement(element, item); return; } } } } finally { setBusy(oldBusy); } }
Source:
protected void deleteFile(String fileName) throws IOException { Path dataFilePath = new Path(bucketRoot + PATH_SEPARATOR + fileName); FileSystem fs = FileSystem.newInstance(dataFilePath.toUri(), configuration); try { if (fs.exists(dataFilePath)) { logger.debug("start delete {}", fileName); fs.delete(dataFilePath, true); logger.debug("end delete {}", fileName); } } finally { fs.close(); } }

Target:
protected void deleteFile(String fileName) throws IOException { Path dataFilePath = new Path(bucketRoot + PATH_SEPARATOR + fileName); try (FileSystem fs = FileSystem.newInstance(dataFilePath.toUri(), configuration)) { if (fs.exists(dataFilePath)) { logger.debug("start delete {}", fileName); fs.delete(dataFilePath, true); logger.debug("end delete {}", fileName); } } }
Source:
private List<String> getConsumerTopics(Properties props, String group) { List<String> ret = new ArrayList<>(); AdminClient client = AdminClient.create(props); Map<TopicPartition, Object> response = JavaConversions.mapAsJavaMap(client.listGroupOffsets(group)); for (TopicPartition tp : response.keySet()) { ret.add(tp.topic()); } return ret; }

Target:
private List<String> getConsumerTopics(Properties props, String group) { AdminClient client = AdminClient.create(props); return JavaConversions.mapAsJavaMap(client.listGroupOffsets(group)) .keySet() .stream() .map(TopicPartition::topic) .collect(Collectors.toList()); }
Source:
public Stands stands() { try { return new RestStands( URI.create( new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .assertXPath("/page/links/link[@rel='stands']") .xml() .xpath("/page/links/link[@rel='stands']/@href") .get(0) ), this.token ); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public Stands stands() { try { return new RestStands( URI.create( new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .assertXPath("/page/links/link[@rel='stands']") .xml() .xpath("/page/links/link[@rel='stands']/@href") .get(0) ), this.token ); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
public AccountServiceConfig(VerifiableProperties verifiableProperties) { containerIdStartNumber = verifiableProperties.getShortInRange(CONTAINER_ID_START_NUMBER, (short) 0, (short) 0, Short.MAX_VALUE); }

Target:
public AccountServiceConfig(VerifiableProperties verifiableProperties) { containerIdStartNumber = verifiableProperties.getShortInRange(CONTAINER_ID_START_NUMBER, (short) 1, (short) 0, Short.MAX_VALUE); }
Source:
protected Object getGreaterValue(Object value) { byte[] address = ((Slice) value).getBytes(); checkState(++address[address.length - 1] != 0, "Last byte of address is 0xff"); try { return InetAddresses.toAddrString(InetAddress.getByAddress(address)); } catch (UnknownHostException e) { throwIfUnchecked(e); throw new AssertionError(e); } }

Target:
protected Object getGreaterValue(Object value) { byte[] address = ((Slice) value).getBytes(); checkState(++address[address.length - 1] != 0, "Last byte of address is 0xff"); return Slices.wrappedBuffer(address); }
Source:
public PagedFlux<DigitalTwinModelData> createModels(List<String> models) { return new PagedFlux<>( () -> withContext(context -> createModelsSinglePageAsync(models, context)), nextLink -> withContext(context -> Mono.empty())); }

Target:
public PagedFlux<ModelData> createModels(List<String> models) { return new PagedFlux<>( () -> withContext(context -> createModelsSinglePageAsync(models, context)), nextLink -> withContext(context -> Mono.empty())); }
Source:
public void showWait() { setCenter(waitPanel); }

Target:
public void showWait() { closeDetailsView(); setCenter(waitPanel); }
Source:
private long calculateRemainingEntriesToSend(long ackedTimestamp) { long maxReplicatedStreamTail = getMaxReplicatedStreamsTail(); if (maxReplicatedStreamTail == Address.NON_ADDRESS) { return NO_REPLICATION_REMAINING_ENTRIES; } if (ackedTimestamp == Address.NON_ADDRESS && lastSyncType == LogReplicationMetadata.ReplicationStatusVal.SyncType.SNAPSHOT) { return maxReplicatedStreamTail; } if (lastSyncType == LogReplicationMetadata.ReplicationStatusVal.SyncType.LOG_ENTRY) { long remainingEntriesToSend = 0; for (String stream : config.getStreamsToReplicate()) { UUID streamId = CorfuRuntime.getStreamID(stream); StreamAddressRange range = new StreamAddressRange(streamId, maxReplicatedStreamTail, ackedTimestamp); StreamAddressSpace addressSpace = runtime.getSequencerView().getStreamAddressSpace(range); remainingEntriesToSend += addressSpace.getAddressMap().getLongCardinality(); return remainingEntriesToSend; } } return (baseSnapshotTimestamp - ackedTimestamp) + (maxReplicatedStreamTail - baseSnapshotTimestamp); }

Target:
private long calculateRemainingEntriesToSend(long ackedTimestamp) { long maxReplicatedStreamTail = getMaxReplicatedStreamsTail(); if (maxReplicatedStreamTail == Address.NON_ADDRESS) { return NO_REPLICATION_REMAINING_ENTRIES; } if (ackedTimestamp == Address.NON_ADDRESS && lastSyncType == LogReplicationMetadata.ReplicationStatusVal.SyncType.SNAPSHOT) { ackedTimestamp = 0; } if (lastSyncType == LogReplicationMetadata.ReplicationStatusVal.SyncType.LOG_ENTRY) { return calculateRemainingEntriesForLogEntrySync(maxReplicatedStreamTail, ackedTimestamp); } return ((baseSnapshotTimestamp - ackedTimestamp) + calculateRemainingEntriesForLogEntrySync(maxReplicatedStreamTail, baseSnapshotTimestamp)); }
Source:
private double getOutputSizeForSymbol(SymbolStatsEstimate symbolStatistics, Type type) { double averageRowSize = symbolStatistics.getAverageRowSize(); double numberOfNonNullRows = outputRowCount * (1.0 - firstNonNaN(symbolStatistics.getNullsFraction(), 0d)); if (isNaN(averageRowSize)) { if (type instanceof FixedWidthType) { averageRowSize = ((FixedWidthType) type).getFixedSize(); } else { averageRowSize = DEFAULT_DATA_SIZE_PER_COLUMN; } } return numberOfNonNullRows * averageRowSize; }

Target:
private double getOutputSizeForSymbol(SymbolStatsEstimate symbolStatistics, Type type) { checkArgument(type != null, "type is null"); double averageRowSize = symbolStatistics.getAverageRowSize(); double nullsFraction = firstNonNaN(symbolStatistics.getNullsFraction(), 0d); double numberOfNonNullRows = outputRowCount * (1.0 - nullsFraction); if (isNaN(averageRowSize)) { if (type instanceof FixedWidthType) { averageRowSize = ((FixedWidthType) type).getFixedSize(); } else { averageRowSize = DEFAULT_DATA_SIZE_PER_COLUMN; } } double outputSize = numberOfNonNullRows * averageRowSize; outputSize += outputRowCount * Byte.BYTES; if (type instanceof VariableWidthType) { outputSize += outputRowCount * Integer.BYTES; } return outputSize; }
Source:
public static AcidStats parseAcidStats(Reader reader) { if (reader.hasMetadataValue(ACID_STATS)) { String statsSerialized; try { ByteBuffer val = reader.getMetadataValue(ACID_STATS) .duplicate(); statsSerialized = utf8Decoder.decode(val).toString(); } catch (CharacterCodingException e) { throw new IllegalArgumentException("Bad string encoding for " + ACID_STATS, e); } return new AcidStats(statsSerialized); } else { return null; } }

Target:
public static AcidStats parseAcidStats(Reader reader) { if (reader.hasMetadataValue(ACID_STATS)) { try { ByteBuffer val = reader.getMetadataValue(ACID_STATS).duplicate(); return new AcidStats(utf8Decoder.decode(val).toString()); } catch (CharacterCodingException e) { throw new IllegalArgumentException("Bad string encoding for " + ACID_STATS, e); } } else { return null; } }
Source:
public RegisterTemplateModel() { super(); this.externalVnicProfilesPerTargetCluster = new HashMap<>(); }

Target:
public RegisterTemplateModel() { this.externalVnicProfilesPerTargetCluster = new HashMap<>(); }
Source:
public Map<TaskDataDto, Map<String, TestInfoDto>> getTestInfoByTaskDataDto(Collection<TaskDataDto> taskDataDtos) throws RuntimeException { if (taskDataDtos.isEmpty()) { return Collections.emptyMap(); } long temp = System.currentTimeMillis(); Set<Long> taskDataIds = new HashSet<Long>(); for (TaskDataDto taskDataDto : taskDataDtos) { taskDataIds.addAll(taskDataDto.getIds()); } Map<Long,Map<String,TestInfoDto>> preliminaryResult = fetchUtil.getTestInfoByTaskIds(taskDataIds); Map<TaskDataDto, Map<String, TestInfoDto>> resultMap = new HashMap<TaskDataDto, Map<String, TestInfoDto>>(taskDataDtos.size()); for (Map.Entry<Long,Map<String,TestInfoDto>> entry : preliminaryResult.entrySet()) { for (TaskDataDto td : taskDataDtos) { if (td.getIds().contains(entry.getKey())) { if (!resultMap.containsKey(td)) { resultMap.put(td, new HashMap<String, TestInfoDto>()); } resultMap.get(td).putAll(entry.getValue()); break; } } } log.debug("Time spent for testInfo fetching for taskDataDtos : {}ms", new Object[]{taskDataDtos.size(), System.currentTimeMillis() - temp}); return resultMap; }

Target:
public Map<TaskDataDto, Map<String, TestInfoDto>> getTestInfoByTaskDataDto(Collection<TaskDataDto> taskDataDtos) throws RuntimeException { if (taskDataDtos.isEmpty()) { return Collections.emptyMap(); } long temp = System.currentTimeMillis(); Set<Long> taskDataIds = new HashSet<Long>(); for (TaskDataDto taskDataDto : taskDataDtos) { taskDataIds.addAll(taskDataDto.getIds()); } Map<Long,Map<String,TestInfoDto>> preliminaryResult = getTestInfoByTaskIds(taskDataIds); Map<TaskDataDto, Map<String, TestInfoDto>> resultMap = new HashMap<TaskDataDto, Map<String, TestInfoDto>>(taskDataDtos.size()); for (Map.Entry<Long,Map<String,TestInfoDto>> entry : preliminaryResult.entrySet()) { for (TaskDataDto td : taskDataDtos) { if (td.getIds().contains(entry.getKey())) { if (!resultMap.containsKey(td)) { resultMap.put(td, new HashMap<String, TestInfoDto>()); } resultMap.get(td).putAll(entry.getValue()); break; } } } log.debug("Time spent for testInfo fetching for taskDataDtos : {}ms", new Object[]{taskDataDtos.size(), System.currentTimeMillis() - temp}); return resultMap; }
Source:
private static File getReportsDirectoryFromDeprecatedProperty(Settings settings, FileSystem fs, PathResolver pathResolver) { if(settings.hasKey(SUREFIRE_REPORTS_PATH_PROPERTY)) { LOGGER.info(String.format("Property '%s' is deprecated. Use property '%s' instead.", SUREFIRE_REPORTS_PATH_PROPERTY, SUREFIRE_REPORT_PATHS_PROPERTY)); String path = settings.getString(SUREFIRE_REPORTS_PATH_PROPERTY); if (path != null) { return getFileFromPath(fs, pathResolver, path); } } return null; }

Target:
private static File getReportsDirectoryFromDeprecatedProperty(Settings settings, FileSystem fs, PathResolver pathResolver) { if(settings.hasKey(SUREFIRE_REPORTS_PATH_PROPERTY)) { LOGGER.info("Property '{}' is deprecated. Use property '{}' instead.", SUREFIRE_REPORTS_PATH_PROPERTY, SUREFIRE_REPORT_PATHS_PROPERTY); String path = settings.getString(SUREFIRE_REPORTS_PATH_PROPERTY); if (path != null) { return getFileFromPath(fs, pathResolver, path); } } return null; }
Source:
public void onViewStateRestored(Bundle savedInstanceState) { super.onViewStateRestored(savedInstanceState); if (savedInstanceState != null) { FormFieldsWrapper formFieldsWrapper = (FormFieldsWrapper) savedInstanceState.getSerializable(ApplicationConstants.BundleKeys.FORM_FIELDS_BUNDLE); inputFields = formFieldsWrapper.getInputFields(); for(InputField field:inputFields){ DiscreteSeekBar sb = (DiscreteSeekBar) getActivity().findViewById(field.getId()); if(sb != null) { sb.setProgress(field.getValue().intValue()); } if(field.isRed()){ RangeEditText ed = (RangeEditText) getActivity().findViewById(field.getId()); ed.setTextColor(ContextCompat.getColor(OpenMRS.getInstance(), R.color.red)); } } selectOneFields = formFieldsWrapper.getSelectOneFields(); } }

Target:
public void onViewStateRestored(Bundle savedInstanceState) { super.onViewStateRestored(savedInstanceState); if (savedInstanceState != null) { FormFieldsWrapper formFieldsWrapper = (FormFieldsWrapper) savedInstanceState.getSerializable(ApplicationConstants.BundleKeys.FORM_FIELDS_BUNDLE); inputFields = formFieldsWrapper.getInputFields(); for(InputField field:inputFields){ View v = getActivity().findViewById(field.getId()); if(v != null && v instanceof DiscreteSeekBar) { DiscreteSeekBar sb = (DiscreteSeekBar) v; sb.setProgress(field.getValue().intValue()); } if(field.isRed()){ RangeEditText ed = (RangeEditText) getActivity().findViewById(field.getId()); ed.setTextColor(ContextCompat.getColor(OpenMRS.getInstance(), R.color.red)); } } selectOneFields = formFieldsWrapper.getSelectOneFields(); } }
Source:
void disableRecovery() { if (lraRecoveryModule != null) { Implementations.uninstall(); RecoveryManager.manager().removeModule(lraRecoveryModule, false); lraRecoveryModule = null; if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf("LRAServicve.disableRecovery%n"); } } }

Target:
void disableRecovery() { if (lraRecoveryModule != null) { RecoveryManager.manager().removeModule(lraRecoveryModule, false); Implementations.uninstall(); lraRecoveryModule = null; if (LRALogger.logger.isDebugEnabled()) { LRALogger.logger.debugf("LRAServicve.disableRecovery"); } } }
Source:
public Map<String, List<DatastreamTask>> getTasksToCleanUp(List<DatastreamGroup> datastreamGroups, Map<String, Set<DatastreamTask>> currentAssignment) { Set<String> datastreamGroupsSet = datastreamGroups.stream().map(DatastreamGroup::getTaskPrefix).collect(Collectors.toSet()); Map<String, List<DatastreamTask>> tasksToCleanUp = new HashMap<>(); Map<String, DatastreamTask> assignmentsMap = currentAssignment.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toMap(DatastreamTask::getDatastreamTaskName, Function.identity())); for (String instance : currentAssignment.keySet()) { List<DatastreamTask> tasksPerInstance = currentAssignment.get(instance) .stream() .filter(t -> datastreamGroupsSet.contains(t.getTaskPrefix())) .map(task -> ((DatastreamTaskImpl) task).getDependencies()) .flatMap(Collection::stream) .map(assignmentsMap::get) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!tasksPerInstance.isEmpty()) { tasksToCleanUp.put(instance, tasksPerInstance); } } return tasksToCleanUp; }

Target:
public Map<String, List<DatastreamTask>> getTasksToCleanUp(List<DatastreamGroup> datastreamGroups, Map<String, Set<DatastreamTask>> currentAssignment) { Set<String> datastreamGroupsSet = datastreamGroups.stream().map(DatastreamGroup::getTaskPrefix).collect(Collectors.toSet()); Map<String, List<DatastreamTask>> tasksToCleanUp = new HashMap<>(); Map<String, DatastreamTask> assignmentsMap = currentAssignment.values() .stream() .flatMap(Collection::stream) .collect(Collectors.toMap(DatastreamTask::getDatastreamTaskName, Function.identity())); for (String instance : currentAssignment.keySet()) { List<DatastreamTask> dependencyTasksPerInstance = currentAssignment.get(instance) .stream() .filter(t -> datastreamGroupsSet.contains(t.getTaskPrefix())) .map(task -> ((DatastreamTaskImpl) task).getDependencies()) .flatMap(Collection::stream) .map(assignmentsMap::get) .filter(Objects::nonNull) .collect(Collectors.toList()); if (!dependencyTasksPerInstance.isEmpty()) { tasksToCleanUp.put(instance, dependencyTasksPerInstance); } } return tasksToCleanUp; }
Source:
protected void connectSensors(String mirroredEntityUrl) { Function<HttpToolResponse, Void> mirrorSensors = new Function<HttpToolResponse,Void>() { @SuppressWarnings("rawtypes") @Override public Void apply(HttpToolResponse input) { Map sensors = new Gson().fromJson(input.getContentAsString(), Map.class); for (Object kv: sensors.entrySet()) setAttribute(Sensors.newSensor(Object.class, ""+((Map.Entry)kv).getKey()), ((Map.Entry)kv).getValue()); setAttribute(MIRROR_STATUS, "normal"); return null; } }; @SuppressWarnings("rawtypes") Function<HttpToolResponse, Map> mirrorSummary = new Function<HttpToolResponse, Map>() { @Override public Map apply(HttpToolResponse input) { Map<?, ?> entitySummary = new Gson().fromJson(input.getContentAsString(), Map.class); String catalogItemId = (String)entitySummary.get("catalogItemId"); setAttribute(MIRROR_CATALOG_ITEM_ID, catalogItemId); return entitySummary; } }; final BrooklynEntityMirrorImpl self = this; mirror = HttpFeed.builder().entity(this) .baseUri(mirroredEntityUrl) .credentialsIfNotNull(getConfig(BrooklynNode.MANAGEMENT_USER), getConfig(BrooklynNode.MANAGEMENT_PASSWORD)) .period(getConfig(POLL_PERIOD)) .poll(HttpPollConfig.forMultiple() .suburl("/sensors/current-state") .onSuccess(mirrorSensors) .onFailureOrException(new Function<Object, Void>() { @Override public Void apply(Object input) { ServiceStateLogic.updateMapSensorEntry(self, Attributes.SERVICE_PROBLEMS, "mirror-feed", "error contacting service"); if (input instanceof HttpToolResponse) { int responseCode = ((HttpToolResponse)input).getResponseCode(); if (responseCode == HttpStatus.SC_NOT_FOUND) { Entities.unmanage(self); } } return null; } })) .poll(HttpPollConfig.forSensor(MIRROR_SUMMARY).onSuccess(mirrorSummary)).build(); populateEffectors(); }

Target:
protected void connectSensors(String mirroredEntityUrl) { Function<HttpToolResponse, Void> mirrorSensors = new Function<HttpToolResponse,Void>() { @SuppressWarnings("rawtypes") @Override public Void apply(HttpToolResponse input) { Map sensors = new Gson().fromJson(input.getContentAsString(), Map.class); for (Object kv: sensors.entrySet()) setAttribute(Sensors.newSensor(Object.class, ""+((Map.Entry)kv).getKey()), ((Map.Entry)kv).getValue()); setAttribute(MIRROR_STATUS, "normal"); return null; } }; final BrooklynEntityMirrorImpl self = this; mirror = HttpFeed.builder().entity(this) .baseUri(mirroredEntityUrl) .credentialsIfNotNull(getConfig(BrooklynNode.MANAGEMENT_USER), getConfig(BrooklynNode.MANAGEMENT_PASSWORD)) .period(getConfig(POLL_PERIOD)) .poll(HttpPollConfig.forMultiple() .suburl("/sensors/current-state") .onSuccess(mirrorSensors) .onFailureOrException(new Function<Object, Void>() { @Override public Void apply(Object input) { ServiceStateLogic.updateMapSensorEntry(self, Attributes.SERVICE_PROBLEMS, "mirror-feed", "error contacting service"); if (input instanceof HttpToolResponse) { int responseCode = ((HttpToolResponse)input).getResponseCode(); if (responseCode == HttpStatus.SC_NOT_FOUND) { Entities.unmanage(self); } } return null; } })) .poll(HttpPollConfig.forSensor(MIRROR_SUMMARY).onSuccess(new MirrorSummary())).build(); populateEffectors(); }
Source:
public void testMultipleCookies() throws IOException { String requestURI = OAuthClient.AUTH_SERVER_ROOT + "/realms/foo/account"; Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_YEAR, 1); BasicClientCookie wrongCookie = new BasicClientCookie(AuthenticationSessionManager.AUTH_SESSION_ID, AUTH_SESSION_VALUE); wrongCookie.setDomain("localhost"); wrongCookie.setPath(OLD_COOKIE_PATH); wrongCookie.setExpiryDate(calendar.getTime()); CookieStore cookieStore = getCorrectCookies(requestURI); cookieStore.addCookie(wrongCookie); Assert.assertThat(cookieStore.getCookies(), Matchers.hasSize(3)); login(requestURI, cookieStore); Assert.assertThat(cookieStore.getCookies().stream().map(c -> c.getName()).collect(Collectors.toList()), Matchers.containsInAnyOrder("AUTH_SESSION_ID", "KEYCLOAK_IDENTITY", "KEYCLOAK_SESSION")); cookieStore.getCookies().stream().map(c -> c.getPath()).forEach(path ->Assert.assertThat(path, Matchers.endsWith("/"))); String authSessionId = cookieStore.getCookies().stream().filter(c -> "AUTH_SESSION_ID".equals(c.getName())).findFirst().get().getValue(); String KCSessionId = cookieStore.getCookies().stream().filter(c -> "KEYCLOAK_SESSION".equals(c.getName())).findFirst().get().getValue(); String KCSessionSuffix = KCSessionId.split("/")[2]; Assert.assertThat(authSessionId, Matchers.containsString(KCSessionSuffix)); }

Target:
public void testMultipleCookies() throws IOException { String requestURI = OAuthClient.AUTH_SERVER_ROOT + "/realms/foo/account"; Calendar calendar = Calendar.getInstance(); calendar.add(Calendar.DAY_OF_YEAR, 1); BasicClientCookie wrongCookie = new BasicClientCookie(AuthenticationSessionManager.AUTH_SESSION_ID, AUTH_SESSION_VALUE); wrongCookie.setDomain("localhost"); wrongCookie.setPath(OLD_COOKIE_PATH); wrongCookie.setExpiryDate(calendar.getTime()); CookieStore cookieStore = getCorrectCookies(requestURI); cookieStore.addCookie(wrongCookie); Assert.assertThat(cookieStore.getCookies(), Matchers.hasSize(3)); login(requestURI, cookieStore); Assert.assertThat(cookieStore.getCookies().stream().map(org.apache.http.cookie.Cookie::getName).collect(Collectors.toList()), Matchers.containsInAnyOrder("AUTH_SESSION_ID", "KEYCLOAK_IDENTITY", "KEYCLOAK_SESSION")); cookieStore.getCookies().stream().map(org.apache.http.cookie.Cookie::getPath).forEach(path ->Assert.assertThat(path, Matchers.endsWith("/"))); String authSessionId = cookieStore.getCookies().stream().filter(c -> "AUTH_SESSION_ID".equals(c.getName())).findFirst().get().getValue(); String KCSessionId = cookieStore.getCookies().stream().filter(c -> "KEYCLOAK_SESSION".equals(c.getName())).findFirst().get().getValue(); String KCSessionSuffix = KCSessionId.split("/")[2]; Assert.assertThat(authSessionId, Matchers.containsString(KCSessionSuffix)); }
Source:
public void setData(@Nullable ISegmentStoreProvider provider) { fSegmentProvider = provider; if (provider == null) { updateModel(null); return; } SegmentStoreTableDataProvider tableProvider = null; if(fTrace != null) { tableProvider = SegmentStoreTableDataProvider.getOrCreate(fTrace, provider); } fDataProvider = tableProvider; createColumns(); ISegmentStore<ISegment> segStore = provider.getSegmentStore(); if (segStore != null && tableProvider != null) { updateModel(tableProvider); return; } updateModel(null); SegmentStoreProviderProgressListener listener = fListener; if (listener != null) { provider.addListener(listener); } if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); } }

Target:
public void setData(@Nullable ISegmentStoreProvider provider) { fSegmentProvider = provider; if (provider == null) { updateModel(null); return; } SegmentStoreTableDataProvider tableProvider = null; ITmfTrace trace = fTrace; if(trace != null) { tableProvider = SegmentStoreTableDataProvider.getOrCreate(trace, provider); } fDataProvider = tableProvider; createColumns(); ISegmentStore<ISegment> segStore = provider.getSegmentStore(); if (segStore != null && tableProvider != null) { updateModel(tableProvider); return; } updateModel(null); SegmentStoreProviderProgressListener listener = fListener; if (listener != null) { provider.addListener(listener); } if (provider instanceof IAnalysisModule) { ((IAnalysisModule) provider).schedule(); } }
Source:
protected void persistNonRDFSource(final ResourceOperation operation, final OCFLObjectSession objectSession, final String rootIdentifier) throws PersistentStorageException { final var resourceId = operation.getResourceId(); final var fedoraSubpath = relativizeSubpath(rootIdentifier, resourceId); final var subpath = resolveOCFLSubpath(rootIdentifier, fedoraSubpath); log.debug("persisting ({}) to {}", resourceId, subpath); final var nonRdfSourceOperation = (NonRdfSourceOperation) operation; final FileWriteOutcome outcome; if (forExternalBinary(nonRdfSourceOperation)) { outcome = null; } else { final var transmissionDigestAlg = objectSession.getObjectDigestAlgorithm(); final var providedDigests = nonRdfSourceOperation.getContentDigests(); final var multiDigestWrapper = new MultiDigestInputStreamWrapper( nonRdfSourceOperation.getContentStream(), providedDigests, Arrays.asList(transmissionDigestAlg)); final var contentStream = multiDigestWrapper.getInputStream(); outcome = (FileWriteOutcome) objectSession.write(subpath, contentStream); if (!CollectionUtils.isEmpty(providedDigests)) { multiDigestWrapper.checkFixity(); } outcome.setDigests(multiDigestWrapper.getDigests()); objectSession.registerTransmissionDigest(subpath, multiDigestWrapper.getDigest(transmissionDigestAlg)); } final var headers = populateHeaders(objectSession, subpath, nonRdfSourceOperation, outcome, fedoraSubpath.isEmpty()); writeHeaders(objectSession, headers, subpath); }

Target:
protected void persistNonRDFSource(final ResourceOperation operation, final OCFLObjectSession objectSession, final String rootIdentifier) throws PersistentStorageException { final var resourceId = operation.getResourceId(); final var fedoraSubpath = relativizeSubpath(rootIdentifier, resourceId); final var subpath = resolveOCFLSubpath(rootIdentifier, fedoraSubpath); log.debug("persisting ({}) to {}", resourceId, subpath); final var nonRdfSourceOperation = (NonRdfSourceOperation) operation; final FileWriteOutcome outcome; if (forExternalBinary(nonRdfSourceOperation)) { outcome = null; } else { final var transmissionDigestAlg = objectSession.getObjectDigestAlgorithm(); final var providedDigests = nonRdfSourceOperation.getContentDigests(); final var multiDigestWrapper = new MultiDigestInputStreamWrapper( nonRdfSourceOperation.getContentStream(), providedDigests, List.of(transmissionDigestAlg)); final var contentStream = multiDigestWrapper.getInputStream(); outcome = (FileWriteOutcome) objectSession.write(subpath, contentStream); if (!CollectionUtils.isEmpty(providedDigests)) { multiDigestWrapper.checkFixity(); } outcome.setDigests(multiDigestWrapper.getDigests()); objectSession.registerTransmissionDigest(subpath, multiDigestWrapper.getDigest(transmissionDigestAlg)); } final var headers = populateHeaders(objectSession, subpath, nonRdfSourceOperation, outcome, fedoraSubpath.isEmpty()); writeHeaders(objectSession, headers, subpath); }
Source:
private void updateReferencedAnalysisReferences(final DAnalysis newDAnalysis) { EObject semanticParentRoot = getRootContainer(semanticObjectToControl.eContainer()); Set<DAnalysis> referencers = Sets.newLinkedHashSet(); for (Resource aird : session.getAllSessionResources()) { DAnalysis currentAnalysis = getDAnalysis(aird); Option<EObject> optionalMainModel = new DAnalysisQuery(currentAnalysis).getMainModel(); ArrayList<EObject> releventModels = Lists.<EObject> newArrayList(); if (optionalMainModel.some()) { releventModels.add(optionalMainModel.get()); for (EObject model : currentAnalysis.getModels()) { if (!AdapterFactoryEditingDomain.isControlled(model) && !(new EObjectQuery(optionalMainModel.get()).isContainedIn(model))) { releventModels.add(model); } } } if (Iterables.contains(releventModels, semanticParentRoot) && !newDAnalysis.getReferencedAnalysis().contains(currentAnalysis)) { List<DAnalysis> referencedAnalysis = new ArrayList<DAnalysis>(currentAnalysis.getReferencedAnalysis()); for (DAnalysis childrenAnalysis : referencedAnalysis) { Option<EObject> optionalChildrenMainModel = new DAnalysisQuery(childrenAnalysis).getMainModel(); if (optionalChildrenMainModel.some() && new EObjectQuery(optionalChildrenMainModel.get()).isContainedIn(semanticObjectToControl)) { currentAnalysis.getReferencedAnalysis().remove(childrenAnalysis); newDAnalysis.getReferencedAnalysis().add(childrenAnalysis); } } referencers.add(currentAnalysis); } } if (!referencers.isEmpty() && session instanceof DAnalysisSession) { ((DAnalysisSession) session).addReferencedAnalysis(newDAnalysis, referencers); } }

Target:
private void updateReferencedAnalysisReferences(final DAnalysis newDAnalysis) { EObject semanticParentRoot = getRootContainer(semanticObjectToControl.eContainer()); Set<DAnalysis> referencers = Sets.newLinkedHashSet(); for (Resource aird : session.getAllSessionResources()) { DAnalysis currentAnalysis = getDAnalysis(aird); Set<EObject> releventModels = new DAnalysisQuery(currentAnalysis).getMainModels(); if (Iterables.contains(releventModels, semanticParentRoot)) { List<DAnalysis> referencedAnalysis = new ArrayList<DAnalysis>(currentAnalysis.getReferencedAnalysis()); for (DAnalysis childrenAnalysis : referencedAnalysis) { Option<EObject> optionalChildrenMainModel = new DAnalysisQuery(childrenAnalysis).getMainModel(); if (optionalChildrenMainModel.some() && new EObjectQuery(optionalChildrenMainModel.get()).isContainedIn(semanticObjectToControl)) { currentAnalysis.getReferencedAnalysis().remove(childrenAnalysis); newDAnalysis.getReferencedAnalysis().add(childrenAnalysis); } } referencers.add(currentAnalysis); } } if (!referencers.isEmpty() && session instanceof DAnalysisSession) { ((DAnalysisSession) session).addReferencedAnalysis(newDAnalysis, referencers); } }
Source:
public Class<SQLCodeListEntry> getEntryType() { return SQLCodeListEntry.class; }

Target:
protected Class<SQLCodeListEntry> getEntryType() { return SQLCodeListEntry.class; }