auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Response approve(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @PathParam("thingUID") @ApiParam(value = "thingUID", required = true) String thingUID, @ApiParam(value = "thing label") String label) { ThingUID thingUIDObject = new ThingUID(thingUID); String notEmptyLabel = label != null && !label.isEmpty() ? label : null; Thing thing = null; try { thing = inbox.approve(thingUIDObject, notEmptyLabel); } catch (IllegalArgumentException e) { logger.error("Thing unable to be approved: {}", thingUID, e.getLocalizedMessage()); return JSONResponse.createErrorResponse(Status.NOT_FOUND, <START> "Thing unable to be approved: " + e.getLocalizedMessage()); <END> } if (thing == null) { return JSONResponse.createErrorResponse(Status.CONFLICT, "No binding found that can create the thing"); } return Response.ok(null, MediaType.TEXT_PLAIN).build(); }</code><technical_language>I agree log message adding message of exception REST response wrong me. Exceptions messages part of internals exposed caller of a REST API. inbox approve methods state exception message (if IAE) is exposed external callers this message internal information</technical_language>

Target:
public Response approve(@HeaderParam(HttpHeaders.ACCEPT_LANGUAGE) @ApiParam(value = "language") String language, @PathParam("thingUID") @ApiParam(value = "thingUID", required = true) String thingUID, @ApiParam(value = "thing label") String label) { ThingUID thingUIDObject = new ThingUID(thingUID); String notEmptyLabel = label != null && !label.isEmpty() ? label : null; Thing thing = null; try { thing = inbox.approve(thingUIDObject, notEmptyLabel); } catch (IllegalArgumentException e) { logger.error("Thing unable to be approved: {}", thingUID, e.getLocalizedMessage()); return JSONResponse.createErrorResponse(Status.NOT_FOUND, "Thing unable to be approved."); } if (thing == null) { return JSONResponse.createErrorResponse(Status.CONFLICT, "No binding found that can create the thing"); } return Response.ok(null, MediaType.TEXT_PLAIN).build(); }
Source:
<code>public void checkCidrValidation() { <START> boolean result = CidrValidator.isCidrFormatValid(cidr); <END> if (result) { assertEquals(expectedResult, CidrValidator.isCidrValidNetworkAddress(cidr)); } else { assertEquals(expectedResult, CidrValidator.isCidrFormatValid(cidr)); } }</code><technical_language>separate tests</technical_language>

Target:
public void checkCidrValidation() { boolean result = CidrValidator.isCidrFormatValid(cidr); if (result) { assertEquals(expectedResult, CidrValidator.isCidrNetworkAddressValid(cidr)); } else { assertEquals(expectedResult, CidrValidator.isCidrFormatValid(cidr)); } }
Source:
<code>public TestRecord(final ConsumerRecord<K, V> record) { <START> this(record.key(), record.value(), record.headers(), record.timestamp()); <END> }</code><technical_language>add: Objects.requireNonNull(record)</technical_language>

Target:
public TestRecord(final ConsumerRecord<K, V> record) { Objects.requireNonNull(record); this.key = record.key(); this.value = record.value(); this.headers = record.headers(); this.recordTime = Instant.ofEpochMilli(record.timestamp()); }
Source:
<code>private void updatePlan(final RefreshRequest request, IBuildPlan oldPlan, IBuildPlan newPlan, final IOperationMonitor monitor, Date refreshDate) { if (newPlan != null) { newPlan.setRefreshDate(refreshDate); update(request, oldPlan, (BuildPlan) newPlan, monitor); } else { String message; <START> if (oldPlan.getParent() == null) { <END> message = "The plan does not exist."; } else { message = "The child plan does not exist."; } ((BuildPlan) oldPlan).setOperationStatus(new Status(IStatus.ERROR, BuildsCorePlugin.ID_PLUGIN, message)); } }</code><technical_language>this message more useful, include some info plan (id/label)</technical_language>

Target:
private void updatePlan(final RefreshRequest request, IBuildPlan oldPlan, IBuildPlan newPlan, final IOperationMonitor monitor, Date refreshDate) { if (newPlan != null) { newPlan.setRefreshDate(refreshDate); update(request, oldPlan, (BuildPlan) newPlan, monitor); } else { String message; if (oldPlan.getParent() == null) { message = String.format("The plan %s does not exist.", oldPlan.getId()); } else { message = String.format("The child plan %s does not exist.", oldPlan.getId()); } ((BuildPlan) oldPlan).setOperationStatus(new Status(IStatus.ERROR, BuildsCorePlugin.ID_PLUGIN, message)); } }
Source:
<code>public void testGetIntentForBrokerActivityEmptyIntent() throws NameNotFoundException, OperationCanceledException, IOException, AuthenticatorException { final AuthenticationRequest authRequest = createAuthenticationRequest("<LINK_0>", "resource", "client", "redirect", "loginhint", PromptBehavior.Auto, "", UUID.randomUUID(), false); final AccountManager mockAcctManager = getMockedAccountManager(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE, AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME); Bundle expected = new Bundle(); prepareAddAccount(mockAcctManager, expected); final FileMockContext context = new FileMockContext(InstrumentationRegistry.getContext()); context.setMockedAccountManager(mockAcctManager); context.setMockedPackageManager(getMockedPackageManagerWithBrokerAccountServiceDisabled(mock(Signature.class), AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME, true)); final BrokerProxy brokerProxy = new BrokerProxy(context); try { final Intent intent = brokerProxy.getIntentForBrokerActivity(authRequest, null); assertNull("Intent is null", intent); <START> } catch (final AuthenticationException exc) { <END> fail("Not expected."); } }</code><technical_language>declare test method as: java public void testGetIntentForBrokerActivityEmptyIntent() throws NameNotFoundExcep, AuthenticationException skip catch() {fail()}</technical_language>

