auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private SignupPageObject typeBirthdate(String month, String day, String year) { <END> wait.forElementVisible(signupBirthdate); signupBirthdate.click(); safelySetValue(signupBirthMonth, month); safelySetValue(signupBirthDay, day); safelySetValue(signupBirthYear, year); return this; }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') Remove this unused private "typeBirthdate" method. [![rule](<LINK_1>](http://sonar-s4/coding_rules#rule_key=squid%3AUnusedPrivateMethod)</technical_language>

Target:
private SignupPageObject typeBirthdate(String month, String day, String year) { wait.forElementVisible(signupBirthdate); signupBirthdate.click(); setValue(signupBirthMonth, month); setValue(signupBirthDay, day); setValue(signupBirthYear, year); return this; }
Source:
<code>public ParallelRowProcessor(RecordReader reader, EventHandler<GenericRow> handler) { this.reader = reader; this.disruptor = new Disruptor<GenericRow>( <START> GenericRow::new, <END> RING_SIZE, DaemonThreadFactory.INSTANCE, ProducerType.SINGLE, new BusySpinWaitStrategy()); this.disruptor.handleEventsWith(handler); }</code><technical_language>this create more garbage</technical_language>

Target:
public ParallelRowProcessor(RecordReader reader, EventHandler<GenericRow> handler) { _reader = reader; _disruptor = new Disruptor<GenericRow>( GenericRow::new, RING_SIZE, DaemonThreadFactory.INSTANCE, ProducerType.SINGLE, new BusySpinWaitStrategy()); _disruptor.handleEventsWith(handler); }
Source:
<code>public static void setNetworkVdsmName(Network network) { if (network == null) { return; } String networkName = network.getName(); Guid networkId = network.getId(); if (networkId == null ) { networkId = Guid.newGuid(); } Matcher vdsmNameMatcher = VALID_VDS_NAME_PATTERN.matcher(networkName); if <START> (networkName.length() > BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH <END> || !vdsmNameMatcher.matches()) { network.setVdsmName("on" + networkId.toString() .replaceAll("[^a-zA-Z0-9]+", "") .substring(0, BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH - 2)); } else { network.setVdsmName(networkName); } }</code><technical_language>included in VALID_VDS_NAME_PATTERN</technical_language>

Target:
public static void setNetworkVdsmName(Network network) { String networkName = network.getName(); if (VALID_VDS_NAME_PATTERN.matcher(networkName).matches()) { network.setVdsmName(networkName); } else { network.setVdsmName("on" + network.getId().toString() .replaceAll("[^a-zA-Z0-9]+", "") .substring(0, BusinessEntitiesDefinitions.HOST_NIC_NAME_LENGTH - 2)); } }
Source:
<code>public boolean disconnect(Node fromNode, Node toNode) { Preconditions.checkNotNull(fromNode, "fromNode cannot be null!"); Preconditions.checkNotNull(toNode, "toNode cannot be null!"); <START> return graph.removeEdge(fromNode, toNode); <END> }</code><technical_language>Please add a check if edges connected logs a warning</technical_language>

Target:
public void disconnect(Node fromNode, Node toNode) { Preconditions.checkNotNull(fromNode, "fromNode cannot be null!"); Preconditions.checkNotNull(toNode, "toNode cannot be null!"); if (!graph.hasEdgeConnecting(fromNode, toNode)) { logger.warn("Trying to disconnect two nodes that aren't connected, " + fromNode.getUri() + " and " + toNode.getUri()); } graph.removeEdge(fromNode, toNode); }
Source:
<code>public ActualProperties visitWindow(WindowNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); Optional<OrderingScheme> orderingScheme = node.getOrderingScheme(); if (ImmutableSet.copyOf(node.getPartitionBy()).equals(node.getPrePartitionedInputs()) && orderingScheme.isPresent() <START> && node.getPreSortedOrderPrefix() == orderingScheme.get().getOrderBy().size()) { <END> return properties; } ImmutableList.Builder<LocalProperty<Symbol>> localProperties = ImmutableList.builder(); if (!node.getPrePartitionedInputs().isEmpty()) { GroupingProperty<Symbol> prePartitionedProperty = new GroupingProperty<>(node.getPrePartitionedInputs()); for (LocalProperty<Symbol> localProperty : properties.getLocalProperties()) { if (!prePartitionedProperty.isSimplifiedBy(localProperty)) { break; } localProperties.add(localProperty); } } if (!node.getPartitionBy().isEmpty()) { localProperties.add(new GroupingProperty<>(node.getPartitionBy())); } orderingScheme.ifPresent(scheme -> scheme.getOrderBy().stream() .map(column -> new SortingProperty<>(column, scheme.getOrdering(column))) .forEach(localProperties::add)); return ActualProperties.builderFrom(properties) .local(LocalProperties.normalizeAndPrune(localProperties.build())) .build(); }</code><technical_language>code changing a hack</technical_language>

