auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>ProcessWorkProcessor(WorkProcessor.Process<T> process) { this.process = requireNonNull(process, "process is null"); <START> } <END></code><technical_language>private ; is suitable initial state this need @Nullable ? NEEDS_MORE_DATA</technical_language>

Target:
private ProcessWorkProcessor(WorkProcessor.Process<T> process) { this.process = requireNonNull(process, "process is null"); }
Source:
<code>private static Map<Guid, VdcObjectType> getSubjectEntities(List<PermissionSubject> permSubjectList) { return permSubjectList.stream() <START> .filter(subject -> subject != null) <END> .filter(subject -> subject.getObjectType() != null) .collect(toMap( subject -> subject.getObjectId(), subject -> subject.getObjectType() )); }</code><technical_language>ifPresent instead of null checks</technical_language>

Target:
private static Map<Guid, VdcObjectType> getSubjectEntities(List<PermissionSubject> permSubjectList) { return permSubjectList.stream() .filter(subject -> subject != null) .filter(subject -> subject.getObjectType() != null) .collect(Collectors.toMap(PermissionSubject::getObjectId, PermissionSubject::getObjectType)); }
Source:
<code>protected Cluster updateTopology() { Cluster cluster = destinationCluster.clone(); switch (operationType) { case NODE: { logger.info("Detaching node: from stripe: {}", source, destination); <START> Stripe stripe = cluster.getStripe(source).get(); <END> if (stripe.getNodeCount() == 1) { throw new IllegalStateException("Unable to detach since destination stripe contains only 1 node"); } cluster.detachNode(source); break; } case STRIPE: { Stripe stripe = cluster.getStripe(source).get(); logger.info("Detaching stripe containing nodes: from cluster: {}", toString(stripe.getNodeAddresses()), destination); cluster.detachStripe(stripe); break; } default: { throw new UnsupportedOperationException(operationType.name()); } } return cluster; }</code><technical_language>this check line 89</technical_language>

Target:
protected Cluster updateTopology() { Cluster cluster = destinationCluster.clone(); switch (operationType) { case NODE: { logger.info("Detaching node: from stripe: {}", source, destination); cluster.detachNode(source); break; } case STRIPE: { Stripe stripe = cluster.getStripe(source).get(); logger.info("Detaching stripe containing nodes: from cluster: {}", toString(stripe.getNodeAddresses()), destination); cluster.detachStripe(stripe); break; } default: { throw new UnsupportedOperationException(operationType.name()); } } return cluster; }
Source:
<code>protected ActionResult execute() throws EntityDoesNotExistException { <START> Assumption.assertNotNull(regkey); <END> String nextUrl; if (regkey.contains("${amp}" + Const.ParamsNames.NEXT_URL)) { String[] split = regkey.split("\\$\\{amp\\}" + Const.ParamsNames.NEXT_URL + "="); regkey = split[0]; nextUrl = split[1]; } else { nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); } Assumption.assertNotNull(nextUrl); nextUrl = Sanitizer.desanitizeFromNextUrl(nextUrl); ensureStudentExists(); try { logic.joinCourseForStudent(regkey, account.googleId); } catch (JoinCourseException e) { if (e.errorCode == Const.StatusCodes.INVALID_KEY) { setStatusForException(e, String.format(e.getMessage(), requestUrl)); } else { setStatusForException(e, e.getMessage()); } nextUrl = Const.ActionURIs.STUDENT_HOME_PAGE; excludeStudentDetailsFromResponseParams(); return createRedirectResult(nextUrl); } final String studentInfo = "Action Student Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + regkey; RedirectResult response = createRedirectResult(nextUrl); response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, getStudent().course); excludeStudentDetailsFromResponseParams(); if(statusToAdmin != null && !statusToAdmin.trim().isEmpty()) { statusToAdmin += "<br/><br/>" + studentInfo; } else { statusToAdmin = studentInfo; } addStatusMessageToUser(); return response; }</code><technical_language>If this parameter more key, call regkey</technical_language>

Target:
protected ActionResult execute() throws EntityDoesNotExistException { Assumption.assertNotNull(regkey); String nextUrl; if (regkey.contains("${amp}" + Const.ParamsNames.NEXT_URL + "=")) { String[] split = regkey.split("\\$\\{amp\\}" + Const.ParamsNames.NEXT_URL + "="); regkey = split[0]; nextUrl = split[1]; } else { nextUrl = getRequestParamValue(Const.ParamsNames.NEXT_URL); } Assumption.assertNotNull(nextUrl); nextUrl = Sanitizer.desanitizeFromNextUrl(nextUrl); ensureStudentExists(); try { logic.joinCourseForStudent(regkey, account.googleId); } catch (JoinCourseException e) { if (e.errorCode == Const.StatusCodes.INVALID_KEY) { setStatusForException(e, String.format(e.getMessage(), requestUrl)); } else { setStatusForException(e, e.getMessage()); } nextUrl = Const.ActionURIs.STUDENT_HOME_PAGE; excludeStudentDetailsFromResponseParams(); return createRedirectResult(nextUrl); } final String studentInfo = "Action Student Joins Course" + "<br/>Google ID: " + account.googleId + "<br/>Key : " + regkey; RedirectResult response = createRedirectResult(nextUrl); response.addResponseParam(Const.ParamsNames.CHECK_PERSISTENCE_COURSE, getStudent().course); excludeStudentDetailsFromResponseParams(); if(statusToAdmin != null && !statusToAdmin.trim().isEmpty()) { statusToAdmin += "<br/><br/>" + studentInfo; } else { statusToAdmin = studentInfo; } addStatusMessageToUser(); return response; }
Source:
<code>public GradleProjectConvertWizard(IDialogSettings dialogSettings, PublishedGradleVersions publishedGradleVersions) { Preconditions.checkNotNull(dialogSettings); Preconditions.checkNotNull(publishedGradleVersions); setDialogSettings(dialogSettings); this.setController(new ProjectImportWizardController(this)); ProjectImportConfiguration configuration = this.getController().getConfiguration(); this.gradleOptionsPage = new GradleOptionsWizardPage(configuration, publishedGradleVersions); this.gradleOptionsPage.setTitle("Convert to Gralde"); <START> this.gradleOptionsPage.setMessage("Settings for the conversion to Gralde"); <END> }</code><technical_language>'Gralde' misspelt this line above</technical_language>

