auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean productsChanged = false; if (pool.getDerivedProduct() != null) { productsChanged = !pool.getDerivedProduct().getId() .equals(existingPool.getDerivedProduct().getId()); productsChanged = productsChanged || (changedProducts != null && changedProducts.containsKey(pool.getDerivedProduct().getId())); } Set<Product> currentProvided = productCurator.getPoolDerivedProvidedProductsCached(existingPool); Set<Product> incomingProvided = new HashSet<Product>(); if (pool.getDerivedProvidedProducts() != null) { for (Product p : pool.getDerivedProvidedProducts()) { incomingProvided.add(p); } } productsChanged = productsChanged || !currentProvided.equals(incomingProvided) || changedProductsInSet(incomingProvided, changedProducts); if (productsChanged) { if (pool.getDerivedProduct() != null) { existingPool.setDerivedProduct(pool.getDerivedProduct()); } else { existingPool.setDerivedProduct(null); } existingPool.getDerivedProvidedProducts().clear(); if (incomingProvided != null && !incomingProvided.isEmpty()) { existingPool.getDerivedProvidedProducts().addAll(incomingProvided); } } return productsChanged; }

Target:
private boolean checkForChangedDerivedProducts(Pool pool, Pool existingPool, Map<String, Product> changedProducts) { boolean productsChanged = false; if (pool.getDerivedProduct() != null) { productsChanged = !pool.getDerivedProduct().getId() .equals(existingPool.getDerivedProduct().getId()); productsChanged |= (changedProducts != null && changedProducts.containsKey(pool.getDerivedProduct().getId())); } Set<Product> currentProvided = productCurator.getPoolDerivedProvidedProductsCached(existingPool); Set<Product> incomingProvided = new HashSet<Product>(); if (pool.getDerivedProvidedProducts() != null) { for (Product p : pool.getDerivedProvidedProducts()) { incomingProvided.add(p); } } productsChanged |= !currentProvided.equals(incomingProvided) || changedProductsInSet(incomingProvided, changedProducts); if (productsChanged) { if (pool.getDerivedProduct() != null) { existingPool.setDerivedProduct(pool.getDerivedProduct()); } else { existingPool.setDerivedProduct(null); } existingPool.getDerivedProvidedProducts().clear(); if (incomingProvided != null && !incomingProvided.isEmpty()) { existingPool.getDerivedProvidedProducts().addAll(incomingProvided); } } return productsChanged; }
Source:
public File getSQLDialect(DatabaseType db_type) { String xmlNames[] = { (db_type != null ? db_type.name().toLowerCase() : "") + "-dialects.xml", this.benchmarkName + "-dialects.xml", }; for(String xmlName : xmlNames) { URL ddlURL = this.getClass().getResource( DIALECTS_DIR + File.separator + xmlName); if (ddlURL != null) return new File(ddlURL.getPath()); if (LOG.isDebugEnabled()) LOG.warn(String.format("Failed to find SQL Dialect XML file '%s'", xmlName)); } LOG.info("Failed to find SQL Dialect XML file "); return (null); }

