auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void notifyBridgeAboutChildHandlerInitialization(final Thing thing) { final Bridge bridge = getBridge(thing.getBridgeUID()); if (bridge != null) { ThreadPoolManager.getPool(THING_MANAGER_THREADPOOL_NAME).execute(new Runnable() { @Override public void run() { try { BridgeHandler bridgeHandler = bridge.getHandler(); if (bridgeHandler != null) { bridgeHandler.childHandlerInitialized(thing.getHandler(), thing); } } catch (Exception ex) { logger.error("Exception occured during bridge handler notification ('" + bridge.getUID() + "') about handler initialization of child '{}' '" + thing.getUID() + "': " + ex.getMessage(), ex); } } }); } }

Target:
private void notifyBridgeAboutChildHandlerInitialization(final Thing thing) { final Bridge bridge = getBridge(thing.getBridgeUID()); if (bridge != null) { ThreadPoolManager.getPool(THING_MANAGER_THREADPOOL_NAME).execute(new Runnable() { @Override public void run() { try { BridgeHandler bridgeHandler = bridge.getHandler(); if (bridgeHandler != null) { bridgeHandler.childHandlerInitialized(thing.getHandler(), thing); } } catch (Exception e) { logger.error( "Exception occured during bridge handler ('{}') notification about handler initialization of child '{}': {}", bridge.getUID(), thing.getUID(), e.getMessage(), e); } } }); } }
Source:
public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; final String sortOrderStr; if (collectionId != null) { sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); } else { sortOrderStr = null; } return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }

Target:
public Observable<List<Product>> getProducts(final int page, final Long collectionId, final Set<String> tags, final Collection.SortOrder sortOrder) { if (page < 1) { throw new IllegalArgumentException("page is a 1-based index, value cannot be less than 1"); } String sortOrderStr = sortOrder != null ? sortOrder.toString() : Collection.SortOrder.COLLECTION_DEFAULT.toString(); if (collectionId == null) { sortOrderStr = null; } final String tagsQueryStr = tags != null && !tags.isEmpty() ? TextUtils.join(",", tags.toArray()) : null; return retrofitService .getProducts(appId, collectionId, tagsQueryStr, sortOrderStr, page, pageSize) .retryWhen(networkRetryPolicyProvider.provide()) .doOnNext(new RetrofitSuccessHttpStatusCodeHandler<>()) .compose(new UnwrapRetrofitBodyTransformer<ProductListings, List<Product>>()) .onErrorResumeNext(new BuyClientExceptionHandler<List<Product>>()) .observeOn(callbackScheduler); }
Source:
public void process(WatchedEvent event) { if ( LOG_EVENTS ) { log.debug("ConnectState watcher: " + event); } final boolean eventTypeNone = event.getType() == Watcher.Event.EventType.None; if ( eventTypeNone ) { boolean wasConnected = isConnected.get(); boolean newIsConnected = checkState(event.getState(), wasConnected); if ( newIsConnected != wasConnected ) { isConnected.set(newIsConnected); connectionStartMs = System.currentTimeMillis(); } } assert waitOnExpiredEvent(event.getState()); for ( Watcher parentWatcher : parentWatchers ) { OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId()); parentWatcher.process(event); trace.commit(); } if (eventTypeNone) handleState(event.getState()); }