Target:
public ActualProperties visitWindow(WindowNode node, List<ActualProperties> inputProperties) { ActualProperties properties = Iterables.getOnlyElement(inputProperties); Optional<OrderingScheme> orderingScheme = node.getOrderingScheme(); if (ImmutableSet.copyOf(node.getPartitionBy()).equals(node.getPrePartitionedInputs()) && (!orderingScheme.isPresent() || node.getPreSortedOrderPrefix() == orderingScheme.get().getOrderBy().size())) { return properties; } ImmutableList.Builder<LocalProperty<Symbol>> localProperties = ImmutableList.builder(); if (!node.getPrePartitionedInputs().isEmpty()) { GroupingProperty<Symbol> prePartitionedProperty = new GroupingProperty<>(node.getPrePartitionedInputs()); for (LocalProperty<Symbol> localProperty : properties.getLocalProperties()) { if (!prePartitionedProperty.isSimplifiedBy(localProperty)) { break; } localProperties.add(localProperty); } } if (!node.getPartitionBy().isEmpty()) { localProperties.add(new GroupingProperty<>(node.getPartitionBy())); } orderingScheme.ifPresent(scheme -> scheme.getOrderBy().stream() .map(column -> new SortingProperty<>(column, scheme.getOrdering(column))) .forEach(localProperties::add)); return ActualProperties.builderFrom(properties) .local(LocalProperties.normalizeAndPrune(localProperties.build())) .build(); }
Source:
<code>public final <T> Cursor getCursor(@NonNull final Query<T> query) { String[] projection = query.mProjection != null ? query.mProjection : getFullProjection(query.mTable.mType); String orderBy = query.mOrderBy; String groupBy = query.mGroupBy; if (query.mJoins.length > 0) { final String prefix = query.mTable.sqlPrefix(this); projection = projection.clone(); for (int i = 0; i < projection.length; i++) { projection[i] = projection[i].contains(".") ? projection[i] : prefix + projection[i]; } <START> addPrefixToFields(orderBy, prefix); <END> addPrefixToFields(groupBy, prefix); } final Pair<String, String[]> from = query.buildSqlFrom(this); final String tables = from.first; String[] args = from.second; final Pair<String, String[]> where = query.buildSqlWhere(this); args = ArrayUtils.merge(String.class, args, where.second); final Pair<String, String[]> having = query.buildSqlHaving(this); args = ArrayUtils.merge(String.class, args, having.second); final Cursor c = mDbHelper.getReadableDatabase() .query(query.mDistinct, tables, projection, where.first, args, groupBy, having.first, orderBy, null); c.moveToPosition(-1); return c; }</code><technical_language>lost test if orderBy a prefix, this end breaking measurements app, I I utilize order a prefix. This lost test for null orderBy</technical_language>

Target:
public final <T> Cursor getCursor(@NonNull final Query<T> query) { String[] projection = query.mProjection != null ? query.mProjection : getFullProjection(query.mTable.mType); String orderBy = query.mOrderBy; if (query.mJoins.length > 0) { final String prefix = query.mTable.sqlPrefix(this); projection = projection.clone(); for (int i = 0; i < projection.length; i++) { projection[i] = projection[i].contains(".") ? projection[i] : prefix + projection[i]; } orderBy = addPrefixToFields(orderBy, prefix); } final Pair<String, String[]> from = query.buildSqlFrom(this); final String tables = from.first; String[] args = from.second; final Pair<String, String[]> where = query.buildSqlWhere(this); args = ArrayUtils.merge(String.class, args, where.second); String groupBy = null; String having = null; if (query.mGroupBy.length > 0) { final StringBuilder groupByBuilder = new StringBuilder(); boolean firstTime = true; for (final Field field : query.mGroupBy) { if (!firstTime) { groupByBuilder.append(','); } groupByBuilder.append(field.buildSql(this).first); firstTime = false; } groupBy = groupByBuilder.toString(); final Pair<String, String[]> havingRaw = query.buildSqlHaving(this); having = havingRaw.first; args = ArrayUtils.merge(String.class, args, havingRaw.second); } final Cursor c = mDbHelper.getReadableDatabase() .query(query.mDistinct, tables, projection, where.first, args, groupBy, having, orderBy, null); c.moveToPosition(-1); return c; }
Source:
<code>public void testMatches() { fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); <START> assertTrue(fFilter.matches(fEvent)); <END> fFilter.replaceChild(0, FALSE_NODE); assertFalse(fFilter.matches(fEvent)); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); }</code><technical_language>Test fNot=true TRUE children</technical_language>

Target:
public void testMatches() { fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); fFilter.addChild(TRUE_NODE); fFilter.addChild(TRUE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(true); assertFalse(fFilter.matches(fEvent)); fFilter.replaceChild(0, FALSE_NODE); assertTrue(fFilter.matches(fEvent)); fFilter.replaceChild(1, FALSE_NODE); fFilter.setNot(true); assertTrue(fFilter.matches(fEvent)); fFilter.setNot(false); assertFalse(fFilter.matches(fEvent)); }
Source:
<code>protected boolean checkVmOnHost(final VirtualMachine vm, final long hostId) throws AgentUnavailableException, OperationTimedoutException { final Answer answer = _agentMgr.send(hostId, new CheckVirtualMachineCommand(vm.getInstanceName())); if (answer == null || !answer.getResult()) { return false; } if (answer instanceof CheckVirtualMachineAnswer) { final CheckVirtualMachineAnswer vmAnswer = (CheckVirtualMachineAnswer)answer; if (vmAnswer.getState() == PowerState.PowerOff) { return false; } } UserVmVO userVm = _userVmDao.findById(vm.getId()); if (userVm != null) { List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vm.getId()); RestoreVMSnapshotCommand command = _vmSnapshotMgr.createRestoreCommand(userVm, vmSnapshots); if (command != null) { RestoreVMSnapshotAnswer restoreVMSnapshotAnswer = (RestoreVMSnapshotAnswer) _agentMgr.send(hostId, command); if (restoreVMSnapshotAnswer == null || !restoreVMSnapshotAnswer.getResult()) { <START> s_logger.warn("Unable to restore the vm snapshot from image file after migration to the VM: " + restoreVMSnapshotAnswer.getDetails()); <END> } } } return true; }</code><technical_language>is migration (type?) mentioned in this log message? please elaborate this a bit</technical_language>

Target:
protected boolean checkVmOnHost(final VirtualMachine vm, final long hostId) throws AgentUnavailableException, OperationTimedoutException { final Answer answer = _agentMgr.send(hostId, new CheckVirtualMachineCommand(vm.getInstanceName())); if (answer == null || !answer.getResult()) { return false; } if (answer instanceof CheckVirtualMachineAnswer) { final CheckVirtualMachineAnswer vmAnswer = (CheckVirtualMachineAnswer)answer; if (vmAnswer.getState() == PowerState.PowerOff) { return false; } } UserVmVO userVm = _userVmDao.findById(vm.getId()); if (userVm != null) { List<VMSnapshotVO> vmSnapshots = _vmSnapshotDao.findByVm(vm.getId()); RestoreVMSnapshotCommand command = _vmSnapshotMgr.createRestoreCommand(userVm, vmSnapshots); if (command != null) { RestoreVMSnapshotAnswer restoreVMSnapshotAnswer = (RestoreVMSnapshotAnswer) _agentMgr.send(hostId, command); if (restoreVMSnapshotAnswer == null || !restoreVMSnapshotAnswer.getResult()) { s_logger.warn("Unable to restore the vm snapshot from image file after live migration of vm with vmsnapshots: " + restoreVMSnapshotAnswer.getDetails()); } } } return true; }
Source:
<code>public static void writeTo(ObjectOutput output, DataConversion dataConversion) throws IOException { byte flags = 0; boolean isDefault = isDefault(dataConversion); <START> if (isDefault(dataConversion)) flags = 1; <END> if (dataConversion.isKey) flags = (byte) (flags | 2); output.writeByte(flags); if (!isDefault) { output.writeShort(dataConversion.encoder.id()); output.writeByte(dataConversion.wrapper.id()); output.writeObject(dataConversion.requestMediaType); } }</code><technical_language>newly extracted isDefault flag instead of invoking isDefault(dataConversion)</technical_language>