Target:
public void testGetIntentForBrokerActivityEmptyIntent() throws NameNotFoundException, OperationCanceledException, IOException, AuthenticatorException, AuthenticationException { final AuthenticationRequest authRequest = createAuthenticationRequest("<LINK_0>", "resource", "client", "redirect", "loginhint", PromptBehavior.Auto, "", UUID.randomUUID(), false); final AccountManager mockAcctManager = getMockedAccountManager(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE, AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME); Bundle expected = new Bundle(); prepareAddAccount(mockAcctManager, expected); final FileMockContext context = new FileMockContext(InstrumentationRegistry.getContext()); context.setMockedAccountManager(mockAcctManager); context.setMockedPackageManager(getMockedPackageManagerWithBrokerAccountServiceDisabled(mock(Signature.class), AuthenticationConstants.Broker.COMPANY_PORTAL_APP_PACKAGE_NAME, true)); final BrokerProxy brokerProxy = new BrokerProxy(context); final Intent intent = brokerProxy.getIntentForBrokerActivity(authRequest, null); assertNull("Intent is null", intent); }
Source:
<code>public void testThrowExceptionOnNonexistingAttribute() { <START> RequirementMatcher matcher = new RequirementMatcher(ComplexReq.class, new RequirementVersionMatcher("noConfig.version", ">1.0")); <END> matcher.matches(complexConfig); }</code><technical_language>removed 2 tests</technical_language>

Target:
public void testThrowExceptionOnNonexistingAttribute() { RequirementMatcher matcher = new RequirementMatcher(ComplexReq.class, "noConfig.version", new VersionMatcher(">1.0")); matcher.matches(complexConfig); }
Source:
<code>public void testExists() throws IOException { String path = "/path"; Assert.assertFalse(_testBaseDataAccessor.exists(path, AccessOption.PERSISTENT)); Map<String, Boolean> result; String data = new JerseyUriRequestBuilder("zookeeper{}?command=exists").format(path) .isBodyReturnExpected(true).get(this); result = OBJECT_MAPPER.readValue(data, HashMap.class); Assert.assertTrue(result.containsKey("exists")); <START> Assert.assertEquals(result.get("exists"), Boolean.FALSE); <END> String content = "testExists"; Assert.assertTrue( _testBaseDataAccessor.create(path, content.getBytes(), AccessOption.PERSISTENT)); Assert.assertTrue(_testBaseDataAccessor.exists(path, AccessOption.PERSISTENT)); data = new JerseyUriRequestBuilder("zookeeper{}?command=exists").format(path) .isBodyReturnExpected(true).get(this); result = OBJECT_MAPPER.readValue(data, HashMap.class); Assert.assertTrue(result.containsKey("exists")); Assert.assertEquals(result.get("exists"), Boolean.TRUE); _testBaseDataAccessor.remove(path, AccessOption.PERSISTENT); }</code><technical_language>Nit: assertFalse (and assertTrue in this test)</technical_language>

Target:
public void testExists() throws IOException { String path = "/path"; Assert.assertFalse(_testBaseDataAccessor.exists(path, AccessOption.PERSISTENT)); Map<String, Boolean> result; String data = new JerseyUriRequestBuilder("zookeeper{}?command=exists").format(path) .isBodyReturnExpected(true).get(this); result = OBJECT_MAPPER.readValue(data, HashMap.class); Assert.assertTrue(result.containsKey("exists")); Assert.assertFalse(result.get("exists")); String content = "testExists"; Assert.assertTrue( _testBaseDataAccessor.create(path, content.getBytes(), AccessOption.PERSISTENT)); Assert.assertTrue(_testBaseDataAccessor.exists(path, AccessOption.PERSISTENT)); data = new JerseyUriRequestBuilder("zookeeper{}?command=exists").format(path) .isBodyReturnExpected(true).get(this); result = OBJECT_MAPPER.readValue(data, HashMap.class); Assert.assertTrue(result.containsKey("exists")); Assert.assertTrue(result.get("exists")); _testBaseDataAccessor.remove(path, AccessOption.PERSISTENT); }
Source:
<code>public String getName() { AppInstanceStatusResource instance = this.instances.iterator().next(); return (instance != null && instance.getAttributes() != null) ? <START> instance.getAttributes().get("skipper.application.name") : "no-instances"; <END> }</code><technical_language>I need find a place fit attribute names constants (the skipper.application.name skipper.release.version). Currently, declared in controller package in scope of REST resources</technical_language>

Target:
public String getName() { AppInstanceStatusResource instance = this.instances.iterator().next(); return (instance != null && instance.getAttributes() != null) ? instance.getAttributes().get(StreamRuntimePropertyKeys.ATTRIBUTE_SKIPPER_APPLICATION_NAME) : NO_INSTANCES; }
Source:
<code>public List<AppConfigElement> getMostRecentElements(StudyIdentifier studyId, boolean includeDeleted) { DynamoAppConfigElement key = new DynamoAppConfigElement(); key.setStudyId(studyId.getIdentifier()); List<DynamoAppConfigElement> elements = indexHelper.queryKeys(DynamoAppConfigElement.class, "studyId", studyId.getIdentifier(), null); Map<String,Long> versionMap = Maps.newHashMap(); for (DynamoAppConfigElement oneElement : elements) { if (includeDeleted || !oneElement.isDeleted()) { <START> String elementKey = studyId.getIdentifier() + ":" + oneElement.getId(); <END> Long existingRevision = versionMap.get(elementKey); if (existingRevision == null || oneElement.getRevision() > existingRevision) { versionMap.put(elementKey, oneElement.getRevision()); } } } List<AppConfigElement> mostRecentElements = Lists.newArrayListWithCapacity(versionMap.size()); for (Map.Entry<String,Long> entry : versionMap.entrySet()) { DynamoAppConfigElement oneKey = new DynamoAppConfigElement(); oneKey.setKey(entry.getKey()); oneKey.setRevision(entry.getValue()); DynamoAppConfigElement appConfigElement = mapper.load(oneKey); mostRecentElements.add(appConfigElement); } return mostRecentElements; }</code><technical_language>Nitpick: AppConfig IDs unique study, pre-pending studyID hash key is unnecessary</technical_language>