Target:
public void process(WatchedEvent event) { if ( LOG_EVENTS ) { log.debug("ConnectState watcher: " + event); } final boolean eventTypeNone = event.getType() == Watcher.Event.EventType.None; if ( eventTypeNone ) { boolean wasConnected = isConnected.get(); boolean newIsConnected = checkState(event.getState(), wasConnected); if ( newIsConnected != wasConnected ) { isConnected.set(newIsConnected); connectionStartMs = System.currentTimeMillis(); } } if (debugWaitOnExpiredEvent && event.getState() == Event.KeeperState.Expired) { waitOnExpiredEvent(); } for ( Watcher parentWatcher : parentWatchers ) { OperationTrace trace = new OperationTrace("connection-state-parent-process", tracer.get(), getSessionId()); parentWatcher.process(event); trace.commit(); } if (eventTypeNone) handleState(event.getState()); }
Source:
private String buildFastForwardMessage(MergeResult mergeResult, Ref oldHead) { final StringBuilder messageBuilder = new StringBuilder(); final Integer returnCode; ObjectId oldHeadId = oldHead.getObjectId(); messageBuilder.append("Updating ").append(oldHeadId.abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append("..").append(mergeResult.getNewHead().abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append(EOL); messageBuilder.append(mergeResult.getMergeStatus().toString()); return messageBuilder.toString(); }

Target:
private String buildFastForwardMessage(MergeResult mergeResult, Ref oldHead) { final StringBuilder messageBuilder = new StringBuilder(); ObjectId oldHeadId = oldHead.getObjectId(); messageBuilder.append("Updating ").append(oldHeadId.abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append("..").append(mergeResult.getNewHead().abbreviate(SHORT_COMMIT_ID_LENGTH).name()) .append(EOL); messageBuilder.append(mergeResult.getMergeStatus().toString()); return messageBuilder.toString(); }
Source:
private Optional<CompactReader.Factory<RowData>> createCompactReaderFactory(Context context) { DataType producedDataType = schema.toRowDataType(); if (bulkReaderFormat != null) { BulkFormat<RowData, FileSourceSplit> format = bulkReaderFormat.createRuntimeDecoder( createSourceContext(context), producedDataType); return Optional.of(CompactBulkReader.factory(format)); } else if (formatFactory != null) { InputFormat<RowData, ?> format = formatFactory.createReader(createReaderContext()); if (format instanceof FileInputFormat) { return Optional.of(FileInputFormatCompactReader.factory((FileInputFormat<RowData>) format)); } } else if (deserializationFormat != null) { DeserializationSchema<RowData> decoder = deserializationFormat.createRuntimeDecoder( createSourceContext(context), getFormatDataType()); int[] projectedFields = IntStream.of(0, schema.getFieldCount()).toArray(); DeserializationSchemaAdapter format = new DeserializationSchemaAdapter( decoder, schema, projectedFields, partitionKeys, defaultPartName); return Optional.of(CompactBulkReader.factory(format)); } return Optional.empty(); }

Target:
private Optional<CompactReader.Factory<RowData>> createCompactReaderFactory(Context context) { DataType producedDataType = schema.toRowDataType(); if (bulkReaderFormat != null) { BulkFormat<RowData, FileSourceSplit> format = bulkReaderFormat.createRuntimeDecoder( createSourceContext(context), producedDataType); return Optional.of(CompactBulkReader.factory(format)); } else if (formatFactory != null) { InputFormat<RowData, ?> format = formatFactory.createReader(createReaderContext()); if (format instanceof FileInputFormat) { return Optional.of(FileInputFormatCompactReader.factory((FileInputFormat<RowData>) format)); } } else if (deserializationFormat != null) { DeserializationSchema<RowData> decoder = deserializationFormat.createRuntimeDecoder( createSourceContext(context), getFormatDataType()); int[] projectedFields = IntStream.range(0, schema.getFieldCount()).toArray(); DeserializationSchemaAdapter format = new DeserializationSchemaAdapter( decoder, schema, projectedFields, partitionKeys, defaultPartName); return Optional.of(CompactBulkReader.factory(format)); } return Optional.empty(); }
Source:
public QueryResponse getChromosomes(@RequestParam(name = "species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { if (species == null || species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<String> chromosomeList = variantEntityRepository.findDistinctChromosomes(); QueryResult<String> queryResult = Utils.buildQueryResult(chromosomeList); return setQueryResponse(queryResult); }

Target:
public QueryResponse getChromosomes(@RequestParam(name = "species") String species, HttpServletResponse response) throws IllegalOpenCGACredentialsException, IOException { if (species.isEmpty()) { response.setStatus(HttpServletResponse.SC_BAD_REQUEST); return setQueryResponse("Please specify a species"); } MultiMongoDbFactory.setDatabaseNameForCurrentThread(DBAdaptorConnector.getDBName(species)); List<String> chromosomeList = variantEntityRepository.findDistinctChromosomes(); QueryResult<String> queryResult = Utils.buildQueryResult(chromosomeList); return setQueryResponse(queryResult); }
Source:
public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOnBothOrders() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); OrderService orderService = Context.getOrderService(); Order order = orderService.getOrderByOrderNumber("111"); Date discontinueDate = new Date(); String discontinueReasonNonCoded = "Test if I can discontinue this"; Order discontinueOrder = orderService.discontinueOrder(order, discontinueReasonNonCoded, discontinueDate); Assert.assertEquals(order.getDateStopped(), discontinueDate); Assert.assertNotNull(discontinueOrder); Assert.assertNotNull(discontinueOrder.getId()); Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE); Assert.assertEquals(discontinueOrder.getDiscontinuedReasonNonCoded(), discontinueReasonNonCoded); }

Target:
public void discontinueOrderWithNonCodedReason_shouldPopulateCorrectAttributesOnBothOrders() throws Exception { executeDataSet("org/openmrs/api/include/OrderServiceTest-globalProperties.xml"); OrderService orderService = Context.getOrderService(); Order order = orderService.getOrderByOrderNumber("111"); Date discontinueDate = new Date(); String discontinueReasonNonCoded = "Test if I can discontinue this"; Order discontinueOrder = orderService.discontinueOrder(order, discontinueReasonNonCoded, discontinueDate); Assert.assertEquals(order.getDateStopped(), discontinueDate); Assert.assertNotNull(discontinueOrder); Assert.assertNotNull(discontinueOrder.getId()); Assert.assertEquals(discontinueOrder.getAction(), Action.DISCONTINUE); Assert.assertEquals(discontinueOrder.getDiscontinuedReasonNonCoded(), discontinueReasonNonCoded); Assert.assertEquals(discontinueOrder.getPreviousOrder(), order); }
Source:
private void createOtherOptions(Composite basicTop) { Composite otherOptionsGroup = new Composite(basicTop, SWT.NONE); otherOptionsGroup.setLayout(new GridLayout()); otherOptionsGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); Label label = new Label(otherOptionsGroup, SWT.WRAP); label.setText(Messages.getString("ValgrindOptionsTab.OtherOptionsLabel")); otherOptionsText = new Text(otherOptionsGroup, SWT.BORDER); otherOptionsText.addSelectionListener(selectListener); otherOptionsText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); }

Target:
private void createOtherOptions(Composite basicTop) { Composite otherOptionsGroup = new Composite(basicTop, SWT.NONE); otherOptionsGroup.setLayout(new GridLayout()); otherOptionsGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); Label label = new Label(otherOptionsGroup, SWT.WRAP); label.setText(Messages.getString("ValgrindOptionsTab.ExtraOptionsLabel")); label.setToolTipText(Messages.getString("ValgrindOptionsTab.ExtraOptionsTooltip")); otherOptionsText = new Text(otherOptionsGroup, SWT.BORDER); otherOptionsText.setToolTipText(Messages.getString("ValgrindOptionsTab.ExtraOptionsTooltip")); otherOptionsText.addModifyListener(modifyListener); otherOptionsText.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); }
Source:
public AnonymousSpec anonymous(){ if (this.anonymous == null) { this.anonymous = new AnonymousSpec(); } return this.anonymous.authorities("ROLE_USER"); }

Target:
public AnonymousSpec anonymous(){ if (this.anonymous == null) { this.anonymous = new AnonymousSpec(); } return this.anonymous; }
Source:
private Filter translateType(String jsonText) { final FilterFactory2 ff = parse.getFilterFactory(); Expression dimension = ff.function("dimension", ff.function("geometry")); switch (jsonText) { case "Point": return ff.equals(dimension, ff.literal(0)); case "LineString": return ff.equals(dimension, ff.literal(1)); case "Polygon": return ff.and( ff.equals(dimension, ff.literal(2)), ff.not(ff.equals(ff.function("isCoverage"), ff.literal(true)))); default: return null; } }