Target:
public File getSQLDialect(DatabaseType db_type) { String xmlNames[] = { (db_type != null ? db_type.name().toLowerCase() : "") + "-dialects.xml", this.benchmarkName + "-dialects.xml", }; for(String xmlName : xmlNames) { URL ddlURL = this.getClass().getResource( DIALECTS_DIR + File.separator + xmlName); if (ddlURL != null) return new File(ddlURL.getPath()); if (LOG.isDebugEnabled()) LOG.warn(String.format("Failed to find SQL Dialect XML file '%s'", xmlName)); } return (null); }
Source:
public void configure() throws Exception { from("{{fcrepo.stream}}") .routeId("CdrMetaServicesRouter") .to("direct-vm:index.start") .to("direct:process.enhancement"); from("direct:process.enhancement") .routeId("ProcessEnhancement") .filter(simple("${headers[org.fcrepo.jms.eventType]} contains 'ResourceCreation'" + " && ${headers[org.fcrepo.jms.identifier]} regex '.*original_file'" + " && ${headers[org.fcrepo.jms.resourceType]} contains '" + Binary.getURI() + "'")) .threads(enhancementThreads, enhancementThreads, "CdrEnhancementThread") .delay(simple("{{cdr.enhancement.postIndexingDelay}}")) .to("direct:process.binary.original"); from("direct:process.binary.original") .routeId("ProcessOriginalBinary") .log(LoggingLevel.DEBUG, "Processing binary metadata for ${headers[org.fcrepo.jms.identifier]}") .removeHeaders("CamelHttp*") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=ServerManaged&accept=text/turtle") .process(mdProcessor) .multicast() .to("direct-vm:imageEnhancements","direct-vm:extractFulltext", "direct-vm:replication"); }

Target:
public void configure() throws Exception { from("{{fcrepo.stream}}") .routeId("CdrMetaServicesRouter") .to("direct-vm:index.start") .to("direct:process.ingest"); from("direct:process.ingest") .routeId("ProcessIngest") .filter(simple("${headers[org.fcrepo.jms.eventType]} contains 'ResourceCreation'" + " && ${headers[org.fcrepo.jms.identifier]} regex '.*(original_file|techmd_fits)'" + " && ${headers[org.fcrepo.jms.resourceType]} contains '" + Binary.getURI() + "'")) .threads(enhancementThreads, enhancementThreads, "CdrEnhancementThread") .delay(simple("{{cdr.enhancement.postIndexingDelay}}")) .to("direct:process.creation"); from("direct:process.creation") .routeId("ProcessCreationEvent") .log(LoggingLevel.DEBUG, "Processing binary metadata for ${headers[org.fcrepo.jms.identifier]}") .removeHeaders("CamelHttp*") .to("fcrepo:{{fcrepo.baseUrl}}?preferInclude=ServerManaged&accept=text/turtle") .process(mdProcessor) .choice() .when(simple("${headers[org.fcrepo.jms.identifier]} regex '.*original_file'")) .to("direct-vm:replication") .to("direct:process.enhancements") .when(simple("${headers[org.fcrepo.jms.identifier]} regex '.*techmd_fits'")) .to("direct-vm:replication") .otherwise() .log(LoggingLevel.WARN, "Cannot process binary metadata for ${headers[org.fcrepo.jms.identifier]}") .end(); from("direct:process.enhancements") .routeId("ProcessEnhancements") .multicast() .to("direct-vm:imageEnhancements","direct-vm:extractFulltext"); }
Source:
public BloodTestingRule createEntity(BloodTestingRuleBackingForm bloodTestingRuleBackingForm) { BloodTestingRule bloodTestingRule = new BloodTestingRule(); bloodTestingRule.setId(bloodTestingRuleBackingForm.getId()); bloodTestingRule.setCategory(bloodTestingRuleBackingForm.getBloodTest().getCategory()); bloodTestingRule.setDonationFieldChanged(bloodTestingRuleBackingForm.getDonationFieldChanged()); bloodTestingRule.setIsDeleted(bloodTestingRuleBackingForm.getIsDeleted()); bloodTestingRule.setNewInformation(bloodTestingRuleBackingForm.getNewInformation()); bloodTestingRule.setPattern(bloodTestingRuleBackingForm.getPattern()); bloodTestingRule.setBloodTest(bloodTestFactory.createEntity(bloodTestingRuleBackingForm.getBloodTest())); bloodTestingRule.setPendingTestsIds(StringUtils.join(bloodTestingRuleBackingForm.getPendingTestsIds(), ',')); return bloodTestingRule; }

Target:
public BloodTestingRule createEntity(BloodTestingRuleBackingForm bloodTestingRuleBackingForm) { BloodTestingRule bloodTestingRule = new BloodTestingRule(); bloodTestingRule.setId(bloodTestingRuleBackingForm.getId()); bloodTestingRule.setDonationFieldChanged(bloodTestingRuleBackingForm.getDonationFieldChanged()); bloodTestingRule.setIsDeleted(bloodTestingRuleBackingForm.getIsDeleted()); bloodTestingRule.setNewInformation(bloodTestingRuleBackingForm.getNewInformation()); bloodTestingRule.setPattern(bloodTestingRuleBackingForm.getPattern()); bloodTestingRule.setBloodTest(bloodTestRepository.findBloodTestById(bloodTestingRuleBackingForm.getBloodTest().getId())); List<Long> pendingTestsIds = new ArrayList<>(); for (BloodTestBackingForm pendingBloodTest : bloodTestingRuleBackingForm.getPendingTests()) { pendingTestsIds.add(pendingBloodTest.getId()); } bloodTestingRule.setPendingTestsIds(StringUtils.join(pendingTestsIds, ',')); return bloodTestingRule; }
Source:
private boolean isRegexMatch(String pageMatcher, String toMatch) { Pattern patt = Pattern.compile(pageMatcher); return patt.matcher(toMatch).find(); }

Target:
private boolean isRegexMatch(String pageMatcher, String toMatch) { if (pattern == null) { pattern = Pattern.compile(pageMatcher); } return pattern.matcher(toMatch).find(); }
Source:
public long saveSequencerServiceRecord(SequencerServiceRecord record) throws IOException { return sequencerServiceRecordStore.save(record); }

Target:
public long saveSequencerServiceRecord(SequencerServiceRecord record) throws IOException { if (sequencerServiceRecordStore != null) { return sequencerServiceRecordStore.save(record); } else { throw new IOException("No sequencerServiceRecordStore available. Check that it has been declared in the Spring config."); } }
Source:
public void toggleToC(int action) { if (tocHandler == null) { return; } switch (action) { case ShowToCEvent.ACTION_SHOW: tocHandler.show(); break; case ShowToCEvent.ACTION_HIDE: tocHandler.hide(); break; default: if (tocHandler.isVisible()) { tocHandler.hide(); } else { tocHandler.show(); } } }

Target:
public void toggleToC(int action) { if (tocHandler == null) { return; } switch (action) { case ShowToCEvent.ACTION_SHOW: tocHandler.show(); break; case ShowToCEvent.ACTION_HIDE: tocHandler.hide(); break; case ShowToCEvent.ACTION_TOGGLE: if (tocHandler.isVisible()) { tocHandler.hide(); } else { tocHandler.show(); } break; default: throw new RuntimeException("Unknown action!"); } }
Source:
public ImmutableSetValue<BlockType> breakable() { return new ImmutableSpongeSetValue<BlockType>(Keys.BREAKABLE_BLOCK_TYPES, Sets.newHashSet(this.breakable)); }

Target:
public ImmutableSetValue<BlockType> breakable() { return (ImmutableSetValue<BlockType>) getValueGetter(); }
Source:
private void findAndWrite2OutputStream(MessageContext messageContext, OutputStream out, boolean preserve) throws AxisFault { try { SOAPEnvelope envelope = messageContext.getEnvelope(); OMElement contentEle = envelope.getBody().getFirstElement(); if (contentEle != null) { OMNode node = contentEle.getFirstOMChild(); if (!(node instanceof OMText)) { String msg = "Wrong Input for the Validator, " + "the content of the first child element of the Body " + "should have the zip file"; log.error(msg); throw new AxisFault(msg); } OMText binaryDataNode = (OMText) node; DataHandler dh = (DataHandler) binaryDataNode.getDataHandler(); DataSource dataSource = dh.getDataSource(); if (dataSource instanceof StreamingOnRequestDataSource) { if (((StreamingOnRequestDataSource) dataSource).isConsumed()) { Object httpMethodObj = messageContext.getProperty(Constants.Configuration.HTTP_METHOD); if ((httpMethodObj instanceof String) && "POST".equals(httpMethodObj)) { log.warn("Attempting to send an already consumed request [" + messageContext.getTo().getAddress() + " POST/Empty Message Body]"); } } if (!preserve && dataSource instanceof StreamingOnRequestDataSource) { ((StreamingOnRequestDataSource) dataSource).setLastUse(true); } } dh.writeTo(out); } } catch (OMException e) { log.error(e); throw AxisFault.makeFault(e); } catch (IOException e) { log.error(e); throw AxisFault.makeFault(e); } }

Target:
private void findAndWrite2OutputStream(MessageContext messageContext, OutputStream out, boolean preserve) throws AxisFault { try { SOAPEnvelope envelope = messageContext.getEnvelope(); OMElement contentEle = envelope.getBody().getFirstElement(); if (contentEle != null) { OMNode node = contentEle.getFirstOMChild(); if (!(node instanceof OMText)) { String msg = "Wrong Input for the Validator, " + "the content of the first child element of the Body " + "should have the zip file"; log.error(msg); throw new AxisFault(msg); } OMText binaryDataNode = (OMText) node; DataHandler dh = (DataHandler) binaryDataNode.getDataHandler(); DataSource dataSource = dh.getDataSource(); if (dataSource instanceof StreamingOnRequestDataSource) { if (((StreamingOnRequestDataSource) dataSource).isConsumed()) { Object httpMethodObj = messageContext.getProperty(Constants.Configuration.HTTP_METHOD); if ((httpMethodObj instanceof String) && "POST".equals(httpMethodObj)) { log.warn("Attempting to send an already consumed request [" + messageContext.getTo().getAddress() + " POST/Empty Message Body]"); } if (!preserve) { ((StreamingOnRequestDataSource) dataSource).setLastUse(true); } } } dh.writeTo(out); } } catch (OMException e) { log.error(e); throw AxisFault.makeFault(e); } catch (IOException e) { log.error(e); throw AxisFault.makeFault(e); } }
Source:
public ConsumerDTO create( @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal, @QueryParam("username") String userName, @QueryParam("owner") String ownerKey, @QueryParam("activation_keys") String activationKeys, @QueryParam("identity_cert_creation") @DefaultValue("true") boolean identityCertCreation) throws BadRequestException { Consumer consumer = new Consumer(); if (dto.getUuid() != null) { consumer.setUuid(dto.getUuid()); } populateEntity(consumer, dto); if (dto.getType() != null) { ConsumerType ctype = this.consumerTypeCurator.lookupByLabel(dto.getType().getLabel()); if (ctype == null) { throw new BadRequestException(i18n.tr("Invalid unit type: {0}", dto.getType().getLabel())); } consumer.setType(ctype); } else { throw new BadRequestException(i18n.tr("Unit type must be specified.")); } if (dto.getCreated() != null) { consumer.setCreated(dto.getCreated()); } return translator.translate(createConsumerFromEntity(consumer, principal, userName, ownerKey, activationKeys, identityCertCreation), ConsumerDTO.class); }

Target:
public ConsumerDTO create( @ApiParam(name = "consumer", required = true) ConsumerDTO dto, @Context Principal principal, @QueryParam("username") String userName, @QueryParam("owner") String ownerKey, @QueryParam("activation_keys") String activationKeys, @QueryParam("identity_cert_creation") @DefaultValue("true") boolean identityCertCreation) throws BadRequestException { Consumer consumer = new Consumer(); if (dto.getUuid() != null) { consumer.setUuid(dto.getUuid()); } populateEntity(consumer, dto); if (dto.getType() == null) { throw new BadRequestException(i18n.tr("Unit type must be specified.")); } ConsumerType ctype = this.consumerTypeCurator.lookupByLabel(dto.getType().getLabel()); if (ctype == null) { throw new BadRequestException(i18n.tr("Invalid unit type: {0}", dto.getType().getLabel())); } consumer.setType(ctype); if (dto.getCreated() != null) { consumer.setCreated(dto.getCreated()); } return translator.translate(createConsumerFromEntity(consumer, principal, userName, ownerKey, activationKeys, identityCertCreation), ConsumerDTO.class); }
Source:
protected void write(LogEntry entity, CSVPrinter printer) throws IOException { List<String> propertiesToFetch = getPropertiesToFetch(); for (String property : propertiesToFetch) { String getterName = "get" + property.substring(0, 1).toUpperCase() + property.substring(1); try { printer.print(entity.getClass().getMethod(getterName).invoke(entity)); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { log.catching(e); } } }

Target:
protected void write(LogEntry entity, CSVPrinter printer) throws IOException { Set<String> propertiesToFetch = new HashSet<>(getPropertiesToFetch()); if (propertiesToFetch.contains(LOG_ID)) { printer.print(entity.getId()); } if (propertiesToFetch.contains(LOG_CATEGORY)) { printer.print(entity.getCategory()); } if (propertiesToFetch.contains(LOG_PRINCIPAL_NAME)) { printer.print(entity.getPrincipalName()); } if (propertiesToFetch.contains(LOG_COMMENT)) { printer.print(entity.getComment()); } if (propertiesToFetch.contains(LOG_DOC_LIFE_CYCLE)) { printer.print(entity.getDocLifeCycle()); } if (propertiesToFetch.contains(LOG_DOC_PATH)) { printer.print(entity.getDocPath()); } if (propertiesToFetch.contains(LOG_DOC_TYPE)) { printer.print(entity.getDocType()); } if (propertiesToFetch.contains(LOG_DOC_UUID)) { printer.print(entity.getDocUUID()); } if (propertiesToFetch.contains(LOG_EVENT_ID)) { printer.print(entity.getEventId()); } if (propertiesToFetch.contains(LOG_REPOSITORY_ID)) { printer.print(entity.getRepositoryId()); } if (propertiesToFetch.contains(LOG_EVENT_DATE)) { printer.print(entity.getEventDate()); } if (propertiesToFetch.contains(LOG_LOG_DATE)) { printer.print(entity.getLogDate()); } }
Source:
public static Index loadIndex(final String source, final InputStream inputStream) { try (BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream, Defaults.NON_ZERO_BUFFER_SIZE)) { return createIndex(bufferedInputStream); } catch (final EOFException ex) { throw new TribbleException.CorruptedIndexFile("Index file is corrupted", source, ex); } catch (final IOException ex) { throw new RuntimeIOException("Failed to read index file: " + source, ex); } }

Target:
public static Index loadIndex(final String source, final InputStream inputStream) { try (BufferedInputStream bufferedInputStream = new BufferedInputStream(inputStream, Defaults.NON_ZERO_BUFFER_SIZE)) { return createIndex(bufferedInputStream); } catch (final EOFException ex) { throw new TribbleException.CorruptedIndexFile("Index file is corrupted", source, ex); } catch (final IOException ex) { throw new TribbleException.UnableToReadIndexFile("Failed to read index file", source, ex); } }
Source:
public CSVLoaderConsumer(String dataLoadingPolicy, Session session, String schema) { this.dataLoadingPolicy = Objects.requireNonNull(dataLoadingPolicy, "duplicatePolicy must not be null"); if (!DATA_LOADING_POLICIES.contains(dataLoadingPolicy)) { throw new DirectoryException("Invalid dataLoadingPolicy: " + dataLoadingPolicy + ", it should be one of: " + DATA_LOADING_POLICIES); } this.session = Objects.requireNonNull(session, "session is null"); this.schema = Objects.requireNonNull(schema, "schema is null"); }

Target:
public CSVLoaderConsumer(String dataLoadingPolicy, Session session, String schema) { this.dataLoadingPolicy = dataLoadingPolicy; this.session = session; this.schema = schema; }
Source:
public void setUpProgressListener() throws Exception { Method setCurrentMethod = TaskUtil.class.getDeclaredMethod( "setCurrent", ProgressListener.class ); setCurrentMethod.setAccessible( true ); setCurrentMethod.invoke( null, new CancellableProgressListenerWrapper( null ) ); }

Target:
public void setUpProgressListener() throws Exception { new TaskUtil() { { setCurrent( new CancellableProgressListenerWrapper( null ) ); } }; }
Source:
public int add( final SegmentIdentifier identifier, final InputRow row, final Supplier<Committer> committerSupplier ) throws IndexSizeExceededException, SegmentNotWritableException { if (!identifier.getDataSource().equals(schema.getDataSource())) { throw new IAE( "Expected dataSource[%s] but was asked to insert row for dataSource[%s]?!", schema.getDataSource(), identifier.getDataSource() ); } final Sink sink = getOrCreateSink(identifier); metrics.reportMessageMaxTimestamp(row.getTimestampFromEpoch()); final int sinkRowsInMemoryBeforeAdd = sink.getNumRowsInMemory(); final int sinkRowsInMemoryAfterAdd; try { sinkRowsInMemoryAfterAdd = sink.add(row); } catch (IndexSizeExceededException e) { log.error(e, "Sink for segment[%s] was unexpectedly full!", identifier); throw e; } if (sinkRowsInMemoryAfterAdd < 0) { throw new SegmentNotWritableException("Attempt to add row to swapped-out sink for segment[%s].", identifier); } final int numAddedRows = sinkRowsInMemoryAfterAdd - sinkRowsInMemoryBeforeAdd; rowsCurrentlyInMemory += numAddedRows; totalRows += numAddedRows; if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush || rowsCurrentlyInMemory >= tuningConfig.getMaxRowsInMemory()) { persistAll(committerSupplier.get()); } return sink.getNumRows(); }