Target:
public static void writeTo(ObjectOutput output, DataConversion dataConversion) throws IOException { byte flags = 0; boolean isDefault = isDefault(dataConversion); if (isDefault) flags = 1; if (dataConversion.isKey) flags = (byte) (flags | 2); output.writeByte(flags); if (!isDefault) { output.writeShort(dataConversion.encoder.id()); output.writeByte(dataConversion.wrapper.id()); output.writeObject(dataConversion.requestMediaType); } }
Source:
<code>public void testQuery() throws Exception { try (Connection connection = createConnection(); Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery("SELECT orderkey FROM tpch.tiny.orders")) { while (rs.next()) { <START> rs.getString("orderkey"); <END> } } }</code><technical_language>count rows assert result</technical_language>

Target:
public void testQuery() throws Exception { try (Connection connection = createConnection(); Statement statement = connection.createStatement(); ResultSet rs = statement.executeQuery("SELECT row_number() OVER () n FROM tpch.tiny.orders")) { long count = 0; long sum = 0; while (rs.next()) { count++; sum += rs.getLong("n"); } assertEquals(count, 15000); assertEquals(sum, (count / 2) * (1 + count)); } }
Source:
<code>public int hashCode() { <START> Long result = articleId; <END> result = 31 * result + doi.hashCode(); return result.intValue(); }</code><technical_language>java int result = Long.hashCode(articleId);</technical_language>

Target:
public int hashCode() { int result = Long.hashCode(articleId); result = 31 * result + doi.hashCode(); return result; }
Source:
<code><START> protected java.util.ArrayList<Guid> getTemplatesList() { <END> return getParameters().getEntitiesId(); }</code><technical_language>please import java.util instead of explicitly writing</technical_language>

Target:
protected ArrayList<Guid> getTemplatesList() { return getParameters().getEntitiesId(); }
Source:
<code>public GeppettoManager(IGeppettoManager manager) { super(); if(manager instanceof GeppettoManager) { <START> IUser u = manager.getUser(); <END> System.out.println(u.getLogin()); GeppettoManager other = (GeppettoManager) manager; u = other.getUser(); System.out.println(u.getLogin()); if(other.projects!=null) { this.projects.putAll(other.projects); } this.user = DataManagerHelper.getDataManager().getUserByLogin(other.getUser().getLogin()); } }</code><technical_language>@jrmartin instructions left some debugging, delete them</technical_language>

Target:
public GeppettoManager(IGeppettoManager manager) { super(); if(manager instanceof GeppettoManager) { GeppettoManager other = (GeppettoManager) manager; if(other.projects!=null) { this.projects.putAll(other.projects); } this.user = DataManagerHelper.getDataManager().getUserByLogin(other.getUser().getLogin()); } }
Source:
<code><START> public void booleanMapping() { <END> OgmSession session = openSession(); Transaction transaction = session.beginTransaction(); rowAssertion( session.getSessionFactory(), "Bookmark" ) .id( "id", bookmarkId ) .assertColumn( "favourite", true ) .execute(); transaction.commit(); session.close(); }</code><technical_language>Or, making abstract class instead of interface, reuse some set-up / tear-down code</technical_language>

Target:
public void booleanMapping() { OgmSession session = openSession(); Transaction transaction = session.beginTransaction(); rowAssertion( session.getSessionFactory(), "Bookmark" ) .keyColumn( "id", bookmarkId ) .assertColumn( "favourite", true ) .execute(); transaction.commit(); session.close(); }
Source:
<code>public Object apply(AccountResource rsrc, Input input) throws AuthException, ResourceNotFoundException, OrmException { if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to set HTTP password"); } if (input == null) { input = new Input(); } AccountExternalId.Key key = <START> new AccountExternalId.Key(SCHEME_USERNAME, rsrc.getUser().getUserName()); <END> AccountExternalId id = dbProvider.get().accountExternalIds().get(key); if (id == null) { throw new ResourceNotFoundException(); } String newPassword; if (input.generate) { newPassword = generate(); } else { if (!Strings.isNullOrEmpty(input.httpPassword) && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to set HTTP password directly, " + "need to be Gerrit administrator"); } newPassword = Strings.emptyToNull(input.httpPassword); } id.setPassword(newPassword); dbProvider.get().accountExternalIds().update(Collections.singleton(id)); accountCache.evict(rsrc.getUser().getAccountId()); return Strings.isNullOrEmpty(newPassword) ? Response.none() : newPassword; }</code><technical_language>username null. in cases NPE in db code instead fail rest API a ResourceConflictException similar</technical_language>