Target:
public GradleProjectConvertWizard(IDialogSettings dialogSettings, PublishedGradleVersions publishedGradleVersions) { Preconditions.checkNotNull(dialogSettings); Preconditions.checkNotNull(publishedGradleVersions); setDialogSettings(dialogSettings); setController(new ProjectImportWizardController(this)); ProjectImportConfiguration configuration = getController().getConfiguration(); this.gradleOptionsPage = new GradleOptionsWizardPage(configuration, publishedGradleVersions); this.gradleOptionsPage.setTitle("Convert to Gradle"); this.gradleOptionsPage.setMessage("Settings for the conversion to Gradle"); }
Source:
<code>private TreeNode getTree(Node parent, TreeNode treeparent) { for (Relationship r : IteratorUtil.loop(parent.getRelationships(Direction.OUTGOING, <START> RelTypes.ANCESTOR_OF).iterator())) { <END> TreeNode child = new TreeNode(treeparent); child.setDistance((int) parent.getProperty(PropertyTypes.DIST_TO_ROOT.name()) + 1); if (r.getEndNode().hasLabel(NodeLabels.SOURCE)) { child.setName((String) r.getEndNode().getProperty(PropertyTypes.SOURCE.name())); } else { getTree(r.getEndNode(), child); } } return treeparent; }</code><technical_language>getRelationships returns Iterable, need get Iterator iterator(), turn Iterable IteratorUtil.loop</technical_language>

Target:
private TreeNode getTree(Node parent, TreeNode treeparent) { for (Relationship r : parent.getRelationships(Direction.OUTGOING, RelTypes.ANCESTOR_OF)) { TreeNode child = new TreeNode(treeparent); child.setDistance((int) parent.getProperty(PropertyTypes.DIST_TO_ROOT.name()) + 1); if (r.getEndNode().hasLabel(NodeLabels.SOURCE)) { child.setName((String) r.getEndNode().getProperty(PropertyTypes.SOURCE.name())); } else { getTree(r.getEndNode(), child); } } return treeparent; }
Source:
<code>public Object processFetch(Environment context, PersistentResourceFetcher fetcher) { NonEntityDictionary nonEntityDictionary = fetcher.getNonEntityDictionary(); String fieldName = context.field.getName(); Object object = nonEntityDictionary.getValue(nonEntity, fieldName, context.requestScope); if (object == null) { return null; } <START> if (nonEntityDictionary.hasBinding(new ClassType(object.getClass()))) { <END> return new NonEntityContainer(object); } if (object instanceof Map) { return ((Map<Object, Object>) object).entrySet().stream() .map(MapEntryContainer::new) .collect(Collectors.toList()); } if (object instanceof Collection) { Type<?> innerType = nonEntityDictionary.getParameterizedType(nonEntity.getClass(), fieldName); if (nonEntityDictionary.hasBinding(innerType)) { return ((Collection) object).stream() .map(NonEntityContainer::new) .collect(Collectors.toList()); } } return object; }</code><technical_language>call object.getClass directly. dictionary.getType</technical_language>

Target:
public Object processFetch(Environment context, PersistentResourceFetcher fetcher) { NonEntityDictionary nonEntityDictionary = fetcher.getNonEntityDictionary(); String fieldName = context.field.getName(); Object object = nonEntityDictionary.getValue(nonEntity, fieldName, context.requestScope); if (object == null) { return null; } if (nonEntityDictionary.hasBinding(EntityDictionary.getType(object))) { return new NonEntityContainer(object); } if (object instanceof Map) { return ((Map<Object, Object>) object).entrySet().stream() .map(MapEntryContainer::new) .collect(Collectors.toList()); } if (object instanceof Collection) { Type<?> innerType = nonEntityDictionary.getParameterizedType(nonEntity.getClass(), fieldName); if (nonEntityDictionary.hasBinding(innerType)) { return ((Collection) object).stream() .map(NonEntityContainer::new) .collect(Collectors.toList()); } } return object; }
Source:
<code>private void validatePayloadHasFields(JsonNode payload, List<String> expectedFields, List<String> atLeastOneOfTheseFieldsMustExist) throws ValidationException { if (payload == null) { throw new ValidationException("Body cannot be empty"); } List<String> missingFields = expectedFields .stream() .filter(expectedKey -> !payload.has(expectedKey)) .collect(Collectors.toList()); if (!missingFields.isEmpty()) { <START> throw new ValidationException(format("Missing fields: [%s]", String.join(", ", missingFields))); <END> } if (!atLeastOneOfTheseFieldsMustExist.isEmpty() && atLeastOneOfTheseFieldsMustExist .stream() .noneMatch(payload::has)) { throw new ValidationException(format("At least one of these fields must be present: [%s]", String.join(", ", atLeastOneOfTheseFieldsMustExist))); } }</code><technical_language>Changing this throw new ValidationException("Missing fields: " + missingFields); effect of Lists toString()</technical_language>