Target:
public int add( final SegmentIdentifier identifier, final InputRow row, final Supplier<Committer> committerSupplier ) throws IndexSizeExceededException, SegmentNotWritableException { if (!identifier.getDataSource().equals(schema.getDataSource())) { throw new IAE( "Expected dataSource[%s] but was asked to insert row for dataSource[%s]?!", schema.getDataSource(), identifier.getDataSource() ); } final Sink sink = getOrCreateSink(identifier); metrics.reportMessageMaxTimestamp(row.getTimestampFromEpoch()); final int sinkRowsInMemoryBeforeAdd = sink.getNumRowsInMemory(); final int sinkRowsInMemoryAfterAdd; try { sinkRowsInMemoryAfterAdd = sink.add(row); } catch (IndexSizeExceededException e) { log.error(e, "Sink for segment[%s] was unexpectedly full!", identifier); throw e; } if (sinkRowsInMemoryAfterAdd < 0) { throw new SegmentNotWritableException("Attempt to add row to swapped-out sink for segment[%s].", identifier); } final int numAddedRows = sinkRowsInMemoryAfterAdd - sinkRowsInMemoryBeforeAdd; rowsCurrentlyInMemory.addAndGet(numAddedRows); totalRows.addAndGet(numAddedRows); if (!sink.canAppendRow() || System.currentTimeMillis() > nextFlush || rowsCurrentlyInMemory.get() >= tuningConfig.getMaxRowsInMemory()) { persistAll(committerSupplier.get()); } return sink.getNumRows(); }
Source:
protected AbstractEventGateway(Builder builder) { this.eventBus = builder.eventBus; this.dispatchInterceptors = builder.dispatchInterceptors; }