Target:
public Response<String> apply(AccountResource rsrc, Input input) throws AuthException, ResourceNotFoundException, ResourceConflictException, OrmException { if (self.get() != rsrc.getUser() && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to set HTTP password"); } if (input == null) { input = new Input(); } if (rsrc.getUser().getUserName() == null) { throw new ResourceConflictException("no username"); } AccountExternalId.Key key = new AccountExternalId.Key(SCHEME_USERNAME, rsrc.getUser().getUserName()); AccountExternalId id = dbProvider.get().accountExternalIds().get(key); if (id == null) { throw new ResourceNotFoundException(); } String newPassword; if (input.generate) { newPassword = generate(); } else { if (!Strings.isNullOrEmpty(input.httpPassword) && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to set HTTP password directly, " + "need to be Gerrit administrator"); } newPassword = Strings.emptyToNull(input.httpPassword); } id.setPassword(newPassword); dbProvider.get().accountExternalIds().update(Collections.singleton(id)); accountCache.evict(rsrc.getUser().getAccountId()); return Strings.isNullOrEmpty(newPassword) ? Response.<String>none() : Response.ok(newPassword); }
Source:
<code>private FreeIpaHealthCheckClient buildFreeIpaHealthCheckClient(HttpClientConfig clientConfig, int port, String basePath, Map<String, String> headers, FreeIpaHealthCheckRpcListener listener) throws FreeIpaClientException, MalformedURLException { Client restClient; try { restClient = RestClientUtil.createClient(clientConfig.getServerCert(), clientConfig.getClientCert(), clientConfig.getClientKey(), connetionTimeoutMillis, readTimeoutMillis, restDebug); } catch (Exception e) { <START> throw new FreeIpaClientException("Unable to create clietn for freeipa health checks", e); <END> } URL freeIpaHealthCheckUrl = getIpaHealthCheckUrl(clientConfig, port, basePath); return new FreeIpaHealthCheckClient(restClient, freeIpaHealthCheckUrl, headers, listener); }</code><technical_language>clietn -> client</technical_language>

Target:
private FreeIpaHealthCheckClient buildFreeIpaHealthCheckClient(HttpClientConfig clientConfig, int port, String basePath, Map<String, String> headers, FreeIpaHealthCheckRpcListener listener) throws FreeIpaClientException, MalformedURLException { Client restClient; try { restClient = RestClientUtil.createClient(clientConfig.getServerCert(), clientConfig.getClientCert(), clientConfig.getClientKey(), connetionTimeoutMillis, readTimeoutMillis, restDebug); } catch (Exception e) { throw new FreeIpaClientException("Unable to create client for FreeIPA health checks", e); } URL freeIpaHealthCheckUrl = getIpaHealthCheckUrl(clientConfig, port, basePath); return new FreeIpaHealthCheckClient(restClient, freeIpaHealthCheckUrl, headers, listener); }
Source:
<code>public void whenHeadlessMode_thenImagesWork() { boolean result = false; try (FileInputStream inStream = new FileInputStream(IN_FILE); FileOutputStream outStream = new FileOutputStream(OUT_FILE)) { BufferedImage inputImage = ImageIO.read(inStream); result = ImageIO.write(inputImage, FORMAT, outStream); } catch (IOException e) { <START> LOGGER.error(e.getMessage()); <END> } assertThat(result).isTrue(); }</code><technical_language>if fails this fail completely right? In this case declare method throw exception, if handle exception throw stack</technical_language>

Target:
public void whenHeadlessMode_thenImagesWork() throws IOException { boolean result = false; try (InputStream inStream = HeadlessModeUnitTest.class.getResourceAsStream(IN_FILE); FileOutputStream outStream = new FileOutputStream(OUT_FILE)) { BufferedImage inputImage = ImageIO.read(inStream); result = ImageIO.write(inputImage, FORMAT, outStream); } assertThat(result).isTrue(); }
Source:
<code>public List<NameValuePair> toUrlParams() { <START> return new ArrayList<NameValuePair>(0); <END> }</code><technical_language>Collections.emptyList() cleaner here</technical_language>

Target:
public List<NameValuePair> toUrlParams() { return Collections.emptyList(); }
Source:
<code>public IStatus validateChange(final IResourceDelta delta, final IProgressMonitor monitor) { final ISarosSession currentSession = session; if (currentSession == null) return Status.OK_STATUS; Set<IReferencePoint> sharedReferencePoints = session.getReferencePoints(); for (IReferencePoint referencePoint : sharedReferencePoints) { IContainer referencePointDelegate = ResourceConverter.getDelegate(referencePoint); IResourceDelta referencePointDelta = delta.findMember(referencePointDelegate.getFullPath()); <START> final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(referencePoint, currentSession); <END> if (referencePointDelta != null) { continue; } try { delta.accept(visitor); } catch (CoreException e) { log.warn( "error occurred during delta visitation, some resources might have not been checked", e); } if (!currentSession.hasWriteAccess() && visitor.isModifyingResources()) return MODIFYING_RESOURCES_ERROR_STATUS; if (visitor.isDeletingProject()) return DELETE_PROJECT_ERROR_STATUS; if (visitor.isMovingProject()) return MOVE_OR_RENAME_PROJECT_ERROR_STATUS; } return Status.OK_STATUS; }</code><technical_language>place line 80, here</technical_language>

Target:
public IStatus validateChange(final IResourceDelta delta, final IProgressMonitor monitor) { final ISarosSession currentSession = session; if (currentSession == null) return Status.OK_STATUS; Set<IReferencePoint> sharedReferencePoints = session.getReferencePoints(); for (IReferencePoint referencePoint : sharedReferencePoints) { IContainer referencePointDelegate = ResourceConverter.getDelegate(referencePoint); IResourceDelta referencePointDelta = delta.findMember(referencePointDelegate.getFullPath()); if (referencePointDelta == null) { continue; } final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(referencePoint, currentSession); try { referencePointDelta.accept(visitor); } catch (CoreException e) { log.warn( "error occurred during delta visitation, some resources might have not been checked", e); } if (!currentSession.hasWriteAccess() && visitor.isModifyingResources()) return MODIFYING_RESOURCES_ERROR_STATUS; if (visitor.isDeletingProject()) return DELETE_PROJECT_ERROR_STATUS; if (visitor.isMovingProject()) return MOVE_OR_RENAME_PROJECT_ERROR_STATUS; } return Status.OK_STATUS; }
Source:
<code>private void configureActionProvider( String protocol, String host, String port, String contextRoot) { <START> setProperty("org.codice.ddf.external.hostname", host); <END> setProperty("org.codice.ddf.external.httpPort", port); setProperty("org.codice.ddf.external.httpsPort", port); setProperty("org.codice.ddf.external.protocol", protocol); setProperty("org.codice.ddf.system.rootContext", contextRoot); }</code><technical_language>constants for of these</technical_language>