Target:
private Filter translateType(String jsonText) { final FilterFactory2 ff = parse.getFilterFactory(); Expression dimension = ff.function("dimension", ff.function("geometry")); switch (jsonText) { case TYPE_POINT: return ff.equals(dimension, ff.literal(0)); case TYPE_LINE: return ff.equals(dimension, ff.literal(1)); case TYPE_POLYGON: return ff.and( ff.equals(dimension, ff.literal(2)), ff.not(ff.equals(ff.function("isCoverage"), ff.literal(true)))); default: return null; } }
Source:
public PrefixSearchableContentSupplier make(@Nonnull MultiLanguageStringProperty source) { return entity -> { StringList tokens = new StringList(); ((Map<String, String>) source.getValue(entity)).forEach((key, value) -> tokens.add(value)); return tokens; }; }

Target:
public PrefixSearchableContentConsumer make(@Nonnull MultiLanguageStringProperty source) { return (entity, consumer) -> { ((Map<String, String>) source.getValue(entity)).forEach((key, value) -> { consumer.accept(value); }); }; }
Source:
public void testOrderByQualifier() { OpenSourceProject project = new OpenSourceProject(); project.setName( PROJECT_NAME ); Programmer unclebob = new Programmer( CONTRIBUTOR1 ); Programmer ddalto = new Programmer( CONTRIBUTOR2 ); Programmer telegraph4eternity = new Programmer( CONTRIBUTOR3 ); Programmer fax4ever = new Programmer( CONTRIBUTOR4 ); Programmer phone4induction = new Programmer( CONTRIBUTOR5 ); project.addContributor( unclebob ); project.addContributor( ddalto ); project.addContributor( telegraph4eternity ); project.addContributor( fax4ever ); project.addContributor( phone4induction ); inTransaction( session -> persistAll( session, unclebob, ddalto, telegraph4eternity, fax4ever, phone4induction, project ) ); inTransaction( session -> { OpenSourceProject load = session.load( OpenSourceProject.class, PROJECT_NAME ); assertThat( load.getContributors() ).containsOnly( ddalto, fax4ever, phone4induction, telegraph4eternity, unclebob ); } ); }

Target:
public void testOrderByQualifier() { OpenSourceProject project = new OpenSourceProject(); project.setName( PROJECT_NAME ); project.addContributor( UNCLEBOB ); project.addContributor( DDALTO ); project.addContributor( TELEGRAPH_4_ETERNITY ); project.addContributor( FAX_4_EVER ); project.addContributor( PHONE_4_INDUCTION ); inTransaction( session -> persistAll( session, UNCLEBOB, DDALTO, TELEGRAPH_4_ETERNITY, FAX_4_EVER, PHONE_4_INDUCTION, project ) ); inTransaction( session -> { OpenSourceProject load = session.load( OpenSourceProject.class, PROJECT_NAME ); assertThat( load.getContributors() ).containsOnly( DDALTO, FAX_4_EVER, PHONE_4_INDUCTION, TELEGRAPH_4_ETERNITY, UNCLEBOB ); assertThat( load.getContributors() ).hasSize( 5 ); assertThat( load.getContributors().get( 0 ) ).isEqualTo( DDALTO ); assertThat( load.getContributors().get( 1 ) ).isEqualTo( FAX_4_EVER ); assertThat( load.getContributors().get( 2 ) ).isEqualTo( PHONE_4_INDUCTION ); assertThat( load.getContributors().get( 3 ) ).isEqualTo( TELEGRAPH_4_ETERNITY ); assertThat( load.getContributors().get( 4 ) ).isEqualTo( UNCLEBOB ); } ); }
Source:
public void setUp() throws Exception { URL resource = getClass().getResource("/projects/guess-project"); testProjectServiceClient.importProject( workspace.getId(), Paths.get(resource.toURI()), PROJECT_NAME, MAVEN_SPRING); ide.open(workspace); projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.selectItem(PROJECT_NAME); projectExplorer.openItemByPath(PROJECT_NAME); }

Target:
public void setUp() throws Exception { URL resource = getClass().getResource("/projects/guess-project"); testProjectServiceClient.importProject( workspace.getId(), Paths.get(resource.toURI()), PROJECT_NAME, MAVEN_SPRING); ide.open(workspace); projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.selectItem(PROJECT_NAME); projectExplorer.quickExpandWithJavaScript(); }
Source:
private ComponentParameter param(String category, String defaultValue, String type, String label, String name, List<String> comboValues) { ComponentParameter param1 = new ComponentParameter(); param1.setCategory(category); param1.setDefaultValue(defaultValue); param1.setType(type); param1.setLabel(label); param1.setName(name); param1.setComboValues(emptyList()); return param1; }

Target:
private ComponentParameter param(String category, String defaultValue, String type, String label, String name, List<String> comboValues) { return new ComponentParameter(name, type, category, defaultValue, label, comboValues); }
Source:
private void checkForIllegalStreamName(String streamName, String streamDef) { try { StreamNode sn = parse(streamName, streamDef); fail("expected to fail but parsed " + sn.stringify()); } catch (StreamDefinitionException e) { assertEquals(XDDSLMessages.ILLEGAL_STREAM_NAME, e.getMessageCode()); assertEquals(0, e.getPosition()); e.printStackTrace(); assertEquals(streamName, e.getInserts()[0]); } }

Target:
private void checkForIllegalStreamName(String streamName, String streamDef) { try { StreamNode sn = parse(streamName, streamDef); fail("expected to fail but parsed " + sn.stringify()); } catch (StreamDefinitionException e) { assertEquals(XDDSLMessages.ILLEGAL_STREAM_NAME, e.getMessageCode()); assertEquals(0, e.getPosition()); assertEquals(streamName, e.getInserts()[0]); } }
Source:
protected void endRemoveEntity() { setCommandShouldBeLogged(false); setSucceeded(true); }

Target:
private void endRemoveEntity() { setCommandShouldBeLogged(false); setSucceeded(true); }
Source:
public DruidQuerySignature(RowSignature rowSignature) { this.isImmutable = false; this.rowSignature = rowSignature; this.virtualColumnPrefix = rowSignature == null ? "v" : Calcites.findUnusedPrefix( "v", new TreeSet<>(rowSignature.getRowOrder()) ); this.virtualColumnsByExpression = new HashMap<>(); this.virtualColumnsByName = new HashMap<>(); }