Target:
private void validatePayloadHasFields(JsonNode payload, List<String> expectedFields, List<String> atLeastOneOfTheseFieldsMustExist) throws ValidationException { if (payload == null) { throw new ValidationException("Body cannot be empty"); } List<String> missingFields = expectedFields .stream() .filter(expectedKey -> !payload.has(expectedKey)) .collect(Collectors.toList()); if (!missingFields.isEmpty()) { throw new ValidationException("Missing fields: " + missingFields); } if (!atLeastOneOfTheseFieldsMustExist.isEmpty() && atLeastOneOfTheseFieldsMustExist .stream() .noneMatch(payload::has)) { throw new ValidationException("At least one of these fields must be present: " + atLeastOneOfTheseFieldsMustExist); } }
Source:
<code>public PasswordGrantRequest createAccessTokenAuthenticationRequest(HttpServletRequest request) throws OauthException { try { String username = Strings.clean(request.getParameter(USERNAME_PARAM_NAME)); Assert.hasText(username, "username must not be null or empty."); String password = Strings.clean(request.getParameter(PASSWORD_PARAM_NAME)); Assert.hasText(password, "password must not be null or empty."); String accountStoreId = Strings.clean(request.getParameter(ACCOUNT_STORE_PARAM_NAME)); AccountStore accountStore = null; <START> if (accountStore != null){ <END> return Oauth2Requests.PASSWORD_GRANT_REQUEST.builder() .setPassword(password) .setLogin(username) .setAccountStore(accountStore) .build(); } else { return Oauth2Requests.PASSWORD_GRANT_REQUEST.builder() .setPassword(password) .setLogin(username) .build(); } } catch (Exception e){ throw new OauthException(OauthErrorCode.INVALID_REQUEST); } }</code><technical_language>53 66 replaced by: AccountStore accountStore = accountStoreResolver.getAccountStore(request, null); PasswordGrantRequestBuilder requestBuilder = Oauth2Requests.PASSWORD_GRANT_REQUEST.builder() .setPassword(password) .setLogin(username); if (accountStore != null){ requestBuilder.setAccountStore(accountStore); } return requestBuilder.build();</technical_language>