Target:
private void configureActionProvider( String protocol, String host, String port, String contextRoot) { setProperty(SystemBaseUrl.EXTERNAL_HOST, host); setProperty(SystemBaseUrl.EXTERNAL_PORT, port); setProperty(SystemBaseUrl.EXTERNAL_HTTPS_PORT, port); setProperty(SystemBaseUrl.EXTERNAL_PROTOCOL, protocol); setProperty(SystemBaseUrl.ROOT_CONTEXT, contextRoot); }
Source:
<code>public String toString() { <START> return "SizeCommand{" + <END> '}'; }</code><technical_language>return a single String</technical_language>

Target:
public String toString() { return "SizeCommand{}"; }
Source:
<code>public int hashCode() { <START> return Arrays.hashCode(new Object[]{actionClass, metadataType}); <END> }</code><technical_language>Arrays.hashcode instead of Objects.hashcode</technical_language>

Target:
public int hashCode() { return Objects.hashCode(actionClass, metadataType); }
Source:
<code>public void testBloomFilterExprFilter() throws Exception { cannotVectorize(); BloomKFilter filter = new BloomKFilter(1500); filter.addString("a-foo"); filter.addString("-foo"); if (!NullHandling.replaceWithDefault()) { filter.addBytes(null, 0, 0); } byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = StringUtils.encodeBase64String(bytes); testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE bloom_filter_test(concat(dim2, '-foo'), '%s') = TRUE", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .virtualColumns( <START> new ExpressionVirtualColumn( <END> "v0", "concat(\"dim2\",'-foo')", ValueType.STRING, createExprMacroTable() ) ) .filters( new BloomDimFilter( "v0", BloomKFilterHolder.fromBytes(bytes), null ) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{5L} ) ); }</code><technical_language>This test testing bloom_filter_test expression macro function a generic bloom filter sql test, I query needs change continue do that, this test removed</technical_language>

Target:
public void testBloomFilterExprFilter() throws Exception { BloomKFilter filter = new BloomKFilter(1500); filter.addString("a-foo"); filter.addString("-foo"); if (!NullHandling.replaceWithDefault()) { filter.addBytes(null, 0, 0); } byte[] bytes = BloomFilterSerializersModule.bloomKFilterToBytes(filter); String base64 = StringUtils.encodeBase64String(bytes); testQuery( StringUtils.format("SELECT COUNT(*) FROM druid.foo WHERE nullif(bloom_filter_test(concat(dim2, '-foo'), '%s'), 1) is null", base64), ImmutableList.of( Druids.newTimeseriesQueryBuilder() .dataSource(CalciteTests.DATASOURCE1) .intervals(querySegmentSpec(Filtration.eternity())) .granularity(Granularities.ALL) .filters( new ExpressionDimFilter( StringUtils.format( "case_searched(bloom_filter_test(concat(\"dim2\",'-foo'),'%s'),1,isnull(bloom_filter_test(concat(\"dim2\",'-foo'),'%s')))", base64, base64 ), null, createExprMacroTable() ) ) .aggregators(aggregators(new CountAggregatorFactory("a0"))) .context(TIMESERIES_CONTEXT_DEFAULT) .build() ), ImmutableList.of( new Object[]{5L} ) ); }
Source:
<code>public void setAccountNumber(String accountNumber) { <START> this.accountNumber = accountNumber; <END> }</code><technical_language>@hijklmno. This good overall. reason for setting this.accountNumber stringOrNull(accountNumber)</technical_language>

Target:
public void setAccountNumber(String accountNumber) { this.accountNumber = stringOrNull(accountNumber); }
Source:
<code>private Session createJavaMailSession() { Session session; Properties props = new Properties(System.getProperties()); <START> System.out.printf(params.smtpAuth()); <END> props.put("mail.smtp.host",params.smtpServer()); if(params.smtpAuth().equals("true")) { props.put("mail.smtp.auth", params.smtpAuth()); props.put("mail.smtp.starttls.enable", true); props.put("mail.smtp.port", 587); session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(params.smtpUser(), params.smtpPassword()); } }); } else { session = Session.getInstance(props); } return session; }</code><technical_language>Leftover debug code? Also, trailing newline</technical_language>

Target:
private Session createJavaMailSession() { Session session; Properties props = new Properties(System.getProperties()); props.put("mail.smtp.host",params.smtpServer()); if(params.smtpAuth()) { props.put("mail.smtp.auth", params.smtpAuth()); props.put("mail.smtp.starttls.enable", true); props.put("mail.smtp.port", 587); session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(params.smtpUser(), params.smtpPassword()); } }); } else { session = Session.getInstance(props); } return session; }
Source:
<code>public void insertToRealm_InvalidRealmModel() { InvalidRealmModel invalidRealmModel = new InvalidRealmModel(); realm.beginTransaction(); try { realm.insertToRealm(invalidRealmModel); fail("Expected Missing Proxy Class Exception"); } catch (RealmException ignored) { } <START> realm.commitTransaction(); <END> }</code><technical_language>a pick. this java } finally { realm.cancelTransaction(); }</technical_language>

Target:
public void insertToRealm_InvalidRealmModel() { InvalidRealmModel invalidRealmModel = new InvalidRealmModel(); realm.beginTransaction(); try { realm.insert(invalidRealmModel); fail("Expected Missing Proxy Class Exception"); } catch (RealmException ignored) { } finally { realm.cancelTransaction(); } }
Source:
<code>public void testRisingEdge() { Latch latch = new Latch(false, Latch.EdgeType.RisingEdge); MockLatch mockLatch = new MockLatch(); latch.addObserver(mockLatch); <START> latch.setValue(true); <END> assertTrue(mockLatch.getEdgeType() == Latch.EdgeType.RisingEdge); }</code><technical_language>Assert calling setValue</technical_language>