Target:
protected AbstractEventGateway(Builder builder) { builder.validate(); this.eventBus = builder.eventBus; this.dispatchInterceptors = builder.dispatchInterceptors; }
Source:
public TransactionCoordinator buildTransactionCoordinator(TransactionCoordinatorOwner owner, TransactionCoordinatorOptions options) { if ( delegate.isJta() ) { TransactionCoordinator coordinator = delegate.buildTransactionCoordinator( owner, options ); return new Neo4jJtaTransactionCoordinator( coordinator, datastoreProvider ); } else { NoopJdbcResourceTransactionCoordinatorOwner noopOwner = new NoopJdbcResourceTransactionCoordinatorOwner( owner ); TransactionCoordinator coordinator = delegate.buildTransactionCoordinator( noopOwner, options ); return new Neo4jLocalTransactionCoordinator( coordinator, datastoreProvider ); } }

Target:
public TransactionCoordinator buildTransactionCoordinator(TransactionCoordinatorOwner owner, TransactionCoordinatorOptions options) { if ( delegate.isJta() ) { TransactionCoordinator coordinator = delegate.buildTransactionCoordinator( owner, options ); return new Neo4jJtaTransactionCoordinator( coordinator, datastoreProvider ); } else { return new Neo4jResourceLocalTransactionCoordinator( this, owner, datastoreProvider ); } }
Source:
public void sendResponse(String message) { try (MDCCloseable mdc = Logging.withContextMapCloseable(loggingContext)) { if (message != null) { T response = rpcModule.unmarshalResponse(message); if (response.getErrorMessage() != null) { responseFuture.completeExceptionally(new RemoteExecutionException(response.getErrorMessage())); span.log(response.getErrorMessage()); failedMeter.mark(); } else { responseFuture.complete(response); } isProcessed = true; responseSize.update(message.getBytes().length); } else { responseFuture.completeExceptionally(new RequestTimedOutException(new TimeoutException())); span.setTag(TAG_TIMEOUT, "true"); failedMeter.mark(); } rpcDuration.update(System.currentTimeMillis() - requestCreationTime); span.finish(); rpcResponseMap.remove(rpcId); messageCache.remove(rpcId); } catch (Throwable e) { LOG.warn("error while handling response for RPC module , response = \n \n", rpcModule.getId(), message, e); } }