Target:
public DruidQuerySignature(RowSignature rowSignature) { this.isAggregateSignature = false; this.rowSignature = rowSignature; this.virtualColumnPrefix = rowSignature == null ? "v" : Calcites.findUnusedPrefix( "v", new TreeSet<>(rowSignature.getRowOrder()) ); this.virtualColumnsByExpression = new HashMap<>(); this.virtualColumnsByName = new HashMap<>(); }
Source:
protected void internalInit() { final HashSet<String> names = new HashSet<>(); final List<Client> loadedClients = loadClientsInternal(); if (loadedClients != null) { for (final Client client : loadedClients) { final String name = client.getName(); if (names.contains(name)) { throw new TechnicalException("Duplicate name in clients: " + name); } names.add(name); updateCallbackUrlOfIndirectClient(client); } } }

Target:
protected void internalInit() { CommonHelper.assertNotNull("clients", getClients()); final HashSet<String> names = new HashSet<>(); for (final Client client : getClients()) { final String name = client.getName(); final String lowerName = name.toLowerCase(); if (names.contains(lowerName)) { throw new TechnicalException("Duplicate name in clients: " + name); } names.add(lowerName); updateCallbackUrlOfIndirectClient(client); } }
Source:
private int outputDeployment(Configuration config) { try { File configInfoDir = new VoltFile(config.m_voltdbRoot, Constants.CONFIG_DIR); File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.isFile() || !depFH.canRead()) { hostLog.fatal("Failed to get configuration or deployment configuration is invalid. " + depFH.getAbsolutePath()); return -1; } config.m_pathToDeployment = depFH.getCanonicalPath(); } catch (IOException e) { hostLog.fatal("Failed to read deployment: " + e.getMessage()); return -1; } ReadDeploymentResults readDepl = readPrimedDeployment(config); try { DeploymentType dt = CatalogUtil.updateRuntimeDeploymentPaths(readDepl.deployment); String out; if ((out = CatalogUtil.getDeployment(dt, true)) != null) { if ((new File(config.m_getOutput)).exists() && !config.m_forceGetCreate) { hostLog.fatal("Failed to save deployment, file already exists: " + config.m_getOutput); return -1; } try (FileOutputStream fos = new FileOutputStream(config.m_getOutput.trim())){ fos.write(out.getBytes()); } catch (IOException e) { hostLog.fatal("Failed to write deployment to " + config.m_getOutput + " : " + e.getMessage()); return -1; } hostLog.info("Deployment configuration saved at " + config.m_getOutput.trim()); } else { hostLog.fatal("Failed to get configuration or deployment configuration is invalid."); return -1; } } catch (Exception e) { hostLog.fatal("Failed to get configuration or deployment configuration is invalid. " + "Please make sure voltdbroot is a valid directory. " + e.getMessage()); return -1; } return 0; }

Target:
private int outputDeployment(Configuration config) { try { File configInfoDir = new VoltFile(config.m_voltdbRoot, Constants.CONFIG_DIR); File depFH = new VoltFile(configInfoDir, "deployment.xml"); if (!depFH.isFile() || !depFH.canRead()) { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid. " + depFH.getAbsolutePath()); return -1; } config.m_pathToDeployment = depFH.getCanonicalPath(); } catch (IOException e) { consoleLog.fatal("Failed to read deployment: " + e.getMessage()); return -1; } ReadDeploymentResults readDepl = readPrimedDeployment(config); try { DeploymentType dt = CatalogUtil.updateRuntimeDeploymentPaths(readDepl.deployment); String out; if ((out = CatalogUtil.getDeployment(dt, true)) != null) { if ((new File(config.m_getOutput)).exists() && !config.m_forceGetCreate) { consoleLog.fatal("Failed to save deployment, file already exists: " + config.m_getOutput); return -1; } try (FileOutputStream fos = new FileOutputStream(config.m_getOutput.trim())){ fos.write(out.getBytes()); } catch (IOException e) { consoleLog.fatal("Failed to write deployment to " + config.m_getOutput + " : " + e.getMessage()); return -1; } consoleLog.info("Deployment configuration saved at " + config.m_getOutput.trim()); } else { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid."); return -1; } } catch (Exception e) { consoleLog.fatal("Failed to get configuration or deployment configuration is invalid. " + "Please make sure voltdbroot is a valid directory. " + e.getMessage()); return -1; } return 0; }
Source:
public boolean upload(FilePath workspace, String artifactIncludes, PrintStream log) { boolean result = true; if(workspace!=null) { for(String roomId : roomIds) { SlackFileRequest slackFileRequest = new SlackFileRequest( workspace, populatedToken, roomId, null, artifactIncludes); try { workspace.getChannel().callAsync(new SlackUploadFileRunner(log, Jenkins.get().proxy, slackFileRequest)).get(); } catch (IllegalStateException e) { logger.log(Level.WARNING, "IllegalStateException", e); result = false; } catch (InterruptedException e) { logger.log(Level.WARNING, "InterruptedException", e); result = false; } catch (ExecutionException e) { logger.log(Level.WARNING, "ExecutionException", e); result = false; } catch (IOException e) { logger.log(Level.WARNING, "Error closing HttpClient", e); result = false; } } } else { logger.log(Level.WARNING, "Could not get workspace for current execution"); result = false; } return result; }