Target:
public void testRisingEdge() { Latch latch = new Latch(false, Latch.EdgeType.RisingEdge); latch.addObserver(latchTestObserver); verifyEdgeType(null); verifyTimesUpdateWasCalled(0); latch.setValue(true); verifyEdgeType(Latch.EdgeType.RisingEdge); verifyTimesUpdateWasCalled(1); }
Source:
<code>private int tickAllGenerators(LongConsumer timings) { Set<Location> exploded = new HashSet<>(); int supply = 0; for (Map.Entry<Location, EnergyNetComponent> entry : generators.entrySet()) { long timestamp = SlimefunPlugin.getProfiler().newEntry(); Location l = entry.getKey(); EnergyNetComponent component = entry.getValue(); if (component instanceof EnergyNetProvider) { SlimefunItem item = (SlimefunItem) component; try { EnergyNetProvider provider = (EnergyNetProvider) component; Config config = BlockStorage.getLocationInfo(l); int energy = provider.getGeneratedOutput(l, config); if (provider.isChargeable()) { energy += provider.getCharge(l); } if (provider.willExplode(l, config)) { <START> exploded.add(l); <END> BlockStorage.clearBlockInfo(l); Slimefun.runSync(() -> { l.getBlock().setType(Material.LAVA); l.getWorld().createExplosion(l, 0F, false); }); } else { supply += energy; } } catch (Exception | LinkageError t) { exploded.add(l); new ErrorReport(t, l, item); } long time = SlimefunPlugin.getProfiler().closeEntry(l, item, timestamp); timings.accept(time); } else { exploded.add(l); } } generators.keySet().removeAll(exploded); return supply; }</code><technical_language>a variable name verbose, Cookie</technical_language>

Target:
private int tickAllGenerators(LongConsumer timings) { Set<Location> explodedBlocks = new HashSet<>(); int supply = 0; for (Map.Entry<Location, EnergyNetProvider> entry : generators.entrySet()) { long timestamp = SlimefunPlugin.getProfiler().newEntry(); Location loc = entry.getKey(); EnergyNetProvider provider = entry.getValue(); SlimefunItem item = (SlimefunItem) provider; try { Config config = BlockStorage.getLocationInfo(loc); int energy = provider.getGeneratedOutput(loc, config); if (provider.isChargeable()) { energy += provider.getCharge(loc); } if (provider.willExplode(loc, config)) { explodedBlocks.add(loc); BlockStorage.clearBlockInfo(loc); Slimefun.runSync(() -> { loc.getBlock().setType(Material.LAVA); loc.getWorld().createExplosion(loc, 0F, false); }); } else { supply += energy; } } catch (Exception | LinkageError t) { explodedBlocks.add(loc); new ErrorReport<>(t, loc, item); } long time = SlimefunPlugin.getProfiler().closeEntry(loc, item, timestamp); timings.accept(time); } generators.keySet().removeAll(explodedBlocks); return supply; }
Source:
<code>public int waitFor() { try { int exitValue = processApi.waitFor(process); streamConsumer.await(); return exitValue; <START> } catch (InterruptedException e) { <END> processApi.interrupt(); LOG.error("Interrupted while waiting for process to terminate."); return 1; } finally { streamConsumer.shutdownNow(); } }</code><technical_language>add destroy</technical_language>

Target:
public int waitFor() { try { int exitValue = processWrapper.waitFor(process); streamConsumer.await(); return exitValue; } catch (InterruptedException e) { processWrapper.interrupt(); LOG.error("Interrupted while waiting for process to terminate."); return 1; } finally { streamConsumer.shutdownNow(); } }
Source:
<code><START> public void repositoriesWithUrlPropertyInProfile() <END> throws Exception { MavenPomView pomView = loadPoms( "pom-with-repo-property-in-profile.xml" ); List<RepositoryView> rvs = pomView.getAllRepositories(); for ( RepositoryView rv : rvs ) { if ( rv.getName().equals( "repo.one" ) ) { assertThat( rv.getUrl(), equalTo( "<LINK_2>" ) ); } if ( rv.getName().equals( "test.oracle" ) ) { assertThat( rv.getUrl(), equalTo( "<LINK_1>" ) ); } if ( rv.getName().equals( "test.two.oracle" ) ) { assertThat( rv.getUrl(), equalTo( "<LINK_3>" ) ); } } }</code><technical_language>need a variant of this test retrieves a dependency main POM (_not_ a profile), a version contains expression in it...and _after_ url in profile repository. property in main pom, a in profile. assertion dependency version main pom. So, sequence be: 1. Read POM -> MavenPomView 2. Get repository declared in profile -> RepositoryView 3. Get URL repository -> assert is resolved values profile 4. Get dependency declared in main body of POM (not a profile) 5. Get version of dependency, is declared expression referencing a property is defined in main pom.xml, another in profile 6. Assert dependency version main pom.xml This show cross-pollution of profile information I talking above, in changes for MavenPomView</technical_language>