Target:
public PasswordGrantRequest createAccessTokenAuthenticationRequest(HttpServletRequest request) throws OauthException { try { String username = Strings.clean(request.getParameter(USERNAME_PARAM_NAME)); Assert.hasText(username, "username must not be null or empty."); String password = Strings.clean(request.getParameter(PASSWORD_PARAM_NAME)); Assert.hasText(password, "password must not be null or empty."); AccountStore accountStore = accountStoreResolver.getAccountStore(request, null); PasswordGrantRequestBuilder requestBuilder = Oauth2Requests.PASSWORD_GRANT_REQUEST.builder() .setPassword(password) .setLogin(username); if (accountStore != null){ requestBuilder.setAccountStore(accountStore); } return requestBuilder.build(); } catch (Exception e){ throw new OauthException(OauthErrorCode.INVALID_REQUEST); } }
Source:
<code>public void init() { if (!versionTableExist()) { try (Connection connection = dataSource.getConnection()) { createVersionTable(connection); createVersionTableRow(connection); } catch (SQLException e) { <START> throw new RuntimeException(e); <END> } } }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Define throw a dedicated exception instead of a generic one. [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public void init() { if (!versionTableExist()) { try (Connection connection = dataSource.getConnection()) { createVersionTable(connection); createVersionTableRow(connection); } catch (SQLException e) { throw new UncheckedSqlException(e); } } }
Source:
<code>public void dispose() { super.dispose(); <START> if (fStatsViewers != null) { <END> fStatsViewers.dispose(); } TmfStatisticsTreeRootFactory.removeAll(); }</code><technical_language>I this check in places. fStatsViewers null? final, initialize in constructor</technical_language>

Target:
public void dispose() { super.dispose(); fStatsViewers.dispose(); TmfStatisticsTreeRootFactory.removeAll(); }
Source:
<code>public void writeTaskPartitionAssignments(Map<SystemStreamPartition, List<String>> sspToTaskNameMapping) { for (SystemStreamPartition partition: sspToTaskNameMapping.keySet()) { List<String> taskNames = sspToTaskNameMapping.get(partition); LOG.info("Storing ssp: and task: into metadata store", partition, taskNames); String serializedSSPAsJson = serializeSSPToJson(partition); if (taskNames == null || taskNames.isEmpty()) { LOG.info("Deleting the key: from the metadata store.", partition); metadataStore.delete(serializedSSPAsJson); } else { <START> try { <END> String taskNamesAsString = taskNamesMapper.writeValueAsString(taskNames); byte[] taskNamesAsBytes = valueSerde.toBytes(taskNamesAsString); LOG.info("Storing the partition: and taskNames: into the metadata store.", serializedSSPAsJson, taskNames); metadataStore.put(serializedSSPAsJson, taskNamesAsBytes); } catch (Exception e) { throw new SamzaException("Exception occurred when writing task to partition assignment.", e); } } } metadataStore.flush(); }</code><technical_language>do catch exceptions metadatstore.put delete flush</technical_language>

Target:
public void writeTaskPartitionAssignments(Map<SystemStreamPartition, List<String>> sspToTaskNameMapping) { for (SystemStreamPartition partition: sspToTaskNameMapping.keySet()) { List<String> taskNames = sspToTaskNameMapping.get(partition); String serializedSSPAsJson = serializeSSPToJson(partition); if (taskNames == null || taskNames.isEmpty()) { LOG.info("Deleting the key: from the metadata store.", partition); metadataStore.delete(serializedSSPAsJson); } else { try { String taskNamesAsString = taskNamesMapper.writeValueAsString(taskNames); byte[] taskNamesAsBytes = valueSerde.toBytes(taskNamesAsString); LOG.info("Storing the partition: and taskNames: into the metadata store.", serializedSSPAsJson, taskNames); metadataStore.put(serializedSSPAsJson, taskNamesAsBytes); } catch (Exception e) { throw new SamzaException("Exception occurred when writing task to partition assignment.", e); } } } metadataStore.flush(); }
Source:
<code>public static OVirtNodeInfo[] get() { final String delimiter = ":"; final String path[] = Config.resolveOVirtISOsRepositoryPath().split(delimiter); final String minimumVersion[] = Config.<String> GetValue(ConfigValues.OvirtInitialSupportedIsoVersion).split(delimiter); final String regex[] = Config.<String> GetValue(ConfigValues.OvirtIsoPrefix).split(delimiter); <START> Pattern exp = Pattern.compile("\\((.*?)\\)", Pattern.DOTALL); <END> String prefix = null; List<OVirtNodeInfo> info = new LinkedList<OVirtNodeInfo>(); log.debugFormat("NodeInfo: regex length {0} minimum length {1} path length {2}", regex.length, minimumVersion.length, path.length); if (regex.length != minimumVersion.length || regex.length != path.length) { throw new IllegalArgumentException("Illegal NodeInfo - length"); } for (int i=0; i < regex.length; i++) { log.debugFormat("NodeInfo: regex {0} path {1}, minimumVersion {2}", regex[i], path[i], minimumVersion[i]); Matcher matcher = exp.matcher(regex[i]); matcher.find(); prefix = matcher.group(1); log.infoFormat("matcher group: [{0}] prefix found: [{1}]", regex[i], prefix); info.add(new OVirtNodeInfo(prefix, path[i], minimumVersion[i], regex[i])); } return info.toArray(new OVirtNodeInfo[info.size()]); }</code><technical_language>do need this exp</technical_language>

Target:
public static OVirtNodeInfo[] get() { final String delimiter = ":"; final String path[] = Config.resolveOVirtISOsRepositoryPath().split(delimiter); final String minimumVersion[] = Config.<String> GetValue(ConfigValues.OvirtInitialSupportedIsoVersion).split(delimiter); final String regex[] = Config.<String> GetValue(ConfigValues.OvirtIsoPrefix).split(delimiter); List<OVirtNodeInfo> info = new LinkedList<OVirtNodeInfo>(); log.debugFormat("NodeInfo: regex length {0} minimum length {1} path length {2}", regex.length, minimumVersion.length, path.length); if (regex.length != minimumVersion.length || regex.length != path.length) { throw new IllegalArgumentException("Illegal NodeInfo - length"); } for (int i=0; i < regex.length; i++) { log.debugFormat("NodeInfo: regex {0} path {1}, minimumVersion {2}", regex[i], path[i], minimumVersion[i]); info.add(new OVirtNodeInfo(Pattern.compile(regex[i]), path[i], minimumVersion[i])); } return info.toArray(new OVirtNodeInfo[info.size()]); }
Source:
<code>public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallSubprocessLevelEventWithEdgesEmptyProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptySubprocessEvent = getCatchingIntermediateNodeById(diagram, EMPTY_WITH_OUTGOING_EDGE_SUBPROCESS_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptySubprocessEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptySubprocessEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptySubprocessEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>public BaseResponseDto<RegisterResponseDataDto> registerUserFromHuizu(RegisterHuizuRequestDto registerHuizuRequestDto) { RegisterUserDto dto = registerHuizuRequestDto.convertToRegisterUserDto(); BaseResponseDto<RegisterResponseDataDto> baseResponseDto = new BaseResponseDto<>(ReturnMessage.SUCCESS.getCode(), ReturnMessage.SUCCESS.getMsg()); RegisterResponseDataDto registerDataDto = new RegisterResponseDataDto(); baseResponseDto.setData(registerDataDto); registerDataDto.setPhoneNum(dto.getMobile()); boolean mobileIsExist = userService.mobileIsExist(dto.getMobile()); <START> if (mobileIsExist) { <END> registerDataDto.setToken(myAuthenticationUtil.createAuthentication(dto.getLoginName(), dto.getSource())); return baseResponseDto; } userService.registerUserFromHuizu(dto); registerDataDto.setToken(myAuthenticationUtil.createAuthentication(dto.getLoginName(), dto.getSource())); return baseResponseDto; }</code><technical_language>if(!mobileIsExist){ userService.registerUserFromHuizu(dto); } registerDataDto.setToken(myAuthenticationUtil.createAuthentication(dto.getLoginName(), dto.getSource())); return baseResponseDto;</technical_language>

Target:
public BaseResponseDto<RegisterResponseDataDto> registerUserFromHuizu(RegisterHuizuRequestDto registerHuizuRequestDto) { RegisterUserDto dto = registerHuizuRequestDto.convertToRegisterUserDto(); BaseResponseDto<RegisterResponseDataDto> baseResponseDto = new BaseResponseDto<>(ReturnMessage.SUCCESS.getCode(), ReturnMessage.SUCCESS.getMsg()); RegisterResponseDataDto registerDataDto = new RegisterResponseDataDto(); baseResponseDto.setData(registerDataDto); registerDataDto.setPhoneNum(dto.getMobile()); UserModel userModel = userService.findByMobile(dto.getMobile()); if (userModel == null) { userService.registerUserFromHuizu(dto); } else { dto.setLoginName(userModel.getLoginName()); } registerDataDto.setToken(myAuthenticationUtil.createAuthentication(dto.getLoginName(), dto.getSource())); return baseResponseDto; }
Source:
<code>private Message createNickMessage(EntityBareJid to, String nickName) { String escapedNickName = StringUtils.escapeForXml(nickName).toString(); Message message = new Message(); <START> message.setFrom(connection().getUser()); <END> message.setTo(to); message.setType(Message.Type.chat); message.setStanzaId(); message.addExtension(new Nick(escapedNickName)); return message; }</code><technical_language>is need set 'from', eventually means method static</technical_language>

Target:
private static Message createNickMessage(EntityBareJid to, String nickName) { Message message = new Message(); message.setTo(to); message.setType(Message.Type.chat); message.setStanzaId(); message.addExtension(new Nick(nickName)); return message; }
Source:
<code>public Response add(OpenStackVolumeProvider provider) { validateParameters(provider, "name"); StoragePool storagePool = provider.isSetDataCenter() ? <START> getStoragePool(provider.getDataCenter()) : new StoragePool(); <END> provider.setDataCenter(DataCenterMapper.map(storagePool, null)); return performCreate( VdcActionType.AddProvider, new ProviderParameters(map(provider)), new QueryIdResolver<Guid>(VdcQueryType.GetProviderById, IdQueryParameters.class) ); }</code><technical_language>is a bit weird create empty "StoragePool" is storage pool use. pass "null" backend in case</technical_language>

Target:
public Response add(OpenStackVolumeProvider provider) { validateParameters(provider, "name"); if (provider.isSetDataCenter()) { StoragePool storagePool = getStoragePool(provider.getDataCenter()); provider.setDataCenter(DataCenterMapper.map(storagePool, null)); } return performCreate( VdcActionType.AddProvider, new ProviderParameters(map(provider)), new QueryIdResolver<Guid>(VdcQueryType.GetProviderById, IdQueryParameters.class) ); }
Source:
<code>public List<AggregatorFactory> getRequiredColumns() { <START> return Arrays.asList(new StringLastAggregatorFactory(fieldName, fieldName, maxStringBytes)); <END> }</code><technical_language>nit: Collections.singletonList() instead</technical_language>

Target:
public List<AggregatorFactory> getRequiredColumns() { return Collections.singletonList(new StringLastAggregatorFactory(fieldName, fieldName, maxStringBytes)); }
Source:
<code>void packageNameFilterInclude_nonMatchingPackagesAreExcluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine.unknown")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); Stream<UniqueId> includedDescriptors = engineDescriptor.getDescendants().stream().map(TestDescriptor::getUniqueId); <START> assertThat(includedDescriptors).isEmpty(); <END> }</code><technical_language>this following? java assertThat(engineDescriptor.getDescendants()).isEmpty()</technical_language>

Target:
void packageNameFilterInclude_nonMatchingPackagesAreExcluded() { EngineDiscoveryRequest request = request().filters( PackageNameFilter.includePackageNames("org.junit.jupiter.engine.unknown")).build(); TestDescriptor engineDescriptor = engineDescriptor() .with( classTestDescriptor("matching", MatchingClass.class) ) .build(); applier.applyAllFilters(request, engineDescriptor); assertThat(engineDescriptor.getDescendants()).isEmpty(); }
Source:
<code>private void testUnlimitedFailedAuthAttempts( int maxFailedAttempts ) { FakeClock clock = getFakeClock(); AuthenticationStrategy authStrategy = new RateLimitedAuthenticationStrategy( clock, maxFailedAttempts ); User user = new User.Builder( "user", Credential.forPassword( "right" ) ).build(); int attempts = ThreadLocalRandom.current().nextInt( 5, 100 ); for ( int i = 0; i < attempts; i++ ) { <START> assertEquals( AuthenticationResult.TOO_MANY_ATTEMPTS, authStrategy.authenticate( user, "wrong" ) ); <END> } }</code><technical_language>I understand idea this test/name. unlimited part get TOO_MANY_ATTMPTS test is written assert try..</technical_language>

Target:
private void testUnlimitedFailedAuthAttempts( int maxFailedAttempts ) { FakeClock clock = getFakeClock(); AuthenticationStrategy authStrategy = new RateLimitedAuthenticationStrategy( clock, maxFailedAttempts ); User user = new User.Builder( "user", Credential.forPassword( "right" ) ).build(); int attempts = ThreadLocalRandom.current().nextInt( 5, 100 ); for ( int i = 0; i < attempts; i++ ) { assertEquals( AuthenticationResult.FAILURE, authStrategy.authenticate( user, "wrong" ) ); } }
Source:
<code>public PrologEnvironment newPrologEnvironment() throws CompileException { PrologEnvironment env = envFactory.create(getClass().getClassLoader()); String rules; try { <START> rules = getPrologRules(); <END> } catch (RepositoryNotFoundException err) { throw new CompileException("Local repository does not exist ", err); } if (rules != null) { PushbackReader in = new PushbackReader(new StringReader(rules), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", SymbolTerm.makeSymbol("rules.pl"), streamObject)) { throw new CompileException("Cannot consult rules.pl " + getProject().getName() + " " + getConfig().getRevision()); } } return env; }</code><technical_language>say: getConfig().getPrologRules(). (See for why.)</technical_language>

Target:
public PrologEnvironment newPrologEnvironment() throws CompileException { PrologEnvironment env = envFactory.create(getClass().getClassLoader()); String rules = getConfig().getPrologRules(); if (rules != null) { PushbackReader in = new PushbackReader(new StringReader(rules), Prolog.PUSHBACK_SIZE); JavaObjectTerm streamObject = new JavaObjectTerm(in); if (!env.execute(Prolog.BUILTIN, "consult_stream", SymbolTerm.makeSymbol("rules.pl"), streamObject)) { throw new CompileException("Cannot consult rules.pl " + getProject().getName() + " " + getConfig().getRevision()); } } return env; }
Source:
<code>private void addToSpeakQueue(String sectionText, TextToSpeech tts) { <START> if (sectionText.length() >= tts.getMaxSpeechInputLength()) { <END> Integer remainingCharStart = tts.getMaxSpeechInputLength(); String newSectionText = TextUtils.substring(sectionText, 0, tts.getMaxSpeechInputLength()); if (!isLastCharWhitespace(newSectionText)) { Integer count = 0; while (!isLastCharWhitespace(newSectionText)) { newSectionText = newSectionText.substring(0, newSectionText.length() - 1); count++; } remainingCharStart = remainingCharStart - count; } tts.speak(newSectionText, TextToSpeech.QUEUE_ADD, null, null); addToSpeakQueue( TextUtils.substring( sectionText, remainingCharStart, sectionText.length() ), tts ); } else { tts.speak(sectionText, TextToSpeech.QUEUE_ADD, null, null); } }</code><technical_language>getMaxSpeechInputLength() requires API 18+. If this functionality older platforms a API, a hardcoded conservative size</technical_language>

Target:
private void addToSpeakQueue(String sectionText, TextToSpeech tts) { Integer maxLength = 2000; if (ApiUtil.hasLollipop()) { maxLength = tts.getMaxSpeechInputLength(); } if (sectionText.length() >= maxLength) { Integer remainingCharStart = maxLength; String newSectionText = TextUtils.substring(sectionText, 0, maxLength); if (!isLastCharWhitespace(newSectionText)) { Integer count = 0; while (!isLastCharWhitespace(newSectionText)) { newSectionText = newSectionText.substring(0, newSectionText.length() - 1); count++; } remainingCharStart = remainingCharStart - count; } speak(newSectionText, null, tts); addToSpeakQueue( TextUtils.substring( sectionText, remainingCharStart, sectionText.length() ), tts ); } else { speak(sectionText, null, tts); } }
Source:
<code><START> public PointSensitivityBuilder riskyAnnuitySensitivity( <END> ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { ArgChecker.isTrue(cds.getProtectionEndDate().isAfter(ratesProvider.getValuationDate()), "CDS already expired"); LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return riskyAnnuitySensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, stepinDate, effectiveStartDate); }</code><technical_language>Is returning builder right choice for a public method</technical_language>

Target:
public PointSensitivityBuilder riskyAnnuitySensitivity( ResolvedCds cds, CreditRatesProvider ratesProvider, LocalDate referenceDate, ReferenceData refData) { if (isExpired(cds, ratesProvider)) { return PointSensitivityBuilder.none(); } LocalDate stepinDate = cds.getStepinDateOffset().adjust(ratesProvider.getValuationDate(), refData); LocalDate effectiveStartDate = cds.calculateEffectiveStartDate(stepinDate); Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> rates = reduceDiscountFactors(cds, ratesProvider); return riskyAnnuitySensitivity( cds, rates.getFirst(), rates.getSecond(), referenceDate, stepinDate, effectiveStartDate); }
Source:
<code>public Http2MultiplexedChannelPool(InetSocketAddress inetSocketAddress, SSLFactory sslFactory, EventLoopGroup eventLoopGroup, Http2ClientConfig http2ClientConfig, Http2ClientMetrics http2ClientMetrics, ChannelInitializer streamChannelInitializer) { this(new SimpleChannelPool(createBootStrap(eventLoopGroup, http2ClientConfig, inetSocketAddress), new Http2ChannelPoolHandler(sslFactory, inetSocketAddress.getHostName(), inetSocketAddress.getPort(), http2ClientConfig)), eventLoopGroup, ConcurrentHashMap.newKeySet(), inetSocketAddress, <START> new Http2ClientConfig(new VerifiableProperties(new Properties())), http2ClientMetrics, <END> streamChannelInitializer); }</code><technical_language>is http2ClientConfig passed in constructor here</technical_language>

Target:
public Http2MultiplexedChannelPool(InetSocketAddress inetSocketAddress, SSLFactory sslFactory, EventLoopGroup eventLoopGroup, Http2ClientConfig http2ClientConfig, Http2ClientMetrics http2ClientMetrics, ChannelInitializer streamChannelInitializer) { this(new SimpleChannelPool(createBootStrap(eventLoopGroup, http2ClientConfig, inetSocketAddress), new Http2ChannelPoolHandler(sslFactory, inetSocketAddress.getHostName(), inetSocketAddress.getPort(), http2ClientConfig)), eventLoopGroup, ConcurrentHashMap.newKeySet(), inetSocketAddress, http2ClientConfig, http2ClientMetrics, streamChannelInitializer); }
Source:
<code>private List<PickerMilestone> cloneList(List<PickerMilestone> sourceList) { List<PickerMilestone> destList = new ArrayList<>(); sourceList.stream() .forEach(milestone -> destList.add(new PickerMilestone(milestone))); <START> return destList; <END> }</code><technical_language>new ArrayList<>(sourceList) instead</technical_language>

Target:
private List<PickerMilestone> cloneList(List<PickerMilestone> sourceList) { return sourceList.stream() .map(PickerMilestone::new) .collect(Collectors.toList()); }
Source:
<code>public void onChange(WorkspaceProjectContextChangeEvent previous, WorkspaceProjectContextChangeEvent current) { if (current.getWorkspaceProject() != null) { if (Utils.hasProjectChanged(previous.getWorkspaceProject(), current.getWorkspaceProject()) && <START> current.requiresRefresh()) { <END> if (closeAllPlacesOrNothing()) { goToProject(); } } } }</code><technical_language>Personally I a fan of a boolean flag for this. In time end needing more more of hard true false in constructors stand for. thinking this onChange. do need ProjectScreen? project changes another project. I if project changed compare if repositories in WorkspaceProjects equal. This change name, pom configuration is this ProjectScreen</technical_language>

Target:
public void onChange(WorkspaceProjectContextChangeEvent previous, WorkspaceProjectContextChangeEvent current) { if (current.getWorkspaceProject() != null) { if (Utils.hasRepositoryChanged(previous.getWorkspaceProject(), current.getWorkspaceProject())) { closeAllPlacesOrNothing(this::goToProject); } } }
Source:
<code>protected void handleResponse(Request req, Address sender, byte[] buf, int offset, int length, boolean is_exception) { Object retval; try { ByteArrayInputStream is = new ByteArrayInputStream(buf, offset, length); <START> retval = ispnMarshaller.objectFromInputStream(is); <END> } catch (Exception e) { log.error(Util.getMessage("FailedUnmarshallingBufferIntoReturnValue"), e); retval = e; is_exception = true; } req.receiveResponse(retval, sender, is_exception); }</code><technical_language>objectFromByteBuffer(byte[] buf, int offset, int length). objectFromInputStream() copy input invoke objectFromByteBuffer() (unnecessary) copy</technical_language>

Target:
protected void handleResponse(Request req, Address sender, byte[] buf, int offset, int length, boolean is_exception) { Object retval; try { retval = ispnMarshaller.objectFromByteBuffer(buf, offset, length); } catch (Exception e) { log.error(Util.getMessage("FailedUnmarshallingBufferIntoReturnValue"), e); retval = e; is_exception = true; } req.receiveResponse(retval, sender, is_exception); }
Source:
<code>private void onCloneVM() { UnitVmModel model = (UnitVmModel) getWindow(); CloneVmFromSnapshotModelBehavior behavior = (CloneVmFromSnapshotModelBehavior) model.getBehavior(); Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } if (!model.validate()) { return; } VM vm = behavior.getVm(); String name = model.getName().getEntity(); <START> AsyncDataProvider.getInstance().isTemplateNameUnique(new <END> AsyncQuery<>( isNameUnique -> { if (!isNameUnique) { model.getInvalidityReasons().clear(); model.getName() .getInvalidityReasons() .add(ConstantsManager.getInstance() .getConstants() .nameMustBeUniqueInvalidReason()); model.getName().setIsValid(false); model.setIsValid(false); model.fireValidationCompleteEvent(); } else { postNameUniqueCheckVM(vm, snapshot, behavior, model); } }), name, null); }</code><technical_language>This 'isVmNameUnique'</technical_language>

Target:
private void onCloneVM() { UnitVmModel model = (UnitVmModel) getWindow(); CloneVmFromSnapshotModelBehavior behavior = (CloneVmFromSnapshotModelBehavior) model.getBehavior(); Snapshot snapshot = getSelectedItem(); if (snapshot == null) { cancel(); return; } if (!model.validate()) { return; } VM vm = behavior.getVm(); String name = model.getName().getEntity(); AsyncDataProvider.getInstance().isVmNameUnique(new AsyncQuery<>( isNameUnique -> { if (!isNameUnique) { model.getInvalidityReasons().clear(); model.getName() .getInvalidityReasons() .add(ConstantsManager.getInstance() .getConstants() .nameMustBeUniqueInvalidReason()); model.getName().setIsValid(false); model.setIsValid(false); model.fireValidationCompleteEvent(); } else { postNameUniqueCheckVM(vm, snapshot, behavior, model); } }), name, model.getSelectedDataCenter().getId()); }
Source:
<code>public boolean stopServer() { if (serverStarting) { <START> LOGGER.info("[ws] JabRefWebsocketServer is currently starting up and cannot be stopped during this process"); <END> return false; } else if (serverStarted) { LOGGER.info("[ws] stopping JabRefWebsocketServer..."); if (heartbeatExecutor != null) { heartbeatExecutor.shutdown(); this.heartbeatExecutor = null; } try { stop(1000); } catch (InterruptedException e) { e.printStackTrace(); } serverStarted = false; return true; } else { LOGGER.info("[ws] JabRefWebsocketServer is not started"); return false; } }</code><technical_language>I of logger statements degraded debug. Info messages shown user in Console Log</technical_language>

Target:
public synchronized boolean stopServer() { if (serverStarting) { LOGGER.info("[ws] JabRefWebsocketServer is currently starting up and cannot be stopped during this process"); return false; } if (serverStarted) { LOGGER.debug("[ws] stopping JabRefWebsocketServer..."); if (heartbeatExecutor != null) { heartbeatExecutor.shutdown(); this.heartbeatExecutor = null; } try { stop(1000); } catch (InterruptedException e) { LOGGER.error(e.getMessage(), e); } serverStarted = false; return true; } LOGGER.info("[ws] JabRefWebsocketServer is not started"); return false; }
Source:
<code>public void handleStateChanged(Watcher.Event.KeeperState state) { LOG.info("ZkStateChangeListener:: handleStateChanged {}", state.toString()); switch (state) { case Expired: _timer.cancel(); <START> onBecomeFollower(); <END> exitOnSessionExpiryOrEstablishmentError(); return; case Disconnected: LOG.warn("Got event. Scheduling a system stop.", state.toString()); scheduleExpiryTimerAfterSessionTimeout(); return; case SyncConnected: LOG.info("ZkStateChangeListener::Connected. Canceling timer."); _timer.cancel(); return; default: } }</code><technical_language>is this necessary? calling exit() next anyways, this clears some internal state</technical_language>

Target:
public void handleStateChanged(Watcher.Event.KeeperState state) { LOG.info("ZkStateChangeListener::handleStateChanged {}", state); switch (state) { case Expired: _zkSessionExpiryFuture.cancel(false); onSessionExpired(); return; case Disconnected: LOG.warn("ZkStateChangeListener::Got event. Scheduling a system stop.", state); scheduleExpiryTimerAfterSessionTimeout(); return; case SyncConnected: LOG.info("ZkStateChangeListener::Connected. Canceling timer."); _zkSessionExpiryFuture.cancel(false); return; default: } }
Source:
<code>private static ArrayList<Artifact> asArtifacts(Collection<Change> changes) { ArrayList<Artifact> arts = new ArrayList<>(); for (Change artifactChange : changes) { Artifact changeArtifact = artifactChange.getChangeArtifact(); if (changeArtifact.isValid()) { <START> arts.add(artifactChange.getChangeArtifact()); <END> } } return arts; }</code><technical_language>local variable "changeArtifact"</technical_language>

Target:
private static ArrayList<Artifact> asArtifacts(Collection<Change> changes) { ArrayList<Artifact> arts = new ArrayList<>(); for (Change artifactChange : changes) { Artifact changeArtifact = artifactChange.getChangeArtifact(); if (changeArtifact.isValid()) { arts.add(changeArtifact); } } return arts; }
Source:
<code>public synchronized boolean disconnect(BluetoothDevice device) { if (DBG) { StringBuilder sb = new StringBuilder(); dump(sb); Log.d(TAG, "A2DP disconnect device: " + device + ", InstanceMap start state: " + sb.toString()); } A2dpSinkStateMachine stateMachine = mInstanceMap.get(device); if (stateMachine == null) { return false; } int connectionState = stateMachine.getState(); if (connectionState == BluetoothProfile.STATE_DISCONNECTED || connectionState == BluetoothProfile.STATE_DISCONNECTING) { return false; } <START> stateMachine.disconnect(); <END> return true; }</code><technical_language>preference of is state machines get removed disconnected</technical_language>

Target:
public synchronized boolean disconnect(BluetoothDevice device) { if (DBG) { StringBuilder sb = new StringBuilder(); dump(sb); Log.d(TAG, "A2DP disconnect device: " + device + ", InstanceMap start state: " + sb.toString()); } A2dpSinkStateMachine stateMachine = mDeviceStateMap.get(device); if (stateMachine == null) { return false; } int connectionState = stateMachine.getState(); if (connectionState == BluetoothProfile.STATE_DISCONNECTED || connectionState == BluetoothProfile.STATE_DISCONNECTING) { return false; } stateMachine.disconnect(); return true; }
Source:
<code>public List<Community> findAuthorized(Context context, EPerson ePerson, List<Integer> actions) throws SQLException { CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context); CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, Community.class); Root<Community> communityRoot = criteriaQuery.from(Community.class); Join<Community, ResourcePolicy> join = communityRoot.join("resourcePolicies"); <START> List<Predicate> orPredicates = new LinkedList<Predicate>(); <END> for (Integer action : actions) { orPredicates.add(criteriaBuilder.equal(join.get(ResourcePolicy_.actionId), action)); } Predicate orPredicate = criteriaBuilder.or(orPredicates.toArray(new Predicate[] {})); criteriaQuery.select(communityRoot); criteriaQuery.where( criteriaBuilder.and(criteriaBuilder.equal(join.get(ResourcePolicy_.resourceTypeId), Constants.COLLECTION), criteriaBuilder.equal(join.get(ResourcePolicy_.eperson), ePerson), orPredicate ) ); return list(context, criteriaQuery, true, Community.class, -1, -1); }</code><technical_language>this 'Predicate[] orPredicate = new Predicate[actions.length]'? create more work more garbage calculating toArray() later. IIRC similar code in CollectionDAOImpl</technical_language>

Target:
public List<Community> findAuthorized(Context context, EPerson ePerson, List<Integer> actions) throws SQLException { CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context); CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, Community.class); Root<Community> communityRoot = criteriaQuery.from(Community.class); Join<Community, ResourcePolicy> join = communityRoot.join("resourcePolicies"); List<Predicate> orPredicates = new LinkedList<Predicate>(); for (Integer action : actions) { orPredicates.add(criteriaBuilder.equal(join.get(ResourcePolicy_.actionId), action)); } Predicate orPredicate = criteriaBuilder.or(orPredicates.toArray(new Predicate[] {})); criteriaQuery.select(communityRoot); criteriaQuery.where( criteriaBuilder.and(criteriaBuilder.equal(join.get(ResourcePolicy_.resourceTypeId), Constants.COMMUNITY), criteriaBuilder.equal(join.get(ResourcePolicy_.eperson), ePerson), orPredicate ) ); return list(context, criteriaQuery, true, Community.class, -1, -1); }
Source:
<code>public void testOnlyVisibleGroupsReturned() throws OrmException, JSchException, IOException { <START> List<String> expectedGroups = Lists.newLinkedList(); <END> expectedGroups.add("Anonymous Users"); expectedGroups.add("Registered Users"); TestAccount user = accounts.create("user", "user@example.com", "User"); Reader r = (new RestSession(user)).get("/groups/"); @SuppressWarnings("serial") Map<String, GroupInfo> result = (new Gson()).fromJson(r, new TypeToken<Map<String, GroupInfo>>() {}.getType()); assertGroups(expectedGroups, result.keySet()); }</code><technical_language>Set<String> expectedGroups = Maps.newHashSet();</technical_language>