Target:
public boolean upload(FilePath workspace, String artifactIncludes, PrintStream log) { boolean result = true; if(workspace!=null) { for(String roomId : roomIds) { SlackFileRequest slackFileRequest = new SlackFileRequest( workspace, populatedToken, roomId, null, artifactIncludes); try { workspace.getChannel().callAsync(new SlackUploadFileRunner(log, Jenkins.get().proxy, slackFileRequest)).get(); } catch (IllegalStateException | InterruptedException e) { logger.log(Level.WARNING, "Exception", e); result = false; } catch (ExecutionException e) { logger.log(Level.WARNING, "ExecutionException", e); result = false; } catch (IOException e) { logger.log(Level.WARNING, "Error closing HttpClient", e); result = false; } } } else { logger.log(Level.WARNING, "Could not get workspace for current execution"); result = false; } return result; }
Source:
public void getApp(HttpServletRequest request, HttpServletResponse response, String app) { org.geoserver.platform.resource.Resource script = null; try { org.geoserver.platform.resource.Resource appDir; try { appDir = scriptManager.app(app); } catch (IllegalStateException e) { throw new RestException(format("Error looking up app directory %s", app), HttpStatus.INTERNAL_SERVER_ERROR); } if (appDir == null) { throw new RestException(format("No such app %s", app), HttpStatus.NOT_FOUND); } script = scriptManager.findAppMainScript(appDir); if (script == null) { throw new RestException(format("No main file for app %s", app), HttpStatus.NOT_FOUND); } ScriptEngine eng = scriptManager.createNewEngine(script); if (eng == null) { throw new RestException(format("Script engine for %s not found", script.name()), HttpStatus.BAD_REQUEST); } AppHook hook = scriptManager.lookupAppHook(script); if (hook == null) { throw new RestException(format("No hook found for %s", script.path()), HttpStatus.INTERNAL_SERVER_ERROR); } Reader in = new BufferedReader(new InputStreamReader(script.in())); try { eng.eval(in); hook.run(request, response, eng); } finally { in.close(); } } catch (Exception e) { LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e); throw new RestException("Error executing script " + script.name(), HttpStatus.INTERNAL_SERVER_ERROR); } }

Target:
public void getApp(HttpServletRequest request, HttpServletResponse response, String app) { Resource script = null; try { Resource appDir; try { appDir = scriptManager.app(app); } catch (IllegalStateException e) { throw new RestException(format("Error looking up app directory %s", app), HttpStatus.INTERNAL_SERVER_ERROR); } if (appDir == null) { throw new RestException(format("No such app %s", app), HttpStatus.NOT_FOUND); } script = scriptManager.findAppMainScript(appDir); if (script == null) { throw new RestException(format("No main file for app %s", app), HttpStatus.NOT_FOUND); } ScriptEngine eng = scriptManager.createNewEngine(script); if (eng == null) { throw new RestException(format("Script engine for %s not found", script.name()), HttpStatus.BAD_REQUEST); } AppHook hook = scriptManager.lookupAppHook(script); if (hook == null) { throw new RestException(format("No hook found for %s", script.path()), HttpStatus.INTERNAL_SERVER_ERROR); } Reader in = new BufferedReader(new InputStreamReader(script.in())); try { eng.eval(in); hook.run(request, response, eng); } finally { in.close(); } } catch (Exception e) { LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e); throw new RestException("Error executing script " + script.name(), HttpStatus.INTERNAL_SERVER_ERROR); } }
Source:
public void shouldGetAllDistinctStages() throws Exception { List<StageConfigIdentifier> expectedResult = new ArrayList<StageConfigIdentifier>(); when(sqlMapClientTemplate.queryForObject("findStageHistoryEntryBefore")).thenReturn(expectedResult); List<StageConfigIdentifier> result = stageSqlMapDao.getAllDistinctStages(); assertThat(result, is(expectedResult)); }

Target:
public void shouldGetAllDistinctStages() throws Exception { List<StageConfigIdentifier> expectedResult = Arrays.asList(new StageConfigIdentifier()); when(sqlMapClientTemplate.queryForList("getDistinctStages")).thenReturn(expectedResult); List<StageConfigIdentifier> result = stageSqlMapDao.getAllDistinctStages(); assertThat(result, is(expectedResult)); }
Source:
private void removeNetworkFromHosts() { List<VdsNetworkInterface> nics = interfaceDao.getAllInterfacesByLabelForDataCenter(getStoragePoolId(), network.getLabel()); ArrayList<ActionParametersBase> parameters = removeNetworkParametersBuilder.buildParameters(network, nics); if (!parameters.isEmpty()) { HostSetupNetworksParametersBuilder.updateParametersSequencing(parameters); parameters.forEach(this::withRootCommandInfo); backend.runInternalMultipleActions(ActionType.PersistentHostSetupNetworks, parameters, cloneContextAndDetachFromParent()); } }

Target:
private void removeNetworkFromHosts() { List<VdsNetworkInterface> nics = interfaceDao.getAllInterfacesByLabelForDataCenter(getStoragePoolId(), network.getLabel()); setupNetworksParameters = removeNetworkParametersBuilder.buildParameters(network, nics); if (!setupNetworksParameters.isEmpty()) { HostSetupNetworksParametersBuilder.updateParametersSequencing(setupNetworksParameters); setupNetworksParameters.forEach(this::withRootCommandInfo); backend.runInternalMultipleActions(ActionType.PersistentHostSetupNetworks, setupNetworksParameters, cloneContextAndDetachFromParent()); } }
Source:
public void checkPrefixFormatValidation() { assertEquals("Failed to validate prefix's Format: " + mask, isMaskValid && isPrefixValid, MaskValidator.getInstance().isPrefixValid(mask)); }

Target:
public void checkPrefixFormatValidation() { assertEquals("Failed to validate prefix's Format: " + mask, isPrefixValid, MaskValidator.getInstance().isPrefixValid(mask)); }
Source:
public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder client) { if (Build.VERSION.SDK_INT >= 16 && Build.VERSION.SDK_INT < 22) { try { SSLContext sc = SSLContext.getInstance("TLSv1.2"); sc.init(null, null, null); client.sslSocketFactory(new Tls12SocketFactory(sc.getSocketFactory())); ConnectionSpec cs = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .tlsVersions(TlsVersion.TLS_1_2) .build(); List<ConnectionSpec> specs = new ArrayList<>(); specs.add(cs); specs.add(ConnectionSpec.COMPATIBLE_TLS); specs.add(ConnectionSpec.CLEARTEXT); client.connectionSpecs(specs); } catch (Exception exc) { logger.error(exc); } } return client; }