Target:
public List<AppConfigElement> getMostRecentElements(StudyIdentifier studyId, boolean includeDeleted) { DynamoAppConfigElement key = new DynamoAppConfigElement(); key.setStudyId(studyId.getIdentifier()); DynamoDBQueryExpression<DynamoAppConfigElement> query = new DynamoDBQueryExpression<DynamoAppConfigElement>() .withIndexName(STUDY_ID_INDEX_NAME) .withHashKeyValues(key) .withConsistentRead(false) .withScanIndexForward(false); List<DynamoAppConfigElement> elementIndices = mapper.query(DynamoAppConfigElement.class, query); Map<String,AppConfigElement> versionMap = Maps.newHashMap(); Map<String, List<Object>> resultMap = mapper.batchLoad(elementIndices); for (List<Object> resultList : resultMap.values()) { for (Object oneResult : resultList) { if (!(oneResult instanceof DynamoAppConfigElement)) { throw new BridgeServiceException("DynamoDB returned objects of type " + oneResult.getClass().getName() + " instead of DynamoAppConfigElement"); } DynamoAppConfigElement oneElement = (DynamoAppConfigElement)oneResult; if (!includeDeleted && oneElement.isDeleted()) { continue; } AppConfigElement existingElement = versionMap.get(oneElement.getId()); Long existingRevision = (existingElement == null) ? null : existingElement.getRevision(); if (existingRevision == null || oneElement.getRevision() > existingRevision) { versionMap.put(oneElement.getId(), oneElement); } } } List<AppConfigElement> elements = Lists.newArrayList(versionMap.values()); Collections.sort(elements, Comparator.comparing(AppConfigElement::getId)); return elements; }
Source:
<code>public static OfflineUserRestore buildInMemoryUserRestore(InputStream restoreStream) throws IOException { OfflineUserRestore offlineUserRestore = new OfflineUserRestore(); offlineUserRestore.restore = new String(StreamsUtil.inputStreamToByteArray(restoreStream)); <START> return offlineUserRestore; <END> }</code><technical_language>sounds right me, clear this method does. restore field built represent</technical_language>

Target:
public static OfflineUserRestore buildInMemoryUserRestore(InputStream restoreStream) throws UnfullfilledRequirementsException, IOException, InvalidStructureException, XmlPullParserException { OfflineUserRestore offlineUserRestore = new OfflineUserRestore(); byte[] restoreBytes = StreamsUtil.inputStreamToByteArray(restoreStream); offlineUserRestore.restore = new String(restoreBytes); offlineUserRestore.checkThatRestoreIsValid(); offlineUserRestore.password = PropertyUtils.genUUID(); return offlineUserRestore; }
Source:
<code>public void shouldUpdatePersonWithGivenParameters() { Person person = createTestPerson(); Person.Address personAddress = person.getPreferredAddress(); openMRSActionProxyService.updatePerson(person.getUuid(), person.getPreferredName().getGivenName(), person.getPreferredName().getMiddleName(), person.getPreferredName().getFamilyName(), personAddress.getAddress1(), personAddress.getAddress2(), personAddress.getAddress3(), personAddress.getAddress4(), personAddress.getAddress5(), personAddress.getAddress6(), personAddress.getCityVillage(), personAddress.getStateProvince(), personAddress.getCountry(), personAddress.getPostalCode(), personAddress.getCountyDistrict(), personAddress.getLatitude(), personAddress.getLongitude(), new DateTime(personAddress.getStartDate()), new DateTime(personAddress.getEndDate()), new DateTime(person.getBirthdate()), person.getBirthdateEstimated(), <START> person.getGender(), person.getDead(), ""); <END> verify(personService).updatePerson(eq(null), personCaptor.capture()); assertEquals(person, personCaptor.getValue()); }</code><technical_language>causeOfDeath is empty</technical_language>

Target:
public void shouldUpdatePersonWithGivenParameters() { Person person = createTestPerson(); Concept causeOfDeath = createTestConcept("testCauseOfDeathConcept"); person.setDead(true); person.setCauseOfDeath(causeOfDeath); Person.Address personAddress = person.getPreferredAddress(); doReturn(causeOfDeath).when(conceptService).getConceptByUuid(eq(null), eq(causeOfDeath.getUuid())); openMRSActionProxyService.updatePerson(person.getUuid(), person.getPreferredName().getGivenName(), person.getPreferredName().getMiddleName(), person.getPreferredName().getFamilyName(), personAddress.getAddress1(), personAddress.getAddress2(), personAddress.getAddress3(), personAddress.getAddress4(), personAddress.getAddress5(), personAddress.getAddress6(), personAddress.getCityVillage(), personAddress.getStateProvince(), personAddress.getCountry(), personAddress.getPostalCode(), personAddress.getCountyDistrict(), personAddress.getLatitude(), personAddress.getLongitude(), new DateTime(personAddress.getStartDate()), new DateTime(personAddress.getEndDate()), new DateTime(person.getBirthdate()), person.getBirthdateEstimated(), person.getGender(), person.getDead(), causeOfDeath.getUuid()); verify(personService).updatePerson(eq(null), personCaptor.capture()); assertEquals(person, personCaptor.getValue()); }
Source:
<code>public ParameterTypeRegistry createParameterTypeRegistry() { ParameterTypeRegistry parameterTypeRegistry = new ParameterTypeRegistry(ENGLISH); parameterTypeRegistry.defineParameterType(new ParameterType<Integer>( "digit", <START> "([0-9])", <END> Integer.class, new SingleTransformer<Integer>(new Function<String, Integer>() { @Override public Integer apply(String text) { return Integer.parseInt(text); } }) )); parameterTypeRegistry.defineParameterType(new ParameterType<Character>( "operator", "([+–x\\/=])", Character.class, new SingleTransformer<Character>(new Function<String, Character>() { @Override public Character apply(String text) { return text.charAt(0); } }) )); return parameterTypeRegistry; }</code><technical_language>need a capture group here. capture group if want capture more thing</technical_language>