Target:
public void sendResponse(String message) { try (MDCCloseable mdc = Logging.withContextMapCloseable(loggingContext)) { if (message != null) { T response = rpcModule.unmarshalResponse(message); if (response.getErrorMessage() != null) { responseFuture.completeExceptionally(new RemoteExecutionException(response.getErrorMessage())); span.log(response.getErrorMessage()); failedMeter.mark(); } else { responseFuture.complete(response); } isProcessed = true; responseSize.update(message.getBytes().length); } else { responseFuture.completeExceptionally(new RequestTimedOutException(new TimeoutException())); span.setTag(TAG_TIMEOUT, "true"); failedMeter.mark(); } rpcDuration.update(System.currentTimeMillis() - requestCreationTime); span.finish(); rpcResponseMap.remove(rpcId); messageCache.remove(rpcId); } catch (Throwable e) { LOG.warn("Error while handling response for RPC module: {}. Response string: {}", rpcModule.getId(), message, e); } }
Source:
public InputStream wrap(InputStream inputStream) { if (inputStream == null) return null; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); OutputStream tee = new FilterOutputStream(buffer) { @Override public void close() throws IOException { synchronized (FileStreamDumper.this) { dumpOutput.write(buffer.toByteArray()); dumpOutput.flush(); } super.close(); } }; return new TeeInputStream(inputStream, tee, true); }

Target:
public InputStream wrap(InputStream inputStream) { if (inputStream == null) return null; ByteArrayOutputStream buffer = new ByteArrayOutputStream(); OutputStream tee = new FilterOutputStream(buffer) { @Override public void close() throws IOException { synchronized (FileStreamDumper.this) { dumpOutput.write(buffer.toByteArray()); } super.close(); } }; return new TeeInputStream(inputStream, tee, true); }
Source:
public Response getTermsOfUse() { return response( req -> ok(systemConfig.getApiTermsOfUse())); }

Target:
public Response getTermsOfUse() { return allowCors(response( req -> ok(systemConfig.getApiTermsOfUse()))); }
Source:
public String toStringWithoutPersonalIdentifiableInformation() { return "ChargeCreateRequest{" + "amount=" + amount + ", reference='" + reference + '\'' + ", returnUrl='" + returnUrl + '\'' + delayedCapture != null ? ", delayed_capture=" + delayedCapture : "" + language != null ? ", language=" + language.toString() : "" + email != null ? ", email='" + email + '\'' : "" + '}'; }

Target:
public String toStringWithoutPersonalIdentifiableInformation() { return "ChargeCreateRequest{" + "amount=" + amount + ", reference='" + reference + '\'' + ", returnUrl='" + returnUrl + '\'' + delayedCapture != null ? ", delayed_capture=" + delayedCapture : "" + language != null ? ", language=" + language.toString() : "" + '}'; }
Source:
private static LeftToRightBitSet createMaskWithKBits(int sizeBytes, int baseSeqNum, List<Integer> protectedSeqNums) { int numBits = sizeBytes * 8; LeftToRightBitSet mask = new LeftToRightBitSet(numBits); for (Integer protectedSeqNum : protectedSeqNums) { int delta = protectedSeqNum - baseSeqNum; mask.set(delta); } if (sizeBytes > MASK_SIZE_SMALL) { if (sizeBytes > MASK_SIZE_MED) { LeftToRightBitSet.shiftBitsRight(mask, MASK_2_START_BIT - 3, numBits - 1, 1); } LeftToRightBitSet.shiftBitsRight(mask, MASK_1_START_BIT - 2, numBits - 1, 1); } LeftToRightBitSet.shiftBitsRight(mask, MASK_0_START_BIT - 1, numBits - 1, 1); if (sizeBytes > MASK_SIZE_MED) { mask.set(MASK_2_K_BIT); } else if (sizeBytes > MASK_SIZE_SMALL) { mask.set(MASK_1_K_BIT); } else { mask.set(MASK_0_K_BIT); } return mask; }

Target:
private static FlexFec03BitSet createMaskWithKBits(int sizeBytes, int baseSeqNum, List<Integer> protectedSeqNums) { int numBits = getNumBitsExcludingKBits(sizeBytes); FlexFec03BitSet mask = new FlexFec03BitSet(numBits); for (Integer protectedSeqNum : protectedSeqNums) { int delta = RTPUtils.getSequenceNumberDelta(protectedSeqNum , baseSeqNum); mask.set(delta); } if (sizeBytes > MASK_SIZE_MED) { mask.addBit(MASK_0_K_BIT, false); mask.addBit(MASK_1_K_BIT, false); mask.addBit(MASK_2_K_BIT, true); } else if (sizeBytes > MASK_SIZE_SMALL) { mask.addBit(MASK_0_K_BIT, false); mask.addBit(MASK_1_K_BIT, true); } else { mask.addBit(MASK_0_K_BIT, true); } return mask; }
Source:
public void setInitialPositionY(final HTMLElement dragAndDropElement, final List<HTMLElement> children) { Integer parentY = Position.getY(dragAndDropElement); for (final Element element : children) { parentY++; Position.setY(element, parentY); } }