Target:
public static OkHttpClient.Builder enableTls12OnPreLollipop(OkHttpClient.Builder client) { if (Build.VERSION.SDK_INT >= 16 && Build.VERSION.SDK_INT < 22) { try { final SSLContext sslContext = SSLContext.getInstance("TLSv1.2"); sslContext.init(null, null, null); client.sslSocketFactory(new Tls12SocketFactory(sslContext.getSocketFactory())); final ConnectionSpec connectionSpec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .tlsVersions(TlsVersion.TLS_1_2) .build(); final List<ConnectionSpec> specs = new ArrayList<>(); specs.add(connectionSpec); specs.add(ConnectionSpec.COMPATIBLE_TLS); specs.add(ConnectionSpec.CLEARTEXT); client.connectionSpecs(specs); } catch (NoSuchAlgorithmException e) { logger.error(e); } catch (KeyManagementException e) { logger.error(e); } } return client; }
Source:
private void informUnkownHaskellException() { String msg = "Whoops! An unkown error has occured. We're sorry, but can't really tell you more than this."; CustomAlert alert = new CustomAlert(getPane(), msg); getPane().getChildren().add(alert); alert.relocate(this.getLayoutX() + 100, this.getLayoutY() + 100); }

Target:
protected void informUnkownHaskellException() { String msg = "Whoops! An unkown error has occured. We're sorry, but can't really tell you more than this."; CustomAlert alert = new CustomAlert(getPane(), msg); getPane().getChildren().add(alert); alert.relocate(this.getLayoutX() + 100, this.getLayoutY() + 100); }
Source:
public void runWorkflowThroughOneSuccessfulState() { WorkflowInstance instance = executingInstanceBuilder().setType("execute-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); when(workflowInstancePreProcessor.process(newChildWorkflow)).thenReturn(newChildWorkflow); when(workflowInstancePreProcessor.process(newWorkflow)).thenReturn(newWorkflow); assertTimeoutPreemptively(ofSeconds(5),() -> executor.run()); verify(workflowInstanceDao).updateWorkflowInstanceAfterExecution( argThat( matchesWorkflowInstance(inProgress, ExecuteTestWorkflow.State.process, 0, is("Scheduled by previous state start"))), argThat(matchesWorkflowInstanceAction(ExecuteTestWorkflow.State.start, is("Process after delay"), 0, stateExecution)), childWorkflows.capture(), workflows.capture(), eq(true)); assertThat(childWorkflows.getValue().get(0), is(newChildWorkflow)); assertThat(workflows.getValue().get(0), is(newWorkflow)); }

Target:
public void runWorkflowThroughOneSuccessfulState() { WorkflowInstance instance = executingInstanceBuilder().setType("execute-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); when(workflowInstancePreProcessor.process(newChildWorkflow)).thenReturn(newChildWorkflow); when(workflowInstancePreProcessor.process(newWorkflow)).thenReturn(newWorkflow); runExecutorWithTimout(); verify(workflowInstanceDao).updateWorkflowInstanceAfterExecution( argThat( matchesWorkflowInstance(inProgress, ExecuteTestWorkflow.State.process, 0, is("Scheduled by previous state start"))), argThat(matchesWorkflowInstanceAction(ExecuteTestWorkflow.State.start, is("Process after delay"), 0, stateExecution)), childWorkflows.capture(), workflows.capture(), eq(true)); assertThat(childWorkflows.getValue().get(0), is(newChildWorkflow)); assertThat(workflows.getValue().get(0), is(newWorkflow)); }
Source:
public DiscountViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); }

Target:
public DiscountViewHolder(View itemView) { super(itemView); ButterKnife.bind(this, itemView); context = itemView.getContext(); }
Source:
public FlatTextRange(int start, int end) { this.start = start; this.end = end; this.length = end - start; }

Target:
public FlatTextRange(int start, int end) { if (end < start) { throw new IllegalArgumentException("start must be < end"); } this.start = start; this.end = end; this.length = end - start; }
Source:
public void connectionChanged(@Nonnull EnderLiquidConduit con, @Nonnull EnumFacing conDir) { NetworkTankKey key = new NetworkTankKey(con, conDir); NetworkTank tank = new NetworkTank(con, conDir); tanks.remove(tank); tanks.add(tank); tankMap.remove(key); tankMap.put(key, tank); hasMultipleTanksSet.remove(key); if (tank.isValid() && !tank.externalTank.getTankInfoWrappers().isEmpty()) { hasMultipleTanksSet.add(key); } tanks.sort((left, right) -> right.priority - left.priority); }

Target:
public void connectionChanged(@Nonnull EnderLiquidConduit con, @Nonnull EnumFacing conDir) { NetworkTankKey key = new NetworkTankKey(con, conDir); NetworkTank tank = new NetworkTank(con, conDir); tanks.remove(tank); tanks.add(tank); tankMap.remove(key); tankMap.put(key, tank); tanks.sort((left, right) -> right.priority - left.priority); }
Source:
public boolean onPrepareActionMode(ActionMode mode, Menu menu) { boolean isClozeType, itemExists; int noteModelType; try { noteModelType = getCurrentlySelectedModel().getInt("type"); } catch (JSONException e) { throw new RuntimeException(e); } isClozeType = noteModelType == Consts.MODEL_CLOZE; itemExists = menu.findItem(mMenuId) != null; if (isClozeType && !itemExists) { menu.add(Menu.NONE, mMenuId, 0, R.string.multimedia_editor_popup_cloze); return true; } else { return false; } }

Target:
public boolean onPrepareActionMode(ActionMode mode, Menu menu) { int noteModelType; try { noteModelType = getCurrentlySelectedModel().getInt("type"); } catch (JSONException e) { throw new RuntimeException(e); } boolean isClozeType = noteModelType == Consts.MODEL_CLOZE; boolean itemExists = menu.findItem(mMenuId) != null; if (isClozeType && !itemExists) { menu.add(Menu.NONE, mMenuId, 0, R.string.multimedia_editor_popup_cloze); return true; } else { return false; } }
Source:
public static Graph load(InputStream in) { Input input = new Input(in); Kryo kryo = makeKryo(); GraphAndEdges graphAndEdges = (GraphAndEdges) kryo.readClassAndObject(input); Graph graph = graphAndEdges.graph; LOG.debug("Graph read."); if (graph.graphVersionMismatch()) { throw new RuntimeException("Graph version mismatch detected."); } graphAndEdges.reconstructEdgeLists(); LOG.info("Graph read. |V|={} |E|={}", graph.countVertices(), graph.countEdges()); graph.index(new DefaultStreetVertexIndexFactory()); return graph; }

Target:
public static Graph load(InputStream in) { Input input = new Input(in); Kryo kryo = SerializedGraphObject.makeKryo(); SerializedGraphObject serializedGraphObject = (SerializedGraphObject) kryo.readClassAndObject(input); Graph graph = serializedGraphObject.graph; LOG.debug("Graph read."); if (graph.graphVersionMismatch()) { throw new RuntimeException("Graph version mismatch detected."); } serializedGraphObject.reconstructEdgeLists(); LOG.info("Graph read. |V|={} |E|={}", graph.countVertices(), graph.countEdges()); graph.index(new DefaultStreetVertexIndexFactory()); return graph; }
Source:
public int getLocalTableBlogIdForJetpackOrWpComRemoteSiteId(int remoteBlogId) { int localId = getLocalTableBlogIdForJetpackRemoteID(remoteBlogId, null); if (localId == 0) { localId = getLocalTableBlogIdForRemoteBlogId(remoteBlogId); } return localId; }

Target:
public int getLocalTableBlogIdForJetpackOrWpComRemoteSiteId(int remoteBlogId) { int localId = getLocalTableBlogIdForJetpackRemoteID(remoteBlogId, null); if (localId == 0) { localId = getLocalTableBlogIdForWpComRemoteBlogId(remoteBlogId); } return localId; }
Source:
protected String loadKieTextFromJar(final String jarFilePath, final String subPath, final String fileName) { ArtifactRepository repository = this.getArtifactRepository(ArtifactRepositoryService.GLOBAL_M2_REPO_NAME); final File file = new File(repository.getRootDir(), jarFilePath); final String normalizedPath = file.toPath().normalize().toString(); if (isJar(normalizedPath) || isKJar(normalizedPath)) { return loadFileTextFromJar(file, subPath, fileName); } return ""; }

Target:
protected String loadKieTextFromJar(final String jarFilePath, final String subPath, final String fileName) { ArtifactRepository repository = this.getArtifactRepository(ArtifactRepositoryService.GLOBAL_M2_REPO_NAME); final File file = new File(repository.getRootDir(), jarFilePath); final String normalizedPath = file.toPath().normalize().toString(); if (isJar(normalizedPath) || isKJar(normalizedPath)) { return loadFileTextFromJar(file, subPath, fileName); } return null; }
Source:
private void finalizePipeline(PipelineID pipelineId) throws IOException { lock.writeLock().lock(); try { stateManager.finalizePipeline(pipelineId); Set<ContainerID> containerIDs = stateManager.getContainers(pipelineId); for (ContainerID containerID : containerIDs) { eventPublisher.fireEvent(SCMEvents.CLOSE_CONTAINER, containerID); } metrics.clearMetrics(pipelineId); } finally { lock.writeLock().unlock(); } }

Target:
private void finalizePipeline(PipelineID pipelineId) throws IOException { lock.writeLock().lock(); try { stateManager.finalizePipeline(pipelineId); Set<ContainerID> containerIDs = stateManager.getContainers(pipelineId); for (ContainerID containerID : containerIDs) { eventPublisher.fireEvent(SCMEvents.CLOSE_CONTAINER, containerID); } metrics.removePipelineMetrics(pipelineId); } finally { lock.writeLock().unlock(); } }
Source:
public boolean contains (Circle circle) { float xmin = circle.x - circle.radius; float xmax = circle.x + circle.radius; float ymin = circle.y - circle.radius; float ymax = circle.y + circle.radius; return (xmin >= x && xmin <= x + width) && (xmax >= x && xmax <= x + width) && (ymin >= y && ymin <= y + height) && (ymax >= y && ymax <= y + height); }

Target:
public boolean contains (Circle circle) { return (circle.x - circle.radius >= x) && (circle.x + circle.radius <= x + width) && (circle.y - circle.radius >= y) && (circle.y + circle.radius <= y + height); }
Source:
private void setFocusOnVisible() { TerminalSession visibleTerminal = getSelectedTerminal(); if (visibleTerminal != null) { if (!suppressAutoFocus_) Scheduler.get().scheduleDeferred(() -> { if (visibleTerminal.terminalEmulatorLoaded()) { visibleTerminal.setFocus(true); } else { new Timer() { @Override public void run() { if (visibleTerminal.terminalEmulatorLoaded()) { visibleTerminal.setFocus(true); } } }.schedule(200); } }); activeTerminalToolbarButton_.setActiveTerminal( visibleTerminal.getCaption(), visibleTerminal.getHandle()); setTerminalTitle(visibleTerminal.getTitle()); } }

Target:
private void setFocusOnVisible() { TerminalSession visibleTerminal = getSelectedTerminal(); if (visibleTerminal != null) { if (!suppressAutoFocus_) Scheduler.get().scheduleDeferred(() -> { if (visibleTerminal.terminalEmulatorLoaded()) { visibleTerminal.setFocus(true); } else { Timers.singleShot(200, () -> { if (visibleTerminal.terminalEmulatorLoaded()) visibleTerminal.setFocus(true); }); } }); activeTerminalToolbarButton_.setActiveTerminal( visibleTerminal.getCaption(), visibleTerminal.getHandle()); setTerminalTitle(visibleTerminal.getTitle()); } }
Source:
EmailSender(final Mailer mailer, final Config config, final ObjectMapper mapper) { _fromAddress = config.getString("fromAddress"); _mailer = mailer; try { _allowedRecipients = mapper.readValue(ConfigurationHelper.toJson(config, "allowedRecipients"), ALLOWED_RECIPIENTS_TYPE); } catch (final IOException e) { throw new IllegalArgumentException(e); } }

Target:
EmailSender(final Mailer mailer, final Config config, final ObjectMapper mapper) { _fromAddress = config.getString("fromAddress"); _mailer = mailer; try { _allowedRecipients = mapper.readValue(ConfigurationHelper.toJson(config, ALLOWED_RECIPIENTS_KEY), ALLOWED_RECIPIENTS_TYPE); } catch (final IOException e) { throw new IllegalArgumentException(e); } }
Source:
public void setName(String name) { if (name == null) { super.setName(name); return; } else if (name.startsWith(this.getContextIndex() + ":")) { name = name.substring(name.indexOf(":")+1); } super.setName(getPanelName(this.getContextIndex(), name)); }

Target:
public void setName(String name) { if (name == null) { super.setName(name); return; } if (name.startsWith(this.getContextIndex() + ":")) { name = name.substring(name.indexOf(":")+1); } super.setName(getPanelName(this.getContextIndex(), name)); }
Source:
public Long create(T data) { logger.debug("Adding new row to table for data object {}", getTableName(), data); assertDatabaseOpen(); ContentValues contentValues = new ContentValues(); if (getContentValuesPopulator().populate(contentValues, data) == true) { logger.debug("Adding new row to table with Content Values {}", getTableName(), contentValues); if (listenerRegistry != null) listenerRegistry.listener(data, this); return database.insert(getName(), null, contentValues); } return (long) -1; }

Target:
public Long create(T data) { logger.debug("Adding new row to table for data object {}", getTableName(), data); assertDatabaseOpen(); ContentValues contentValues = new ContentValues(); if (getContentValuesPopulator().populate(contentValues, data)) { logger.debug("Adding new row to table with Content Values {}", getTableName(), contentValues); if (listenerRegistry != null) listenerRegistry.listener(data, this); return database.insert(getName(), null, contentValues); } return (long) -1; }
Source:
public void shouldThrowExceptionIfCursorNullObservable() { final PreparedGetCursor queryWithNullResult = createQueryWithNullResult(); final TestSubscriber<Cursor> testSubscriber = new TestSubscriber<Cursor>(); queryWithNullResult .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); testSubscriber.assertError(StorIOException.class); }

Target:
public void shouldThrowExceptionIfCursorNullObservable() { final PreparedGetCursor queryWithNullResult = createQueryWithNullResult(); final TestSubscriber<Cursor> testSubscriber = new TestSubscriber<Cursor>(); queryWithNullResult .createObservable() .subscribe(testSubscriber); testSubscriber.awaitTerminalEvent(); testSubscriber.assertNoValues(); TestUtils.checkException( testSubscriber, StorIOException.class, IllegalStateException.class, "Cursor returned by content provider is null"); }
Source:
private boolean authorize(String username, HttpServerRequest request) throws HttpAuthenticationException { if (log.isTraceEnabled()) { try { log.tracef("Trying to authorize user %s using FormAuthenticationMechanism. Request URI: [%s], Context path: [%s], Session ID: [%s]", username, request.getRequestURI(), this.contextPath, getSessionScope(request, false).getID()); } catch (NullPointerException ex) { log.tracef("Unable to re-authorize user %s using FormAuthenticationMechanism. There is no session attached to the following request. " + "Request URI: [%s], Context path: [%s]", username, request.getRequestURI(), this.contextPath); } } IdentityCache identityCache = createIdentityCache(request, true); if (identityCache != null) { CachedIdentityAuthorizeCallback authorizeCallback = new CachedIdentityAuthorizeCallback(username, identityCache); try { callbackHandler.handle(new Callback[]{authorizeCallback}); return authorizeCallback.isAuthorized(); } catch (IOException | UnsupportedCallbackException e) { throw new HttpAuthenticationException(e); } } return super.authorize(username); }

Target:
private boolean authorize(String username, HttpServerRequest request) throws HttpAuthenticationException { log.tracef("Authorizing username: [%s], Request URI: [%s], Context path: [%s]", username, request.getRequestURI(), this.contextPath); IdentityCache identityCache = createIdentityCache(request, true); if (identityCache != null) { CachedIdentityAuthorizeCallback authorizeCallback = new CachedIdentityAuthorizeCallback(username, identityCache); try { callbackHandler.handle(new Callback[]{authorizeCallback}); return authorizeCallback.isAuthorized(); } catch (IOException | UnsupportedCallbackException e) { throw new HttpAuthenticationException(e); } } return super.authorize(username); }
Source:
public ReactiveCosmosTemplate(CosmosFactory cosmosFactory, CosmosConfig cosmosConfig, MappingCosmosConverter mappingCosmosConverter) { Assert.notNull(cosmosFactory, "CosmosDbFactory must not be null!"); Assert.notNull(cosmosConfig, "CosmosConfig must not be null!"); Assert.notNull(mappingCosmosConverter, "MappingCosmosConverter must not be null!"); this.cosmosFactory = cosmosFactory; this.cosmosConfig = cosmosConfig; this.mappingCosmosConverter = mappingCosmosConverter; this.cosmosAsyncClient = cosmosFactory.getCosmosClient(); }

Target:
public ReactiveCosmosTemplate(CosmosFactory cosmosFactory, CosmosConfig cosmosConfig, MappingCosmosConverter mappingCosmosConverter) { Assert.notNull(cosmosFactory, "CosmosFactory must not be null!"); Assert.notNull(cosmosConfig, "CosmosConfig must not be null!"); Assert.notNull(mappingCosmosConverter, "MappingCosmosConverter must not be null!"); this.mappingCosmosConverter = mappingCosmosConverter; this.cosmosAsyncClient = cosmosFactory.getCosmosAsyncClient(); this.databaseName = cosmosFactory.getDatabaseName(); this.responseDiagnosticsProcessor = cosmosConfig.getResponseDiagnosticsProcessor(); this.queryMetricsEnabled = cosmosConfig.isQueryMetricsEnabled(); }
Source:
protected static Blob readStringBlob(String ctype, String fileName, String content) throws IOException { Blob blob = new StringBlob(fileName, content, ctype); return blob; }

Target:
protected static Blob readStringBlob(String ctype, String fileName, String content) { return new StringBlob(fileName, content, ctype); }
Source:
public Map<String, Mapped<PatientDataDefinition>> getContainedDataDefinitions() { return containedDataDefinitions; }

Target:
public Map<String, Mapped<PatientDataDefinition>> getContainedDataDefinitions() { if (containedDataDefinitions == null) { containedDataDefinitions = new HashMap<String, Mapped<PatientDataDefinition>>(); } return containedDataDefinitions; }