Target:
public void testOnlyVisibleGroupsReturned() throws OrmException, JSchException, IOException { Set<String> expectedGroups = Sets.newHashSet(); expectedGroups.add("Anonymous Users"); expectedGroups.add("Registered Users"); TestAccount user = accounts.create("user", "user@example.com", "User"); Reader r = (new RestSession(user)).get("/groups/"); @SuppressWarnings("serial") Map<String, GroupInfo> result = (new Gson()).fromJson(r, new TypeToken<Map<String, GroupInfo>>() {}.getType()); assertGroups(expectedGroups, result.keySet()); }
Source:
<code>public String getRoomLocation(String displayName) { <START> UI.doubleClick(driver.findElement(By.xpath(" END> return RoomLocationCmbBox.getText(); }</code><technical_language>please apply java conventions (spaces +) total amount of characters line</technical_language>

Target:
public String getRoomLocation(String displayName) { UI.doubleClick(driver.findElement(By.xpath(" + displayName + "')and@class='ng-binding']"))); return roomLocationCmbBox.getText(); }
Source:
<code>Series(String string) { this.digits = Arrays.stream(string.split("")).collect(Collectors.toList()); if(!string.isEmpty()) { this.digitsSize = this.digits.size(); <START> }else { <END> this.digitsSize = 0; } }</code><technical_language>minor thing: a space else write this a ternary operator if want: this.digitsSize = string.isEmpty() ? this.digitz.size() : 0;</technical_language>

Target:
Series(String string) { this.digits = Arrays.stream(string.split("")).collect(Collectors.toList()); this.digitsSize = string.isEmpty()?0:this.digits.size(); }
Source:
<code>public static JobConfig fromJSON(JsonReader jsonReader) { JobRepresenter.jsonReader = jsonReader; JobConfig jobConfig = new JobConfig(); <START> if (jsonReader == null) { <END> return jobConfig; } jsonReader.readCaseInsensitiveStringIfPresent("name", jobConfig::setName); setRunInstanceCount(jobConfig); setTimeout(jobConfig); jsonReader.readStringIfPresent("elastic_profile_id", jobConfig::setElasticProfileId); setArtifacts(jobConfig); setEnvironmentVariables(jobConfig); setResources(jobConfig); setTabs(jobConfig); setProperties(jobConfig); setTasks(jobConfig); return jobConfig; }</code><technical_language>Is this null</technical_language>

Target:
public static JobConfig fromJSON(JsonReader jsonReader) { JobRepresenter.jsonReader = jsonReader; JobConfig jobConfig = new JobConfig(); jsonReader.readCaseInsensitiveStringIfPresent("name", jobConfig::setName); setRunInstanceCount(jobConfig); setTimeout(jobConfig); jsonReader.readStringIfPresent("elastic_profile_id", jobConfig::setElasticProfileId); setArtifacts(jobConfig); jobConfig.setVariables(EnvironmentVariableRepresenter.fromJSONArray(jsonReader)); setResources(jobConfig); jobConfig.setTabs(TabConfigRepresenter.fromJSONArray(jsonReader)); jobConfig.setProperties(PropertyConfigRepresenter.fromJSONArray(jsonReader)); jobConfig.setTasks(TaskRepresenter.fromJSONArray(jsonReader)); return jobConfig; }