Target:
public ParameterTypeRegistry createParameterTypeRegistry() { ParameterTypeRegistry typeRegistry = new ParameterTypeRegistry(ENGLISH); typeRegistry.defineParameterType(new ParameterType<Integer>( "digit", "[0-9]", Integer.class, new SingleTransformer<Integer>(new Function<String, Integer>() { @Override public Integer apply(String text) { return Integer.parseInt(text); } }) )); typeRegistry.defineParameterType(new ParameterType<Character>( "operator", "[+–x\\/=]", Character.class, new SingleTransformer<Character>(new Function<String, Character>() { @Override public Character apply(String text) { return text.charAt(0); } }) )); return typeRegistry; }
Source:
<code>public static StringLiteral extractDocstring(@Nullable StatementList statements) { if (statements != null) { Statement firstStatement = statements.statements().get(0); <START> return firstStatement.is(Tree.Kind.EXPRESSION_STMT) && ((ExpressionStatement) firstStatement).expressions().size() == 1 && <END> firstStatement.children().get(0).is(Tree.Kind.STRING_LITERAL) ? (StringLiteral) firstStatement.children().get(0) : null; } return null; }</code><technical_language>This is hard read a conditional expression : a simple if statement ? I helpful fix branch coverage (one branch missing)</technical_language>

Target:
public static StringLiteral extractDocstring(@Nullable StatementList statements) { if (statements != null) { Statement firstStatement = statements.statements().get(0); if (firstStatement.is(Tree.Kind.EXPRESSION_STMT) && ((ExpressionStatement) firstStatement).expressions().size() == 1 && firstStatement.children().get(0).is(Tree.Kind.STRING_LITERAL)) { return (StringLiteral) firstStatement.children().get(0); } } return null; }
Source:
<code><START> private AxonServerEventScheduler(Builder builder) { <END> this.axonServerConnectionManager = builder.axonServerConnectionManager; this.axonServerConfiguration = builder.axonServerConfiguration; this.serializer = builder.eventSerializer.get(); this.converter = new GrpcMetaDataConverter(serializer); }</code><technical_language>suggestion protected AxonServerEventScheduler(Builder builder) {</technical_language>

Target:
protected AxonServerEventScheduler(Builder builder) { this.axonServerConnectionManager = builder.axonServerConnectionManager; this.axonServerConfiguration = builder.axonServerConfiguration; this.serializer = builder.eventSerializer.get(); this.converter = new GrpcMetaDataConverter(serializer); }
Source:
<code>static boolean useKafkaTimestamp(SecorConfig config) { <START> return config.getBoolean("kafka.useTimestamp", false); <END> }</code><technical_language>This call config.useKafkaTimestamp()</technical_language>

Target:
static boolean useKafkaTimestamp(SecorConfig config) { return config.useKafkaTimestamp(); }
Source:
<code>public String[] getMechanismNames(Map<String, ?> properties) { Set<String> mechanismNames = new LinkedHashSet<>(); for (Provider current : providers.get()) { boolean containFactory = false; Set<Service> services = current.getServices(); if (services != null) { for (Service currentService : services) { if (SERVICE_TYPE.equals(currentService.getType())) { containFactory = true; try { String[] serviceMechNames = ((HttpServerAuthenticationMechanismFactory) currentService.newInstance(null)).getMechanismNames(properties); Collections.addAll(mechanismNames, serviceMechNames); } catch (NoSuchAlgorithmException e) { log.debug(e); } } } } if ( ! containFactory) { <START> log.noHttpServerAuthenticationMechanismFactoryProvidedByProvider(current); <END> } } return mechanismNames.toArray(new String[mechanismNames.size()]); }</code><technical_language>I thinking, sense start server in case all? throw exception here? I of example this intentional - user setting explicitly special server mechanism factory mechanism authentication</technical_language>

Target:
public String[] getMechanismNames(Map<String, ?> properties) { Set<String> names = new LinkedHashSet<>(); for (Provider current : providerSupplier.get()) { Set<Service> services = current.getServices(); if (services != null) { for (Service currentService : services) { if (SERVICE_TYPE.equals(currentService.getType())) { try { String[] serviceMechNames = ((HttpServerAuthenticationMechanismFactory) currentService.newInstance(null)).getMechanismNames(properties); Collections.addAll(names, serviceMechNames); } catch (NoSuchAlgorithmException e) { log.debug(e); } } } } } if (names.size() == 0 && log.isTraceEnabled()) { log.tracef("No %s provided by service loader in %s: %s", SERVICE_TYPE, getClass().getSimpleName(), Arrays.toString(providerSupplier.get())); } return names.toArray(new String[names.size()]); }
Source:
<code>private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; <START> if (command.isOfType(RedisCommandType.SHUTDOWN)) { <END> this.server.shutdown(); return; } if (!isAuthenticated) { response = handleUnAuthenticatedCommand(command); writeToChannel(response); return; } if (!(command.isSupported() || allowUnsupportedCommands())) { writeToChannel(RedisResponse.error(RedisConstants.ERROR_UNSUPPORTED_COMMAND)); return; } response = command.execute(this); logResponse(response); moveSubscribeToNewEventLoopGroup(ctx, command); if (response == null) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }</code><technical_language>this SHUTDOWN command code moved check of unsupported commands allowed? I SHUTDOWN is unsupported</technical_language>

Target:
private void executeCommand(ChannelHandlerContext ctx, Command command) throws Exception { RedisResponse response; if (!isAuthenticated) { response = handleUnAuthenticatedCommand(command); writeToChannel(response); return; } if (!(command.isSupported() || allowUnsupportedCommands())) { writeToChannel(RedisResponse.error(RedisConstants.ERROR_UNSUPPORTED_COMMAND)); return; } if (command.isOfType(RedisCommandType.SHUTDOWN)) { this.server.shutdown(); return; } response = command.execute(this); logResponse(response); moveSubscribeToNewEventLoopGroup(ctx, command); if (response == null) { writeToChannel(command.getResponse()); } else if (response != null) { writeToChannel(response); } if (command.isOfType(RedisCommandType.QUIT)) { channelInactive(ctx); } }
Source:
<code>public Result query(String cypher, Map<String, ?> parameters, boolean readOnly) { validateQuery(cypher, parameters, readOnly); RestModelRequest request = new DefaultRestModelRequest(cypher, parameters); ResponseMapper mapper = new RestModelMapper(new GraphEntityMapper(session.metaData(), session.context()), session.metaData()); return session.doInTransaction(transaction -> { try (Response<RestModel> response = session.requestHandler().execute(request)) { Iterable<RestStatisticsModel> mappedModel = mapper.map(null, response); RestStatisticsModel restStatisticsModel = mappedModel.iterator().next(); if (readOnly) { <START> return new QueryResultModel(restStatisticsModel.getResult(), null); <END> } else { return new QueryResultModel(restStatisticsModel.getResult(), restStatisticsModel.getStatistics()); } } }, Transaction.Type.READ_WRITE); }</code><technical_language>This is wrong. QueryStatisticsModel contains_updates = false</technical_language>