Target:
public void setInitialPositionY(final HTMLElement dragAndDropElement, final List<HTMLElement> children) { Integer parentY = Position.getY(dragAndDropElement); for (final Element element : children) { Position.setY(element, ++parentY); } }
Source:
public int postEventsFromFile(String file) { try ( BufferedReader reader = new BufferedReader( new InputStreamReader( EventReceiverFirehoseTestClient.class.getResourceAsStream( file ) ) ); ) { String s; Collection<Map<String, Object>> events = new ArrayList<Map<String, Object>>(); int totalEventsPosted = 0; int expectedEvents = 0; while ((s = reader.readLine()) != null) { events.add( (Map<String, Object>) this.jsonMapper.readValue( s, new TypeReference<Map<String, Object>>() { } ) ); ObjectMapper mapper = (totalEventsPosted % 2 == 0) ? jsonMapper : smileMapper; String mediaType = (totalEventsPosted % 2 == 0) ? MediaType.APPLICATION_JSON : SmileMediaTypes.APPLICATION_JACKSON_SMILE; totalEventsPosted += postEvents(events, mapper, mediaType); expectedEvents += events.size(); events = new ArrayList<>(); } if (totalEventsPosted != expectedEvents) { throw new ISE("All events not posted, expected : %d actual : %d", expectedEvents, totalEventsPosted); } return totalEventsPosted; } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public int postEventsFromFile(String file) { try ( BufferedReader reader = new BufferedReader( new InputStreamReader( EventReceiverFirehoseTestClient.class.getResourceAsStream( file ) ) ); ) { String s; Collection<Map<String, Object>> events = new ArrayList<Map<String, Object>>(); int totalEventsPosted = 0; int expectedEventsPosted = 0; while ((s = reader.readLine()) != null) { events.add( (Map<String, Object>) this.jsonMapper.readValue( s, new TypeReference<Map<String, Object>>() { } ) ); ObjectMapper mapper = (totalEventsPosted % 2 == 0) ? jsonMapper : smileMapper; String mediaType = (totalEventsPosted % 2 == 0) ? MediaType.APPLICATION_JSON : SmileMediaTypes.APPLICATION_JACKSON_SMILE; totalEventsPosted += postEvents(events, mapper, mediaType); ; expectedEventsPosted += events.size(); events = new ArrayList<>(); } if (totalEventsPosted != expectedEventsPosted) { throw new ISE("All events not posted, expected : %d actual : %d", events.size(), totalEventsPosted); } return totalEventsPosted; } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
private boolean prereqSatisfied(String cdnURL) throws Exception { for (String namenode: props.getList("other_namenodes")) { if (removeTrailingSlash(namenode).equals(cdnURL)) { return true; } } return false; }

Target:
private boolean prereqSatisfied(String cdnURL) throws Exception { for (String namenode: props.getList(OTHER_NAMENODES)) { if (removeTrailingSlash(namenode).equals(cdnURL)) { return true; } } return false; }
Source:
public Path matchingFileSystem(Path source, Set<String> options) { URI sourceUri = source.toUri(); return options.stream().filter(opt -> { URI optUri = URI.create(opt); return sourceUri.getScheme().equals(optUri.getScheme()) && Objects.equals(sourceUri.getAuthority(), optUri.getAuthority()); }).map(Path::new).findFirst().orElse(null); }

Target:
public Path matchingFileSystem(Path source, Set<String> options) { URI sourceUri = source.toUri(); return options.stream().filter(opt -> { URI optUri = URI.create(opt); return sourceUri.getScheme().equals(optUri.getScheme()) && Objects.equals(sourceUri.getAuthority(), optUri.getAuthority()); }).map((String opt) -> new Path(opt)).findFirst().orElse(null); }
Source:
public void generateAutoGenNote() { outputln(" "); outputln(); }

Target:
public void generateAutoGenNote() { outputln(" "); outputln(" "); outputln(); }
Source:
public void check() { if (timeOut > 0 && System.currentTimeMillis() - startTime > timeOut) { throw new TaskCancelledException("Timed out"); } }

Target:
public void check() { if (timeOut > 0 && System.nanoTime() - startTime > timeOut) { throw new TaskCancelledException("Timed out"); } }
Source:
private boolean runUpdateMomPolicy(final VDS vds, boolean ballooningEnabled) { VDSReturnValue returnValue = new VDSReturnValue(); try { returnValue = runVdsCommand(VDSCommandType.SetMOMPolicyParameters, new MomPolicyVDSParameters(vds, ballooningEnabled)); } catch (VdcBLLException e) { log.errorFormat("Could not update MoM policy on host {0}", vds.getName()); } return returnValue.getSucceeded(); }

Target:
private boolean runUpdateMomPolicy(final VDS vds, boolean ballooningEnabled) { boolean succeeded = false; try { succeeded = runVdsCommand(VDSCommandType.SetMOMPolicyParameters, new MomPolicyVDSParameters(vds, ballooningEnabled)).getSucceeded(); } catch (VdcBLLException e) { log.errorFormat("Could not update MoM policy on host {0}", vds.getName()); } return succeeded; }
Source:
static List<Expression> fromInternal(Class<?>[] targetTypes, List<Expression> expressions, boolean varArgs) { final List<Expression> list = new ArrayList<>(); if (varArgs) { Class<?> varArgsType = targetTypes[targetTypes.length - 1].getComponentType(); for (int i = 0; i < expressions.size(); i++) { list.add( fromInternal(expressions.get(i), i < targetTypes.length - 1 ? targetTypes[i] : varArgsType)); } } else { for (int i = 0; i < expressions.size(); i++) { list.add(fromInternal(expressions.get(i), targetTypes[i])); } } return list; }

Target:
static List<Expression> fromInternal(Class<?>[] targetTypes, List<Expression> expressions, boolean varArgs) { final List<Expression> list = new ArrayList<>(); if (varArgs) { Class<?> varTargetType = targetTypes[targetTypes.length - 1]; Preconditions.checkArgument(varTargetType != null && varTargetType.isArray(), "the var target type should not null and it must be an array."); Class<?> varArgsType = varTargetType.getComponentType(); for (int i = 0; i < expressions.size(); i++) { list.add( fromInternal(expressions.get(i), i < targetTypes.length - 1 ? targetTypes[i] : varArgsType)); } } else { if (targetTypes.length == expressions.size()) { for (int i = 0; i < expressions.size(); i++) { list.add(fromInternal(expressions.get(i), targetTypes[i])); } } else { int j = 0; for (int i = 0; i < expressions.size(); i++) { Class<?> type; if (!targetTypes[j].isArray()) { type = targetTypes[j]; j++; } else { type = targetTypes[j].getComponentType(); } list.add(fromInternal(expressions.get(i), type)); } } } return list; }
Source:
private void decreasePendingVms() { Guid vdsId = getCurrentVdsId(); VM vm = getVm(); if (vdsId == null || vdsId.equals(lastDecreasedVds)) { log.debugFormat("PendingVms for {0} was already released, not releasing again", vm.getName()); return; } lastDecreasedVds = vdsId; VmHandler.decreasePendingVms(vm, vdsId); getBlockingQueue(vdsId).offer(Boolean.TRUE); }

Target:
private void decreasePendingVms() { Guid vdsId = getCurrentVdsId(); VM vm = getVm(); if (vdsId == null || vdsId.equals(lastDecreasedVds)) { log.debugFormat("PendingVms for the guest {0} running on host {1} was already released, not releasing again", vm.getName(), vdsId); return; } lastDecreasedVds = vdsId; VmHandler.decreasePendingVms(vm, vdsId); getBlockingQueue(vdsId).offer(Boolean.TRUE); }
Source:
public void removeTempInstance() { if (formController != null && formController.getInstanceFile() != null) { SaveFormToDisk.removeSavepointFiles(formController.getInstanceFile().getName()); if (!InstancesDaoHelper.isInstanceAvailable(getAbsoluteInstancePath())) { String instanceFolder = formController.getInstanceFile().getParent(); Timber.i("Attempting to delete: %s", instanceFolder); File file = formController.getInstanceFile().getParentFile(); int images = MediaUtils.deleteImagesInFolderFromMediaProvider(file); int audio = MediaUtils.deleteAudioInFolderFromMediaProvider(file); int video = MediaUtils.deleteVideoInFolderFromMediaProvider(file); Timber.i("Removed from content providers: %d image files, %d audio files and %d audio files.", images, audio, video); FileUtils.purgeMediaPath(instanceFolder); } } else { Timber.w("null returned by getFormController()"); } }

Target:
public void removeTempInstance() { if (formController != null && formController.getInstanceFile() != null) { SaveFormToDisk.removeSavepointFiles(formController.getInstanceFile().getName()); if (!InstancesDaoHelper.isInstanceAvailable(getAbsoluteInstancePath())) { String instanceFolder = formController.getInstanceFile().getParent(); Timber.i("Attempting to delete: %s", instanceFolder); File file = formController.getInstanceFile().getParentFile(); int images = MediaUtils.deleteImagesInFolderFromMediaProvider(file); int audio = MediaUtils.deleteAudioInFolderFromMediaProvider(file); int video = MediaUtils.deleteVideoInFolderFromMediaProvider(file); Timber.i("Removed from content providers: %d image files, %d audio files and %d audio files.", images, audio, video); FileUtils.purgeMediaPath(instanceFolder); } } }
Source:
private List<EmailLogEntry> filterLogsForEmailLogPage(List<AppLogLine> appLogLines, AdminEmailLogPageData data) { List<EmailLogEntry> emailLogs = new LinkedList<EmailLogEntry>(); for (AppLogLine appLog : appLogLines) { String logMsg = appLog.getLogMessage(); boolean isNotEmailLog = (!logMsg.contains("TEAMMATESEMAILLOG")); if (isNotEmailLog) { continue; } EmailLogEntry emailLogEntry = new EmailLogEntry(appLog); if(!data.shouldShowLog(emailLogEntry)) { continue; } emailLogs.add(emailLogEntry); } return emailLogs; }

Target:
private List<EmailLogEntry> filterLogsForEmailLogPage(List<AppLogLine> appLogLines, AdminEmailLogPageData data) { List<EmailLogEntry> emailLogs = new LinkedList<EmailLogEntry>(); for (AppLogLine appLog : appLogLines) { String logMsg = appLog.getLogMessage(); boolean isNotEmailLog = (!logMsg.contains("TEAMMATESEMAILLOG")); if (isNotEmailLog) { continue; } EmailLogEntry emailLogEntry = new EmailLogEntry(appLog); if (data.shouldShowLog(emailLogEntry)) { emailLogs.add(emailLogEntry); } } return emailLogs; }
Source:
public void navigate() { FinderNavigation navigation; if (ConfigUtils.isDomain()) { navigation = new FinderNavigation(browser, DomainConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.PROFILES) .addAddress(FinderNames.PROFILE, "full"); } else { navigation = new FinderNavigation(browser, StandaloneConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS); } navigation.addAddress(FinderNames.SUBSYSTEM, "Transactions"); navigation.selectRow().invoke(FinderNames.VIEW); Application.waitUntilVisible(); }

Target:
public void navigate() { FinderNavigation navigation; if (ConfigUtils.isDomain()) { navigation = new FinderNavigation(browser, DomainConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.PROFILES) .addAddress(FinderNames.PROFILE, ConfigUtils.getDefaultProfile()); } else { navigation = new FinderNavigation(browser, StandaloneConfigEntryPoint.class) .addAddress(FinderNames.CONFIGURATION, FinderNames.SUBSYSTEMS); } navigation.addAddress(FinderNames.SUBSYSTEM, "Transactions"); navigation.selectRow().invoke(FinderNames.VIEW); Application.waitUntilVisible(); }
Source:
private void validate() { ArgChecker.isTrue(fixedLeg.getCurrency().equals(floatingLeg.getCurrency()), "Conventions must have same currency"); }

Target:
private void validate() { ArgChecker.isTrue( fixedLeg.getCurrency().equals(floatingLeg.getCurrency()), Messages.format( "Swap leg conventions must have same currency but found and {}, conventions and {}", fixedLeg.getCurrency(), floatingLeg.getCurrency(), fixedLeg, floatingLeg)); }
Source:
public List getList(String key) { for (Config child : children) { if (child.containsKey(key)) { return child.getList(key); } } return null; }

Target:
public List getList(String key) { for (Config child : children) { if (child.containsKey(key)) { return child.getList(key); } } return notFound(key); }
Source:
private String getExternalUserPassword() { if (externalUserPassword == null) { externalUserPassword = UUID.randomUUID().toString(); } return externalUserPassword; }

Target:
String getExternalUserPassword() { if (externalUserPassword == null) { externalUserPassword = UUID.randomUUID().toString(); } return externalUserPassword; }
Source:
private <DATA_TYPE> void handleBackgroundOperationException(OperationAndData<DATA_TYPE> operationAndData, Throwable e) { if ( (operationAndData != null) && RetryLoop.isRetryException(e) ) { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retry-able exception received", e); } if ( client.getRetryPolicy().allowRetry(operationAndData.getThenIncrementRetryCount(), operationAndData.getElapsedTimeMs(), operationAndData) ) { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retrying operation"); } backgroundOperations.offer(operationAndData); return; } else { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retry policy did not allow retry"); } if ( operationAndData.getErrorCallback() != null ) { operationAndData.getErrorCallback().retriesExhausted(operationAndData); } } } logError("Background exception was not retry-able or retry gave up", e); }

Target:
private <DATA_TYPE> void handleBackgroundOperationException(OperationAndData<DATA_TYPE> operationAndData, Throwable e) { do { if ( (operationAndData != null) && RetryLoop.isRetryException(e) ) { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retry-able exception received", e); } if ( client.getRetryPolicy().allowRetry(operationAndData.getThenIncrementRetryCount(), operationAndData.getElapsedTimeMs(), operationAndData) ) { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retrying operation"); } backgroundOperations.offer(operationAndData); break; } else { if ( !Boolean.getBoolean(DebugUtils.PROPERTY_DONT_LOG_CONNECTION_ISSUES) ) { log.debug("Retry policy did not allow retry"); } if ( operationAndData.getErrorCallback() != null ) { operationAndData.getErrorCallback().retriesExhausted(operationAndData); } } } logError("Background exception was not retry-able or retry gave up", e); } while ( false ); }
Source:
public List<Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.SWITCH_STATEMENT); }