Target:
public void repositoriesWithUrlPropertyInProfile() throws Exception { MavenPomView pomView = loadPoms( "pom-with-repo-property-in-profile.xml" ); List<RepositoryView> rvs = pomView.getAllRepositories(); assertThat( rvs.get( 0 ).getName(), equalTo( "repo.one" ) ); assertThat( rvs.get( 0 ).getUrl(), equalTo( "<LINK_0>" ) ); assertThat( rvs.get( 1 ).getName(), equalTo( "test.oracle.repo" ) ); assertThat( rvs.get( 1 ).getUrl(), equalTo( "<LINK_1>" ) ); assertThat( rvs.get( 2 ).getName(), equalTo( "test.second.oracle.repo" ) ); assertThat( rvs.get( 2 ).getUrl(), equalTo( "<LINK_4>" ) ); }
Source:
<code>public void doScrape() throws Exception { MBeanServerConnection beanConn; JMXConnector jmxc = null; if (hostPort.isEmpty()) { beanConn = ManagementFactory.getPlatformMBeanServer(); } else { String url = "service:jmx:rmi:/ HashMap credential = new HashMap(); <START> credential.put(username, password ); <END> jmxc = JMXConnectorFactory.connect(new JMXServiceURL(url), credential); beanConn = jmxc.getMBeanServerConnection(); } try { Set<ObjectName> mBeanNames = new TreeSet(); for (ObjectName name : whitelistObjectNames) { mBeanNames.addAll(beanConn.queryNames(name, null)); } for (ObjectName name : blacklistObjectNames) { mBeanNames.removeAll(beanConn.queryNames(name, null)); } for (ObjectName name : mBeanNames) { scrapeBean(beanConn, name); } } finally { if (jmxc != null) { jmxc.close(); } } }</code><technical_language>Extra space )</technical_language>

Target:
public void doScrape() throws Exception { MBeanServerConnection beanConn; JMXConnector jmxc = null; if (hostPort.isEmpty()) { beanConn = ManagementFactory.getPlatformMBeanServer(); } else { String url = "service:jmx:rmi:/ HashMap credential = null; if(username != null && username.length() != 0 && password != null && password.length() != 0) { credential = new HashMap(); List<String> credent = new ArrayList<String>(); credent.add(username); credent.add(password); credential.put("javax.management.remote.JMXConnector.CREDENTIALS", credent); } jmxc = JMXConnectorFactory.connect(new JMXServiceURL(url), credential); beanConn = jmxc.getMBeanServerConnection(); } try { Set<ObjectName> mBeanNames = new TreeSet(); for (ObjectName name : whitelistObjectNames) { mBeanNames.addAll(beanConn.queryNames(name, null)); } for (ObjectName name : blacklistObjectNames) { mBeanNames.removeAll(beanConn.queryNames(name, null)); } for (ObjectName name : mBeanNames) { scrapeBean(beanConn, name); } } finally { if (jmxc != null) { jmxc.close(); } } }
Source:
<code><START> public CHProfileConfig setProfile(String profile) { <END> validateProfileName(profile); this.profile = profile; return this; }</code><technical_language>this method package protected allow jackson access it</technical_language>

Target:
CHProfileConfig setProfile(String profile) { validateProfileName(profile); this.profile = profile; return this; }
Source:
<code>public void merge(List<? extends Diff> differences, boolean leftToRight, Registry mergerRegistry) { Preconditions .checkState(getMergeMode().isLeftToRight(isLeftEditable(), isRightEditable()) == leftToRight); if (!differences.isEmpty()) { <START> updateDiffStateAdapter(differences.get(0)); <END> } if (getMergeMode() == MergeMode.LEFT_TO_RIGHT || getMergeMode() == MergeMode.RIGHT_TO_LEFT) { mergeAll(differences, leftToRight, mergerRegistry); } else if (getMergeMode() == MergeMode.ACCEPT || getMergeMode() == MergeMode.REJECT) { List<Diff> diffToMarkAsMerged = newArrayList(); List<Diff> diffToCopyFromLeftToRight = newArrayList(); List<Diff> diffToCopyFromRightToLeft = newArrayList(); for (Diff diff : differences) { MergeOperation mergeAction = getMergeMode().getMergeAction(diff, isLeftEditable(), isRightEditable()); if (mergeAction == MergeOperation.MARK_AS_MERGE) { diffToMarkAsMerged.add(diff); } else { if (isLeftEditable() && leftToRight) { diffToCopyFromRightToLeft.add(diff); } else { diffToCopyFromLeftToRight.add(diff); } } } mergeAll(diffToCopyFromLeftToRight, leftToRight, mergerRegistry); mergeAll(diffToCopyFromRightToLeft, !leftToRight, mergerRegistry); markAllAsMerged(diffToMarkAsMerged, getMergeMode(), mergerRegistry); } else { throw new IllegalStateException(); } }</code><technical_language>This is a nitpicky detail, a bit strange updateDiffStateAdapter for diff. want introduce method updateDiffStateAdapter(List<Diff>) in super class, avoid that. Eventually update adapter comparison anyway, this change in future more control if dedicated methods for diff, diffs, comparison</technical_language>

Target:
public void merge(List<? extends Diff> differences, boolean leftToRight, Registry mergerRegistry) { Preconditions .checkState(getMergeMode().isLeftToRight(isLeftEditable(), isRightEditable()) == leftToRight); if (getMergeMode() == MergeMode.LEFT_TO_RIGHT || getMergeMode() == MergeMode.RIGHT_TO_LEFT) { mergeAll(differences, leftToRight, mergerRegistry); } else if (getMergeMode() == MergeMode.ACCEPT || getMergeMode() == MergeMode.REJECT) { List<Diff> diffToMarkAsMerged = newArrayList(); List<Diff> diffToCopyFromLeftToRight = newArrayList(); List<Diff> diffToCopyFromRightToLeft = newArrayList(); for (Diff diff : differences) { MergeOperation mergeAction = getMergeMode().getMergeAction(diff, isLeftEditable(), isRightEditable()); if (mergeAction == MergeOperation.MARK_AS_MERGE) { diffToMarkAsMerged.add(diff); } else { if (isLeftEditable() && leftToRight) { diffToCopyFromRightToLeft.add(diff); } else { diffToCopyFromLeftToRight.add(diff); } } } mergeAll(diffToCopyFromLeftToRight, leftToRight, mergerRegistry); mergeAll(diffToCopyFromRightToLeft, !leftToRight, mergerRegistry); markAllAsMerged(diffToMarkAsMerged, getMergeMode(), mergerRegistry); } else { throw new IllegalStateException(); } }
Source:
<code>public Optional<AcceptorCacheDigest> updatesSinceCacheKey(AcceptorCacheKey cacheKey) throws InvalidAcceptorCacheKeyException { lock.readLock().lock(); try { if (cacheKey.equals(latestAcceptorCacheKey)) { return Optional.empty(); } Long cacheKeyTimestamp = cacheKeyToTimestamp.getIfPresent(cacheKey); if (cacheKeyTimestamp == null) { throw new InvalidAcceptorCacheKeyException(cacheKey); } <START> Map<Client, Long> diff = clientsByLatestTimestamp.asMap().tailMap(cacheKeyTimestamp).values().stream() <END> .flatMap(Collection::stream) .collect(Collectors.toMap(WithSeq::value, WithSeq::seq)); return Optional.of(ImmutableAcceptorCacheDigest.builder() .newCacheKey(latestAcceptorCacheKey) .updates(diff) .build()); } finally { lock.readLock().unlock(); } }</code><technical_language>tailMap(cacheKeyTimestamp, false)</technical_language>

Target:
public Optional<AcceptorCacheDigest> updatesSinceCacheKey(AcceptorCacheKey cacheKey) throws InvalidAcceptorCacheKeyException { lock.readLock().lock(); try { if (cacheKey.equals(latestAcceptorCacheKey)) { return Optional.empty(); } Long cacheKeyTimestamp = cacheKeyToTimestamp.getIfPresent(cacheKey); if (cacheKeyTimestamp == null) { throw new InvalidAcceptorCacheKeyException(cacheKey); } Map<Client, Long> diff = clientsByLatestTimestamp.asMap().tailMap(cacheKeyTimestamp, false).values() .stream() .flatMap(Collection::stream) .collect(Collectors.toMap(WithSeq::value, WithSeq::seq)); return Optional.of(ImmutableAcceptorCacheDigest.builder() .newCacheKey(latestAcceptorCacheKey) .updates(diff) .build()); } finally { lock.readLock().unlock(); } }
Source:
<code>private PhoenixConnection getConnectionWithTableOrderPreservingMutationState() throws SQLException { Connection con = driver.connect(url, new Properties()); <START> PhoenixConnection phxCon = new PhoenixConnection(con.unwrap(PhoenixConnection.class)); <END> Map<TableRef,Map<ImmutableBytesPtr,MutationState.RowMutationState>> mutations = Maps.newTreeMap(new TableRefComparator()); phxCon.getMutationState().setMutationsTestOnly(mutations); return phxCon; }</code><technical_language>this (part 3 of 3): // Create new connection ordered map for verification testing PhoenixConnection pcon = con.unwrap(PhoenixConnection.class); pcon = new PhoenixConnection(pcon) { @Override protected MutationState newMutationState(int maxSize) { return new MutationState(maxSize, this, Maps.newTreeMap(new TableRefComparator())); } };</technical_language>

Target:
private PhoenixConnection getConnectionWithTableOrderPreservingMutationState() throws SQLException { Connection con = driver.connect(url, new Properties()); PhoenixConnection phxCon = new PhoenixConnection(con.unwrap(PhoenixConnection.class)); final Map<TableRef,Map<ImmutableBytesPtr,MutationState.RowMutationState>> mutations = Maps.newTreeMap(new TableRefComparator()); return new PhoenixConnection(phxCon) { protected MutationState newMutationState(int maxSize) { return new MutationState(maxSize, this, mutations); }; }; }
Source:
<code>@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (igniteInstanceName.contains(NODE_1_CONS_ID)) { failingOnNodeJoinSpi.setIpFinder(sharedStaticIpFinder); failingOnNodeJoinSpi.setJoinTimeout(60_000); cfg.setDiscoverySpi(failingOnNodeJoinSpi); } cfg.setConsistentId(igniteInstanceName); if (igniteInstanceName.contains("client")) cfg.setClientMode(true); else { cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setInitialSize(10500000) .setMaxSize(6659883008L) .setPersistenceEnabled(false) ) ); } <START> if (igniteInstanceName.equals(NODE_4_DIFF_STATIC_CONFIG) || igniteInstanceName.equals("clientWithDiffConfig")) <END> cfg.setCacheConfiguration( prepareStaticCacheCfg(STATIC_CACHE_NAME_1), prepareStaticCacheCfg(STATIC_CACHE_NAME_2) ); else cfg.setCacheConfiguration( prepareStaticCacheCfg(STATIC_CACHE_NAME_1), prepareStaticCacheCfg(STATIC_CACHE_NAME_3) ); return cfg; }</code><technical_language>Missed constant variable name usage "clientWithDiffConfig"</technical_language>

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); if (igniteInstanceName.contains(NODE_1_CONS_ID)) { failingOnNodeJoinSpi.setIpFinder(sharedStaticIpFinder); failingOnNodeJoinSpi.setJoinTimeout(60_000); cfg.setDiscoverySpi(failingOnNodeJoinSpi); } cfg.setConsistentId(igniteInstanceName); if (igniteInstanceName.contains("client")) cfg.setClientMode(true); else { cfg.setDataStorageConfiguration( new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setInitialSize(10500000) .setMaxSize(6659883008L) .setPersistenceEnabled(false) ) ); } if (igniteInstanceName.equals(NODE_4_DIFF_STATIC_CONFIG) || igniteInstanceName.equals(CLIENT_WITH_DIFF_CONFIG)) cfg.setCacheConfiguration( prepareStaticCacheCfg(STATIC_CACHE_NAME_1), prepareStaticCacheCfg(STATIC_CACHE_NAME_2) ); else cfg.setCacheConfiguration( prepareStaticCacheCfg(STATIC_CACHE_NAME_1), prepareStaticCacheCfg(STATIC_CACHE_NAME_3) ); return cfg; }
Source:
<code>private OrderedPropertyValues getOrderedPropertyValues( KernelStatement state, NodeItem node, DefinedProperty changedProperty, int[] indexPropertyIds ) { DefinedProperty[] values = new DefinedProperty[indexPropertyIds.length]; Cursor<PropertyItem> propertyCursor = readOps.nodeGetProperties( state, node ); while ( propertyCursor.next() ) { PropertyItem property = propertyCursor.get(); int k = ArrayUtils.indexOf( indexPropertyIds, property.propertyKeyId() ); if ( k >= 0 ) { values[k] = indexPropertyIds[k] == changedProperty.propertyKeyId() ? changedProperty : Property.property( indexPropertyIds[k], property.value() ); <START> } <END> } return OrderedPropertyValues.of( values ); }</code><technical_language>Feels a check for nulls in values array, return null array, calling code rely that, right</technical_language>

Target:
private OrderedPropertyValues getOrderedPropertyValues( KernelStatement state, NodeItem node, DefinedProperty changedProperty, int[] indexPropertyIds ) { DefinedProperty[] values = new DefinedProperty[indexPropertyIds.length]; Cursor<PropertyItem> propertyCursor = readOps.nodeGetProperties( state, node ); while ( propertyCursor.next() ) { PropertyItem property = propertyCursor.get(); int k = ArrayUtils.indexOf( indexPropertyIds, property.propertyKeyId() ); if ( k >= 0 ) { values[k] = indexPropertyIds[k] == changedProperty.propertyKeyId() ? changedProperty : Property.property( indexPropertyIds[k], property.value() ); } } if ( changedProperty != NO_SUCH_PROPERTY ) { int k = ArrayUtils.indexOf( indexPropertyIds, changedProperty.propertyKeyId() ); if ( k >= 0 ) { values[k] = changedProperty; } } return OrderedPropertyValues.of( values ); }