Target:
public Result query(String cypher, Map<String, ?> parameters, boolean readOnly) { validateQuery(cypher, parameters, readOnly); RestModelRequest request = new DefaultRestModelRequest(cypher, parameters); ResponseMapper mapper = new RestModelMapper(new GraphEntityMapper(session.metaData(), session.context()), session.metaData()); return session.doInTransaction( () -> { try (Response<RestModel> response = session.requestHandler().execute(request)) { Iterable<RestStatisticsModel> mappedModel = mapper.map(null, response); RestStatisticsModel restStatisticsModel = mappedModel.iterator().next(); if (readOnly) { return new QueryResultModel(restStatisticsModel.getResult(), null); } else { return new QueryResultModel(restStatisticsModel.getResult(), restStatisticsModel.getStatistics()); } } }, Transaction.Type.READ_WRITE); }
Source:
<code>private Map setupPySparkEnv() throws IOException{ Map env = EnvironmentUtils.getProcEnvironment(); SparkConf conf = getSparkConf(); if (!env.containsKey("PYTHONPATH")) { String pythonPath = "../interpreter/lib/python"; try { pythonPath += ":" + conf.get("spark.submit.pyFiles").replaceAll(",", ":"); } catch (NoSuchElementException e) { <START> LOG.error("spark.submit.pyFiles property is not set in spark config.") <END> } env.put("PYTHONPATH", pythonPath); } if (SparkInterpreter.useSparkSubmit() && !getSparkInterpreter().isYarnMode()) { String sparkSubmitJars = conf.get("spark.jars").replace(",", ":"); if (!"".equals(sparkSubmitJars)) { env.put("PYTHONPATH", env.get("PYTHONPATH") + sparkSubmitJars); } } return env; }</code><technical_language>LOG logger ";" expecting SEMI</technical_language>

Target:
private Map setupPySparkEnv() throws IOException{ Map env = EnvironmentUtils.getProcEnvironment(); SparkConf conf = getSparkConf(); if (!env.containsKey("PYTHONPATH")) { env.put("PYTHONPATH", conf.get("spark.submit.pyFiles").replaceAll(",", ":") + ":../interpreter/lib/python"); } if (SparkInterpreter.useSparkSubmit() && !getSparkInterpreter().isYarnMode()) { String sparkSubmitJars = conf.get("spark.jars").replace(",", ":"); if (!"".equals(sparkSubmitJars)) { env.put("PYTHONPATH", env.get("PYTHONPATH") + sparkSubmitJars); } } logger.debug("PYTHONPATH: " + env.get("PYTHONPATH")); return env; }
Source:
<code>public HttpWebResponse sendPost(URL url, Map<String, String> headers, byte[] content, String contentType) throws IOException { mRequestUrl = url; mRequestHeaders = headers; if (content != null) { try { mRequestContent = new String(content, "UTF-8"); <START> } catch (UnsupportedEncodingException e) { <END> e.printStackTrace(); Assert.fail("Encoding"); } } if (mReturnException != null) { throw new IllegalArgumentException(mReturnException); } return mReturnResponse; }</code><technical_language>this method throws IOException, need catch UnsupportedEncodingException</technical_language>

Target:
public HttpWebResponse sendPost(URL url, Map<String, String> headers, byte[] content, String contentType) throws IOException { mRequestUrl = url; mRequestHeaders = headers; if (content != null) { try { mRequestContent = new String(content, "UTF-8"); } catch (final IOException e) { Assert.fail("IOException"); } } if (mReturnException != null) { throw new IllegalArgumentException(mReturnException); } return mReturnResponse; }
Source:
<code><START> public AttributeDefinition[] getValueTypes() { <END> return valueTypes; }</code><technical_language>This need public; package protected is fine</technical_language>

Target:
AttributeDefinition[] getValueTypes() { return valueTypes; }
Source:
<code>protected JComponent getWindowContent() { final String datastoreName = getDatastoreName(); String bannerTitle = "Analysis results"; if (!StringUtils.isNullOrEmpty(datastoreName)) { bannerTitle = bannerTitle + " | " + datastoreName; if (_jobFilename != null) { bannerTitle = bannerTitle + " | " + _jobFilename.getName().getBaseName(); } } final DCBannerPanel banner = new DCBannerPanel(imageManager.getImage("images/window/banner-results.png"), bannerTitle); _tabbedPane.addListener(new VerticalTabbedPane.Listener() { @Override public void stateChanged(int newIndex, Tab<?> newTab) { banner.setTitle2(newTab.getTitle()); banner.updateUI(); } }); for (JComponent pluggableButton : _pluggableButtons) { <START> banner.add(pluggableButton); <END> } banner.add(_cancelButton); banner.add(Box.createHorizontalStrut(10)); final DCPanel panel = new DCPersistentSizedPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND, _windowSizePreference); panel.setLayout(new BorderLayout()); panel.add(banner, BorderLayout.NORTH); panel.add(_tabbedPane, BorderLayout.CENTER); return panel; }</code><technical_language>pluggable buttons added banner. touch those, should? :) pluggable button right (in commercial editions) is "export metrics csv" button (I called - similar).... I fits in other buttons moved</technical_language>