Target:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.SWITCH_STATEMENT); }
Source:
private static PreSharedKeyIdentity deserializeIdentity(final DatagramReader reader) { byte scoped = reader.readNextByte(); if (scoped == 1) { byte[] bytes = readBytesWithLength(PSK_LENGTH_BITS, reader); String virtualHost = bytes.length == 0 ? null : new String(bytes, StandardCharsets.UTF_8); bytes = readBytesWithLength(PSK_LENGTH_BITS, reader); return new PreSharedKeyIdentity(virtualHost, new String(bytes, StandardCharsets.UTF_8)); } else { byte[] bytes = readBytesWithLength(PSK_LENGTH_BITS, reader); return new PreSharedKeyIdentity(new String(bytes, StandardCharsets.UTF_8)); } }

Target:
private static PreSharedKeyIdentity deserializeIdentity(final DatagramReader reader) { byte scoped = reader.readNextByte(); if (scoped == 1) { byte[] bytes = readBytesWithLength(PSK_HOSTNAME_LENGTH_BITS, reader); String virtualHost = bytes.length == 0 ? null : new String(bytes, StandardCharsets.UTF_8); bytes = readBytesWithLength(PSK_IDENTITY_LENGTH_BITS, reader); return new PreSharedKeyIdentity(virtualHost, new String(bytes, StandardCharsets.UTF_8)); } else { byte[] bytes = readBytesWithLength(PSK_IDENTITY_LENGTH_BITS, reader); return new PreSharedKeyIdentity(new String(bytes, StandardCharsets.UTF_8)); } }
Source:
private void addItemsToBudgetSpinner() { final List<Budget> budgetList = appData.getBudgetList(); List<String> budgetNameList = new ArrayList<String>(); for (Budget b : budgetList) { Log.d(TAG, b.getName()); budgetNameList.add(b.getName()); } budgetNameList.add(getResources().getString(R.string.new_budget)); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, R.layout.spinner_layout, budgetNameList); dataAdapter.setDropDownViewResource(R.layout.spinner_entry_layout); mBudgetView.setAdapter(dataAdapter); mBudgetView.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { if (pos == budgetList.size()) { startActivity(new Intent(AddEntryActivity.this, AddBudgetActivity.class)); Toast.makeText(parent.getContext(), "new budget!", Toast.LENGTH_LONG).show(); } } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); }

Target:
private void addItemsToBudgetSpinner() { final List<Budget> budgetList = appData.getBudgetList(); List<String> budgetNameList = new ArrayList<String>(); for (Budget b : budgetList) { Log.d(TAG, b.getName()); budgetNameList.add(b.getName()); } budgetNameList.add(getResources().getString(R.string.new_budget)); ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this, R.layout.spinner_layout, budgetNameList); dataAdapter.setDropDownViewResource(R.layout.spinner_entry_layout); mBudgetView.setAdapter(dataAdapter); mBudgetView.setOnItemSelectedListener(new OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) { if (pos == budgetList.size()) { startActivity(new Intent(AddEntryActivity.this, AddBudgetActivity.class)); } } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); }
Source:
public void shouldWarnAboutRocksDBConfigSetterIsNotGuaranteedToBeBackwardsCompatible() { props.setProperty(StreamsConfig.ROCKSDB_CONFIG_SETTER_CLASS_CONFIG, TestRocksDbConfigSetter.class.getName()); final LogCaptureAppender appender = LogCaptureAppender.createAndRegister(); try { new KafkaStreams(new StreamsBuilder().build(), props, supplier, time); } finally { LogCaptureAppender.unregister(appender); } assertThat(appender.getMessages(), hasItem("stream-client [" + CLIENT_ID + "] " + "RocksDB's version will be bumped to version 6+ via KAFKA-8897 in a future release. " + "If you use `org.rocksdb.CompactionOptionsFIFO#setTtl(long)` or `#ttl()` you will need to rewrite " + "your code after KAFKA-8897 is resolved and set TTL via `org.rocksdb.Options` " + "(or `org.rocksdb.ColumnFamilyOptions`).")); }

Target:
public void shouldWarnAboutRocksDBConfigSetterIsNotGuaranteedToBeBackwardsCompatible() { props.setProperty(StreamsConfig.ROCKSDB_CONFIG_SETTER_CLASS_CONFIG, TestRocksDbConfigSetter.class.getName()); try (final LogCaptureAppender appender = LogCaptureAppender.createAndRegister()) { new KafkaStreams(new StreamsBuilder().build(), props, supplier, time); assertThat(appender.getMessages(), hasItem("stream-client [" + CLIENT_ID + "] " + "RocksDB's version will be bumped to version 6+ via KAFKA-8897 in a future release. " + "If you use `org.rocksdb.CompactionOptionsFIFO#setTtl(long)` or `#ttl()` you will need to rewrite " + "your code after KAFKA-8897 is resolved and set TTL via `org.rocksdb.Options` " + "(or `org.rocksdb.ColumnFamilyOptions`).")); } }
Source:
private Object getScriptResult(String script, ScriptEngine engine) { String scriptToExecute = script.substring(script.indexOf(":") + 1); try { return engine.eval(scriptToExecute); } catch (Exception e) { return null; } }

Target:
private Object getScriptResult(String script, ScriptEngine engine) throws ScriptException { String scriptToExecute = script.substring(script.indexOf(":") + 1); return engine.eval(scriptToExecute); }
Source:
public boolean isChangedBy(ProductContentData dto) { if (dto == null) { throw new IllegalArgumentException("dto is null"); } if (dto.isEnabled() != null && !dto.isEnabled().equals(this.enabled)) { return true; } if (dto.getContent() != null) { ContentData dtoContent = dto.getContent(); if (this.content == null || (dtoContent.getUuid() != null && !dtoContent.getUuid().contentEquals(this.getContent().getUuid())) || (dtoContent.getId() != null && !dtoContent.getId().contentEquals(this.getContent().getId())) || this.content.isChangedBy(dto.getContent())) { return true; } } return false; }

Target:
public boolean isChangedBy(ProductContentData dto) { if (dto == null) { throw new IllegalArgumentException("dto is null"); } if (dto.isEnabled() != null && !dto.isEnabled().equals(this.enabled)) { return true; } if (dto.getContent() != null) { if (this.content == null || this.content.isChangedBy(dto.getContent())) { return true; } } return false; }
Source:
public static SAXParserFactory newSecureSAXParserFactory() { SAXParserFactory factory = SAXParserFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException | SAXNotRecognizedException | SAXNotSupportedException e) { LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Feature not supported", e)); } return factory; }

Target:
public static SAXParserFactory newSecureSAXParserFactory() { SAXParserFactory factory = SAXParserFactory.newInstance(); try { factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); } catch (ParserConfigurationException e) { LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Feature not supported", e)); } catch (SAXException e) { LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Feature not supported", e)); } return factory; }