Target:
protected JComponent getWindowContent() { final String datastoreName = getDatastoreName(); String bannerTitle = "Analysis results"; if (!StringUtils.isNullOrEmpty(datastoreName)) { bannerTitle = bannerTitle + " | " + datastoreName; if (_jobFilename != null) { bannerTitle = bannerTitle + " | " + _jobFilename.getName().getBaseName(); } } final DCBannerPanel banner = new DCBannerPanel(imageManager.getImage("images/window/banner-results.png"), bannerTitle); _tabbedPane.addListener(new VerticalTabbedPane.Listener() { @Override public void stateChanged(int newIndex, Tab<?> newTab) { banner.setTitle2(newTab.getTitle()); banner.updateUI(); } }); final DCPanel panel = new DCPersistentSizedPanel(WidgetUtils.COLOR_DEFAULT_BACKGROUND, _windowSizePreference); panel.setLayout(new BorderLayout()); panel.add(banner, BorderLayout.NORTH); panel.add(_tabbedPane, BorderLayout.CENTER); return panel; }
Source:
<code>public void downloadForm(ServerFormDetails form, @Nullable ProgressReporter progressReporter, @Nullable Supplier<Boolean> isCancelled) throws FormDownloadException, InterruptedException { Form formOnDevice = formsRepository.get(form.getFormId(), form.getFormVersion()); if (formOnDevice != null) { if (formOnDevice.isDeleted()) { formsRepository.restore(formOnDevice.getId()); } else if (!(form.getHash().equals(formOnDevice.getMD5Hash()))) { String formIdentifier = formOnDevice.getDisplayName() + " " + formOnDevice.getId(); String formIdHash = FileUtils.getMd5Hash(new ByteArrayInputStream(formIdentifier.getBytes())); analytics.logFormEvent(DOWNLOAD_SAME_FORMID_VERSION, formIdHash); <START> throw new FormDownloadException("You've already downloaded a form with the same ID and version but with different contents. " + <END> "Before downloading, please send all data you have collected with the existing form and delete the data and blank form."); } } File tempDir = new File(cacheDir, "download-" + UUID.randomUUID().toString()); tempDir.mkdirs(); try { FormDownloaderListener stateListener = new ProgressReporterAndSupplierStateListener(progressReporter, isCancelled); boolean result = multiFormDownloader.processOneForm(form, stateListener, tempDir, formsDirPath, formMetadataParser); if (!result) { throw new FormDownloadException(); } } finally { try { deleteDirectory(tempDir); } catch (IOException ignored) { } } }</code><technical_language>I happy localizing method text I good separate out a display concern here. add a type FormDownloadException (or a subtype) match display right message in more UI focused code</technical_language>

Target:
public void downloadForm(ServerFormDetails form, @Nullable ProgressReporter progressReporter, @Nullable Supplier<Boolean> isCancelled) throws FormDownloadException, InterruptedException { Form formOnDevice = formsRepository.getOneByFormIdAndVersion(form.getFormId(), form.getFormVersion()); if (formOnDevice != null) { String remoteFormHash = form.getHash().startsWith("md5:") ? form.getHash().substring("md5:".length()) : form.getHash(); if (formOnDevice.isDeleted()) { formsRepository.restore(formOnDevice.getId()); } else if (!remoteFormHash.equals(formOnDevice.getMD5Hash())) { String formIdentifier = formOnDevice.getDisplayName() + " " + formOnDevice.getId(); String formIdHash = FileUtils.getMd5Hash(new ByteArrayInputStream(formIdentifier.getBytes())); analytics.logFormEvent(DOWNLOAD_SAME_FORMID_VERSION, formIdHash); throw new FormDownloadException(FormDownloadException.Type.DUPLICATE_FORMID_VERSION); } } File tempDir = new File(cacheDir, "download-" + UUID.randomUUID().toString()); tempDir.mkdirs(); try { FormDownloaderListener stateListener = new ProgressReporterAndSupplierStateListener(progressReporter, isCancelled); boolean result = multiFormDownloader.processOneForm(form, stateListener, tempDir, formsDirPath, formMetadataParser); if (!result) { throw new FormDownloadException(); } } finally { try { deleteDirectory(tempDir); } catch (IOException ignored) { } } }
Source:
<code>public void testNotConfiguredFactoryClass() { final Configuration config = new Configuration(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); <START> final PluginManager testingPluginManagerPluginManager = new TestingPluginManager(plugins); <END> config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManagerPluginManager); assertThat(externalResourceDrivers.entrySet(), is(empty())); }</code><technical_language>suggestion final PluginManager testingPluginManager = new TestingPluginManager(plugins);</technical_language>

Target:
public void testNotConfiguredFactoryClass() { final Configuration config = new Configuration(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); final PluginManager testingPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager); assertThat(externalResourceDrivers.entrySet(), is(empty())); }
Source:
<code>public void handle(ZookeeperConfigRefreshEvent event) { if (this.ready.get()) { log.debug(contextName + " " + event.getEventDesc()); <START> if (this.refresh != null) { <END> String[] keys = this.refresh.refresh(); log.info("Refresh keys changed: " + Arrays.asList(keys)); } } }</code><technical_language>If is RefreshEndpoint bean instantiated, I guess null check is unnecessary? @Bean @ConditionalOnBean(RefreshEndpoint.class) public ZookeeperConfigRefreshListener zookeeperConfigRefreshListener( RefreshEndpoint refreshEndpoint) { return new ZookeeperConfigRefreshListener("application", refreshEndpoint); }</technical_language>

Target:
public void handle(ZookeeperConfigRefreshEvent event) { if (this.ready.get()) { log.debug("Event received " + event.getEventDesc()); if (this.refresh != null) { String[] keys = this.refresh.refresh(); log.info("Refresh keys changed: " + Arrays.asList(keys)); } } }
Source:
<code>public boolean doSomething(@NotNull PsiFile file, @NotNull Project project, @Nullable final VirtualFile virtualFile, @NotNull String groupId) throws ExecutionException { if (virtualFile == null || !virtualFile.isInLocalFileSystem()) return true; Document document = PsiDocumentManager.getInstance(project).getDocument(file); assert document != null; String filePath = virtualFile.getCanonicalPath(); assert filePath != null; String sdkHome = GoSdkService.getInstance(project).getSdkHomePath(ModuleUtilCore.findModuleForPsiElement(file)); <START> if (StringUtil.isEmpty(sdkHome)) { <END> warning(project, groupId, "Project sdk is not valid"); return true; } File executable = PathEnvironmentVariableUtil.findInPath(GoEnvironmentUtil.getBinaryFileNameForPath("goimports")); if (executable == null) { warning(project, groupId, "Looks like you haven't any goimports executable in your PATH"); return true; } FileDocumentManager.getInstance().saveDocument(document); GoExecutor goExecutor = GoExecutor. in(project). withCustomExecutable(executable). addParameters("-w", filePath). showOutputOnError(); goExecutor.addProcessListener(new ProcessAdapter() { @Override public void processTerminated(ProcessEvent event) { ApplicationManager.getApplication().invokeLater(new Runnable() { @Override public void run() { ApplicationManager.getApplication().runWriteAction(new Runnable() { @Override public void run() { virtualFile.refresh(false, false); } }); } }); } }); goExecutor.execute(); return false; }</code><technical_language>GoExecutor throw execution error if sdk is set, need check twice, catch exception executor write error message in output console</technical_language>

Target:
public boolean doSomething(@NotNull PsiFile file, @NotNull Project project, @Nullable final VirtualFile virtualFile, @NotNull String groupId) throws ExecutionException { if (virtualFile == null || !virtualFile.isInLocalFileSystem()) return true; Document document = PsiDocumentManager.getInstance(project).getDocument(file); assert document != null; String filePath = virtualFile.getCanonicalPath(); assert filePath != null; File executable = GoEnvironmentUtil.getBinaryFilePathFromEnvironment("goimports"); if (executable == null) { warning(project, groupId, "Looks like you haven't any goimports executable in your PATH"); return true; } FileDocumentManager.getInstance().saveDocument(document); GoExecutor. in(project). withExePath(executable.getAbsolutePath()). addParameters("-w", filePath). showOutputOnError(). execute(); return false; }
Source:
<code>private static boolean checkAndNoteChangeNetworkStateOperation(@NonNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException) { <START> return Settings.checkAndNoteWriteSettingsOperation(context, uid, callingPackage, throwException); <END> }</code><technical_language>happened this code in Settings.checkAndNoteChangeNetworkStateOperation? if (context.checkCallingOrSelfPermission(android.Manifest.permission.CHANGE_NETWORK_STATE) == PackageManager.PERMISSION_GRANTED) { return true; } app CHANGE_NETWORK_STATE permission able call requestNetwork WRITE_SETTINGS</technical_language>

Target:
private static boolean checkAndNoteChangeNetworkStateOperation(@NonNull Context context, int uid, @NonNull String callingPackage, @Nullable String callingAttributionTag, boolean throwException) { return Settings.checkAndNoteChangeNetworkStateOperation(context, uid, callingPackage, throwException); }
Source:
<code>public boolean append(@NonNull StreamInputPacketIndexEntry entry) throws CTFReaderException { if (entry.getTimestampBegin() > entry.getTimestampEnd()) { throw new CTFReaderException("Packet begin timestamp is after end timestamp"); } if (!fEntries.isEmpty() && (entry.getTimestampBegin() < fLastElement.getTimestampBegin())) { throw new CTFReaderException("Packets begin timestamp decreasing"); } fEntries.add(entry); <START> fLastElement = fEntries.get(fEntries.size() - 1); <END> return true; }</code><technical_language>assuming goal is avoid ArrayList.get here, do fLastElement = entry instead</technical_language>

Target:
public boolean append(@NonNull StreamInputPacketIndexEntry entry) throws CTFReaderException { if (entry.getTimestampBegin() > entry.getTimestampEnd()) { throw new CTFReaderException("Packet begin timestamp is after end timestamp"); } if (!fEntries.isEmpty() && (entry.getTimestampBegin() < lastElement().getTimestampBegin())) { throw new CTFReaderException("Packets begin timestamp decreasing"); } fEntries.add(entry); return true; }
Source:
<code>public void publish(String transcript) { File logDir = new File(ROOT_DIR, LOG_DIR); if(logDir.exists() && !logDir.isDirectory()) { if(!logDir.delete()) { logger.warn("Was not able to safe a transcript because" + "there is a file called " + ROOT_DIR + " which cannot" + "be deleted"); return; } } if(!logDir.exists()) { if(!logDir.mkdir()) { logger.warn("Was not able to safe a transcript because" + "unable to make a directory called" + ROOT_DIR); return; } } File t = new File(logDir, "transcript_" + Instant.now() + ".txt"); try(FileWriter writer = new FileWriter(t)) { writer.write(transcript); <START> System.out.println(transcript); <END> } catch(IOException e) { logger.warn("Unable to safe transcript", e); } }</code><technical_language>print line acknowledges saved in a file</technical_language>

Target:
public void publish(String transcript) { File logDir = new File(getLogDirPath()); if(logDir.exists() && !logDir.isDirectory()) { if(!logDir.delete()) { logger.warn("Was not able to safe a transcript because" + "there is a file called " + logDir + " which cannot" + "be deleted"); return; } } if(!logDir.exists()) { if(!logDir.mkdir()) { logger.warn("Was not able to safe a transcript because" + "unable to make a directory called " + logDir); return; } } File t = new File(logDir, "transcript_" + Instant.now() + ".txt"); try(FileWriter writer = new FileWriter(t)) { writer.write(transcript); logger.info("wrote final transcript to " + t); } catch(IOException e) { logger.warn("Unable to safe transcript", e); } }
Source:
<code>private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { <START> List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid, false); <END> for (DefaultIssue issue : issues) { issue.setBeingClosed(true); issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }</code><technical_language>A UT added check changelog correctly loaded</technical_language>

Target:
private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) { DiskCache<DefaultIssue>.DiskAppender cacheAppender = issueCache.newAppender(); try { for (String deletedComponentUuid : deletedComponentUuids) { List<DefaultIssue> issues = issuesLoader.loadForComponentUuid(deletedComponentUuid); for (DefaultIssue issue : issues) { issue.setBeingClosed(true); issue.setOnDisabledRule(false); issueLifecycle.doAutomaticTransition(issue); cacheAppender.append(issue); } } } finally { cacheAppender.close(); } }
Source:
<code>protected void configure() { bind(SnapshotDao.class).to(DummySnapshotDao.class); bind(MachineService.class); Multibinder<String> exposedPortsMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_exposed_ports")); Multibinder<String> volumesMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_volumes")); install(new FactoryModuleBuilder() .implement(Instance.class, DockerInstance.class) .implement(InstanceMetadata.class, DockerInstanceMetadata.class) .implement(InstanceProcess.class, DockerProcess.class) .implement(DockerNode.class, LocalDockerNode.class) .build(DockerMachineFactory.class)); Multibinder.newSetBinder(binder(), InstanceProvider.class).addBinding().to(DockerInstanceProvider.class); if (SystemInfo.isWindows()) { <START> bind(String.class).annotatedWith(Names.named("host.projects.folder")).toProvider(HostProjectsFolderProviderWinOS.class); <END> } else { bind(String.class).annotatedWith(Names.named("host.projects.folder")).toProvider(HostProjectsFolderProviderUnix.class); } }</code><technical_language>full FQN of class in toProvider method</technical_language>

Target:
protected void configure() { bind(SnapshotDao.class).to(DummySnapshotDao.class); bind(MachineService.class); Multibinder<String> exposedPortsMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_exposed_ports")); Multibinder<String> volumesMultibinder = Multibinder.newSetBinder(binder(), String.class, Names.named("machine.docker.system_volumes")); install(new FactoryModuleBuilder() .implement(Instance.class, DockerInstance.class) .implement(InstanceMetadata.class, DockerInstanceMetadata.class) .implement(InstanceProcess.class, DockerProcess.class) .implement(DockerNode.class, LocalDockerNode.class) .build(DockerMachineFactory.class)); Multibinder.newSetBinder(binder(), InstanceProvider.class).addBinding().to(DockerInstanceProvider.class); if (SystemInfo.isWindows()) { bind(String.class).annotatedWith(Names.named("host.projects.root")) .toProvider(org.eclipse.che.plugin.docker.machine.ext.HostProjectsFolderProviderWinOS.class); } else { bind(String.class).annotatedWith(Names.named("host.projects.root")) .toProvider(org.eclipse.che.plugin.docker.machine.ext.HostProjectsFolderProviderWinOS.class); } }
Source:
<code><START> public LocalizableString mockLocalizeableString(String value) { <END> LocalizableString mock2 = mock(LocalizableString.class); when(mock2.getString(any(Locale.class))).thenReturn(value); return mock2; }</code><technical_language>protected sufficient for this method</technical_language>

Target:
protected LocalizableString mockLocalizeableString(String value) { LocalizableString mock2 = mock(LocalizableString.class); when(mock2.getString(any(Locale.class))).thenReturn(value); return mock2; }
Source:
<code>protected boolean connectLunDisks(Guid hostId) { if (getVm().getDiskMap().isEmpty()) { VmHandler.updateDisksFromDb(getVm()); } List<LunDisk> lunDisks = ImagesHandler.filterDiskBasedOnLuns(getVm().getDiskMap().values()); for (LunDisk lunDisk : lunDisks) { LUNs lun = lunDisk.getLun(); lun.setLunConnections(new ArrayList<storage_server_connections>(DbFacade.getInstance() .getStorageServerConnectionDAO() .getAllForLun(lun.getLUN_id()))); <START> if (!lun.getLunConnections().isEmpty()) { <END> if (!StorageHelperDirector.getInstance().getItem(lun.getLunConnections().get(0).getstorage_type()) .ConnectStorageToLunByVdsId(null, hostId, lun, getVm().getstorage_pool_id())) { log.infoFormat("Failed to connect a lun disk to vdsm {0} skiping it", hostId); return false; } } } return true; }</code><technical_language>if && instead if conditions</technical_language>

Target:
protected boolean connectLunDisks(Guid hostId) { if (getVm().getDiskMap().isEmpty()) { VmHandler.updateDisksFromDb(getVm()); } List<LunDisk> lunDisks = ImagesHandler.filterDiskBasedOnLuns(getVm().getDiskMap().values()); for (LunDisk lunDisk : lunDisks) { LUNs lun = lunDisk.getLun(); lun.setLunConnections(new ArrayList<storage_server_connections>(DbFacade.getInstance() .getStorageServerConnectionDAO() .getAllForLun(lun.getLUN_id()))); if (!lun.getLunConnections().isEmpty() && !StorageHelperDirector.getInstance().getItem(lun.getLunConnections().get(0).getstorage_type()) .ConnectStorageToLunByVdsId(null, hostId, lun, getVm().getstorage_pool_id())) { log.infoFormat("Failed to connect a lun disk to vdsm {0} skiping it", hostId); return false; } } return true; }
Source:
<code>protected void uploadConsent(ConsentSignatureBody consentSignatureBody) { DataProvider.getInstance() .uploadConsent(getContext(), consentSignatureBody) .compose(ObservableUtils.applyDefault()) <START> .subscribe(dataResponse -> { <END> hideLoadingDialog(); if(dataResponse.isSuccess()) { super.onComplete(); } else { showOkAlertDialog(dataResponse.getMessage()); } }, throwable -> { hideLoadingDialog(); showOkAlertDialog(throwable.getMessage()); }); }</code><technical_language>track of subscription call unsubscribe in onStop</technical_language>

Target:
protected void uploadConsent(ConsentSignatureBody consentSignatureBody) { Observable<DataResponse> uploadConsent = DataProvider.getInstance() .uploadConsent(getContext(), consentSignatureBody) .compose(ObservableUtils.applyDefault()); StepLayoutHelper.safePerformWithAlerts(uploadConsent, this, response -> super.onComplete() ); }